1. Project introduction
An 8-degree-of-freedom quadruped robot dog with parallel legs based on the open source Hongmeng OpenHarmony system
Developed using the Hi3861 IoT WiFi module to implement walk gait and trot gait , and developed an Android platform APP to implement Socket (UDP) communication
2.Hardware introduction
2.1 Circuit design
- Hi3861 is selected as the main control, and the main frequency can reach up to 160M. As a wifi module, it has rich peripheral interfaces for development and can use multi-thread programming.
- The power supply part is designed with a 12v to 5V DC-DC circuit, using the MP2315 chip, which can support a maximum load current of 3A.
- The servo control chip uses PCA9685PW, which is based on the 12-bit precision of IIC bus communication, 16-channel PWM wave output, and supports the management of up to 16-channel servos.
- Designed an RGB circuit for lighting control
2.2 Mechanical structure design
2.2.1 Leg design
The dog's legs are connected in parallel using two servos. The end of each leg can move freely in the plane where it is located, so each leg has 2 degrees of freedom and the whole has 8 degrees of freedom.
2.2.2 Weight reduction design
In order to reduce weight, many textures are added to the design, which also has a beautifying effect.
2.3 Innovation part
The dog's leg structure is improved (using symmetrical design), the algorithm of inverse kinematics is re-introduced and simplified; a lighting control circuit is added to realize RGB flashing by controlling the IO port of Hi3861.
Re-derivation of the inverse kinematics formula
The inverse solution of kinematics is to solve the rotation angles cita1 and cita2 of the two servos with the known end coordinates E (x, y). Due to the design, we already know AC=BD, CD=DE, 0A=0B, and we connect EB, OE, and AE.
The special position triangles EB0 and E0A in the figure are both right triangles, so according to the Pythagorean theorem, BE can be found to be equal to (0B^2+BE^2)^1/2, and AE can be found in the same way.
In the triangle DBE, we already know DB, DE, and BE. According to the cosine theorem, we can get the angle A1=acos((DB^2+BE^2-DE^2)/(2*DB*BE)). At the same time, we can use the remaining Find the angles A2, A3, A4 of the triangle
Finally we get the twist angle of the servo cita2=180-A1-A2 cita1=180-A3-A4 (angle value)
The above is the derivation of the inverse kinematics formula. We can convert the above algorithm into a program, calculate the steering angle of the steering gear based on the end coordinate value, and then control the steering gear movement.
3. Software part
3.1 Mechanical dog software framework
3.2 Gait algorithm
3.2.1 walk gait
In the walk gait, one leg is in a swinging state every 1/4 cycle, and three legs are in a supporting state. At the same time, the front and back sequence of the leg swings is 1-3-4-2.
During the movement of the mechanical dog, the end trajectory of each leg is a closed figure of cycloid and straight line, as shown above
From the above figure, we know the coordinate expression of the cycloid equation. In programming, we obtain this coordinate by using t as the variable to increase automatically.
Then we divide the cycloid into four parts
In the walking gait of the mechanical dog, one leg is swinging and three legs are supporting in every 1/4 cycle, so in the first 1/4 cycle, leg 1 moves from xs to xf via 1, and leg 2 moves from xf Move to the next position via 2, while leg 3 performs 2 movement and leg 4 performs 3 movement.
In the second 1/4 cycle, leg 1 performs movement 2, leg 2 performs movement 3, leg 3 performs movement 1, and leg 4 performs movement 4.
In the third 1/4 cycle, leg 1 performs movement 3, leg 2 performs movement 4, leg 3 performs movement 1, and leg 4 performs movement 2.
In the last 1/4 cycle, leg 1 performs movement 4, leg 2 performs movement 1, leg 3 performs movement 2, and leg 4 performs movement 3.
Looping the previous process, we get the walk gait.
3.2.2 Trot gait
In the trot gait, two legs are in the support state and two legs are in the swing state in each half cycle, and the movement of the diagonal legs is consistent
We divide the closed figure above into two parts. In the first half of the cycle, leg 1 and leg 3 move from xs to xf via 1, and legs 2 and 4 move from xf to xs via 2. The opposite is true in the second half of the cycle.
Looping the previous process we get the trot gait
3.3 Android platform APP
4.0 Physical verification
5.0 Project experience
- First of all, the circuit design must ensure that a DC-DC chip or LDO that can carry high current is selected. This can ensure that sufficient power is provided for the steering gear operation and reduce jitter.
- The overall weight must be ensured in the mechanical design. Due to the limited torque of the selected servo, it is difficult for the servo to drive the dog body under heavy weight.
- During mechanical installation, each leg must be mechanically leveled to ensure that the mechanical dog can stand stably on a flat surface, which is the key to achieving a stable gait.
Video sequence: linear displacement, trot gait test, walk gait test, off road test, mobile APP test