Switched time delay control based on neural network for fault detection and compensation in robot

Fault detection in robotic manipulators is necessary for their monitoring and represents an effective support to use them as independent systems. This present study investigates an enhanced method for representation of the faultless system behavior in a robot manipulator based on a multi-layer perceptron (MLP) neural network learning model which produces the same behavior as the real dynamic manipulator. The study was based on generation of residue by contrasting the actual output of the manipulator with those of the neural network; Then, a time delay control (TDC) is applied to compensate the fault, in which a typical sliding mode command is used to delete the time delay estimate produced by the belated signal in order to obtain strong performances. The results of the simulations performed on a model of the SCARA arm manipulator, showed a good trajectory tracking and fast convergence speed in the presence of faults on the sensors. In addition, the command is completely model independent, for both TDC and MLP neural network, which represents a major advantage of the proposed command.


INTRODUCTION
In various industrial processes robot manipulators have invaded the mode of technology; they are used to carry out complex and repetitive tasks quickly and efficiently. They are connected to each other by joints so that the manipulators follow the reference trajectory, where articulations must be precisely controlled. To perform these tasks, the manipulators are usually quite complex which increases their factor for fault. Thus, in order to have a good fault diagnosis on a manipulator, it is necessary to have a precise knowledge of its mathematical model. However, it is very difficult to obtain a precise of model as the modeling of dynamic robot which is not always an obvious task. For this purpose, various problems can arise such as uncertainties, external disturbances, uncertain dynamics, and measurement noises, which cause deterioration of the fault detection performance by causing false alarms [1][2][3]. In this respect, fault detection in a robotic manipulator is necessary for monitoring and effective support in utilize of a manipulators as independent systems [4,5]. Methods of defects detection and isolation are generally founded on the concept of production and residual analysis of the residuals. Many techniques have been assessed in order to be successfully applied. Taking into account the reliability which must be the most important criterion of the operation. These techniques allow reliable decisions to be made without knowledge of the mathematical system model. In this respect, artificial neural networks (ANNs) are suitable for such problems. One of this remarkable cleanliness is their ability to learn from their environment and improve their behavior from learning, in addition to the learning results in an adaptation (adjustment) of the weights and bias of the neural network [6,7]. Ideally, after each learning step (iteration), performance improves. There are different learning approaches which differ from each other by the way of adjusting the weights and their structure depends on the architecture of the neural network and the task to be performed. Besides, neural networks have been searched and carried out in real systems [8,9]; there are many ANN applications in data analysis, identification, and model control [10]. Amid various types of ANN, a multi-layer perceptron (MLP) is quite popular and used extensively in research. In order to achieve good fault compensation, controllers capable of effectively compensating for faults are necessary to enable them to perform their task independently and realistically. In this regard, numerous works have been developed to compensate for defects such as robust control algorithms, including synchronization control [11], ANN [12,13], sliding mode control (SMC) [14,15] and time delay control (TDC) [16,17]. SMC are well known for their robustness against unknown systems dynamics.
To eliminate external perturbations and nonlinear dynamics with delay signal, handy nonlinear control strategies for unmodeled disturbances have been developed, for example TDC. This last, its principal objective is to use past observation of the system response as a control input at the present time to immediately change the control actions instead than identify the parameters or adjust the controller gain of the control system, which leads to an independent model controller i.e., compensation without any use of dynamic model [18]. On the other hand, the big disadvantage of TDC is undesirable tracking errors and time delay estimation (TDE) errors. To compensate errors for TDE, many procedures have been tested by combining commands with a TDC. An auxiliary control [16][17][18][19] has been selected to settle its gains adaptively in order to have a switching control scheme. In [20] an auxiliary control in fuzzy sliding mode has also been chattering using fuzzy rules. In general, we caused that several works were realized by combining TDC and neural networks [21].
In other words, in order to eliminate TDE errors, a SMC [22] has been consolidated to allow quick tailoring of switching gains, which improves tracking performance compared to a conventional TDC. Especially, the use of fixed control gains from the TDC allows to ameliorate a performance of the system and the rapid adaptation of the gain [23]. TDC control combined with sliding mode [24], requires a gain adjustment. However, the TDCs adaptation law does not directly reflect current tracking errors or sliding variables, which leads to a slow convergence rate. Thus, it would be useful to develop a TDC control combined with sliding mode, which compensates for the fault with a fast convergence speed, while suppressing TDE errors and avoiding.
In this paper, a methodology has been developed in order to detect, estimate, and compensate for sensor defects in a robot manipulator, which is based on the concept of residual generation with neural network and compensation with a TDC controller. The network learning is based on nonlinear modeling and allows the approximation of the real model in the absence of defects. The principal target behind this approach is to employ neural networks to observe the robotic system to detect all modification in system dynamics owing to faults. By utilizing the approximation capabilities of neural network, the network can be used for residue generation, in which trained trajectories are considered to perform system operation training. Another trajectory is used to test the efficiency of the network; as a result, the MLP network has the same operation as the faultless system.
The difference between the output of the manipulator with fault and that of the neural network gives us an error which will then be compensated. In other words, from these compared results, a global command switch between two commands has been developed. The first command is applied to the manipulator without fault with a low TDC gain, the result, shows immediate continuation of the trajectory, then, with the same command (law gain), we introduce some default on the manipulator. The results show a divergence (failure of the tracking of the trajectory). For the second command, we use TDC with a high gain in the existence of fault on the robot manipulator. Thus, the robot manipulator successfully tracks the desired trajectory even though the measures are faults. The TDC command used in this paper is free model, that is; it does not use required model, as well as the neural network. This presents a major advantage of the developed command. The simulation results indicate the effectiveness of the proposed controller, which is capable to accurately path the reference trajectory and be robust versus uncertain dynamics and external perturbation. The rest of the paper is organized as follows: Section II describes the formulation of the problem and presentation of the ANN and TDC. Section III deals with control design and convergence analysis, section IV introduce the simulation results. In the end section V concludes the article.

