Equations For Hexapod Robot Control
Equations For Hexapod Robot Control
Equations For Hexapod Robot Control
www.hexapod-kit.com
Determine joints angles according to the position of leg tip. A method for linear interpolation (straight walk). A method for circular interpolation (curved walk). A method for body inclination (tilt).
www.hexapod-kit.com
A1
A3
A2
www.hexapod-kit.com
We want to drive the tip of a leg by its coordinates in a Cartesian coordinate system. For reasons of simplicity, we express the coordinates in a fixed coordinate system centred on the body of the hexapod. To calculate the angles to be applied to the three joints of the leg we have to use different coordinate systems, either fixed or movable relative to the body. All angle measurements in formulas are expressed in radians. Coordinate systems fixed to the body c et a3 : Seen from above Front
System c is centred on the robot body. The plan [XY] of the system coincides with the underside of the body (the lowest point). Systems a3px are centred on A3 joints of each leg.
Equations for hexapod robot control Coordinate systems movable relative to the body a2: Seen top Front
www.hexapod-kit.com
Given : - l1et l2 respectively the lengths of the extreme and middle phalanxes. - T1 angle between the extreme phalanx and middle phalanx. - T2 angle between X axis and the middle phalanx. - q1 angle between the axis X and B imaginary line passing through the joint centre A2 and the point P. - q2 angle between B and the middle phalanx. - q3 angle between B and the extreme phalanx.
www.hexapod-kit.com
Find T2
a 2 = l 22 c 2 b 2 = l12 c 2 a 2 b 2 = l 2 2 l12 a 2 ( B a ) 2 = l 2 2 l12 a 2 ( B 2 + a 2 2aB ) = l 2 2 l12 B 2 + 2aB = l 2 2 l12 B 2 + l 2 2 l12 2B T 2 = arccos( B 2 + l 2 2 l12 Pza 2 ) + arctan( ) 2 *l2* B Pxa 2
a=
cos(q 2) =
www.hexapod-kit.com
Find T1
T 1 = q 2 q3 a b T 1 = arccos( ) arccos( ) l2 l1 a b T 1 = ( arcsin( ) + arcsin( ) + ) l2 l1 a b T 1 = arcsin( ) arcsin( ) l2 l1 a b ab cos(T 1) = cos(arcsin( ) * arcsin( )) + l2 l1 l1l 2 a2 b2 ab cos(T 1) = 1 2 * 1 2 + l1l 2 l2 l1 cos(T 1) = cos(T 1) = l 22 a 2 l12 b 2 ab + * 2 2 l2 l1 l1l 2
c2 c2 ab * + 2 2 l1l 2 l2 l1 c c ab cos(T 1) = * + l 2 l1 l1l 2 c 2 + ab l 2 2 a 2 + ab = cos(T 1) = l1l 2 l1l 2 2 2 l 2 (a ab) l 2 2 + (a (a + b)) = cos(T 1) = l1l 2 l 22 2 2 l 2 + aB l 2 aB cos(T 1) = = l1l 2 l1l 2 l1l 2 2 2 2 B + l 2 l1 2l 2 2 cos(T 1) = + 2l1l 2 2l1l 2 2 2 2 2l 2 B l 2 + l12 l 2 2 + l12 B 2 cos(T 1) = = 2l1l 2 2l1l 2
a=
B 2 + l 2 2 l12 2B
T 1 = arccos(
l12 + l 2 2 B 2 ) 2l1l 2
www.hexapod-kit.com
Dec_X2 is the offset on X axis, between joints A3 et A2. Dec_Y2 is the offset on Y axis, between joints A3 et A2. Dec_Z2 is the offset on Z axis, between joints A3 et A2 (=0). Given a the projection on Xa2 of the imaginary line B (seen previously).
c = Dec _ X 2 2 + Dec _ Y 2 2 t2 =
+ arctan(
Dec _ X 2 ) Dec _ Y 2
b = Pxa3 2 + Pya3 2 We know that : a b c = = sin(t1) sin(t 2) sin(t 3) So : Sinus proportionality rule.
www.hexapod-kit.com
www.hexapod-kit.com
System a3 is centred on A3 joint. System c is centred on the hexapod body (Y axis pointing to the front of the hexapod).
A is the angle between X axis of the body centred system and the X axis of the A3 joint centred system. Dec_X1 is the abscissa of a3 system centre, expressed in the c system. Dec_Y1 is the ordinate of a3 system centre, expressed in the c system. Dec_Z1 is the altitude of a3 system centre, expressed in the c system (=0). A, Dec_X1, Dec_Y1 et Dec_Z1 are not the same for all legs.
Pxa3 = Pxc cos( A) + Pyc sin( A) DEC _ X 12 + DEC _ Y 12 Pya3 = ( Pyc cos( A) Pxc sin( A))
www.hexapod-kit.com
Sum up
Coordinate system c to a3 :
Pxa3 = Pxc cos( A) + Pyc sin( A) DEC _ X 12 + DEC _ Y 12 Pya3 = ( Pyc cos( A) Pxc sin( A)) Pza3 = Pzc Dec _ Z1
+ arctan(
Dec _ X 2 ) Dec _ Y 2
Pxa 2 = Bx = b 2 c 2 sin(t 2) 2 + c cos(t 2) Pya 2 = 0 Pza 2 = Pz 3 Dec _ Z 2 Joints angles : B = Pxa 2 2 + Pza 2 2 l12 + l 2 2 B 2 ) 2l1l 2
T 1 = arccos(
T 3 = arctan(
) arctan(
Dec _ Y 2 ) Dec _ X 2
www.hexapod-kit.com
r Given V the vector which norm is equal to L, and which angle with Yc axis is A .
l1 = Dec _ X 1 l 2 = cos( B) ( x min + x max x min ) 2 x max x min l 3 = sin( B) ( x min + ) 2 l 4 = Dec _ Y 1
www.hexapod-kit.com
L 2 L ay = cos( A) 2 dx = ax dy = ay ax = sin( A)
Coordinates of starting and arrival points d et a translated on c point expressed in cp1 system.
a ' x = ax + l1 + l 2 a ' y = ay + l 3 + l 4 d ' x = dx + l1 + l 2 d ' y = dy + l 3 + l 4 Then, we are able to calculate the values of the different joints for starting and arrival point thanks to the previous formulas.
Remarks : Leg movement vector points in the opposite direction to the wanted body movement vector. L Number of cycles to be performed to reach the distance is equal to P In cp1 system Z coordinate of the leg tip is equal to G.
www.hexapod-kit.com
Front
l1 = Dec _ X 1 l 2 = cos( B) ( x min + x max x min ) 2 x max x min l 3 = sin( B) ( x min + ) 2 l 4 = Dec _ Y 1
www.hexapod-kit.com
Compared to straight walking not all legs have the same movement vector. For a given unitary angular step, the farthest leg from the rotation centre will describe the longest distance in one walking cycle (Equal to P in our case). At first we have to determine which leg is the farthest from the rotation centre. For each leg we calculate the length of CP segment :
CP =
(l1 + l 2 XC )2 + (l 3 + l 4 YC )2
For the leg which have the maximal CP, we calculate the angle T represented by points a and d spaced of a distance P, belonging to the circle.
Circ = 2 CP P 2 T= Circ P T= CP
T will be the unitary angular step for all legs in order to respect the unitary linear step P.
Equations for hexapod robot control In the coordinate system centred on the cercle we express : - The angle between the starting point d and X axis : Ad = arctan(
www.hexapod-kit.com
(l 3 + l 4 YC ) ) T (l1 + l 2 XC ) 2
(l 3 + l 4 YC ) ) + T (l1 + l 2 XC ) 2
- d and a coordinates : Xd = cos( Ad ) CP Yd = sin( Ad ) CP Xa = cos( Aa ) CP Ya = sin( Aa ) CP Now we can calculate the coordinates in the body coordinate system of the starting and arrival movement vector points. Xd = (cos( Ad ) CP) + XC Yd = (sin( Ad ) CP) + YC Xa = (cos( Aa ) CP ) + XC Ya = (sin( Aa ) CP) + YC
Then, we are able to calculate the values of the different joints for starting and arrival point thanks to the previous formulas.
www.hexapod-kit.com
X r N=Y Z
X = Z/tan(A) Y = Z/tan(B) Z =1
Coordinates of the body coordinate system centre projected to the Pr plan, expressed in the body coordinate system. P = (0;0;-G)
Equations for hexapod robot control Plane equation. Given: N {a,b,c} vector normal to the plan. A {xa,ya,za} a known point belonging to the plan. M {x,y,z} a point belonging to the plan. The plan equation is : ax+by+cz - (axa+bya+cza) = 0 If d=(axa+bya+cza) is the constant part of the equation. In our case d=-G
www.hexapod-kit.com
l1 = Dec _ X 1 x max x min ) 2 x max x min l 3 = sin( B) ( x min + ) 2 l 4 = Dec _ Y 1 l 2 = cos( B) ( x min +
Ex = l1 + l 2 Ey = l 3 + l 4 Ez = G ( Ex Ey ) tan( A) tan( B)
Then, we are able to calculate the values of the different joints for the starting and arrival points thanks to the previous formulas.