Quadruped Robot

By Omar Essilfie-Quaye

Github Repo Link to github repository Docs Link to source code documentation

Walking Robots

Robotics in general is becoming more and more pervasive in our everyday lives and having robots with the ability to maintain pace with us effortlessly requires alternate means of locomotion. In general most of the world does not have flat or paved land which wheeled robots can traverse easily. The loss of speed and precision by sacrificing this is more than accounted for by the gain of the ability to navigate obstacles and rough or dynamic terrain provided by legged robots.

Robots that can travel using means alternative to the classical wheeled or tracked robot paradigm provide advantages in terms of mobility and terrain navigation. The general articulated limb approach of building these robots allows for locomotion that is much more versatile than wheeled robots but this comes at the cost of much greater complexity and increased power consumption. This complexity increase is not confined to the mechanical world but extends into the software and sensor hardware territory as well. One of the main issues underpinning these complexities is maintaining balance.

The requirement of a walking robot to maintain balance immediately gives rise to a mechanical arrangement for the legs which has high speed and torque with a low inertia. This means that as the robot falls the legs can react quickly and have enough control authority to correct for any wobbles. This high speed motion needs to be measured by sensors with high acquisition rates and this in turn means that software needs to be able to keep up with all of this data. One of the easiest ways to attempt to negate this is develop a robot with many legs which provide static stability if more than three are on the ground at any given time.

A classic example of a multi legged robot is a hexapod robot. There are two sets of three legs so when moving one set can be on the ground whilst the second is in the air, this maintains optimal stability at all times. Moving to the alternate extreme where there is almost never any stability is bipedal robots based on humans. These have two legs and even when both of them are on the ground the robot will be unstable, unless it has extremely wide feet. It is very hard for a bipedal robot to balance when walking and it requires very agile robots with fast computers to achieve it.

Picture of a short two legged robot called cassie created by the company agility robotics

Cassie Bipedal robot created by Agility Robotics

Quadrupeds

Quadruped robots are a class of robot that have specifically 4 legs. This can provide great stability benefits depending on how the gait of the robot is implemented. If the robot keeps 3 legs on the ground at all times and keeps it's centre of mass within those 3 legs it will be statically stable at all times. This means it will not have to do high speed calculations to remain balanced. Further discussions on gait dynamics can be seen further down.

The quadruped robot has the fewest number of legs necessary to to remain statically stable during motion. Higher numbers of legs are possible such as in hexapods or octopods and these come with other advantages and disadvantages. Increased redundancy is a benefit despite the additional complexity and power draw. If designed right these types of robots can also have a significant payload mass available to provide additional functionality.

Link to Hexapod Robot Video on YouTube

The Mantis hexapod robot created by Matt Denton

Link to Boston Dynamics Spot Robot Video on YouTube

The Spot quadruped robot created by Boston Dynamics

Link to Robugtix T8X Robot Spider video review by Adam Savage on YouTube

The T8X robot spider created by Robugtix

Forward Kinematics

Forward kinematics (FK) is a term used to describe the position of a robot's end effector given a series of join angles. In the case of a quadruped robot the end effector would be the end of the leg. For other robots, such as robot arms, the end effector could be anything from a gripper to a drill bit.

In practical terms the usage of forward kinematics means that the control system of the robot works by controlling the joints of the robot without necessarily needing the end effector to follow a particular path to get to the goal location. This is the preferred behaviour when an end effector needs to get to the goal location as quickly as possible. Three animations showing the FK of the different servos on the quadruped robot can be seen below.

Gif animation of the quadruped rotating all hip yaw joints in unison

Forward Kinematics of the quadruped hip yaw servo rotation through 180 degrees.

Gif animation of the quadruped rotating all hip elevation joints in unison

Forward Kinematics of the quadruped hip elevation servo rotation through 180 degrees.

Gif animation of the quadruped rotating all knee extension joints in unison

Forward Kinematics of the quadruped knee extension servo rotation through 180 degrees.

