Sliding Mode Thau Observer for Actuator Fault Diagnosis of Quadcopter UAVs

Fault diagnosis (FD) is one of the main roles of fault-tolerant control (FTC) systems. An FD should not only identify the presence of a fault, but also quantify its magnitude and location. In this work, we present a robust fault diagnosis method for quadcopter unmanned aerial vehicle (UAV) actuator faults. The state equation of the quadcopter UAV is examined as a nonlinear system. An adaptive sliding mode Thau observer (ASMTO) method is proposed to estimate the fault magnitude through an adaptive algorithm. We then obtain the design matrices and parameters using the linear matrix inequalities (LMI) technique. Finally, experimental results are presented to show the advantages of the proposed algorithm. Unlike previous research on quadcopter UAV FD systems, our study is based on ASMTO and can, therefore, determine the time variability of a fault in the presence of external disturbances.


Introduction
Quadcopter unmanned aerial vehicles (UAVs) have been used in a variety of applications, due to their numerous advantages, such as small size, agility, low cost, mechanical simplicity, and indoor and outdoor operability, which have led to their increased popularity compared to other UAV systems.As a result, they have been investigated and tested in a range of environments and applications which include target tracking [1,2], fault detection and fault-tolerant control [3,4], and formation flight [5,6].
Particularly the topic of fault-tolerant control (FTC) has received a large amount of attention in the community, which led to quadcopter UAVs that are less error-prone and, thus, more reliable during flight.In general, there are two types of FTC: passive and active.Several studies investigated passive FTCs [7,8], which have the advantage that they do not require any fault diagnosis scheme, but the resulting disadvantage is that they have a lower fault tolerance [9].To overcome this limitation, active FTCs have been introduced to improve said fault tolerance.Fault diagnosis (FD) is the essential requirement for active FTCs to determine the location and magnitude of faults.Through FD, active FTCs can be designed to compensate the effect of faults and, thus, improve flight control and stability, which makes FD the main task of active FTCs.
The FD approach has been studied by numerous authors.Freddi et al. [10,11] investigated a model-based fault diagnosis which can be used to monitor sensor faults and detect actuator faults.In this method, residuals are used to distinguish between system and observer outputs, but these methods are inaccurate and unsuitable for quantifying the magnitude of a fault.Ma and Zhang [12,13] proposed a method for fault estimation based on a Kalman filter, but their approach is of insufficient robustness with regard to disturbances if the transfer matrices are inaccurate.Several effective approaches, such as sliding mode observer [14,15], neural network [16,17], and adaptive observer [18,19], have been investigated, but none of these approaches focused on a real quadcopter UAV.Moreover, recent studies [20,21] used fuzzy methods for fault diagnosis problems, but these approaches do not focus on real quadcopters, and may be overly complex to implement in a flight controller.Only few studies focused on the problem of fault diagnosis in a real quadcopter UAV, verified through real flight data.While [4] used an actuator fault estimation with an adaptive observer based on H ∞ , and demonstrated the effectiveness of the proposed scheme, this method may not be sufficiently robust to external disturbances because the underlying mathematical model neglects both nonlinear terms and external disturbances.The most recent application of an adaptive Thau observer (ATO) for actuator fault diagnosis was proposed in [22].While this approach is capable of handling model uncertainties in the nonlinear quadcopter model, it is rather complex and time-consuming because it uses system identification to find the drag terms, and the filter to eliminate sensor noise.
In the present study, we try to overcome these limitations by combining a sliding mode observer based on Walcott-Zak observer design [23], with ATO to handle the actuator fault diagnosis.This method is capable of accounting for time-varying actuator faults.We then derive the Lyapunov stability and other conditions to obtain the desired matrices and associated parameters.Finally, a straightforward method based on linear matrix inequalities (LMI) is proposed to allow relaxing the derived conditions, which is a useful feature in flight controllers.Unlike previous methods, our approach is simple and not overly time-consuming, which makes it amenable for use in real quadcopters.Moreover, our method can handle uncertainties of magnitudes that are unknown, a priori, through an adaptive law approach.By comparing our approach to [22], we found that the adaptive algorithm is capable of compensating for the drag terms leading to clear improvements in the results.

