# A Neural Network Based Approach to Inverse Kinematics Problem for General Six-Axis Robots
## 5 Results and Discussion
### Test with Random Pose  
After training the proposed neural networks, we first tested our algorithm with random points in the workspace. In total, 25 sets of joint angles were generated randomly within each subspace, i.e., 4800 in total, with respective poses sought via Equation (2). These poses were applied as inputs of the algorithm in order to obtain the initial and optimized solutions. Performance of the classification system on training sets and test set is given in Table 5. In Table 6, five samples were picked from the test sets randomly as examples, with the corresponding solutions shown in bottom three rows. To evaluate the performance of the error minimization algorithm, both the initial and optimized solutions were transformed into the Cartesian Space. After subtracting the goal poses, the absolute errors of the initial and optimal solutions were obtained and plotted as boxplot in Figures 6 and 7, respectively. Some error indicators were sorted and given in Tables 7 and 8. \begin{table}
\begin{tabular}{c c c c c c c} \hline \hline  & **No** & \(\mathbf{x(\text{m})}\) & \(\mathbf{y(\text{m})}\) & \(\mathbf{z(\text{m})}\) & \(\mathbf{\phi(\text{rad})}\) & \(\mathbf{\theta(\text{rad})}\) & \(\mathbf{\psi(\text{rad})}\) \\ \hline \multirow{4}{*}{\begin{tabular}{c} Goal \\ Pose \\ \end{tabular} } & 1 & \(-\)0.64142 & 0.22652 & 0.22762 & \(-\)0.10588 & \(-\)2.08249 & 2.34062 \\  & 2 & 0.45064 & 0.15015 & 0.63200 & \(-\)2.54416 & \(-\)0.76447 & \(-\)2.30342 \\  & 3 & 0.19978 & 0.55744 & 0.51288 & \(-\)1.06619 & \(-\)1.83045 & 2.78188 \\  & 4 & 0.33833 & 0.42766 & 0.28287 & 0.40171 & \(-\)3.01724 & \(-\)0.99056 \\  & 5 & \(-\)0.24216 & 0.39147 & \(-\)0.17398 & 1.78176 & \(-\)2.12424 & 2.17019 \\ \hline \multirow{4}{*}{\begin{tabular}{c} Exact \\ Solution \\ \end{tabular} } & **No** & \(\mathbf{q_{1}}\) & \(\mathbf{q_{2}}\) & \(\mathbf{q_{3}}\) & \(\mathbf{q_{4}}\) & \(\mathbf{q_{5}}\) & \(\mathbf{q_{6}}\) \\ \cline{2-7}  & 1 & 160.46907 & 37.91946 & \(-\)135.87082 & 18.62891 & 39.46047 & 112.83264 \\  & 2 & 24.29447 & 11.89334 & \(-\)153.69625 & 53.15470 & 8.58257 & 182.38461 \\  & 3 & 64.38381 & 14.31783 & \(-\)145.74087 & 54.39600 & 75.48167 & 120.27973 \\  & 4 & 50.64234 & 30.28887 & \(-\)156.69763 & 4.48408 & 132.64058 & 153.73039 \\  & 5 & 117.71272 & 57.93731 & \(-\)121.66049 & 15.36286 & 120.12755 & 320.55779 \\ \hline \multirow{4}{*}{\
\begin{tabular}{c} Initial \\ Solution \\ \end{tabular} } & 1 & 160.44294 & 37.90550 & \(-\)135.93878 & 18.59329 & 39.40203 & 112.92553 \\  & 2 & 24.26964 & 11.93607 & \(-\)153.77572 & 53.15427 & 8.66457 & 182.47650 \\  & 3 & 64.36072 & 14.37610 & \(-\)145.80470 & 54.32014 & 75.51120 & 120.29442 \\  & 4 & 50.57437 & 30.29154 & \(-\)156.75669 & 4.56464 & 132.62676 & 153.75462 \\  & 5 & 117.75096 & 58.00550 & \(-\)121.67093 & 15.17564 & 120.30039 & 320.64783 \\ \hline \multirow{4}{*}{
\begin{tabular}{c} Optimized \\ Solution \\ \end{tabular} } & 1 & 160.46905 & 37.91945 & \(-\)135.87089 & 18.62888 & 39.46041 & 112.83273 \\  & 2 & 24.29433 & 11.89359 & \(-\)153.69672 & 53.15470 & 8.58306 & 182.38515 \\  & 3 & 64.38376 & 14.31879 & \(-\)145.74103 & 54.39582 & 75.48174 & 120.27977 \\  & 4 & 50.64217 & 30.28888 & \(-\)156.69777 & 4.48428 & 132.64055 & 153.73045 \\  & 5 & 117.71276 & 57.93739 & \(-\)121.66051 & 15.36263 & 120.12776 & 320.55790 \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Example of random data test. \begin{table}
\begin{tabular}{c c c c c} \hline \hline  & **NN 1** & **NN 2** & **NN 3** & **Overall Classification System** \\ \hline Train set & 94.50\% & 97.87\% & 98.53\% & \(\mathrm{N/A}\) \\ \hline Test set & 93.60\% & 95.40\% & 96.25\% & 99.50\% \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Performance of the classification system. From the results, it is apparent that our trained neural networks manage to find an acceptable solution for IKP in all attempts. According to our statistics, without refining, 99.27% predictions are relatively accurate, reaching the precision of 5 mm for position and 2\({}^{\circ}\) for orientation.