legs


Continuity

Four legs balancing and exercises

enter image description here

Over the spring, from the beginning of March until the end of May, I focused on balancing Continuity. I tried many different approaches to gain experience and acquire critical thinking in selecting the best one.

  • The first one is probably the most complex and common in robot control systems: Proportional Integral Derivative control, or PID. The balancing algorithm was working fine, as can be seen from this video. The PID control is not fine-tuned, but even without doing it, I immediately noticed something I didn't like: motors were weakening approaching the desired position, and losing torque. This behaviour is not normal and it might be caused by an incorrect setup of the power distribution system. Additionally, the servo motors were sometimes rotating to undesired positions, I guess due to overlapping signals (?), causing damage to the mechanical structure of the legs.

Transitioning to 6061 Aluminium

enter image description here Watch: 1st attempt CNC machining Continuity's parts

Continuity is currently crafted from 3D-printed PLA plastic, a good material in terms of prototyping flexibility, allowing easy modifications and adjustments. However, as we delve deeper into the mechanical demands, the limitations of PLA become apparent. Achieving structural strength requires high infill or an increase of the external wall count, yet this proves challenging for smaller, intricate parts, where PLA's fragility under load becomes a concern. With the assistance of Edinburgh Napier University's Mechanical Workshop technicians, we are embarking on a transformation. All structural components are undergoing a shift from PLA to robust 6061 Aluminium. This transition necessitates a complete redesign: I used Blender to 3D-model all the pieces, but differently from a 3D printer, CNC machines don't like STL files. To bridge the gap between Blender's polygon-based designs and CNC machines' preference for STEP files, I opted for FreeCad, aligning with my philosophy of using an open-source approach. The photo showcases one of the two top links for Continuity's legs, machined as a test using a CNC machine. The result is good, but not as good as it will be on the actual finished version.


Joypad integration

enter image description here

During the last few weeks of testing, I integrated a joypad into Continuity's control methods. This was done to simplify testing on the robot, improving precision and making things a bit more fun when it comes to having a quick demo available to show to people (this happened multiple times, in the past few weeks). I chose to connect a PS3 joypad using the comprehensive features offered by the "Gamepad" GitHub repository. This repository not only simplifies the process but also provides users with multiple joypad configurations, catering to diverse testing needs. In an initial trial, I focused on controlling the Remote Sensing Mast (RSM), a pivotal element of the rover that comes with two degrees of freedom: azimuth rotation and elevation. The RSM serves critical functions such as capturing photos, and panoramic images and facilitating autonomous navigation by aligning with the direction of movement. Subsequent tests focused on legs extension and other general movements, all executed seamlessly through joypad control. While these tests may appear useless given Continuity's ultimate autonomous functionality, being able to control the robot in a user-friendly way is actually extremely important for something that I'm working on aside. I'm trying to develop a simulation framework using Blender, the same open-source software I used for 3D modelling Continuity. Blender is capable of running rigid body simulations and being able to interface them with a Python script might allow me to use it as a real-time simulation tool. More updates will follow on this topic.


Standing on four legs!

enter image description here

After three months of testing Continuity's front legs only, I'm excited to share that the walking rover has taken a giant leap forward. I've just rolled out an update, bringing the two rear legs into action. This development is a game-changer because now I can dive into real 4-legs-balancing tests, exploring pitch and roll axes movements, along with trying out various walking gaits and manoeuvres. As of now, Continuity is equipped with 8x 25 Kg Servo Motors, each thirsting for 5-7 volts and drawing 1-2 Amps. The entire body is currently made out of 3D-printed PLA, but I've got big plans for the next version: several structural parts of the body will be converted into a sleek carbon fiber structure. The mobility system, aka the legs, is also in for an upgrade, transitioning to a robust aluminium CNC machining.


Weight Optimization and Two feets roll balancing

enter image description here Watch: Two feets roll balancing

