Close

Leg day

A project log for RoboDog

Cheap 3D-printed robot dog: 14-DOF ESP32 quadruped with wobbly first steps, jittery servos and lots of room for hacks at around ~100€.

So, let me make today a leg day.

Designing and programming the legs was the main part of this whole project, everything else was a baby's play compared to it.

So for the legs I would require 3 servos, one of them to move the leg sideways, one for the ankle and one for the shin. And for the code I would have a class with a few functions, the main one of them would take the desired position of the leg tip in XYZ and calculate the angles for each of the servos.

There was a lot of tinkering around with the PCA9685, that is the servo controller, somehow the data that I was finding didn't match what was happening, the PWM cycle setting turned out to be a huge headache, after the PCA9685 finally gave up I ended up with some weird function for cycle and angle setting.

My initial idea was to take 180 degree hobby servos and make a gear ratio of 1:2 to decrease the load on the servo but also decreasing the moving range, somehow I thought that the servos would be too weak to carry all the weight, considering that in the beginning I was planning on using 4 18650 batteries in series with a step-down converter.

That was my first time designing gear with FreeCAD, and, god, did it take a lot of time to figure all the details, make it perfectly fit the servos without any screws, distances between the gears and overall work, many iterations of printing, reprinting, throwing the failed versions again and again. And finally I got this


After the first leg version was physically complete I had to implement the calculations for the servos. I did a lot of googling, conversations with ChatGPT, they both were continuously telling me something about Inverse Kinematics, went in there, checked out a few tutorials on YouTube, turns out to be some magical transformations from linear algebra, and that was never my best understood subject. At the moment I was in another one of my idiotic relationships and I was constantly accused of wasting too much of my time with everything but her, so the project got frozen for about half a year that was taken by suffering a bit more, heavy drinking and stopping the heavy drinking.

Finally half a year later I got back to the project and it turned out to be a very simple problem that can be solved with pen and paper in half an hour using only basic geometry.

The leg design turned out to be very impractical, all these gear connections would constantly fall apart, the leg couldn't survive any side load, so I had to go back to FreeCAD and redesign it all once again, after tons of wasted plastic I ended up with this

This one I still kinda like in terms of the looks, but it was a bit too long, so again it was pretty hard for the dog actually to have enough torque, also due to many parts it wasn't very stable or easy to assemble, and the leg pieces were connected to servo horns directly, so the parts could kinda easily slide over on the horn, which meant that the angle could very quickly offset itself.

So here we go redesigning again. Now I wanted to use the original servo connector and somehow connect to it, that would give me a lot more stable construction, in a week or two I got to this design and it was already pretty good.


This was already pretty nice, but it was somewhat too long and the dog kept falling, so after a bit of redesigning I got to this

and here is one more video with a fall

This is the final version, the body of the dog was still a bit changed later on, but legs are still the same

Discussions