System Description
While the right and left (3 and 4) motors of the quadcopter rotate in the clockwise direction, the other motors rotate in counterclockwise direction (Figure 1).Each motor is located at a distance L from the center of mass o.
methods are inaccurate and unsuitable for quantifying the magnitude of a fault.Ma and Zhang [12,13] proposed a method for fault estimation based on a Kalman filter, but their approach is of insufficient robustness with regard to disturbances if the transfer matrices are inaccurate.Several effective approaches, such as sliding mode observer [14,15], neural network [16,17], and adaptive observer [18,19], have been investigated, but none of these approaches focused on a real quadcopter UAV.Moreover, recent studies [20,21] used fuzzy methods for fault diagnosis problems, but these approaches do not focus on real quadcopters, and may be overly complex to implement in a flight controller.Only few studies focused on the problem of fault diagnosis in a real quadcopter UAV, verified through real flight data.While [4] used an actuator fault estimation with an adaptive observer based on H ∞ , and demonstrated the effectiveness of the proposed scheme, this method may not be sufficiently robust to external disturbances because the underlying mathematical model neglects both nonlinear terms and external disturbances.The most recent application of an adaptive Thau observer (ATO) for actuator fault diagnosis was proposed in [22].While this approach is capable of handling model uncertainties in the nonlinear quadcopter model, it is rather complex and time-consuming because it uses system identification to find the drag terms, and the filter to eliminate sensor noise.
In the present study, we try to overcome these limitations by combining a sliding mode observer based on Walcott-Zak observer design [23], with ATO to handle the actuator fault diagnosis.This method is capable of accounting for time-varying actuator faults.We then derive the Lyapunov stability and other conditions to obtain the desired matrices and associated parameters.Finally, a straightforward method based on linear matrix inequalities (LMI) is proposed to allow relaxing the derived conditions, which is a useful feature in flight controllers.Unlike previous methods, our approach is simple and not overly time-consuming, which makes it amenable for use in real quadcopters.Moreover, our method can handle uncertainties of magnitudes that are unknown, a priori, through an adaptive law approach.By comparing our approach to [22], we found that the adaptive algorithm is capable of compensating for the drag terms leading to clear improvements in the results.

System Description
While the right and left (3 and 4) motors of the quadcopter rotate in the clockwise direction, the other motors rotate in counterclockwise direction (Figure 1).Each motor is located at a distance L from the center of mass o .Assuming the control variables can be described as Assuming the control variables can be described as Appl.Sci.2018, 8, 1893 where τ i and T i represent the torque and thrust force produced by the ith motor, respectively; U 1 is the total thrust; U 2 , U 3 , U 4 are the torques in ϕ, θ, ψ directions, which correspond to roll, pitch, and yaw Euler angles, respectively (Figure 1).Thrust force and torque are related to the rotational speed as follows: where b, d represent the thrust and drag coefficients, and Ω i represents the rotational speed of the ith motor.
Inserting Equations ( 2) and ( 3) into (1) yields The quadcopter dynamic model has previously been formulated as follows [22,24]: where I x , I y , I z represent the moments of inertia along the x, y, z directions, respectively; K ϕ , K θ , K ψ are drag coefficients; J T is the moment of inertia of each motor, and We consider drag terms as disturbances, and they can be compensated by adaptive law, which is discussed in the "nonlinear observer for fault diagnosis" section.By defining the state vector ψ , control input vector u T = U 2 U 3 U 4 , and output vector ψ ], Equation (5) can be described in the state equation as . where . When an actuator fault occurs, Equation (6) can be described as .
where F is the fault matrix, and f (t) ∈ R l is an actuator fault vector.

