*3.2. Experimentation Stage*

A total of 36 training sessions were carried out by implementing the OA in *L*<sup>9</sup> 34 and *L*4 32 configurations, where the network architectures were trained and tested, obtaining the results shown in Table 6.


**Table 6.** Responses measured during the implementation of the crossed OA.

For the analysis of the S/N ratio, an analysis of variance (ANOVA) was performed using the statistical software program JMP. The S/N ratio and the mean value of the MSE are two of the specific criteria for determining the appropriate levels in the variables involved in network design, and their choice is determined through a series of validation procedures carried out in the next stage, as described below.

#### *3.3. Analysis Stage*

Figure 7a shows the best network topology obtained through the normal profile; Figure 7b describes the best topology through the desirable profile, and Figure 7c describes the best network topology using the maximized desirable profile. The three network profiles were obtained through statistical analysis in the JMP software to identify the optimal values in each of the proposed profiles. After performing the analysis of the S/N ratio, the values in which the levels for each of the variables involved were nearest to the average and S/N ratio red lines on the X axis were chosen, which are described in Table 7.


**Table 7.** Best design values with normal desirable and maximized profiles.

For the choice of the best network profile obtained, three training sessions were carried out for each of the three profiles in order to contrast them based on the size of the training and test data and their generalization capacity, estimating the percentage of correct answers in the prediction of the data, obtaining the results shown in Table 8.

The best topology corresponds to the maximized desirable profile, with the percentage of obtained hits being 87.71% with a margin of error of less than 5% in the tests. Once the best topology was chosen, the statistical tests of correlation and chi-square were performed, showing the best and worst prediction of the network, as shown in Figures 8 and 9, respectively.

**Figure 7.** S/N analysis for the determination of the optimal parameters of the network: (**a**) normal profile; (**b**) desirability profile; (**c**) maximized desirability profile.


**Table 8.** Comparison of density and percentage of hits in the three best profiles.

**Figure 8.** Trajectory of the manipulator with the best prediction and correlation test: (**a**) best predicted values; (**b**) correlation test.

**Figure 9.** Trajectory of the manipulator with the worst prediction and correlation test: (**a**) worst predicted values; (**b**) correlation test.

To determine if the predicted data are statistically reliable, the cross-validation method was used by splitting the training and testing datasets. The set was split into five subsets of the same size, as shown in Figure 10. The validation subset in each training session was used to measure the generalization error, in other words, the misclassification rate of the model with data dissimilar from those previously applied during the training procedure. The cross-validation procedure was implemented on the training and testing datasets, and the average value of MSE and the standard deviation obtained were very close to those obtained in the confirmation stage [48].

Table 9 shows the results obtained in the cross-validation process, where it is observed that the average training value was equal to 17.5099, the average percentage of hits considering an error of less than 5% was equal to 87.86%, and the average value of MSE was equal to 17.5099, with standard deviations of 1.5848, 1.8974, and 0.0059, respectively.

**Figure 10.** Cross-validation model.

**Table 9.** Cross-validation results.


In relation to the three profiles analyzed, the choice of the appropriate levels for the structural parameters of the best network topology were those corresponding to the maximized desirable profile with 100 and 30 neurons, respectively, a momentum of 0.2, and a learning rate of 0.2.

Figure 11 shows the layered surface diagram of the neural network used in this work. The training was performed using MATLAB software. The ANN was composed of an input layer with 100 neurons, a hidden layer with 30 neurons, and an output layer with 6 neurons. All three layers used the activation function. The training algorithm used to adjust the weighting of the synaptic weights was *resilient backpropagation*.

**Figure 11.** Best maximized desirable topology used in this study.

#### *3.4. Implementation Results Compared with Simulation Results*

Table 10 shows the measurement of the 10 trajectories predicted by the Quetzal manipulator and the error generated in comparison with the calculated trajectory. To analyze the data, 10 trajectories were chosen from the training dataset, and the simulation of each of them was carried out in order to obtain the distance traveled from the initial position to the final point.


**Table 10.** Trajectory comparison.

The greatest error observed was in trajectory number 236, with a value of 7.7% compared with the calculated one, while for trajectory number 6, the error was 1.1% compared with the calculated one. A mean error of 3.5% was obtained for the implementation of the 10 physically realized trajectories using the low-cost (approximately USD 1500) 3D-printed Quetzal manipulator.

