I’ve been working on my hexapod, and I’ve spent the last weeks struggling with inverse kinematics. I found a great explanation on this website. I started by measuring the parts of the legs. The legs are made of 3 parts, coxa, femur and tibia. I then copied quite a bit of code from the sketch on engineer-this. I did my best to understand how it works and adapt it to my hexapod. The inverse kinematics math is the same but I still needed to convert the IK angles to the servo angles. I used a protractor to measure the servo angles and compare them with the calculated inverse kinematics angles.
It took me some time to figure it all out, but once you managed to do it for 1 leg the other 5 legs are very easy. Yesterday I finally wrote code to move all 6 legs using inverse kinematics. I then quickly made a sketch to move all 6 legs at the same time, so I could check if all servos were working as they should.
The legs moved for a couple of seconds and then 3 legs stopped moving. I checked the voltage and measured none. One of the 2 8A UBEC’s I was using is dead 🙁 Now I did shortcut the UBEC’s when I first tried out all the servos, that was some time ago. Until now they have worked fine. I then powered the hexapod from my lab power supply. My lab power supply has an integrated amp meter and it showed almost 10A. This was with the hexapod sitting on a box so there was no strain on the legs. So I’ve decided to beef up my power supply to the servos and ordered 3 new 8A UBEC’s. Each UBEC will power 2 legs, 6 servos. I hope that’s enough. I’m powering the UBEC’s from a 3S 30C 3000mAh Lipo battery.