RESEARCH METHOD 2.1. Problem formulation
Because of robots are usually involved in remote or dangerous environments; they are faced with external disturbances, uncertain dynamics, and uncertainty. This is why researchers are stimulated to work for solving these problems. For this, we will propose an effective method for detecting and compensating sensor faults, which is: Switched TDC based on neural network for fault detection and compensation in robot manipulators.

Artificial neural network
In this paper, we are interested in MLP correction of algorithm learning error, the difficult with MLP is to efficiently calculate the weight of hidden layers which give a minimal output error (or zero) as a result, where the augmentation of hidden layers increasing calculation difficulty. The MLP structure made up of three layers: input (M), hidden (N) and output (O) as it shown in Figure 1 [8,9].
where 1 and , 1 represent the bias and the weight respectively, between the ℎ neural of the hidden layer and the ℎ neural of the input layer. The upper index 1 represents the (first) connection between the neural of the input / hidden layers. The desired output vector = [ 1 , 2 , … , 0 ] of the network is get from, the vector of intermediate variables , by an activation function 2 of output layer. For example, the output of the neuron can be expressed as follows [8,9]: where the upper index 2 denotes the (secondary) connection between neural of the hidden / output layers. There are several forms of the activation functions 1 and 2 , such as the sigmoid function, the hyperbolic tangent, and the linear function. In MLP, the hyperbolic (tansig) and linear (purelin) tangent activation functions have been used in the hidden layer and the output layer, respectively.

