FAULT DETECTION IN ROBOTS BASED ON DISCRETE WAVELET TRANSFORMATION AND EIGENVALUE OF ENERGY

This article addresses the problem of fault detection in robot manipulator systems. In the production field, online detection and prevention of unexpected robot stops avoids disruption to the entire manufacturing line. A number of researchers have proposed fault diagnosis architectures for electrical systems such as induction motor, DC motor, etc..., utilising the technique of discrete wavelet transform. The results obtained from the use of this technique in the field of diagnosis are very encouraging. Inspired by previous work, The objective of this paper is to present a methodology that enables accurate fault detection in the actuator of a two-degree of freedom robot arm to avoid system performance degradation. A partial reduction in joint torque constitutes the actuator fault, resulting in a deviation from the desired end-effector motion. The actuator fault detection is carried out by analysing the torques signals using the wavelet transform. The stored energy at each level of the transform contains information which can be used as a fault indicator. A Matlab/Simulink simulation of the manipulator robot demonstrates the effectiveness of the proposed technique.


INTRODUCTION
The use of robotic systems has the potential to improve our lives by increasing efficiency, reducing human error, and enabling us to explore and achieve things that would otherwise be impossible.For most of these uses indeed, any failure or malfunction of a robot can have catastrophic and costly consequences.The integration of fault diagnosis (FD) capabilities into robotic systems allows for early detection of the presence of a fault and localization of its source.
Recently, several fault diagnosis and detection techniques have been proposed in the field of robotics, through the integration of qualitative and quantitative information models [1,2].Signal processing has a significant role in the construction of any condition monitoring system.To this end, several signal analysis techniques have been used for fault detection [3,4], such as fast Fourier transform (FFT), short-time Fourier transform (STFT), and discrete wavelet transform (DWT).Despite its common use in industry for fault diagnosis, fast Fourier transform (FFT) analysis remains unsuitable for signals of a transient nature and rapidly reveals its limitations [5,6].As a result, the discrete wavelet transform (DWT) of the torque signal has been suggested as an alternative to overcome the shortcomings of the FFT.The wavelet transform can provide information simultaneously in both the time and frequency domains of the signal under examination, while offering a time-frequency representation of the signal [5][6][7].
Under normal operating conditions, each joint in robotic systems moves at different angular velocities (and accelerations), requiring varying torques, thus resulting in discrete, short-term varying signals [8].On the other hand, signals from a faulty state also have non-stationary behaviour.If the Fourier transform is used to calculate the frequency component of nonstationary signals, the results will not provide information about the temporal location of the regime shift in the signal.In contrast, timefrequency analysis provides information about the composition and frequency variation of the introduced signal at different times [9].DIAGNOSTYKA, Vol. 24, No. 4 (2023) Ouarhlent S, Terki N, Hamiane M, Dahmani H: Fault detection in robots based on discrete wavelet … The discrete wavelet transform (DWT) algorithm is well-established in various signal processing research areas because it provides a time-frequency representation for non-stationary time-varying signals [10].The Discrete Wavelet Transform (DWT) was implemented to solve the resolution problem associated with the Short-Time Fourier Transform (STFT)'s fixed window size.Moreover, there are faults that are described as catastrophic.An example of such a fault is a seal failure [11].Other examples of a catastrophic fault in an actuator is a short circuit, a voltage drop or power loss in an electric motor.
In our work, we use a robot arm.In general robotic arms are widely used in manufacturing and industrial settings, where they can perform repetitive and precise tasks such as welding, painting, and assembly.They are also used in medical applications, such as surgery and rehabilitation, as well as in research and exploration, such as in space exploration or deep sea exploration.There are various types of robotic arms, including cartesian, cylindrical, polar, and articulated arms, each with different advantages and application domains.The choice of arm depends on the specific task and requirements of the application.Robotic arms are typically controlled by a computer system that sends commands to the arm's actuators that move the arm's joints to the desired position and orientation.The control system can be programmed to perform specific tasks, or can be operated in real-time using sensors such as cameras or force sensors.
In this work, we have focused only on faults that are not severe and which can be handled using standard control methods.[12,13].To control our robot arm with two degrees of freedom (2 DoF), we consider the use of the proportional integral derivative (PID) controller.We study the detection of actuator faults in robot manipulators, particularly faults that affect the joint drive systems.For accurate fault diagnosis, we adopted a discrete wavelet transform (DWT)-based time-frequency signal analysis to extract the most salient fault-related features.We applied the fault detection method to the motor torque signal.
This paper is organised as follows: In Section 2, we discuss the problem of actuator fault diagnosis.Then, the PID controller for the robot arm is discussed in Section 3. Section 4, the discrete wavelet transform method is detailed.The simulation results obtained from the proposed control technique and diagnostic method are presented and discussed in Section 5. Finally, the conclusions and prospects for future work are presented in Section 6.

