# Kinematics Model Optimization Algorithm for Six Degrees of Freedom Parallel Platform
## 3 Results  
### Single Algorithm Simulation  
In order to verify the correctness of the Newton iteration and polynomial regression algorithms, and to conduct a comparative test on the performance of the algorithms, the m language script code is written on the MATLAB platform for simulation experiments. The experimental platform is Windows 10 system, the CPU is i7-8750H 2.2 GHz, and the RAM is 16 GB single-channel DDR4 memory at 2666 MHz. The initial value of the Newton iterative algorithm is set to the initial attitude of the parallel platform \([0,0,0,0,0,0]^{T}\). Set the stop condition of the Newton iterative algorithm as the number of iterations exceeds 10, or the Euclidean distance, \(\sqrt{\left[E(X_{k})\right]^{2}}\), between the length of the manipulator obtained from the inverse solution of the attitude after the kth iteration and the length of the given manipulator is less than 0.001. The parameters of the MPR algorithm are set to two cases of the six-element quadratic polynomial and the six-element cubic polynomial. Before using the MPR algorithm for kinematics positive solution, the polynomial coefficients of MPR are solved using the training sample set in the same closed subspace as the test sample set. Write the least-squares method code according to Equation (17). The minimum norm least-squares solution of the MPR coefficients is obtained by using the length attitude data of the training sample set, and the MPR kinematics positive solution is completed using the obtained parameters. The kinematics positive solutions of the first test sample set and the second test sample set were performed using Newton iterative algorithm, six-variable quadratic polynomial regression (MPR2), and six-variate cubic polynomial regression (MPR3) algorithms respectively. Record the total time-consuming and average absolute error of 10,000 solutions. The test results are shown in Table 2.  
The first three columns of the average absolute error in Table 2 are the solution errors of the rotation angles of the \(x\)-axis, \(y\)-axis, and \(z\)-axis, respectively, and the unit is radian. The last three columns are the displacement solution errors of the \(x\)-axis, \(y\)-axis, and \(z\)-axis, respectively, in meters. The solution time unit is seconds. It can be seen from Table 2 that both the Newton iterative algorithm and the MPR algorithm can successfully complete the solution of the positive kinematics solution of the parallel platform. The average single solution time of an algorithm is defined as the total \begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Algorithm** & **Dataset** & **Kinematics** & **Positive** & **Solution** & **Mean** & **Absolute** & **Error** & **Time** \\ \hline \multirow{2}{*}{Newton iteration} & Test Set 1 & & 0.3 & 0.2 & 1.7 & 0.4 & 0.4 & 0.2 \(\times 10^{-5}\) & 1.144 \\  & Test Set 2 & & 0.3 & 0.1 & 0.6 & 0.05 & 0.05 & 0.03 \(\times 10^{-3}\) & 1.815 \\ \hline \multirow{2}{*}{MPR2} & Test Set 1 & & 3.4 & 1.7 & 2.8 & 0.4 & 0.5 & 0.2 \(\times 10^{-4}\) & 0.169 \\  & Test Set 2 & & 2.2 & 1.0 & 1.8 & 0.2 & 0.3 & 0.1 \(\times 10^{-2}\) & 0.164 \\ \hline \multirow{2}{*}{MPR3} & Test Set 1 & & 1.8 & 1.9 & 2.6 & 0.3 & 0.2 & 0.2 \(\times 10^{-5}\) & 0.287 \\  & Test Set 2 & & 5.1 & 3.5 & 6.4 & 0.6 & 0.5 & 0.3 \(\times 10^{-3}\) & 0.272 \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Comparison of Newton iteration method and polynomial regression algorithm. time consumed by the same algorithm in two sample sets divided by the total number of samples, as shown in Equation (18):  
\[\textit{Average time for a single solution}=\frac{\textit{Computation time of sample set }1+\textit{calculation time of sample set }2}{\textit{Number of samples in sample set }1+\textit{number of samples in sample set }2} \tag{18}\]  
According to Equation (18) and the data in Table 2, the average single solution time of the Newton iterative algorithm is calculated to be about 148 microseconds. The average single solution time of MPR2 is about 17 microseconds.