Standard Thau Observer for Fault Detection
According to the state Equation ( 7), the two following conditions must be met by the Thau observer design: C1 the pair (C, A) is observable.C2 the nonlinear term p(x, u) is continuously differentiable and assumed to be Lipschitz, with a constant γ, i.e., p(x From the above conditions, the state Equation ( 7), based on Thau observer, can be constructed as [20]: where K is the observer gain matrix which is determined by Lemma 1. [11]: If the given observer gain matrix in Equation ( 8) satisfies then matrix P ε can be obtained from the Lyapunov equation where ε is a positive constant such that P ε ≥ 0, and the state space model Equation ( 6) is an asymptotic estimation with lim t→∞ e(t) = lim t→∞ ( x(t) − x(t)) = 0.

Adaptive Sliding Mode Thau Observer for Fault Diagnosis
The following conditions and lemmas are given for the ASMTO design: C3 f (t) and .f (t) are norm-bounded, i.e., f (t) ≤ f 1 , .f (t) ≤ f 2 , with f 1 , f 2 > 0. C4 There exists an unknown constant that satisfies d(t) ≤ N.
Lemma 2. For a given symmetric matrix P ≥ 0 and scalar µ > 0, the following inequality must be satisfied: Lemma 3. If C2 holds, there exists a matrix P ≥ 0 such that If all the above conditions and lemmas hold, then the ASMTO has a form .
where x(t) ∈ R n , f (t) ∈ R l , ŷ(t) ∈ R q are the observer state vector, fault estimation of f (t), and observer output vector, respectively.K is the Thau observer gain matrix and v(t) is given by the following algorithm: .
where α is a constant and F 1 is discussed in the "stability analysis" section.
Theorem 1.For a given observer gain, K , if there exist matrices P = P T > 0, G = G T > 0, F 1 , and where σ is positive constant, then, the fault estimation algorithm can be described as where Γ is the learning rate matrix, Γ = Γ T > 0.
Remark 1.The adaptive law in Equation ( 20) uses both error dynamics and fault vector information.While the proportional term can lead to a rapid improvement in system response, the fault vector can eliminate the error of estimation.
Proof.Considering the following Lyapunov function.
Then, its time derivative .
Using Theorem 1, Lemma 2, and Lemma 3, one can see that F 1 e y (t) where λ max is the maximum eigenvalue of the associated matrix.
Remark 2. It is difficult to solve Equations ( 17)-( 19) simultaneously, and this problem can be addressed using the LMI technique.Therefore, we modify Equations ( 18) and ( 19) to [25]

Experimental Setup and Parameters
For safety purposes, the quadcopter test bed was developed in the guidance, navigation, and control (GNC) lab (Figure 2).The fault diagnosis algorithm from Section 3 was tested on a DJI F450 quadcopter.The algorithm was implemented on a Pixhawk2 flight controller using C++ program from Eclipse software [26].The flight controller used firmware version 3.5.In the experimental setup, a remote control was used to inject faults by limiting the pulse width modulation (PWM) of the motors, which allowed us to switch between stabilized and fault modes.During testing, the Mission Planner (MP), a commercially available software, was used to monitor flight data through Xbee (Telemetry) communication [27].Since the MP has some limitations with regard to parameter monitoring, the fault estimation data had to be obtained through a C++ program that writes them to a log file.The experimental procedure is summarized in Figure 3.The DJI F450 parameter values are shown in Table 1.For the experiment, the matrices were chosen as follows: the fault matrix = F B , and the disturbance matrix . The   The DJI F450 parameter values are shown in Table 1.For the experiment, the matrices were chosen as follows: the fault matrix = F B , and the disturbance matrix . The pair ( , ) A C is observable and condition C1 is satisfied, ( , ) p x u is continuously differentiable, and The DJI F450 parameter values are shown in Table 1.For the experiment, the matrices were chosen as follows: the fault matrix F = B, and the disturbance matrix T .The pair (A, C) is observable and condition C1 is satisfied, p(x, u) is continuously differentiable, and satisfies condition C2 as it only contains multiplications and divisions.Thus, all conditions are met, and the proposed scheme is applicable. .
The 30% partial loss fault is injected artificially into motor 1 by limiting the PWM of the motor at time t = 7 s.This is achieved by changing from stabilized mode to fault mode using the remote control.The fault percentage is user-controllable, and can be set in the C++ program.The moments of motors M2, M3, and M4 remained zero while the moment of motor M1 decreases because of the actuator fault (Figure 4).
. The 30% partial loss fault is injected artificially into motor 1 by limiting the PWM of the motor at time t = 7 s.This is achieved by changing from stabilized mode to fault mode using the remote control.The fault percentage is user-controllable, and can be set in the C++ program.The moments of motors M2, M3, and M4 remained zero while the moment of motor M1 decreases because of the actuator fault (Figure 4).

Robust Fault Diagnosis Result
The in-flight attitude response is shown in Figure 5.While Figure 6 shows the fault offset estimations M1 to M4, the real value and fault offset estimation for M1 are shown in Figure 7.It can be seen from Figure 6 that the estimation values of M2, M3, and M4 are affected by that of M1 from

Robust Fault Diagnosis Result
The in-flight attitude response is shown in Figure 5.While Figure 6 shows the fault offset estimations M1 to M4, the real value and fault offset estimation for M1 are shown in Figure 7.It can be seen from Figure 6 that the estimation values of M2, M3, and M4 are affected by that of M1 from 7 to 18 s and, then, they converge to zero.Moreover, from the Figure 7, we see that the fault offset estimation value using ASMTO converges to the desired value with high accuracy.Figure 8 compares the real controller output offset and its estimation.From this Figure, we see that the estimation value can smoothly track the real one.Although ASMTO does not use noise filtering and identification technique for drag terms, which is presented in [20], the estimation values still obtain the high accuracy and smooth tracking.Remark 3. From Equations ( 15) and ( 20), it is easy to show that 2 ( ) ( ) The speed with which the estimation converges depends on the fault characteristics and the ASMTO design parameters.From Equation (30), we can see that Γ and σ need to be tuned in order to obtain better estimations that are adapted to the fault characteristics.Normally, the value of σ would be fixed in this algorithm.

Remark 4.
Since the moments of roll and pitch are at least one order of magnitude larger than the moment of yaw, the latter has a larger error in its fault estimation.We resolved this problem by using an amplification and reduction technique [22].
Remark 5.The fault-tolerant controller was not the main focus of this paper, and we only used an attitude controller for the actuator fault diagnosis.Cases with more than one actuator fault were considered to be beyond the scope of this work, and were excluded mainly due to safety concerns.Moreover, the partial loss fault should be smaller than the nominal thrust of the quadcopter.

Conclusions
In this paper, a robust fault diagnosis method based on a Thau observer has been investigated for use on a quadcopter UAV under actuator fault, using a nonlinear modelling approach.Contrary to previous studies, the proposed scheme not only detects time-varying faults, but also works with an unknown upper bound of the associated disturbances.The stability of the error system could be demonstrated under the presence of an actuator fault.The experimental results could prove the effectiveness of this new method.In our future work, we will attempt to relax Equations ( 17)- (19) and implement an FTC for an attitude and position controller that will be based on the actuator fault estimation information.(30) The speed with which the estimation converges depends on the fault characteristics and the ASMTO design parameters.From Equation (30), we can see that Γ and σ need to be tuned in order to obtain better estimations that are adapted to the fault characteristics.Normally, the value of σ would be fixed in this algorithm.Remark 4. Since the moments of roll and pitch are at least one order of magnitude larger than the moment of yaw, the latter has a larger error in its fault estimation.We resolved this problem by using an amplification and reduction technique [22].
Remark 5.The fault-tolerant controller was not the main focus of this paper, and we only used an attitude controller for the actuator fault diagnosis.Cases with more than one actuator fault were considered to be beyond the scope of this work, and were excluded mainly due to safety concerns.Moreover, the partial loss fault should be smaller than the nominal thrust of the quadcopter.

Conclusions
In this paper, a robust fault diagnosis method based on a Thau observer has been investigated for use on a quadcopter UAV under actuator fault, using a nonlinear modelling approach.Contrary to previous studies, the proposed scheme not only detects time-varying faults, but also works with an unknown upper bound of the associated disturbances.The stability of the error system could be demonstrated under the presence of an actuator fault.The experimental results could prove the effectiveness of this new method.In our future work, we will attempt to relax Equations ( 17)- (19) and implement an FTC for an attitude and position controller that will be based on the actuator fault estimation information.

Figure 1 .
Figure 1.Schematic of the geometric configuration of the quadcopter unmanned aerial vehicle (UAV).

Figure 1 .
Figure 1.Schematic of the geometric configuration of the quadcopter unmanned aerial vehicle (UAV).

Figure 4 .
Figure 4. Motor offsets caused by the fault.

Figure 4 .
Figure 4. Motor offsets caused by the fault.

Figure 7 .
Figure 7. M1 offset by fault and its estimation.

Figure 7 .
Figure 7. M1 offset by fault and its estimation.

Figure 7 .
Figure 7. M1 offset by fault and its estimation.Figure 7. M1 offset by fault and its estimation.

Figure 7 .
Figure 7. M1 offset by fault and its estimation.Figure 7. M1 offset by fault and its estimation.

Figure 8 .
Figure 8. Controller output offset by fault and its estimation.

Figure 8 .
Figure 8. Controller output offset by fault and its estimation.