Failures of the robotic arm
In robotic systems, the occurrence and magnitude of faults are subject to time-dependent variations and are influenced by multiple parameters [12].
The fault dynamics can be generally represented as follows: (, , ̇, ) = ( − )  (, , ̇) Where:   (, , ̇) ∈   is a vector that represents the fault in the robot manipulator,( − )represents the appearance or non-appearance of the fault and T is the time of occurrence of the fault.The fault fm is given by: Where: Actuators in robot manipulators commonly consist of electric motors.Faults occurring in rotating electric motors can be categorised into three types: electrical faults, rotational faults, and vibration faults.
The mathematical model of the electric faults in motors is given by the following equation [15]: Where H is the maximum value that the parameter α can take. ∈ ℝ

The PID controller
For the robotic system (1) the control objective is to follow a predetermined trajectory.The PID controller is the most efficient choice for robot control because it offers a combination of operational simplicity and ease of implementation.
The robot's mechanism is modelled as a decoupled linear system, with each joint controlled by a PID type controller.The fault detection scheme developed in this paper is independent of the type of control applied to the robot system.
Under faultless operating conditions, the formula used for finding the control signal τ is given as Where:   ,  ̇,  ̈are the vectors of desired joint positions, velocities, and accelerations, respectively.e(t) = θ d () − θ(t) is the joint tracking error between the desired trajectory and the actual one.  ,   ,   are 2× 2 constant, diagonal and positive matrices.Moreover, we have the following assumptions: Assumption 1: After a fault occurs, the states of the robotic system remain bounded; i.e., (),  ̇() ∈  ∞ Assumption 2: The vector field ()representing the unknown additive disturbances and noise is both bounded and small, meaning that it remains within limited and negligible ranges, i.e., |  ()| ≤   ̅ (), ∀  ≥ 0,  = 0, . .
Where   ̅ () is a small value constant.

