Finite-Time Attitude Fault Tolerant Control of Quadcopter System via Neural Networks

: This study investigates the design of fault-tolerant control involving adaptive nonsingular fast terminal sliding mode control and neural networks. Unlike those of previous control strategies, the adaptive law of the investigated algorithm is considered in both continuous and discontinuous terms, which means that any disturbances, model uncertainties, and actuator faults can be simultaneously compensated for. First, a quadcopter model is presented under the conditions of disturbances and uncertainties. Second, normal adaptive nonsingular fast terminal sliding mode control is utilized to handle these disturbances. Thereafter, fault-tolerant control based on adaptive nonsingular fast terminal sliding mode control and neural network approximation is presented, which can handle the actuator faults, model uncertainties, and disturbances. For each controller design, the Lyapunov function is applied to validate the robustness of the investigated method. Finally, the e ﬀ ectiveness of the investigated control approach is presented via comparative numerical examples under di ﬀ erent fault conditions and uncertainties.


Introduction
In recent years, unmanned aerial vehicles (UAVs) have been commercialized widely in the market, due to technological developments in the fields of electronics, computers, and mechanics. They have been contributing significant achievements and benefits in different applications such as coastal surveillance, payload transportation, military and defense, and environmental monitoring. Quadcopter, a small UAV, has been investigated and improved for a wide range of applications due to its merits such as agility, mechanical simplicity, and both indoor and outdoor performances, which have rendered its popularity when compared to other kinds of UAV systems. Quadcopters have been studied and developed using different technologies, including object detection and tracking control, formation flight control, obstacle avoidance, remote sensing, and fault tolerant control.
The quadcopter system can be controlled using traditional and advanced control methods. Several classical control techniques have been employed to control [1,2] the quadcopter, such as proportional-integral-derivative (PID) controller and gain scheduling PID [3][4][5] controller. Many advanced control laws have been utilized to enhance the robustness of the quadcopter. In [6,7], 1.
The NFTSMC method is used to enhance the convergence speed and robustness of the quadcopter system.

2.
The adaptive law is integrated with the NFTSMC to tackle the unknown external disturbances.

3.
Radial basic function neural networks (RBFNNs) are combined with adaptive laws to handle model uncertainties and actuator faults.

4.
The proposed control technique has several merits such as robustness, fast finite time convergence, handling model uncertainties and external disturbances, accommodating actuator faults, and lack of magnitude information of bounded faults.
The remainder of this paper is organized as follows. The problem formulation of the quadcopter system is presented in Section 2. Section 3 describes the design of the flight controller. Three types of control techniques are compared to show the robustness and effectiveness of the proposed controller through simulation results in Section 4. Section 5 presents the conclusions and future work.

Mathematical Tools
In this study, RBFNNs were employed to approximate the model uncertainties and actuator faults. The approximation algorithm is shown in [33] as, In Equation (1), the optimal weight is denoted as W * i ∈ R q , the hidden node number is expressed as q > 1, the input vector is given as is the approximation error that meets the requirement of δ i (x) ≤ δ * i ∀x ∈ Ω x with an unknown constant given as δ * i > 0. The optimal weight W * i is denoted as the value of W i that minimizes δ i (x) for x ∈ Ω x ⊂ R r , that is, The Gaussian function is defined as follows: where c j is the center of the receptive field, and σ j is the width of the Gaussian function.

Nonsingular Fast Terminal Sliding Mode
The nonsingular fast terminal sliding mode (NFTSM) method was employed to improve the robustness of the quadcopter during actuator faults, external disturbances, and model uncertainties. The NFTSM surface is defined as [32], In Equation (4), the position and velocity tracking errors are denoted as e, and . e, respectively. p and l are the odd positive numbers and these satisfy the requirements of 1 < p/l < 2 and α > p/l, respectively. k 1 and k 2 are the positive constants. The first derivative of Equation (4)  e p/l = 0, then, the finite time T of e(t) is obtained as where e(0) is the initial value of e(t), and F(•) represents the Gauss' hypergeometric function. Figure 1 illustrates the configuration of a quadcopter. Four propellers are mounted on the corresponding motors in a cross configuration. While the motors M 1 and M 3 spin in the clockwise direction, the other motors (M 2 and M 4 ) spin in the counter-clockwise direction. The forces generated by the motors are represented as f i , i = 1, 2, 3, 4 and the corresponding angular velocities produced by the motors are denoted as ω i , i = 1, 2, 3, 4.

