Watch: Single Leg Prototype - Test 1 (Synchronous movement)
I 3D printed and tested the first leg prototype: the structure is relatively strong, despite the thin thickness of the plastic joints. I used PVC tubes for the links high torque full-metal servo motors to power the leg. The control is achieved using basing sequential coding in forward kinematics.
I used the library pigpio to move the motors, without caring about the movement smoothness. Instead, I tried to define some points the leg had to reach to achieve a step cycle.
From the pigpio library, using pi.set_servo_pulsewidth(pin, angle)
, it is possible to control the servos easily. N.B.: The motors react immediately to the GPIO trigger, meaning that multiple commands can be sequenced, obtaining a parallel/simultaneous movement of the servos. However, this does not allow us to change their speed. This can be achieved by adding a delay between each leg position, even if the result is a bit clunky and definitely not smooth.