Discrete wavelet transform
The wavelet transform (DWT) is a mathematical tool employed for processing and analysis of signals.
It is a way of representing a signal as a sum of wavelets, which are small waves that are scaled and translated in time.The DWT has the advantage of being able to capture both frequency and timedomain information, which makes it useful in many different applications, such as image compression, audio processing, and data analysis.The DWT works by dividing a signal into smaller segments, or "sub-bands", at different scales or resolutions.Each sub-band contains information about a different range of frequencies, with the highest frequencies in the smallest sub-bands and the lowest frequencies in the largest sub-bands [3,15].
The DWT can be used for a variety of applications, such as denoising, feature extraction, compression, and data analysis.One of the main benefits of the DWT is its capability to analyse signals that are non-stationary, which are signals that change over time or have varying frequency components.
Figure 1 presents a diagram that illustrates the DWT process of performing multilevel signal decomposition.After calculating the approximation and detail coefficients at various levels of decomposition, it is possible to reconstruct the approximation and detail signals at each level, facilitating the extraction of features.
By employing the discrete wavelet transform, it is possible to conduct a multiresolution analysis of the torque signals in both healthy and faulty states.This analysis, described in [4], involves decomposing the analysed torque signal S into components at multiple levels.At the initial level, the signal is decomposed into an approximation component ( 1 ) and a detail component ( 1 ).Mathematically, these coefficients can be expressed as: The subsequent decomposition level is built upon the coefficient ( 1 ).In this process, ( 1 ) is decomposed into another approximation component ( 2 ) and another detail component ( 2 ), and this iterative decomposition continues further as illustrated in Figure 1.The coefficients at level 2 can be mathematically represented as follows: Following the decomposition process, the original signal S can be reconstructed in the following manner: () =  1 +  1 = ( 2 +  2 ) +  1 = ( 3 +  3 ) +  2 +  1 (10) or more generally, () =   +   +  (−1) + ⋯  2 +  1 (11) There are many types of wavelets, such as Haar, Daubechies, Symlet, etc. Proper selection of the mother wavelet type and the number of decomposition levels is crucial prior to applying the DWT [16].Haar wavelet has some important properties that make it useful in signal processing and image compression.In this work, The Haar wavelet is chosen as a mother wavelet for the discrete wavelet transform due to its excellent time localization properties and its straightforward hardware implementation.The important property of the Haar transform is that it preserves the energy of the signals.This means that the total energy of a signal remains unchanged after undergoing the Haar transform [17].The Haar wavelet is a mathematical function named after the Hungarian mathematician Alfréd Haar, who first introduced it in 1909.The Haar wavelet is a simple piecewise function that has a compact support, meaning that it is zero outside a finite interval.It consists of a square wave that starts at zero and ramps up to one, followed by a negative square wave that starts at one and ramps down to zero.In wavelet analysis, two main functions are utilized: the scaling function ∅, also known as the father wavelet, and the wavelet () also referred to as the mother wavelet.The Haar mother wavelet function can be described as [18]: Whose graph is shown in Figure 2. The Haar wavelet's lack of continuity and differentiability can be advantageous for analyzing signals with abrupt transitions.This is because the Haar wavelet can effectively capture and represent sharp changes in signals, making it suitable for detecting faults or abrupt changes in machine systems.[19].
The wavelet can detect the presence of a fault when a torque fault occurs.Diagnosis is performed by observing and comparing the decomposition levels that provide information about the fault.By assessing the associated eigenvalue for each level, it is possible to construct a highly efficient diagnostic tool capable of quantifying the severity of faults.
The energy eigenvalue E corresponding to each frequency band is expressed as follows [4]: The eigenvalue E is calculated based on the DWT decomposition level (j), DWT decomposition time (n), and the magnitude of the wavelet coefficient (H) of the signal at each discrete point in the corresponding frequency band.
The energy values at different signal decomposition levels contain valuable information that can be utilized for diagnosing and quantifying the degree of torque faults.