In a recent overhaul, Continuity's design underwent a meticulous weight reduction, shedding non-essential components for enhanced efficiency. Then, I started testing balancing on the roll axis, a crucial step towards achieving stability. However, friction-induced squeaking in the plastic joints posed an initial challenge, partially limiting the movements of the legs and causing very annoying noises. I managed to fix the problem using WD-40 lubricant. Balancing is achieved using a simple accelerometer, with future plans to integrate force pressure sensors on Continuity's feet for enhanced feedback. The code I'm using for balancing is not very well refined and occasional failures are acknowledged. But generally speaking, it works well!


Walk Cycle Refinement

enter image description here

After ensuring a strong enough structure and sufficient current to power the motors, efforts were dedicated to refining the walk cycle of a single leg. Until this point, legs moved along predefined coordinates defined manually, making the movements quite clucky. I decided to avoid inverse kinematics calculations to reduce processing time and resources: this should leave more available memory to the RPi4 for Computer Vision tasks. So, I preferred using forward kinematics, finding a relation between the angles and end effector of the legs. I decided to make the end effector move along a precisely defined curve. This curve comprises two interconnected segments: the upper curve (a), similar (but not) a parabola, and its counterpart below (b), completing a seamless loop. enter image description here One of the standout features of this approach lies in its adaptability. The parameters of the functions governing the two curves can be fine-tuned, allowing for the creation of diverse step shapes. Whether it's a stable, measured gait or a more dynamic stride, adjusting these parameters provides versatile options. Furthermore, the execution speed of each step is a customizable element, adding another layer of control to the robot's locomotion.


Front linkage update

Until the day of this post writing, the front and rear upper linkages of the leg were connected to the motors using aluminium flanges. Generally speaking, this component is great but performs poorly if an overhung stress is applied to the motor shaft, causing vibrations that tend to increase after intense testing of the leg. To (hopefully) fix the problem, I changed the design, substituting the flange with an aluminium bracket that can be secured to the motor shaft using small set screws. Additionally, this design increases the contact area between metal and plastic, improving the force distribution.

enter image description here

This configuration has been tested by running the same tests performed with the previous design. Results show that not only the vibrations are reduced (as well as the chance that screws get unscrewed due to vibrations), but also improve the stability of the leg when it was tested sideways and upside down.


Single Leg Prototype - Test 3 (Walk cycle, ground contact interaction)

enter image description here Watch: Single Leg Prototype - Test 3 (Walk cycle, ground contact interaction)

Over the summer I worked on a simple walk cycle, ensuring the smoothness and precision of the movements. I installed an accelerometer that allows me to simulate a change in ground inclination: the algorithm changes the leg walking cycle, adapting it to the simulated terrain slope. The limit switch discussed in the previous post works simultaneously, raising the leg when an obstacle is encountered. This behaviour would not make sense in a real-world environment, but it is a good starting point for future more complex leg-ground contact interactions.


Single Leg Prototype - Test 2 (Smooth control, ground contact reaction)

enter image description here Watch: Single Leg Prototype - Test 2 (Smooth control, ground contact reaction)

As discussed in the previous post, smoothness is something I want to work on: it helps reduce vibrations that a clunky mechanical movement would otherwise cause. In addition, it is more visually appealing. I used the pigpio library, and I controlled the motors smoothly using a function that I called servo_smooth(motor, angle, speed). The distance between the current servo angle and the target angle is subdivided into small steps that act as a time delay: by changing this value, it is possible to control the movement speed. Additionally, using the function servo_sync(motor1, angle1, speed1, motor2, angle2, speed2) in multithreading, two threads run the servos (one each), allowing me to set a certain angle and the speed I want the motor to run, moving synchronously and smoothly. Finally, I implemented a simple ground contact check by snap-fitting a limit switch in the lower plastic linkage. The program I was running in the video lifts the leg as much as possible, reacting when a force is applied to the foot. This is just an "ON/OFF" configuration, which is quite not the best solution for sensing the ground correctly.


Single Leg Prototype - Test 1 (Synchronous movement)

enter image description here 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.