It should be noted that the paths that all of the legs in the animations above is curved. This is because servos are rotary joints. The simple usage of servos in this manner will always create circularly curved paths, if more complex paths are needed then the servos will need to be controlled in a more complex manner.

Inverse Kinematics

If forward kinematics is calculating the position of an end effector given the joint positions the Inverse Kinematics (IK) is the opposite. This means that the desired location or path for an end effector is chosen then the appropriate joint positions are calculated to get there. In this manner it is possible to obtain any desired path for an end effector, from straight lines to a helix. Despite the ability for IK to generate almost any desired path it should be noted that there are limitations. A non exclusive list of these limitations include, singularities and infinite numbers of solutions.

Whilst the end effector will be able to reach all locations within the working envelope they will not necessarily be smooth transitions between adjacent points. For example travelling through the origin my make a motor go from 0 to 180 for a very small change in position. This discontinuity is known as a singularity, some may be removed through a coordinate transform and some can't be removed at all.

In a simple case there will be three servos trying to manipulate an end effector in three dimensions: x, y and z. In this case there should always be a solution to the problem however, if there are more actuators than dimensions to move in then there may be an infinite number of ways for an end effector to get to a desired location.

For example if you have a robot arm with three axes and a tool which can change orientation, such as a screwdriver. It may be possible to place the tip of the screwdriver on the head of a screw but you can do so from: directly above, from the side or any angle in-between. In this case it may be beneficial to know what the end use case is so that the correct solution (directly above) can be selected. This is not always an option and there are numerical algorithms that can search for a solution, this comes at the expense of taking longer to calculate.

Quadrupeds, and all walking robots, needs IK in order to walk in a straight line. The smooth motion on a leg backwards allows for the robot to generate a smooth walking gait without expending excess energy fighting friction which will occur if the motion is curved. This increases the torque requirements of the motor and this will draw more power. This incorrect motion may also reduce the ability of the robot to maintain it's balance.

Diagram showing how to calculate the IK for a quadruped leg in the horizontal plane.

Diagram showing how to calculate the IK for a quadruped leg in the vertical plane.

Practically the goal of IK is to take a Cartesian (\(x, y, z\)) coordinate and convert it into actuator positions. In the case of the quadruped robot those actuator positions are three angles (\(\theta_1, \theta_2, \theta_3\)). The diagrams showing how the IK for a leg can be calculated can be seen above. Using trigonometry it is possible to calculate (\(\theta_1, \theta_2, \theta_3\)) using the known lengths of the linkages between each joint.

$$ \theta_1 =atan(\frac{y}{x}) $$

$$r = \sqrt{x^2 + y^2} ; \alpha = \sqrt{(z + cx)^2 + r^2} ; \theta_2 = acos(\frac{\alpha^2 - fm^2 - tb^2}{-2 \times fm \times tb})$$

$$\phi_1 = atan(\frac{r}{z+cx}); \phi_2 = asin(\frac{tb \times sin(\theta_2)} {\alpha}); \theta_3 = \pi - \phi_1 - \phi_2$$

Once the IK angles have been calculated they need to be converted to values for the robot. Each leg has servos that are mounted in different orientations. This may require offsets or direction changes to fix. All offsets in motor orientation with respect to the expected orientation need to be corrected through calibration of the motor orientation.

Some of the possible paths that the legs can now take are shown in the animations below. Complex combinations of these paths can lead to very rich movements of a quadruped robot. The most obvious of which is walking.

Gif animation of the quadruped moving it's legs in a straight line along the x axis

Inverse Kinematics of the quadruped rotating all servos in the leg to get a smooth motion of the leg along the x axis.

Gif animation of the quadruped moving it's legs in a straight line along the y axis

Inverse Kinematics of the quadruped rotating all servos in the leg to get a smooth motion of the leg along the y axis.

Gif animation of the quadruped moving it's legs in a straight line along the z axis

Inverse Kinematics of the quadruped rotating all servos in the leg to get a smooth motion of the leg along the z axis.

Gallery

See Also