## 3 Procedure to Synthesize the IKM Using Groebner Basis
### Fifth Step: Groebner Basis Calculation  
Once the lexicographic order is selected, the developed procedure proceeds to calculate the Groebner Basis of the polynomial equation system obtained in Section 3.3. This basis calculation is executed in a two step process: First, an initial Groebner Basis is obtained using [PERSON]'s F4 algorithm [27; 28], with a graded reverse lexicographic order (grevlex). After this first basis is calculated, an FGLM basis conversion, based on the algorithm developed by [PERSON] et al [29], is made to convert the basis to the lexicographic order selected in the previous step. This two-step process was selected because it has been proven that it is the most efficient way to calculate a Groebner Basis for a zero-order Ideal, i.e., an Ideal that has a finite amount of solutions, with six variables or less [26]. This is exactly our case because the Kinematic Problem of the studied non-redundant open-chain robotic systems contains at most six variables: one or two for each of the three DoF (\(q_{1}\), \(q_{2}\) and \(q_{3}\)), depending on whether it is a rotational DoF or a prismatic one. In addition, it also has a finite number of solutions: at most four, as is typical when solving the position of non-redundant open-chain robots. When the developed procedure is applied to the PUMA 560, the output of this fifth step is the Groebner Basis presented in Equations (22) to (27). In these equations, all the parameters of the robot are already substituted by their numerical values. In order to reduce the computation time of the F4 algorithm, all these parameters were given as integer numbers. This means that a dimension conversion, from mm to tenths of mm, was done to the PUMA's parameters (see Table 2). This dimension conversion has to be taken into account in the last step of the procedure, to ensure that all the parameter dimensions and positions are in the same units:  
\[2223081-p_{x}^{2}+2982p_{y}s_{1}+[p_{x}^{2}+p_{y}^{2}]s_{1}^{2}=0 \tag{22}\]  
\[1491+p_{y}s_{1}+p_{x}c_{1}=0 \tag{23}\]  
\[p_{x}^{4}+p_{y}^{4}+p_{z}^{4}+2(p_{x}^{2}p_{y}^{2}+p_{x}^{2}p_{z}^{2}+p_{y}^{2 }p_{z}^{2})-26416(p_{x}^{2}p_{z}+p_{y}^{2}p_{z}+p_{z}^{3})+182342946p_{z}^{2}\]  
\[+7891682(p_{x}^{2}+p_{y}^{2})-10423335856p_{z}+12496273537617\]  
\[+[988024862656p_{z}-295168762271912-74805032(p_{x}^{2}+p_{y}^{2}+p_{z}^{2})]c_{ 3}+1402021590789920c_{3}^{2}=0\]  
\[13208p_{z}-p_{x}^{2}-p_{y}^{2}-p_{z}^{2}-3945841+37402516c_{3}+1753108s_{3}=0 \tag{25}\]\[203(p_{x}^{3}p_{z}+p_{x}p_{y}^{3}+p_{x}p_{y}^{2}p_{z})-1340612(p_{x}^{3}+p_{x}p_{ y}^{2})-6457521(p_{x}^{2}p_{y}+p_{y}^{3}+p_{y}p_{z}^{2})-4021836p_{x}p_{z}^{2}\] \[+26077729363p_{x}p_{z}-55281595746468p_{x}+85290937368p_{y}p_{z}-2548 0351120161p_{y}\] \[+[57203848(p_{x}^{2}p_{z}^{2}+p_{y}^{2}p_{z})-4331(p_{x}^{4}+p_{y}^ {4}+p_{x}^{2}p_{z}^{2}+p_{y}^{2}p_{z}^{2})-8662p_{x}^{2}p_{y}^{2}-17089437371(p_{ x}^{2}+p_{y}^{2})]s_{1} \tag{26}\] \[+242058150980520p_{y}s_{3}+162346177720[p_{x}^{2}+p_{y}^{2}]s_{1}c_ {3}\] \[1491+p_{y}s_{1}+p_{x}c_{1}=0 \tag{23}\]0 \[1491+p_{y}s_{1}+p_{x}c_{1}=0 \tag{23}\]1 \[1491+p_{y}s_{1}+p_{x}c_{1}=0 \tag{23}\]2 \[1491+p_{y}s_{1}+p_{x}c_{1}=0 \tag{23}\]3 (27) \[1491+p_{y}s_{1}+p_{x}c_{1}=0 \tag{23}\]4 \[1491+p_{y}s_{1}+p_{x}c_{1}=0 \tag{23}\]5  
As can be seen in the previous equations, the obtained Groebner Basis constitutes a triangular equation system that can be solved in a staggered way. This is because the first equation of the system, shown in Equation (22), only depends on one variable, the lesser monomial in the selected lex order (see Equation (21)). After that equation is solved, the second one has at most two variables, the one that was previously calculated in the first equation and a new one, while the third depends at most on three variables, two computed in the preceding equations and a new one, and so on. Solving this triangular equation system gives the solution for the all the variables of the original polynomial equation system, the one that was calculated in Section 3.3.