SIMULATION RESULTS
The simulation model is a two-link planar manipulator as depicted in Figure 3 [20].The variables  1 ,  1 ,  1 represent the joint angle, length, and mass of the first link ( = 1), respectively.Similarly,  2 ,  2 ,  2 represent the joint angle, length, and mass of the second link ( = 2), respectively.g represents the gravitational acceleration.The robot links are assumed to be uniform rods of length 1 m and masses 3 kg and 2 kg, respectively.The simulation is implemented in Simulink/Matlab.] is the inertia matrix with the following elements:  11 = ( 1 +  2 ) ] ∶ is a vector of gravity torques.
In the field of control system design, selecting appropriate numerical values for controller gains, such as   ,   ,    is a critical step in creating an effective control system.These gains dictate the controller's response to system errors and have a profound impact on achieving the desired performance and stability of the system.There are several conventional methods for tuning PID controllers, each with its unique advantages and applicability.These methods encompass the Ziegler-Nichols (ZN) method [21], the Cohen-Coon Technique [22], manual tuning [23], optimization techniques [24], and the utilization of PID tuning software [25], among others [26].Additionally, PID controllers can be tuned using various intelligent methods such as fuzzy logic, artificial neural networks (ANN), adaptive neuro-fuzzy inference systems (ANFIS), genetic algorithms (GA), and more [27,28].The choice of tuning method depends on the specific system under study, and the control objectives.
In our work, the selection of numerical values for the PID gains (  ,   ,    ) is a critical step in achieving the desired control system performance.
To determine these values, we have chosen manual tuning using simulation tools, namely MATLAB/SIMULINK.This approach enables us to fine-tune the PID controller parameters based on the system's response to ensure optimal control system performance.This decision is motivated by the advantages of simulation, which allow us to explore and test a wide range of PID parameter combinations in a controlled and risk-free virtual environment.By conducting simulations, we can observe how different PID gain values impact the system's response, thus facilitating the fine-tuning process.This approach ensures that our chosen PID values align precisely with our project's control objectives and result in optimal system performance.The controller gains in the control law (7) has been chosen as follows:   = 500 2×2 ,   = 500  2×2    = 500 2×2 , where  2×2 represents a 2 × 2 identity matrix .The desired joint trajectories to be tracked have been selected as follows:  1 () = 2 * sin (0.3)  2 () = (−2.6)* sin (0.3)

