# Machine Learning Sequential Methodology for Robot Inverse Kinematic Modelling
## 4 Experimental Campaign and Discussion
### Model Validation  
Finally, the optimized models obtained from the three configurations (sequential from Base, sequential from TCP, and global) are compared. The validation trajectories are defined within the generated workspace, as shown in Figure 13a-d, each of them with more than 100 discrete target points. Furthermore, Figures 14-17 present the error comparison between the lab robot (FANUC LR Mate 200 lc) and the IK Model for the X-, Y-, Z-axes. Figure 13: Robot (blue) vs. IK procedure (red) for the implemented trajectories: (**a**) circle in the Y-Z plane; (**b**) spiral X-Y along Z-axis; (**c**) rectangle in the X-Y plane (**d**) S-shape in the X-Y plane. Figure 16: Rectangle in the X-Y plane: X-, Y-, Z-axes Robot vs. IK procedure. Figure 14: Circle in the Y-Z plane: X-, Y-, Z-axes Robot vs. IK procedure. Figure 15: Spiral along Z-axis: X-, Y-, Z-axes Robot vs. IK procedure. Comparing the different models, the circle trajectory (Y-Z plane) shows that the maximum error is equal to 1.113 mm in the global approach, 0.675 mm in the sequential method starting from the TCP, and 0.777 mm in the sequential method starting from the base frame. The developed trajectories have a different number of elements, such as 150 in the S-shape and 320 elements in the spiral. Nevertheless, it is noted that the number of points does not influence the robustness of the final model capabilities, for example, the trajectory obtained by points has a mean absolute Euclidean error, expressed as a vector [global, sequential from TCP, sequential from base] equal to [0.73 mm, 0.60 mm, 0.56 mm] that is comparable to the results obtained by the 320 points trajectory [0.87 mm, 0.48 mm, 0.69 mm]. The study also shows a residual range error of 0.370-0.699 mm of MAE for trajectory following of 120.0-200.0 mm features, as shown in Table 9. MAE (%) is close to 0.582% without any knowledge of robot kinematic and equipment calibration or set-up. The required procedure is performed offline to maintain the robot's availability. The IK complexity has been overcome and proved by numerical and laboratory campaigns. \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & \multicolumn{5}{c}{**Global 6 Layers**} \\ \hline
**Trajectory** & **MAE [mm]** & **MSE [mm2]** & **RMSE [mm]** & **MAXE [mm]** & **R\({}^{2}\) [-]** \\ \hline Circle in Y-Z & \(8.19\times 10^{-1}\) & \(7.25\times 10^{-1}\) & \(8.52\times 10^{-1}\) & \(1.11\times 10^{0}\) & 99.975\% \\ Spiral X-Y & \(8.67\times 10^{-1}\) & \(8.60\times 10^{-1}\) & \(9.27\times 10^{-1}\) & \(1.51\times 10^{0}\) & 99.971\% \\ Rectangle X-Y & \(8.67\times 10^{-1}\) & \(9.13\times 10^{-1}\) & \(9.55\times 10^{-1}\) & \(1.77\times 10^{0}\) & 99.988\% \\ S-shape in X-Y & \(7.26\times 10^{-1}\) & \(5.80\times 10^{-1}\) & \(7.62\times 10^{-1}\) & \(1.11\times 10^{0}\) & 99.987\% \\ \hline \hline  & \multicolumn{5}{c}{**Sequential From TCP**} \\ \hline
**Trajectory** & **MAE [mm]** & **MSE [mm2]** & **RMSE [mm]** & **MAXE [mm]** & **R\({}^{2}\) [-]** \\ \hline Circle in Y-Z & \(4.06\times 10^{-1}\) & \(2.00\times 10^{-1}\) & \(4.47\times 10^{-1}\) & \(6.75\times 10^{-1}\) & 99.993\% \\ Spiral X-Y & \(4.82\times 10^{-1}\) & \(2.79\times 10^{-1}\) & \(5.28\times 10^{-1}\) & \(9.71\times 10^{-1}\) & 99.990\% \\ Rectangle X-Y & \(5.66\times 10^{-1}\) & \(4.38\times 10^{-1}\) & \(6.62\times 10^{-1}\) & \(1.26\times 10^{0}\) & 99.994\% \\ S-shape in X-Y & \(6.00\times 10^{-1}\) & \(4.43\times 10^{-1}\) & \(6.65\times 10^{-1}\) & \(1.06\times 10^{0}\) & 99.990\% \\ \hline \hline  & \multicolumn{5}{c}{**Sequential From Base**} \\ \hline
**Trajectory** & **MAE [mm]** & **MSE [mm2]** & **RMSE [mm]** & **MAXE [mm]** & **R\({}^{2}\) [-]** \\ \hline Circle in Y-Z & \(5.13\times 10^{-1}\) & \(2.90\times 10^{-1}\) & \(5.39\times 10^{-1}\) & \(7. Table 10 states the training, testing, and validation errors in terms of the joint prediction for the different models (global approach and sequential method). The results show the capability of the ANN structure to model any path or data point within the workspace.