# FPGA-Based Methodology for Detecting Positional Accuracy Degradation in Industrial Robots
## 2 Materials and Methods
### Proposed Methodology
Figure 7: Real-world dataset joint one with 5 dB of noise DWT decomposition level 4. (**a**) CO state signal approximation components. (**b**) CO state signal details components. (**c**) HO state signal approximation components. (**d**) HO state signal details components. The trajectory parameters presented in Equation (7) are the radius of the helix \(r=0.1\) m, the final height \(b=0.025\) m, the frequency of the helix \(f=2\), and time \(t=8.1920\) s.  
\[x=0.6+rcos(2\pi ft),y=rsin(2\pi ft),z=0.1+bt. \tag{7}\]  
The sampling frequency of the UR5 robot is 125 Hz; therefore, with the above parameters, the synthetic signals of the simulated robot have a total of 1024 samples. In the synthetic scenario, one data set consists of the trajectory signals without deviation, which is the initial CO state. Six different data sets are generated for the HO state, and the deviation at each of the different joints of the robot is added. A sinusoidal signal is added to the robot's joint position signal obtained by following the helix trajectory to simulate the deviation. The sinusoidal signal has a randomly generated amplitude of 1 to 10% of the maximum amplitude value of the robot's joint position signal, a frequency of \(f=2\), and a time of \(t=8.1920\) s. This way, six HO datasets with 50 synthetic signals are obtained; each set contains random deviation levels in different joints. Each signal in the dataset generates ten additional signals for each noise level by adding white Gaussian noise (5 dB, 10 dB, 15 dB, and 20 dB), resulting in 2000 signals for each HO state dataset. For the CO dataset, one signal without deviation is processed similarly to obtain 500 signals per noise level. Combining the HO and CO datasets gives 4000 signals for the cases with joint deviation. On the other hand, for the real case, a public-access dataset provided by the National Institute of Standards and Technology (NIST) is used [50]. Different speed levels test for the robot are provided in the dataset (50% and 100% speed). In this work, the dataset corresponding to the 100% speed of the robot is used. Like the synthetic case, the robot used is the UR5. The signals from the robot actuators were received at the controller level. The frequency was 125 Hz. Figure 8b presents the trajectory used in this dataset. The robot continuously follows the trajectory with a weight of 4.5 lb on its end-effector for approximately 2 h. The CO status signals are captured when the robot has just started, and the HO status signals are obtained after 2 h of continuous operation. Three signals are provided for each robot's operation state: CO and HO, and the size of the signals was adjusted to obtain exact powers of 2 and to divide each signal into three parts of 2048 samples for a set of nine signals for each CO and HO state. As was done with the synthetic dataset and to augment the dataset size, 50 new signals are generated from each of the nine original signals by applying white Gaussian noise at each noise level. This results in 3600 signals, with 1800 for each HO and CO data set. For each signal in the data set, the approximation and details of levels three and four are used to calculate the variance and RMS features, which means that each signal has eight features that are used as input to the neural network. So the datasets have a size of 4000 \(\times\) 8  
Figure 8: Trajectories followed by the robot. (**a**) Synthetic case. (**b**) Real case. and 3600 \(\times\) 8. For the neural network classifier, the datasets are split as follows: 70% for training, 15% for validation, and 15% for testing. The neural network comprises one input layer of size eight, a hidden layer of 16 neurons, and an output layer of size two. Besides, it is trained for 1000 epochs, using the Adam optimizer and the mean square error loss function. The activation function for the hidden and output layers is sigmoid. With the dataset of the synthetic and real scenarios prepared, we proceed to describe the hardware implementation of the proposed method.