Dynamic model of a robot manipulator
The dynamic equation of robot manipulator is as (3): joints, respectively, and is the control input torque. In this paper, the dynamic model of SCARA robot has been used in the simulation [25]. We assume that there is an additive sensor's fault expressed by: by replacing (4) in (3) obtains the dynamic equation of manipulator: where ∆ is the sensor fault, is the measured joint and q is the joint without fault. ( ), ( ,̇), ( ) and is the inertia matrix, the matrix of Coriolis and centrifuge, the vector of gravitational force and the control input torque, we are introducing the fault (additive fault).

Time delay control
In this paper, our objective is to synthesize a control law able to compensate the sensor defect in the manipulator based on the residuals between the real measurements and the neural network model and hence achieve good tracking performances [18]. Multiplying both part of (5) by −1 ( )and resolving for ̈, we obtain: where t indicates the actual sample and ̅ = ( ̅ 1 , ̅ 2 , … , ̅ ) × is a diagonal positive matrix. We take up the common supposition that the robot dynamics in (5) comply with ≤ ( ) ≤ [26], for certain positive values and . This is since the inertia matrix ( ) is voiced in terms of sin ( ) and cos ( ). From (6) we write a compact and simple form of ̈ as (7).
, the command purpose is to construct the joint angles of a manipulator pursue the reference , accurately, so that the tracking error = , − should be as close as possible to zero. Since N t in (7) is not available, we use its estimate ̂. The TDC controller is expressed as [18] ̅ = − ̅̂+ ̅ (̈, +̇+ ) where = ( 1 , 2 , … , ) ∈ × and = ( 1 , 2 , … , ) ∈ × are positive concept matrices, ̈, = [̈1 , ,̈2 , , … ,̈, ] ∈ is the desired angular acceleration, ̇ is a by-product of the tracking error,̂= [̂1 , ,̂2 , , … ,̂, ] ∈ . The ̂ is the estimate of in (7) obtained by a delayed measurement of the sample, called TDE [18,19]. The expression of ̂ is given by: where is a sampling time period, − is a sample passed. Replacing (9) in (8), we obtain the following recursive control: which is often called TDC [18]. It should be noted that the TDE is bounded, if the control gain ̅ is select to gratify the ensuing condition: formally ≥ 0, also, the TDE error are limited by constant * for all = 1,2, … , , i.e., | , −̂, | ≤ * [27,28]. It implies as the command gains ought to be select to warrant the bounded ness of TDE errors. Thus, generally, little fixed command gains are utilized to gratify the inequality (11). Besides, if command gains are improperly little, the following performance degrades. Contrary, if those become improperly tall for quick response, those tend to produce a system unsteady.

Control design and convergence analysis
In this section, we will exploit the control design used in this paper together with the convergence analysis.

Control design
To achieve the control objectives outlined in the previous section, we must first determine the following sliding variable [29,30]: Where, = [ ,1 , ,2 , ,3 ] ∈ 3 , = ( ,1 , ,2 , ,3 ) ∈ 3 and =[ ,1 , ,2 , ,3 ]∈ 3 . It is renowned that in (12) is a conception parameter to be specified for ensuring the stability. In terms of the sliding variable in (12), we build the following command schema [31]. The proposed switching TDC based neural network algorithm is given as follows: The main objective of this paper is to suggest a global command which switches between two controllers the first one (13) is applied to the manipulator without fault, introducing a low gain. The second controller (14) is applied to the manipulator with a fault, but a large gain has been introduced. If ( 2 ) > ( 1 ), indicates the proper value of a matrix, = ( 1, , 2, , 3, ) ∈ 3 is a control gain to be updated in-line according to the adaptive law, and is the threshold not to be exceeded.
It should be noted that the results of the neural network outputs compared to those of the real system outputs generate residuals which are processed as to be compared. Our proposed controller switches between two control schemes. The first one (13) is applied on a system without fault, where the TDC uses a small gain, in order to achieve good tracking performances with a smooth control signal. The second control scheme (14) is developed on a faulty system. In this case we introduce a large gain, in order to compensate the fault and external disturbances effects. The switching between the two schemas based on the residual's values.

