R Robot Inverse Solution Algorithm Based on Quaternion Matrix and Groebner Base

This article proposes a new algorithm of quaternion and dual quaternion in matrix form. It applies quaternion in special cases of rotated plane, transforming the sine and cosine of the rotation angle into matrix form, then exporting flat quaternions base in two matrix form. It establishes serial 6R manipulator kinematic equations in the form of quaternion matrix. Then five variables are eliminated through linear elimination and application of lexicographic Groebner base. Thus, upper bound of the degree of the equation is determined, which is 16. In this way, a 16-degree equation with single variable is obtained without any extraneous root. This is the first time that quaternion matrix modeling has been used in 6R robot inverse kinematics analysis.


Introduction
This article uses quaternion matrix to solve the problem of 6R robot inverse kinematics in the three-dimensional space.In fact, this problem has been solved in 1986 [1], through Closed Displacement Equation established by Homogeneous Transforms Matrix.It makes use of the product of the closed equation to conduct linear combination and then gets a new series of related equations.Finally, it performs linear elimination according to the linear combination among equations and does final elimination by the resultant, obtaining the 16-degree equation with single variable in the end.The kinematic model of 6R robot can also be built using Dual quaternion or Double quaternion, but there are some problems existed.When Qiao Shuguang [2] used Double quaternion to solve the problem, Z. S. Ni, R. K. Wu with single variable is obtained.Huang Xiguang [3] and Gan Dongming [4] transformed the sine and cosine of one rotation angle into plural form instead of extracting common factors, but numerical calculation is needed.Because only in that way, ±12 degree equation can be transformed to ±8 degree equation, and then a 16-degree equation with single variable can be obtained.Even though they have obtained the single-variable equation, the deduction process depends on numerical computation lacking rigorous proof.A new algorithm using quaternion and dual quaternion in matrix form is put forward in this article.It applies quaternion in special cases of rotated plane, transforming the sine and cosine of the rotation angle into matrix form, then exporting flat quaternion base in two matrixes form.It establishes serial 6R manipulator kinematic equations in the form of quaternion matrix.Then five variables are eliminated through linear elimination and application of lexicographic Groebner base.Thus, upper bound of the degree of the equation is determined, which is 16.In this way, a 16-degree equation with single variable is obtained without any extraneous root.This is the first time that quaternion matrix [5] [6] modeling has been used in 6R robot inverse kinematics analysis.

Homogeneous Transformations in the Form of Quaternion Matrix
A dual quaternion can be expressed as: which the last four part can be written as which the part in the bracket can be transformed to matrix form using the method above, so the matrix form of dual quaternion can be expressed as: Using D-H method to build robot coordinate system, the relationship of two adjacent joint coordinate systems i-1 and i, can be described by the parameters in Figure 1.
In Figure 1, a new coordinate system can be derived by the coordinate system i-1 rotating on its axis Z with angle θ i and transforming s i along the same axis.Similarly, by rotating this new coordinate system on its axis X with angle α i and transforming a i along the same X, the coordinate system i can be obtained.This kinematics can be described in matrix form like this ( ) ( )

Q
among which the latter one is a conversion related to x-axis.

Mathematical Modeling
Inverse solution of position of 6R robot in three dimensions is that given the position and gesture and parameter s i , a i , α i , find the input angles ( ( ) of every joints.6R serial mechanism (Figure 2) has six joints and it needs 6 three-dimension movements described in Figure 1.According to basic theories of quaternion matrix, the mathematical model of inverse solution of kinematics position of 6R serial mechanism in three dimensions can be expressed in matrix form: θ i , s i , α i and a i in the equations are structural parameters of 6R robot manipulate arm.
( ) are quaternion matrix transformations that rotate and move along z-axis and x-axis respectively.M is the expression in quaternion matrix form of the position and gesture of the end of the robot.For general 6R robot, unknown variables are ( )


and other variable are determined by the structure of robot which are known.Our goal is to find out the six angles.We use T i and A i to represent ( ) Qiao [2] said that two of the six variables on the left of Equation ( 2) can be moved to the right and then it can be solved by Dixon resultant.Here, we move three of six variables on the left to the right, then Equation (2) becomes:

T AT A T MA A T A T A T
Assume that the left and right part in equation is T 7 and T 8 respectively, which are quaternions in matrix form.Using Mathematic 6.0, we get: Since ) and we assume that x j θ = =  , we can obtain eight equations below: where a i and b i are known parameters determined by the structure of mechanical arm.

Eliminate x4, x5 and x6
Assume the right end of the eight Equations in (5) to be:

x x x y x x x y x x x y x x x y x x x y x x x y x x x y x x x y
Solve y i and we can get eight equations below: ( ) 1, 2, ,8 where c i are known parameters determined by the structure of mechanical arm.
In (7), we use lexicographic method to order, so 4 5 6 x x x > > , then we com- pute the Groebner base.Use algebraic system to perform symbolic operation, then we get 21 bases.However, 11 bases among them are eliminated because of containing x 4 , x 5 and x 6 .Other ten lower-degree bases are selected as quadric bases: x x x to both sides, then we obtain 10 equations about 2 2 2 1 2 3 , , x x x whose degrees are no more than 4: ( ) For (9), assume 2 ( ) 1, 2, , 7 e e X e X e X e X X e X e X i Other four bases are abandoned because they have high degree of X 1 and X 2 .The coefficients e ij in (10) are 4, 3, 1, 3, 2, 2, 1 algebraic expression of X 3 .
The seven Equations in (10) can be transformed into matrix form: where In order to have solutions, the value of determinant of coefficient must be 0, that is ( ) According to the analysis to the degree of X 3 , matrix N 7×7 has 16 degrees about X 3 .So the degree of expansion is more than 16.
According to (12), there is no need to extract any common factor and 16-degree input and output equations with single variable X 3 can be obtained: where s i are real coefficients determined by input parameters.Solve (13), 16 solutions will be obtained and through: value of 3 θ is available.Substitute x 3 to (8) and extract eight equations to build an equation set; con- , , , , , X X X X X X X as unknown variables and solve it.Then we can get X 1 and X 2 .Through (14), we can get θ 1 and θ 2 .Input θ 1 and θ 2 to (7), y i can be solved.Then, by ( 6) and ( 14), θ 4 , θ 5 and θ 6 are also available.

Sample Analysis
Use the parameters in example by Q. Shuguang, which the structural parameters are shown in Table 1.According to the parameter above, we obtain the position and gesture matrix of the end of the mechanical arm, which has 16 groups of joint angles.
The results of back solution are shown in Table 2, in which there are four real solutions and the 14 th solution equals to the initial value.In addition, the result in Table 2 is exactly the same as the result gained by program in [2] [7] and [8].In this way, this algorithm is correct.

Conclusion
Based on research of quaternion in matrix form, we apply it on the modeling of 6R robot.By using lexicographic Groebner base twice, we eliminate and obtain 10 bases in the first time and 11 bases in the second time.Thus, the degree of variables decreases.Using 7 bases among them and resultant elimination, the analytical solution of the 16-degree equation is obtained and the numerical example gets the same result as the literature above.It is a convenient method which can be applied to inverse kinematics analysis of 6R robot in three dimensions, laying a new foundation for real application.
equation by lexicographic Groebner base.Detailed steps are: Use Mathematica on Intel Pentium IV, 2.93 GHz, RAM 1 G, PC and rank the Groebner bases in (9) according to cost 5.657 seconds and we obtain 11 bases.Seven of the 11 bases are shown below: Z Z. S. Ni, R. K. Wu

Table 2 .
16 groups of solutions of 6R robot.