# FPGA-Based Methodology for Detecting Positional Accuracy Degradation in Industrial Robots
## 3 Results and Discussion
On the other hand, for the real case, 540 samples were used to test the classifier. As in the synthetic case, these samples also represent 15% of the respective datasets used for training the classifiers and the samples are unknown to the classifiers. The confusion matrices obtained are presented in Figure 16, where Figure 16a-c correspond to articulations one to three and Figure 16d-f correspond to joints four through six and a summarized version is presented in Table 4.  
Figure 15: Confusion matrices obtained in the ANN validation process for the synthetic cases where the deviation is induced in one of the robot joints at a time. (**a–c**) confusion matrices correspond to joints one to three. (**d–f**) confusion matrices correspond to joints four to six. Figure 16 shows that for joints two and three, an average accuracy of 66.5% and 72.8% is obtained, respectively. Whereas for joints one and four, an average accuracy greater than 88% is obtained. Furthermore, joints five and six present an average accuracy of 100%. These results are obtained from a real-world dataset; however, the dataset does not provide information on the condition of the robot at the time of obtaining the signals, so it is not possible to determine if there is a mechanical, electrical, or wear failure that has caused a joint failure deviation in the robot. In this sense, the results obtained for joints two and three indicate that the signals of the robot CO and HO's operating states are not different. Additionally, the other joints have results greater than 90% accuracy, for which the classifier can distinguish the two states of operation and indicate a deviation. Emphasize that this dataset has a time difference of 2 h between the initial and final operating states, in addition to the fact that this robot performs a trajectory continuously with a mass of 4.5 lb and operates at 100% of its maximum speed, for which these results could be attributed to the additional inertia caused by the extra weight and speed of operation. The results obtained in the synthetic case and in the real case show that the proposed method can process signals with different noise levels using the DWT, using the DWT, which allows the noisy signal to be decomposed into different frequency bands without losing the characteristics of the original signal, thus enabling the utilization of the frequency band of interest. Regarding the results of the implementation in the physical system, validation is made that the calculations made in the FPGA device correspond to those obtained in the software simulation. In this sense, Table 5 shows the performance obtained in the main modules used to implement the methodology on hardware. The information in the Table 5 consists of the clock cycles necessary to calculate the module and complete processing of the module (calculation and copy of data to the buffers), as well as the calculation time and complete processing of each module. It is observed that the module that requires less time to perform complete processing is the neural network, while the DWT is the module with the most extended duration. The DWT module decomposes and reconstructs the window of the  
Figure 16: Confusion matrices obtained in the ANN validation process for the real case where the deviation at joint five is known. (**a–c**) confusion matrices correspond to joints one to three. (**d–f**) confusion matrices correspond to joints four to six. signal to be analyzed; the module's error for calculating the approximation levels is 0.006%, while for the details, it is 0.02%. The complete system implemented in FPGA includes the DWT, statistical, and neural network modules, the embedded microprocessor, internal data bus, and device drivers such as flash memory, USB, RAM, bootloader, debugger, and programmer, among others. Table 6 presents the resources of the FPGA device used for the implementation; it should be noted that this is a low-cost device and that, with the resources used, it is capable of calculating the entire process in less than a second.