Quadcopter Model
Two coordinate systems were employed to represent the model of the quadcopter system. The earth-fixed frame axes are described as {E}(O, x, y, z), and the body-fixed frame axes are denoted as {B}(O B , x B , y B , z B ). As depicted in Figure 1, the total thrust in the z B -direction is described as The torque in the x B -direction is generated by the difference between two left and two right propellers, and is defined as U φ = Lk th (−u 1 + u 3 + u 2 − u 4 ). The pitch moment in the y B -direction is produced by the difference between two front and two rear propellers and is denoted by U θ = Lk th (u 1 − u 2 + u 3 − u 4 ). The torque in the z B -direction is the difference between two counter-clockwise and two clockwise propellers, and is defined as where k th and k d are the thrust and drag coefficient, respectively, L is the arm length, which is the distance from the center of mass to each propeller. According to the Newton-Euler law, the dynamical model of the quadcopter can be expressed as [6], In Equation (8), g is the gravitational acceleration constant and m is the total mass of the quadcopter. The inertial moments in x B , y B and z B directions are I 1 , I 2 , and I 3 , respectively. The global position of the quadcopter is denoted as x, y, z. The drag coefficients are represented as K i , i = 1, 2, . . . , 6. The roll, pitch, and yaw angles are denoted as φ, θ, and ψ, respectively. The disturbances are denoted as ζ i , i = 1, 2, . . . , 6.
Let us define the state vector as, The general model of the quadcopter under an actuator fault is expressed as where k = 1, 2, 3 denotes each subsystem, , α k and is the actuator fault effectiveness with 0 ≤ γ k ≤ 1.

Flight Controller Design
In this section, we consider two scenarios of controller design. Firstly, an adaptive NFTSM control (ANFTSMC) method has been presented to handle bounded disturbances. Secondly, the ANFTSMC is integrated with a neural network to handle the actuator faults, disturbances, and model uncertainties. (10) is norm-bounded with the requirement

Assumption 1. The disturbance in the quadcopter model
In case of γ k = 1, let us define the first and second tracking errors as where β k = −c k1 z k1 is the virtual control, c k1 is a constant, X d k and is the desired state. The first derivative of z k1 is Similarly, the first derivative of z k2 is: .
As per Section 2.2, the design of ANFTSMC for quadcopter can be achieved as, The first derivative of Equation (14) is given by the following equation: .
The Lyapunov function is chosen as follows: By means of defining M k = . z k1 + λ k1 α|z k1 | α−1 . z k1 and H k = λ k2 p l |z k2 | p/l−1 , the control law can be designed as, where (20) and the adaptive law is updated by the following equation: .η where ϑ k is the positive gain.
Theorem 1. Consider the general model of the quadcopter shown in Equation (10), and the sliding surface in Equation (14). If the controller defined in Equation (18) is updated by Equation (21), then the system converges to the sliding surface within a finite time. (18)-(21) into Equation (17), we have:

Proof. After inserting Equations
Let us define µ k = n k − |d k |. From Assumption 1, we can obtain According to the Lyapunov theory, the system states converge to the sliding surface s k (t) = 0 asymptotically.

Remark 1.
In this controller design, the adaptive law in discontinuous term is considered in presence of disturbances. To enhance the robustness of the system in presence of disturbances, uncertainties, and actuator faults, the adaptive law can be designed in both continuous and discontinuous term.