First simulation: absence of faults for the first and the second motors
In this simulation, the first and second motors have been selected free of faults.This healthy state is illustrated in Figure 4 and Figure 5.  sec In this simulation, a failure modelled by equation ( 6), which is a reduction in motor torque, occurs on the first motor (1) at t=3sec.Similarly, a partial fault on the second motor occurs at time t=3.4sec, which results in the deviation of the actual position trajectory (faulty state) from the desired trajectory (healthy state) starting from this time onwards, as illustrated in Figures 6 and 7.After the occurrence of a fault, it becomes clear that the local PID control law at joints 1 and 2 loses its ability to maintain the joint position on its desired trajectory.Fig. 8 presents a comparison between the command torque (blue line) and the actual torque (red line).features such as discontinuity in value and sudden frequency changes.These characteristics suggest the presence of abnormalities or faults in the motor system.The observation reveals that the faults start to become apparent at level 5, as previous levels typically lack the capability to detect these occurrences.This highlights the significance of higher decomposition levels in effectively identifying and capturing the fault-related information.
Comparison between the results of the DWT analysis of healthy and faulty states indicates that when the fault level increases, the amplitude coefficients  7 ,  7 ,  6 and  5 also increase.The same results are obtained regarding the oscillations.
This simulation demonstrates how wavelet analysis can effectively detect the precise moment when a signal undergoes a change, as well as the nature of that change, whether it is a sudden disruption in the signal, an abrupt shift in oscillations, or a significant variation in amplitude.Such information enables us to assess the operational status of the robot.The torque energy can be calculated for each frequency band using Equation (12).Tables 1  through 4, give the energy values at various decomposition levels in the simulation of the first and the second joints.Furthermore, It is important to note that the Haar transform guarantees the conservation of signal energies.The analysis of the calculated torques energies at each frequency band with fault and without fault, can be used for fault detection.This is because the energy of the torque may be amplified in certain frequency bands due to the generated damage.
After the occurrence of a fault, the relative energy of the signal tends to increase in certain frequency bands, resulting in a significant disparity between the energy calculations before and after the fault.
Therefore, changes in energy levels within specific frequency bands serve as indicators of the motor's condition, and the energy content in the decomposed frequency bands of the signal holds valuable information about the severity of damage.
Simulation results depicted in Figures 11a and  11b demonstrate the variation in stored energy across different levels of the torque signal, reflecting the healthy and faulty states of the robot.Notably, an upsurge in energy is observed in both the first and second joints, which can serve as an indicator of the fault.Despite the fault being characterized by a decrease in actuator torque, it is noteworthy that an increase in energy is generated, primarily attributed to the influence of the PID regulator.
The PID regulator's response to the fault, by increasing the actuator command, helps maintain the desired performance of the system, albeit at the cost of consuming more energy.The increase in energy can be seen as a consequence of the PID regulator's effort to counteract the effect of the fault and maintain system stability.
The comparison of the obtained results with other techniques from the literature (signal processing technique) [29], namely FFT (Fast Fourier As indicated in reference [29], it can be inferred that each diagnostic approach has the capacity to identify various forms of damage and faults during the robot's operation, contingent upon the objectives established.
The FFT and STFT techniques are suitable for rapid and uncomplicated detection, particularly when applied to steady signals or signals that exhibit low levels of noise.
These techniques are characterized by their simplicity and do not necessitate supplementary sensors and computational power [30], they are, however, less effective for transient signals and are better suited for stationary signals or those with minimal noise.
Based on the results presented in this article and previous research [4,31], it can be concluded that DWT (Discrete Wavelet Transform) is remarkable for its capability to provide a specialized timefrequency representation tailored for non-stationary, time-varying signals.This characteristic makes DWT particularly suitable for analysing transient signals, enabling a thorough assessment of signal components across both temporal (time) and spectral (frequency) domains.Furthermore, the work presented in this paper introduces the idea of evaluating torque energy across different frequency ranges through DWT analysis, thus emphasizing that alterations in energy levels within these specific frequency ranges can act as indicators of the the motor's state.

CONCLUSION AND FUTURE WORK
In conclusion, the proposed method based on the Discrete Wavelet Transform for detecting torquerelated faults in the actuator of a 2 DOF robot arm is shown to be effective in detecting different types of faulty and normal operating conditions.The method's advantages in both the time and frequency domains make it an efficient and useful tool for actuator fault detection.
As a potential improvement, the sub-signals obtained from the DWT analysis can be directly used as inputs to various classification schemes, such as the ANN classifier, for more accurate fault detection.Moreover, it would be worthwhile to explore the application of condition monitoring techniques using other types of signals, such as vibration, electrical, and sound signals, in order to enhance the overall effectiveness of robot condition monitoring.Adequate processing these signals is of utmost importance to extract the most relevant features associated with specific types of faults.These extracted features can then be utilized to build a comprehensive database comprising the most common faults encountered in the system.Hence, it would be possible to design a state monitoring system for the robot that is capable of detecting various electrical and mechanical faults using the proposed method.This system would enable continuous monitoring of the robot's performance, hence offering real-time feedback to enhance its overall reliability and efficiency. Author DIAGNOSTYKA, Vol. 24, No. 4 (2023) Ouarhlent S, Terki N, Hamiane M, Dahmani H: Fault detection in robots based on discrete wavelet … 4

3. 2 .
Second simulation: actuator faults In this second simulation we have considered two types of faults, which are: • Bias fault on  1 (first joint) for ∈ [3 ÷ 3.5] sec • Partial fault on second joint for ∈ [3.4 ÷ 4.6]

Table 1 .
Nomenclature of Frequency Band Numbers and Energy Distribution Across Various Scales.

Table 2 .
Nomenclature of Frequency Band Numbers and Energy Distribution Across Various Scales.

Table 3 .
Nomenclature of Frequency Band Numbers and Energy Distribution Across Various Scales.

Table 4 .
Nomenclature of Frequency Band Numbers and Energy Distribution Across Various Scales.
contributions: research concept and design, S.O.; Collection and/or assembly of data, S.O.; Data analysis and interpretation, S.O., N.T.; Writing the article, S.O., N.T.; Critical revision of the article, H.D., M.H.; Final approval of the article, N.T.
Declaration of competing interest:The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.