# Machine Learning Sequential Methodology for Robot Inverse Kinematic Modelling
## 3 Simulation Validation
### Model Validation  
The trajectories defined in Equations (5)-(11) and used for the FK validation step, are employed to evaluate the performance of the IK model, obtained by the optimized structure. Figures 6-10 shows the results of the sequential IK procedure prediction of the simulated trajectories. To assess the model, the trajectories are selected in critical workspace zones, such as the extreme reaching regions of the robot, where small errors in the joint space may create significant errors in TCP positioning. Although this effect is particularly relevant, the model deployment maintains the performance of the MAE (mean absolute error) in 3D space lower than 0.654 mm. \begin{table}
\begin{tabular}{c c c} \hline
**Requirements** & **Sequential** & **Global** \\ \hline - Number of joints & J1–J3 & J1–J3 \\ - Algorithm limitations & Mix & \textless{8 Layers} \\ - Activation Functions & Tansig & Tansig \\ - Feature filtering & J4–J6 & J4–J6 \\ - Epochs & 1000 & 1000 \\ \hline \end{tabular}
\end{table} 
Table 4: GA/ANN optimization inputs for IRB140. Figure 5: Workspace for the IRB140, J4—blue; J3—red; J2—black. Figure 6: 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 7: Circle in the Y-Z plane: X-, Y-, Z- axes Virtual IRB140 vs. IK procedure. Figure 8: Spiral X-Y along Z-direction: X-, Y-, Z- axes Virtual IRB140 vs. IK procedure. Figure 10: S-shape: X-, Y-, Z- axes Virtual IRB140 vs. IK procedure. Figure 9: Rectangle in the X-Y plane: X-, Y-, Z- axes Virtual IRB140 vs. IK procedure. Table 5 summarizes the MAE, MSE, RMSE, MAXE, and R\({}^{2}\) obtained comparing simulations and the developed models using the global approach and the sequential method. R\({}^{2}\) coefficients are greater than 99.99% for all the deployed models, confirming the goodness of the correlation. Comparing the adopted methods, the results highlight that the global approach (7 hidden layers) has a higher error (MAE) than the sequential method by 42.7-56.7%. The sequential method has been obtained using [5; 5; 6] layers and [5; 3; 7] layers, starting from the robot TCP or from the base, respectively. Moreover, the maximum Euclidean error is close to 1.3 mm using the global approach, while the sequential approach shows lower error (MAXE) values, reaching a minimum of 0.634 mm for the S-shape path. Considering the spiral trajectory, the sequential network starting from the base has the MAXE equal to 0.8 mm, that is lower than the global approach by 35.3%. Similar results are obtained from the rectangle trajectory. These deviations are calculated in the extreme reaching positionings of the robot where low errors in the joint space are amplified. Table 6 lists the main error indicators in the join space related to the sequential method datasets (train, validation, test), underlining the capability to model datapoints in the robot workspace. \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Train** & **MSE [rad2]** & **RMSE [rad]** & **MAXE [rad]** \\ \hline Sequential From Base & \(1.23\times 10^{-6}\) & \(1.11\times 10^{-3}\) & \(9.68\times 10^{-3}\) \\ Sequential From TCP & \(9.23\times 10^{-7}\) & \(9.61\times 10^{-4}\) & \(1.07\times 10^{-2}\) \\ \hline
**Validation** & **MSE [rad2]** & **RMSE [rad]** & **MAXE [rad]** \\ \hline Sequential From Base & \(1.50\times 10^{-6}\) & \(1.22\times 10^{-3}\) & \(8.51\times 10^{-3}\) \\ Sequential From TCP & \(1.40\times 10^{-6}\) & \(1.18\times 10^{-3}\) & \(2.15\times 10^{-2}\) \\ \hline
**Test** & **MSE [rad2]** & **RMSE [rad]** & **MAXE [rad]** \\ \hline Sequential From Base & \(1.73\times 10^{-6}\) & \(1.32\times 10^{-3}\) & \(1.60\times 10^{-2}\) \\ Sequential From TCP & \(1.95\times 10^{-6}\) & \(1.40\times 10^{-3}\) & \(4.87\times 10^{-2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 6: Train, validation, and test performance for the sequential models.