Synthetizing ANFTSMC with Neural Network
In this section, the ANFTSMC is combined with neural network to handle three tasks, including disturbances, actuator faults, and uncertainties. Then, the stability of whole system is verified through the Lyapunov function.
Theorem 2. Consider the actuator fault, disturbances, and model uncertainties occurring in the system (Equation (10)). Let the following neural network-based fault tolerant control (NNFTC) be implemented as, and updated as: . .η where µ k1 , µ k2 are the positive gains. Then, the closed-loop system becomes stable, and it will reach the sliding mode within a finite time.
Proof. As per Section 2.2, the sliding surface can be chosen as, The first derivative of Equation (28) is expressed as, The Lyapunov function is chosen as, The first derivative of the Lyapunov function is expressed as, Replacing Equations (24)- (27) and (29) into (31), we have If we assume that d k + δ * k < η k , then the system states converge to the sliding surface s k (t) = 0 asymptotically according to the Lyapunov theory.

Simulation
Some simulations are presented to demonstrate the effectiveness of the proposed FTC (PFTC) from Section 3.2. To highlight the effectiveness and robustness of the PFTC, conventional SMC [34] and adaptive sliding mode control (ASMC) [6] were chosen for comparison. The complete parameters of the quadcopter model are described in Table 1. The parameters for the proposed controller can be designed as p = 30, l = 20, µ k1 = 0.01, µ k2 = 2, ϑ k = 0.0001, c j =0.5, σ j = 7.5. Three scenarios are illustrated to validate the robustness and effectiveness of the proposed control method. In Scenario 1, multiple faults are investigated without considering uncertainties and disturbances. In Scenario 2, in addition to multiple faults, uncertainties and disturbances are added in Scenario 1 to consider the effectiveness and robustness of the developed control method. In Scenario 3, the intermittent fault is injected into one actuator by considering the uncertainties and disturbances to demonstrate the superiority of the proposed method.

Scenario 1
In this scheme, faults are injected into actuators #4 and #3 under 20% and 25% loss of control effectiveness (LoCE) at 22 s and 52 s, respectively. The attitude tracking and attitude tracking errors without considering uncertainties and disturbances are depicted in Figures 2 and 3. After faults occur in actuators #4 and #3, the PSMC can compensate for these faults perfectly to maintain the attitude tracking performance, and the attitude tracking errors converge quickly to zero. Although ASMC shows a small oscillation after the occurrence of such faults, the feedback attitude angles can gradually track the desired attitude angles. The SMC showed the worst attitude tracking response after faults occurred. The motor inputs of the quadcopter are depicted in Figure 4. After faults occur, the motor inputs in actuators #4 and #3 are increased to accommodate these faults. The PSMC contributes more control efforts than ASMC and SMC because of the adaptive gain in the discontinuous part.

Scenario 2
In this scenario, in addition to the multiple faults presented in Scenario 1, a 10% mismatch in the moment of inertia and disturbances ( 0.1, 1, 2,3 k d k = = ) was examined. Figures 5 and 6 depict the attitude tracking and attitude tracking errors by considering uncertainties and disturbances. When faults occur in actuators #4 and #3, the PSMC can compensate for these faults perfectly to maintain the attitude tracking performance, and the attitude tracking errors converge quickly to zero. Although ASMC shows a small oscillation after the occurrence of these faults, the feedback attitude angles can gradually track the desired attitude angles. The SMC showed the worst attitude tracking response after faults occurred. The motor inputs of the quadcopter are depicted in Figure 7. After faults occur, the motor inputs in actuators #4 and #3 were increased to accommodate these faults. The PSMC contributes more control efforts than ASMC and SMC because of the adaptive gain in the discontinuous part.

Scenario 2
In this scenario, in addition to the multiple faults presented in Scenario 1, a 10% mismatch in the moment of inertia and disturbances (d k = 0.1, k = 1, 2, 3) was examined. Figures 5 and 6 depict the attitude tracking and attitude tracking errors by considering uncertainties and disturbances.
When faults occur in actuators #4 and #3, the PSMC can compensate for these faults perfectly to maintain the attitude tracking performance, and the attitude tracking errors converge quickly to zero. Although ASMC shows a small oscillation after the occurrence of these faults, the feedback attitude angles can gradually track the desired attitude angles. The SMC showed the worst attitude tracking response after faults occurred. The motor inputs of the quadcopter are depicted in Figure 7. After faults occur, the motor inputs in actuators #4 and #3 were increased to accommodate these faults. The PSMC contributes more control efforts than ASMC and SMC because of the adaptive gain in the discontinuous part.