Convergence analysis
Consider the dynamic model of the robot manipulator described as follows: where is the external disturbance. Let us consider that we have a sensors fault expressed in (4). Hence, the dynamic model with sensors fault is given: where 1 is the lumped disturbance which is expressed by: Then the TDE is used to estimate N t , which allows us to evaluate the dynamics model without requiring any prior knowledge neither on the system nor on the sensors fault. Furthermore, TDC can use this estimation to compensate the effect of the lumped disturbances and achieve a good tracking performance. Theorem: Consider the dynamic model of robot (3) subjected to external disturbances and sensors fault. The control law given by (13) and (14), guarantees the convergence asymptotically of the tracking error and the tracking error rate. Proof: In order to prove above theorem, we use the Lyapunov function applicant as specified: Its time derivative is given by: Using (12) and (20) lead to: Replacing in (21) ̈by its expression deduced from (7), it comes to: By applying the control law given by (13) and (14) we obtain: We obtain: Since || −̂|| ∞ ≤ * as demonstrated in [27,28]; hence where 2, is ith value of the diagonal matrix 2 . Hence, if we choose 2, > * then ̇ becomes defined negative. Consequently, from the definition of we can conclude that converge asymptotically to zero: As a result, the tracking error and the tracking error rate converge asymptotically to zero:

SIMULATIONS AND RESULTS
We considered a manipulator arm with 3 degrees of freedom, called SCARA as described in section 2 of this paper. The command purpose here is to force the robot to follow a reference trajectory created in advance. The robot's equations and parameters as in (1) are given in [25]. The manipulator's parameters are 1 = 0.5, 2 = 0.3, 3 = 0.1 ( ). The length of the links is set to be = 1 , the moments of inertia are 1 = 0.02, 2 = 0.03, 3 = 0.05 ( ⁄ ) and the sampling time is equal to = 0.01 . In the following two sections, we will present the simulations and results of the proposed method for the detection and compensation of faults in the robot arm. These methods were presented in the previous sections of this paper.

Simulation results of the fault detection
In order to detect the faults in our system (the SCARA robot arm), we have chosen to use the following neural network design: One input layer that contains 9 neural (three articular positions, three articular velocities and three articular couples measured in t), one hidden layer, with 15 neural, and two output layers with six neural (three articular positions and three articular velocities at (t+∆t)). The MLP was designed with a back propagation algorithm. The learning set is made by simulating 4 flawless spherical trajectories, introducing the input/output of each trajectory. After the training, the model obtained is then tested and validated using a fifth spherical trajectory by introducing only the input. As a result, the trajectory was immediately followed, as the MLP produced a copy of the dynamic manipulator behavior, in which the neural network has the same functionality as the manipulator. The simulations results are given in Figures 2-5.  Where Figure 2 represents the set trajectory to be followed together with the neural network output trajectory, it is noted that the neural network output trajectory follows exactly that of the manipulators. Figure  3 (a, b, c) represents the real and neural network trajectories following the x-axis, y-axis, and z-axis, respectively. It is clear again, that the neural network output trajectory is the same of that of the real robot The suggested procedure is executed on-line so that faults can be detected right away. In order to simulate a sensor fault, we add ∆ = 0.001°as a failure on a sensor which leads to a significant reduction or rise in the torque, resulting in anomalous variations of the residue. This residue is compared to some set values, and if the comparison is positive, it conducts to the detection of the fault. Once the fault detection has been carried out, one proceeds to the fault compensation using the TDC which is presented in the following section.