### *3.5. Comparative Analysis*

Table 11 shows the values obtained in the design of the optimized BPNN in comparison with the BPNN based on trial and error and other methods used in the optimization of the structural parameters in ANN. As can be seen, the conventional BPNN method based on trial and error shows a greater difficulty in determining the optimal parameters, whereas the optimized BPNN results in a shorter time in the training process than the other methods; in addition, it involves noise parameters that are necessary to generate greater robustness in the network design.



#### **4. Conclusions and Discussion**

Various approaches and powerful learning algorithms of great value have been introduced in recent decades; however, the integration of the various approaches in ANN optimization has allowed researchers to improve performance and generalizability in ANNs. The results of this work revealed that the proposed systematic and experimental approach is a useful alternative for the robust design of ANNs since it allows simultaneously considering the design and the noise variables, incorporating the concept of robustness in the design of ANNs. The RDANN methodology used in this work was initially proposed in the field of neutron dosimetry, so it was adapted for implementation in the field of robotics, allowing us to improve the performance and generalization capacity in an ANN to find the solution to the inverse kinematics in the Quetzal manipulator.

The time spent during the network design process was significantly reduced compared with the conventional methods based on trial and error. In the methods that are generally proposed by the previous experience of the researcher, the design and modeling of the network can take from several days to a few weeks or even months to test the different ANN architectures, which can lead to a relatively poor design. The use of the RDANN methodology in this study allowed the network design to be carried out in less time, with approximately 13 h of training, due to the orthogonal arrangement corresponding to the 36 training sessions performed using a conventional AMD Ryzen 7 5700 series processor with an integrated graphics card.

Depending on the complexity of the problem, the use of this methodology allows handling times ranging from minutes to hours to determine the best robustness parameters in the network architecture. Therefore, it is possible to streamline the process and reduce efforts, with a high degree of precision in network performance. The use of the RDANN methodology allowed the analysis of the interaction between the values in the design variables that were involved, in order to consider their effects on network performance, thus allowing a reduction in the time and effort spent in the modeling stage and speeding up the selection and interpretation of the optimal values in the structural parameters of the network. The quality of the data in the training sets, without a doubt, can significantly help to increase the performance, generalization capacity, and precision of the results obtained. Although the proposed method was implemented and tested in a low-cost manipulator in this study, in future work, we plan to implement it in an industrial-type robot controller. The implementation of the proposed method in parallel robotic manipulators, where the solution of the kinematics is more complex, is also considered.

**Supplementary Materials:** The following are available online at https://www.mdpi.com/article/10 .3390/app12199512/s1, dataset: dataSetQuetzalRobot.mat, code: workspaceQuetzal.m.

**Author Contributions:** Conceptualization, T.I.-P. and M.d.R.M.-B.; methodology, J.M.O.-R. and T.I.-P.; software, H.G.-R. and H.A.G.-O.; validation, H.G.-R. and T.I.-P.; formal analysis, J.M.O.-R. and M.d.R.M.-B.; investigation, T.I.-P.; resources, F.O.-D. and H.A.G.-O.; data curation, H.G.-R. and H.A.G.-O.; writing—original draft preparation, T.I.-P.; writing—review and editing, T.I.-P. and F.O.-D.; visualization, H.G.-R. and H.A.G.-O.; supervision, M.d.R.M.-B.; project administration, M.d.R.M.-B.; funding acquisition, J.M.O.-R. and T.I.-P. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research was supported by the Instituto Politécnico Nacional (IPN) under grants number CPE/COTEBAL/14/2021, the Consejo Nacional de Ciencia y Tecnología (CONACYT-BECAS) under grants number 431101/498318 and the Consejo Zacatecano de Ciencia, Tecnología e Innovación (COZCyT).

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Not applicable.

**Acknowledgments:** This research was supported by the Instituto Politécnico Nacional (IPN) under grants number CPE/COTEBAL/14/2021, the Consejo Nacional de Ciencia y Tecnología (CONACYT-BECAS) under grants number 431101/498318 and the Consejo Zacatecano de Ciencia, Tecnología e Innovación (COZCyT). The authors gratefully acknowledge these support agencies. We sincerely thank the people who provided support and advice for this paper, as well as the reviewers for their comments and suggestions.

**Conflicts of Interest:** The authors declare no conflict of interest.