Scenario 3
In this scenario, a 40% LoCE is applied to actuator #4 with the following function scheme: Attitude tracking and tracking error performances are depicted in Figure 8 and Figure 9. It can be seen that after intermittent faults occur in actuator #4, the PSMC can accommodate these faults to maintain the trajectory tracking performance, and the attitude tracking errors converge to zero quickly. The ASMC shows a slow compensation in the presence of uncertainties and intermittent faults. The motor inputs of the quadcopter are depicted in Figure 10. After faults occur, the motor inputs in actuator #4 are increased to compensate for these faults. The PSMC contributes more control

Scenario 3
In this scenario, a 40% LoCE is applied to actuator #4 with the following function scheme: where u 4 is the old motor input, and u * 4 is the new motor input. A 10% mismatch in the moment of inertia and disturbances (d k = 0.15, k = 1, 2, 3) was examined. Attitude tracking and tracking error performances are depicted in Figures 8 and 9. It can be seen that after intermittent faults occur in actuator #4, the PSMC can accommodate these faults to maintain the trajectory tracking performance, and the attitude tracking errors converge to zero quickly. The ASMC shows a slow compensation in the presence of uncertainties and intermittent faults. The motor inputs of the quadcopter are depicted in Figure 10. After faults occur, the motor inputs in actuator #4 are increased to compensate for these faults. The PSMC contributes more control efforts than ASMC because of the adaptive gain in the discontinuous part.

Scenario 3
In this scenario, a 40% LoCE is applied to actuator #4 with the following function scheme: Attitude tracking and tracking error performances are depicted in Figure 8 and Figure 9. It can be seen that after intermittent faults occur in actuator #4, the PSMC can accommodate these faults to maintain the trajectory tracking performance, and the attitude tracking errors converge to zero quickly. The ASMC shows a slow compensation in the presence of uncertainties and intermittent faults. The motor inputs of the quadcopter are depicted in Figure 10. After faults occur, the motor inputs in actuator #4 are increased to compensate for these faults. The PSMC contributes more control

Remark 2.
This article mainly focuses on partial loss effectiveness in single or multiple actuators. Therefore, the complete fault in one actuator (one motor is failure) is not considered in this work due to the scope of this paper. However, to overcome this issue, the configuration technique of allocation matrix [35] is applied to guarantee the stability of the quadcopter system.

Conclusions
In this study, an attitude fault-tolerant control based on a nonsingular fast terminal sliding mode and a neural network have been proposed for a quadcopter. The developed method not only can guarantee the robustness but also can enhance the convergence speed of the attitude tracking system within a finite time. To be more specific, the actuator faults, uncertainties, and bounded disturbances are compensated for through two schemes. Firstly, the ANFTSMC is designed to handle the bounded disturbances without considering the actuator faults and uncertainties. Then, the ANFTSMC is integrated with neural networks to handle three targets, including uncertainties, disturbances, and actuator faults. The proposed control technique is compared with the adaptive sliding mode control and normal sliding mode control methods through three scenarios: (1) faults occur in actuator four and three without considering uncertainties and disturbances, (2) faults occur in actuator four and three with considering uncertainties and disturbances, (3) intermittent fault in actuator four with considering uncertainties and disturbances. The results indicate that the proposed control law is more robust than the other two methods in the presence of actuator faults, model uncertainties, and bounded disturbances. However, the proposed control method does not consider the time-varying disturbances and complete fault in one actuator. In future studies, the complete fault in one actuator, the implementation of the proposed control method on embedded system, and time-varying disturbances will be examined for a flight controller.