Simulation result of compensation
Three sets of simulations have been carried out in order to assess the TDC method.
-Case 1 (fault-free) This case is considered the nominal one, where the system is not subjected to any faults (∆q=0). We will see how our method behaves when no faults are present  Figure 4 presents the ser trajectory to be followed and the robot's real trajectory (in 3D). It is shown that both trajectories are superimposed, which shows that the TDC method has not intervened negatively in the fault-free case. Figure 5 also show that we have obtained good tracking performance (on the x, y, and z axis respectively) when using the TDC method, while the torques stay in admissible values Figure 6.
-Case 2 (faulty case) In order to evaluate the performances of the controller (13) in faulty environment, we have introduced sensor faults as follows: ∆q=0.01° in joints 1 and 2. The results of the simulation of the suggested command are illustrated in Figures 7 to 9.
From Figures 6-9, it is clear that the controller given by (13) does not give acceptable results, as the robot does not track well the proposed trajectory. We observe that there is an error between the set trajectory and the robot's trajectory. Therefore, we precede a change in the controller's parameters as given in (14). This change in parameters has been applied in the following section.
-Case 3 (faulty case, with parameter change) In this case, the proposed switched TDC based on neural network is introduced to overcome the drawbacks of controller (13). The proposed scheme uses the controller (12) in the scenario where there were no sensors faults, and switches to the controller (14) in the case of detecting important errors.
The simulations results for the proposed controller are demonstrated in Figures 10 to 12. We can clearly see that at the time of the introduction of the fault, the robot's trajectory changes Figure 10, to be corrected soon after by the proposed TDC method. This shows that the proposed controller is working well. Indeed, soon after introducing a defect, we switch to the controller (14) which is programmed with a large gain. The latter provides an important help to improve tracking performance. We can also see that the controller is effective in eliminating chattering (according to the Figures 10 to 12). In addition, it is obvious that the trajectory tracking has been improved by comparison to the controller (13).
The main goal of this paper is to develop a method which allows detecting and compensating of sensor defect that often affects the manipulator joints. So, we proposed an MLP neural network, which allows to learn the functioning of the system (manipulator) without faults, as it was shown in Figure 2 and 3 perfect learning of the system function. Once he has learned how to operate the system without faults, we injected it with disturbances at the manipulator outputs (position and speed) in order to compensate them later. Then, we developed two controllers (13 and 14) which allow us to compensate this defect. Controller 13 is applied to the system (without fault) as it was shown in Figure 4 and 5; where it is noted a divergence when the fault is introduced, continuation of the trajectory is lost Figure 7 and 8. This result allowed us to think of developing another controller with a significant gain in order to compensate for the defect. The controller 14 which allows us to have a rapid compensation for the continuation of the trajectory even in the presence of a fault as it was shown in Figure 10. The principle of this step is to switch between the controllers 13 and 14, in presence or absence fault based on neural networks.

CONCLUSION
In this paper, a new concept of fault detection and compensation based on neural networks and TDC, on a SCARA robot arm has been developed. It consists of a reliable detection and robust compensation in the presence of faults on the sensors. It is important to note that the combination of neural networks and TDC is very important to diagnose in a system. For this purpose, neural network modeling was used for the generation of residues, in which several trajectories were driven in order to model the different functioning cases of the system. Another trajectory was used to test the efficiency of the network and validate it. This results in MLP model that has the same behavior of the faultless system. By making the difference between the output of the robot with faulty sensors and that of the network mode, we obtain an error which should be compensated. From these errors, a global control switch (TDC) between two commands has been developed. The first command (TDC) is applied to the faultless robot with a low gain, which showed a good tracking of the trajectory. Then, with the same command (low gain), we introduce a fault on the robot, which shows the divergence (failure to follow the trajectory). A second control was developed, with a high gain in the presence of a fault. The results of the simulations show that the robot arm followed the desired trajectory successfully. The TDC command used in this paper is model free, i.e., it does not use a specific model, which represents a major advantage of the proposed command. This study shows that the developed approach can produce good detection and compensation results for a nonlinear system exposed to faults. Moreover, the controller conception is capable of stabilizing the error trajectories of the system in a finite time. The robustness, stability, and perturbation rejection of the proposed controller have also been demonstrated.