In the last few weeks, we have been making legs, physical and virtual. We wanted to experiment with the ratios of the different leg sections to see which would yield the best results. We wanted the robot to make smaller steps, and therefore be more manoeverable, as the speed could still remain the same via the motors without having to take long steps.
As aforementioned, we wanted to experiment with the ratios of different parts. However it would be nice if this testing could be done virtually, without having to print out hundreds of different versions to try them out. We turned to Pymunk. The video below shows an early test, just to see if we could make a test bed using it. The results were positive – we could!
Here the animation has been expanded – a motor now drives two gears which connect to cranks and the beginning of a Klann linkage. The lack of actual legs can lead to interesting things happening, as we discovered to our amusement.
And here we have an example of such an amusing occurrence. We have legs now (good…), and everything is connected. All the parts are the correct size, but something doesn’t work… The answer is, that when using the default settings of Pymunk, it is very unstable and produces chaotic movement very quickly.
Increasing the number of iterations in each simulation step from the default 10 (“sufficient for most simple games”) to 1000 made a big improvement. But an even better solution is to run many (100) short simulation steps in each rendering cycle, as the Pymunk documentation suggests. This produces acceptable results. There is still something funny happening when hitting a wall, but we got what we needed: to be able to test the movement, speed and gait with various configurations using different sizes for the links and legs.
Here is another simulation, comparing three different configurations:
Bottom: original (2019) version
Middle: new version with smaller steps
Top: new version, but with longer legs
We used the above simulation to validate the new configuration that roughly halves the length of each step and keeps the body straight.
The idea is that by making small steps faster, we’ll get more precise control, especially when turning at low speeds.
The whole simulator is available in our GitLab repository. To try it out, all you need is Python 3 and
virtualenv, just run
make run-obstacles or
Another change is a complete redesign of the joints: instead of screws with lock nuts, we are using mini ball bearings (MR62ZZ) inside every joint.
This will hopefully lead to smoother movement, less wobble and no problems with having to manually adjust the tightness.
Printing and assembling everything for all eight legs took almost two full days.
Finally, the end result (the final legs will have better grip):
While the robot does have very little grip, and so is a little unwieldy, it performs a lot better, and can make much finer turns.