# Machine Learning Sequential Methodology for Robot Inverse Kinematic Modelling
## 5 Conclusions  
This paper proposes a procedure to generate a ML model using a sequential scheme for an accurate IK formulation. Two anthropomorphic robots are studied, evaluating the spatial trajectory error obtained from a data-driven model in the simulated (ABB IRB140) and the laboratory experimental (FANUC LR Mate 200 iC) environments. A 3-step procedure is proposed: (i) IK boundary definition and pre-processing, (ii) network architecture definition based on GA, and (iii) network validation. The models show promising results for the validation of the trajectories, executed in critical workspace positionings of the robot. The goodness of IK methodology is confirmed by evaluating the errors of the joint space and the trajectories in cartesian space. In the simulation, the sequential procedure shows a reduction of the mean squared error index of \(42.7\)-\(56.7\%\), compared to the global scheme. In particular, the most effective approach is obtained by modeling the robot starting from the base to the TCP, with a final mean square error equal to \(1.73\times 10^{-6}\) [rad\({}^{2}\)] in joint space. Comparable results are collected from the experimental campaign with a MAE lower than \(0.60\) mm, using the sequential method. As in the simulated environment, the global approach highlights a greater error, that is close to \(0.72\) mm. Compared with other studies in the literature [23; 31; 32; 33; 34; 35], the proposed methodology offers several contributions. The first point is the application of simulated data points based on the FK equations obtained from an automatic procedure with a reduced experimental dataset to train the ML model. Usually, it is required a significant computation of the FK model or the D-H parameters for the dataset creation [35]. This approach allows the creation of large datasets without unnecessary experimental measurements, reducing the application time. Furthermore, the automatic proposed procedure does not require \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Train** & **MSE [rad\({}^{2}\)]** & **RMSE [rad]** & **MAXE [rad]** \\ \hline Sequential From Base & \(1.25\times 10^{-6}\) & \(1.12\times 10^{-3}\) & \(9.70\times 10^{-3}\) \\ Sequential From TCP & \(1.18\times 10^{-6}\) & \(1.09\times 10^{-3}\) & \(1.41\times 10^{-2}\) \\ \hline
**Validation** & **MSE [rad\({}^{2}\)]** & **RMSE [rad]** & **MAXE [rad]** \\ \hline Sequential From Base & \(1.62\times 10^{-6}\) & \(1.27\times 10^{-3}\) & \(1.33\times 10^{-2}\) \\ Sequential From TCP & \(1.83\times 10^{-6}\) & \(1.35\times 10^{-3}\) & \(3.51\times 10^{-2}\) \\ \hline
**Test** & **MSE [rad\({}^{2}\)]** & **RMSE [rad]** & **MAXE [rad]** \\ \hline Sequential From Base & \(1.90\times 10^{-6}\) & \(1.38\times 10^{-3}\) & \(2.56\times 10^{-2}\) \\ Sequential From TCP & \(2.78\times 10^{-6}\) & \(1.67\times 10^{-3}\) & \(6.29\times 10^{-2}\) \\ \hline \hline \end{tabular}
\end{table} 
Table 10: Sequential IK procedure error results for the training, validation, and testing phases. user-time since the data generation and ANN configuration are done by the deployed methodology. In addition, if the robot does not allow a continuous data sample to produce the corresponding D-H parameters, the user may implement the direct FK equations within the program manually. A further advantage of this methodology is the inclusion of the genetic algorithm to define and optimize the network structure. This step permits the user to avoid any kind of ANN parameters tuning; however, the limits and discretization for the number of hid-den layers and hidden neurons for each layer has to be defined. The fine-tuning requirement may represent a boundary limitation for the complete methodology application, and it may directly influence the results obtained during the model deployment and the computational training time. The methodology also provides robust modeling in dealing with the multiple IK solutions, compared to the global approach or the pure individual joints method [22; 23; 24; 27; 35].