Learn how to make the HF08 hexapod robot (with three degrees of freedom on each leg) easily walk with arduino and Torobot servo controller.
This post explains how to design leg movement trajectories of an hexapod robot from scratch and creates simple motion sequences. At a later stage, we could add sensors and artificial intelligence to the hexapod, and use these scripts as a basis for programming.
- Necessary elements
For the implementation of this project, it has been chosen a printable model of intermediate size called HF08 hexapod. Torobot board capable of controlling 32 servos with internal memory and UART connection has been used to control 18 leg servos. Finally the movement is controlled with an Arduino processor connected to a PC with ROS software.
The robot HF08 is a printable model of Hellium Frog which are available files for each piece here. Once parts have been printed, you need to follow the instructions described in the own Hellium Frog blog.
Torobot board is a servo controller that allows you to control up to 32 servos simultaneously through a serial slave device (UART) or USB . The string of commands to be send must have follow the following telegram:
#x1Py1 #x2Py2… #xnPynTzrn
Where xn indicates the position of the servo control, yn is the position of the servo that varies between 500-2500, and z is the time in ms that should perform the operation (100 ms minimum). Another way to control the servos is by using “action groups” saved in the ROM memory of 512K that has the card.
To power the board you must use two separate sources, one for the servos which can supply the high current required by them (typically at 6-7.2V) and another for the electronics (5V). In our case the latter will be powered via the USB port.
The processor generates trajectories and sends commands to the Torobot board to control the hexapod. Since in this project there are no sensor or artificial intelligence, Arduino Uno has been selected, since it has enough capacity to run these actions in real time.
Two platforms have been used in terms of programming and robot teleoperation. On the one hand we have Arduino which only requires an environment of open development that provides the page of Arduino. The second option that is included is the ROS platform, which must be executed within a Linux operating system.
Another tool that has been used in this project is the software that provides the company’s Torobot card. This program allows you to control individual servos and is used to calibrate the robot and make a first approach to the control of the hexapod.
Once we have obtained the files of the parts mentioned previously, we can print each piece of the robot following the recommendations offered by the designer himself of the robot. Since the robot is going to be subjected to efforts, parts must be solid enough. The filling recommended Hellium Frog blog is 35% and body it is recommended to use three layers of base is where it generates more stress.
To assemble the hexapod is worth noting that the legs are not identical but are symmetrical, i.e. right legs are the reflection of the left, to avoid mistakes it is recommended to mark the printed components a “L” or “R” to determine which side they belong. The following illustration shows the left front leg assembly.
In the same way to assemble the body we have to take into account the symmetry. Each servo should be placed in its support. Once this is fixed to the body, as shown in the following illustration the servos on the front are oriented as opposed to the rest, this is to give greater range of movement to such extremities. Servos and some supporting parts of the exploded view have been removed to simplify the image.
Once it has been mounted before final assembling, servos are set in neutral position must be approximately in half of its tour, since they are non-continuous rotation servos. The servo controller is located at the top and if necessary can accommodate a battery or the microcontroller between two walls of the body.
- Design of the movement
In order to create sequences of movement, we must assign a position to the servo at each step, so we will take the position of the end of the tibia and using inverse kinematics to obtain the angles of each joint. For this purspose, we set a local reference system to the legs of the robot. This is done using the method of Denavit-Hartenberg parameters the following table and image reference system which is obtained.
To determine the angle of each joint starting from a position (x, y, z) end of the tibia, taking as origin based on tip get the inverse of that limb kinematics. Since this is a complex problem it will be solved beginning with the coordinate q1 and from the plane facing q1 resolved coordinates q2 and q3 as shown in the following diagram.
If the appropriate trigonometric operations are performed has to obtain the relationship between (q1, q2, q3) and (x, y, z) is shown below
For sequences we have developed can be implemented in reality must be set to the off position to the servo. The program provided by Torobot allows us to move the servos individually in real time can be used for this. So the robot move there to open the serial port, so the program will go to the online status. Moving the sliders of each servo position varies in real time. It must be manually placed the robot in a similar position to the rest. In this position the coxae are parallel to each other rather than being distributed radially and the angle between the femur and the tibia of each limb must be 90 °.
Once the robot is calibrated you can proceed to program the different trajectories. For this purpose, we consider the position of the servo at the rest position (home) and using inverse kinematic equations, we compute the required angle on each trajectory point of the end effector. Through this process you get scripts that can be run automatically so that the robot to move in a certain way.
An example of how to send sequences of movements through robot communication series of servo controller can be found in the file caminar_recto (written for the Arduino one), which sends a sequence in loop that allows the hexapod move in straight paths in different directions depending on which buttons are pressed in an interface as the image.