Adaptive Observer-Based Fault Detection and Fault-Tolerant Control of Quadrotors under Rotor Failure Conditions

Featured Application: This method provides a rotor fault detection and fault tolerance control mechanism for a quadrotor to achieve safety ﬂight even in the presence of single rotor loss. Abstract: This paper aims to propose a strategy for the ﬂight control of quad-rotors under single rotor failure conditions. The proposed control strategy consists of two stages—fault detection (FD) and fault tolerant control (FTC). A dual observer-based strategy for FD and fault estimation is developed. With the combination of the results from both observers, the decision making in whether a fault actually happened or the observed anomaly was caused by an external disturbance could be distinguished. Following the FD result, a control strategy for normal ﬂight, as well as the abnormal one, is presented. The FTC considers a real-time coordinate transformation scheme to manipulate the target angles for the quad-rotor to follow a prescribed trajectory. When a rotor fault happens, it is going to be detected by the dual observers and then the FTC is activated to stabilize the system such that the trajectory following task can still be fulﬁlled. Furthermore, in order to achieve robust ﬂight in the presence of external wind perturbation, the sliding mode control (SMC) theory is further integrated. Simulations illustrate the e ﬀ ectiveness and feasibility of the proposed method.


Introduction
Quadrotors have been widely used in many fields, such as agriculture, cargo delivery, surveillance, aerial photography, military fields and environmental monitoring [1]. This evidently reveals that the flying area of quadrotors gradually covers most of the areas where people live. Therefore, the safety of people under the flying area is now a concerned and an important issue. To ensure the safety of flight of the quad-rotor and the safety of people under or nearby the flying area, it is necessary to adopt an appropriate field safety strategy, such as fault-tolerant control, when a quad-rotor is malfunctioning.
Actually, FTC strategies have been investigated for decades and applied to many different fields. Among various methods for FTC published in the literature, observer-based approaches are effective and reliable. In [2], a speed sensor FTC for electric-vehicle (EV) powertrains was proposed. The approach considers two observers and a voting algorithm for the sensor fault decision making. Based on a higher order sliding mode (HOSM) observer, a reconfiguration scheme is proposed to maintain a good speed tracking control performance of a permanent-magnet synchronous motor in the event of sensor faults/failures [3]. To achieve on-line speed sensor fault detection, a simple adaptive observer-based scheme for induction motors is developed in [4] for the FTC of EVs under cruise operation mode. However, external vehicular disturbances, which may perturb the fault estimation accuracy, were not considered.
In the literature, many other FTC methods have also been proposed for quadrotor systems, such as model-reference adaptive control [5][6][7], multiple model switching and tuning [8][9][10][11][12][13], feedback linearization [14] and sliding mode control [15][16][17]. Generally, FTC can be classified into passive and active FTC [18,19], which relies on the fault detection and isolation (FDI) result. The techniques of FDI [20] could be classified as model-based [21,22] and data driven [23][24][25] approaches. Model-based methods are more economical and efficient as they do not require one to process massive datasets. An example is demonstrated in [26], which shows that with accurate fault information, the corresponding FTC could be implemented precisely and immediately when faults occur. In some papers, nonlinear adaptive thresholds are designed to enhance the robustness and fault sensitivity of the properties FDI algorithm [27,28]. Moreover, a Thau observer is applied in [29] to generate a diagnostic residue whose value would be almost zero without faults happening inside the fault detection system, but in practical cases, it is hard for the residual to be zero owing to noise, disturbance and the system uncertainties. Hence, an adaptive threshold is adopted to ensure the system robustness and to judge if the real fault exists or not. Another adaptive Thau observer (ATO) was proposed in [30]. Based on the residuals monitoring, the FDI aims to identify the faults as well as estimate the fault offset parameters.
Different from the former study, an innovative fault diagnosis strategy was developed to not only detect the actuators fault, but also to quantify the magnitude of faults. Nevertheless, it would take much time to process the fault estimation since it used some techniques to improve and optimize the original observer, like compensating for the uncertainties based on system identification and filtering the noise by a specified low-pass filter. Some examples of applications of FTC and FDI on aircraft are revealed. For instance, developing a flight control algorithm based on a linear parameter varying (LPV) controller to fulfill tracking during normal and fault conditions [16,31,32]. The study [33] designs adaptive sliding mode Thau observer (ASTMO) to derive the estimation of fault magnitude and the system parameters are solved in terms of the linear matrix inequalities (LMIs). Recently, actuator fault estimation and FTC was demonstrated using model-based observer as well [34]. The study considers a quadrotor vertical take-off and landing scenario subject to partial fault rotor damage. An aggressive fault on a rotor up to 80% is considered. However, a total loss of a rotor was not considered.
Different from the previous studies, in this paper, a dual observer-based strategy for FD and fault estimation is developed. The main objective is to stabilize and control the quadrotor subject to a total loss of a single rotor. Furthermore, with the combination of the residuals from both observers, the decision making process can distinguish whether a fault actually happened or the anomaly was caused by an external disturbance. The proposed FTC of quadrotors further provides a feasible way to deal with potential risks during flight. With model-based FDI scheme, the faults of a quadrotor would be detected by the combination of a nonlinear observer and an adaptive observer, which improves the sensitivity and accuracy of the FD result. Therefore, with the signals generated from the two observers, the real rotor failure can be isolated, so as to activate the FTC laws. Finally, simulations are performed to verify the feasibility of the flight control under a single rotor failure.

Configuration of the Quadrotor
The following are the assumptions of the quadrotor to be discussed, including the coordinate definition, variables for geometry configuration, force directions of the thrust, spin directions of propellers, and the heading of the quad-rotor.
In this paper, the coordinate of the vehicle is set to be the Cartesian one with the north-east-down (NED) definition. The cross point of the quadrotor is denoted as C.G. and it is also the origin point of the body-fixed frame. Moreover, the heading of the quad-rotor is along with the x axis as shown in Figure 1. Notice that the propellers' colors carry different meaning-the red propellers are set to be the same side of the heading as the black ones are on the tail side of the quad-rotor. We assume set to be the same side of the heading as the black ones are on the tail side of the quad-rotor. We assume that the quad-rotor is symmetric about the cross section and the distance between propeller and the origin point of body-fixed frame are ll and lw shown in Figure 1. The thrust of propellers are pointing upward, expressed as fi, and the angular velocity of each propeller is defined as ωpi shown in Figure 2, where i denotes the ith propeller.

Governing Equations
The force equation, including disturbance caused by drag force and wind force, in the x, y, and z direction of the earth frame is formed as below:

R
With the rotation transformation matrix, the control input, u, which is acting in the z direction of the body-fixed frame of the quad-rotor, could be transformed into the vector expressed in the earth frame. Therefore, Equation (1) could be written the vector form as indicated below: set to be the same side of the heading as the black ones are on the tail side of the quad-rotor. We assume that the quad-rotor is symmetric about the cross section and the distance between propeller and the origin point of body-fixed frame are ll and lw shown in Figure 1. The thrust of propellers are pointing upward, expressed as fi, and the angular velocity of each propeller is defined as ωpi shown in Figure 2, where i denotes the ith propeller.

Governing Equations
The force equation, including disturbance caused by drag force and wind force, in the x, y, and z direction of the earth frame is formed as below: where δx, δy and δz denote the drag coefficients; fwx, fwy and fwz denote disturbances caused by wind. u is the composition of forces of the four propellers; that is = − − − − is the body 3-2-1 rotation transformation matrix that transfers vectors expressed in bodyfixed frame to the one expressed in the earth frame. The definition of E R B is as follows:

R
With the rotation transformation matrix, the control input, u, which is acting in the z direction of the body-fixed frame of the quad-rotor, could be transformed into the vector expressed in the earth frame. Therefore, Equation (1) could be written the vector form as indicated below:

Governing Equations
The force equation, including disturbance caused by drag force and wind force, in the x, y, and z direction of the earth frame is formed as below: where δ x , δ y and δ z denote the drag coefficients; f wx , f wy and f wz denote disturbances caused by wind. u is the composition of forces of the four propellers; that is E R B is the body 3-2-1 rotation transformation matrix that transfers vectors expressed in body-fixed frame to the one expressed in the earth frame. The definition of E R B is as follows: With the rotation transformation matrix, the control input, u, which is acting in the z direction of the body-fixed frame of the quad-rotor, could be transformed into the vector expressed in the earth frame. Therefore, Equation (1) could be written the vector form as indicated below: where In moment equation, the derivative of angular velocity of the quadrotor is defined as . ω B ∈ R 3×1 , the moment of inertia of the quadrotor is defined as J ∈ R 3×3 , the torque generated from the propellers is defined as τ η ∈ R 3×1 , the wind disturbance is defined as d η ∈ R 3×1 , the gyroscope effects and the rest terms is defined as P.
The governing equations are summarized below: . where: In (3), µ denotes the lift to torque coefficient, I B denotes the moment of inertia of the quadrotor without rotors, a o denotes the acceleration of the quadrotor, r ci denotes the vector pointing from O to the C.G. of i th propeller, I p denotes the moment of inertia of the propeller, ω pi denotes the angular velocity of i th propeller.
In this paper, the propellers' dynamics are also taken into consideration, which makes the equation derivation complicated, although these additional terms may be negligible since many papers do not include the effect of the propellers and some of the terms relative to the propellers are relatively small comparing to the quad-rotor. Nevertheless, in this work, we are trying to model for the quadrotor in detail and observe the terms that would affect the rotational motion of the drone. Moreover, for flight properties analysis considering different rotor space configurations readers can refer to [35].
Equation (3) represents the body frame rotational dynamics, which means one could get the angular velocity at different instants. From the control point of view, the global orientation of the drone should be calculated. The relationship between the variation of the Euler angle and the body frame angular velocity is described by [36]: Differentiating Equation (5) gives: Substituting Equation (3) into Equation (6) gives the complete dynamics for quadrotor represented as follows:

Controller Design
During the loss of a single rotor, the applied torque can no longer achieve ordinary orientation control. This specific scenario could be regarded as a reduced attitude stabilization problem [37]. In order to maintain flight stability under rotor failure conditions, the control effort on yaw dynamics should be determined [38]. Meanwhile, since there is no control effort imposed on the yaw dynamics, there would be an unexpected yaw motion such that incorrect control torque vector may be induced. Thus, the flight controller in this paper consists of two parts-a coordinate transformation based outer-loop controller and an inner-loop stabilization controller illustrated in Figure 3.

Controller Design
During the loss of a single rotor, the applied torque can no longer achieve ordinary orientation control. This specific scenario could be regarded as a reduced attitude stabilization problem [37]. In order to maintain flight stability under rotor failure conditions, the control effort on yaw dynamics should be determined [38]. Meanwhile, since there is no control effort imposed on the yaw dynamics, there would be an unexpected yaw motion such that incorrect control torque vector may be induced. Thus, the flight controller in this paper consists of two parts-a coordinate transformation based outer-loop controller and an inner-loop stabilization controller illustrated in Figure 3.
For translational dynamics Equations (8)-(10), the sliding mode variables for x, y and z are defined respectively as follows: By taking the derivative of Equations (11)-(13), the control law could be obtained: From Equation (1), it can be represented in detail by: .. .. ..
For translational dynamics Equations (8)-(10), the sliding mode variables for x, y and z are defined respectively as follows: e y + λ y e y (12) By taking the derivative of Equations (11)-(13), the control law could be obtained: where: Appl. Sci. 2020, 10, 3503 6 of 19 and: The parameters ρ x , ρ y and ρ z are applied switching gains, and ε x , ε y and ε z are the scaling parameters of the sigmoid function, which are used to eliminate the chattering problem of SMC.
To achieve trajectory tracking control in the presence of heading variation, the virtual control inputs are applied to the x and y: Equations (17) and (18) are described in an Earth frame, and are used to generate corrected roll and pitch commands when the heading is varying. In other words, the yaw angle obtained from measurement should be applied as a coordinate transformation to get the desired angles such that the torque can be correctly distributed even in the presence of unexpected yaw rotations.
With the aid of the yaw-angle based coordinate transformation, the desired angles could be expressed in the body-fixed frame by: where B denotes body-fixed frame and E denotes the Earth frame.
The desired angles could be obtained by Equations (17)- (19). Combining with Equation (7), the sliding variables are defined as the vector form: Design the sliding control torque as follows: where: Following is the proof of the closed-loop stability.

Stability Analysis
Stability analysis provides a way for the guidance of gain selection of the sliding controller. Define the Lyapunov functions for z-dynamics and Euler angle dynamics respectively as follows: Appl. Sci. 2020, 10, 3503 7 of 19 Taking the derivative of Equations (23) and (24) yields: and: .
It is evident that the finite time approaching is satisfied providing: The parameters ε z and ε η not only eliminate the chattering problem of sliding mode control, but also dominate the convergence capability. Since the traditional discontinuous switching control is replaced by the continuous sigmoid function, the perfect sliding motion may not be attained and the region of the convergence is relative to the size of the scaling parameters used in the sigmoid function. Nevertheless, the high frequency control switching can be avoided.

Fault Detection
Model-based fault detection method is discussed in this section. With the implementation of observers, fault alarms could be generated and its residual provides the mechanism for the flight controller switch to the FTC.

Fault Detection Based on Residue Generation
Define the state variables to be: where: (2) and (7), the governing equations in state space form could be obtained and written as: where h consists of nonlinear terms, denotes the force distribution matrix, F denotes thrust of each propeller, γ represents disturbance, and α denotes actuator fault residual signal. The rest system matrices are defined as follows: Since the system is fully observable, the observer could be designed as follows: where L denotes as the observer gain with proper dimension. In order to analyze the relationship between the states and the estimated ones, the state estimation error is defined by: Taking the derivative of Equation (34), and bringing Equations (32) and (33) into the result gives: where A o is a negative definite matrix with a proper pole placement via L.
The following assumptions are imposed for the observer stability proof: Proof. Based on Assumptions 1 and 2, define the Lyapunov function as V = x T Ξx and take the derivative of it, which gives: It can be seen that the estimation error converges as long as x ∈ Ω(x): Equation (37) shows that both the fault signal and external disturbance restrain state estimation error from converging to zero, but to a bound. Hence, the idea of fault detection is to set a boundary of residues. If the residue exceeds the set described by Equation (37), it is regarded as fault happening. To this aim, the work [29] is adopted for boundary generation: Equations (38) and (39) denote the adaptive upper and lower bounds of the residue. r i denotes the residue along the ith dimension, K u denotes gains for upper bound, and K l denotes gains for lower bound. In this study, r i comes from the state estimation error Equation (34).

Fault Detection Based on Fault Estimation
In the previous section, the fault detection method alarms right after the system differs from the model. However, the residue-based fault estimator presented in the previous section is suitable for UAVs with non-static flight orientation. To improve the fault evaluation accuracy for fixed orientation flight situations, another observer for estimating the fault residual is further introduced.
To address the stability, the fault is assumed to be slow time varying, and the update rate of estimated fault is designed as: Define a Lyapunov function as V = x T Ξx + α T ∆ α ∆ /ρ α . Taking the time derivative yields: The inequality implies that the convergence of state estimation error is affected by the external disturbance: The result of fault estimation is affected by the state estimation error. Thus, the observer gain should be selected carefully in case of making a fault estimation stop updating. On the other hand, the convergence of state estimation error is affected by the magnitude of the disturbance, which also has an impact on the fault estimation precision. The next step is to address the mechanism for the determination of the rotor fault.

Fault Detection Making Algorithm
Based on the dual observers as shown in Figure 4, they return two flags. Flag1 and Flag2 represent the judgement results from the methods presented in the Sections 4.1 and 4.2, respectively. As for Flag1, the residues of roll, pitch, x, y, and z are taken into consideration. When any of the residues mentioned exceeds the upper bound or lower bound as presented in Equations (38) and (39), the fault alarm Flag1 would be triggered. However, using only Flag1 would lead to an incorrect fault alarm. As for Flag2, the estimated fault would be filtered by moving average. If any of the results exceed the threshold, it is treated as fault happening. The fault signal of from the 1st observer reacts quickly when fault happens, but residues may still converge due to the property of observer. The fault signal of the 2nd observer requires time to converge while it would eventually close to the fault happening. With the combination of Flag1 and Flag2, the decision making regarding whether the true fault happens or not would be made in the judgment block as shown in Figure 4. By default, Flag1 = Flag2 = 1, which represents the normal status. Therefore, the real-time fault double confirmation procedure, as shown in Table 1, is applied:  Based on the judgement procedure, if any of the flags denotes a fault is happening, the fault detection result would be considered as a fault happening first. In order to prevent wrong judgments, a mechanism is further imposed to pull back a faulty alarm. That is, if both of the flags denote normal flight for a time period, the fault detection would return to "normal". Based on the judgement procedure, if any of the flags denotes a fault is happening, the fault detection result would be considered as a fault happening first. In order to prevent wrong judgments, a mechanism is further imposed to pull back a faulty alarm. That is, if both of the flags denote normal flight for a time period, the fault detection would return to "normal".

Simulation Results
To verify the proposed fault detection and fault control strategies, in the following sections we consider a couple of simulations. Figure 5 shows the detailed signal processing of residual-based fault detection. The yaw residue result is not considered, since it is sensitive to the unexpected yaw motion induced by loss of efficiency (LOE) or rotor failure. In our case, slight LOE is not classified to an actuator fault since the quadrotor at this situation still has the ability to complete the flight mission. Parameters for the upper and lower boundary discussed in Section 4.1 are set to be Table 2.    Table 2. After getting result, the fault signal would be filtered by a moving average.  In Figure 6, the fault is detected at 4.12 s when it is set to happen at 3.9 s, where the blue and black lines represent r u i and r i , respectively. The reaction time is about 0.22 s with the parameter set in Table 2. After getting result, the fault signal would be filtered by a moving average. In Figure 6, the fault is detected at 4.12 s when it is set to happen at 3.9 s, where the blue and black lines represent u i r and i r  , respectively. The reaction time is about 0.22 s with the parameter set in Table 2. After getting result, the fault signal would be filtered by a moving average. In order to prevent outliers during the fault estimation process, the moving average method is also applied, where the parameters are shown in Table 3. The fault estimation method performs well under slow time varying fault. Meanwhile, with the implement of moving average, the chance of accidental triggering of fault alarm could be reduced. Table 3. Parameters of the moving average.

Method
Moving Window Threshold residue estimation 0.01 (s) 0.5 In order to prevent outliers during the fault estimation process, the moving average method is also applied, where the parameters are shown in Table 3. The fault estimation method performs well under slow time varying fault. Meanwhile, with the implement of moving average, the chance of accidental triggering of fault alarm could be reduced. As the fault signal is being processed by moving average, the threshold illustrated in Table 3 would separate the result into Boolean logic answers that represent whether a fault happened or not. In Figure 7, it is regarded as normal flight when the Flag is 1. Due to the convergent property of the observer, a fault detection result based on residue generation is accurate only around the time that the fault happens. As one can see, some switching between normal and abnormal judgment appears around the fault occurrence time. After taking a moving average, the fault detection results act much better.
would separate the result into Boolean logic answers that represent whether a fault happened or not. In Figure 7, it is regarded as normal flight when the Flag is 1. Due to the convergent property of the observer, a fault detection result based on residue generation is accurate only around the time that the fault happens. As one can see, some switching between normal and abnormal judgment appears around the fault occurrence time. After taking a moving average, the fault detection results act much better. As one could see in Figure 8, the estimated fault becomes smoother, which reduces the chance of accidental triggering. On the other hand, the control law of the quadrotor would be modified, which releases yaw control, right after a fault happens. The unexpected yaw motion would affect the fault estimation As one could see in Figure 8, the estimated fault becomes smoother, which reduces the chance of accidental triggering.
As the fault signal is being processed by moving average, the threshold illustrated in Table 3 would separate the result into Boolean logic answers that represent whether a fault happened or not. In Figure 7, it is regarded as normal flight when the Flag is 1. Due to the convergent property of the observer, a fault detection result based on residue generation is accurate only around the time that the fault happens. As one can see, some switching between normal and abnormal judgment appears around the fault occurrence time. After taking a moving average, the fault detection results act much better. As one could see in Figure 8, the estimated fault becomes smoother, which reduces the chance of accidental triggering. On the other hand, the control law of the quadrotor would be modified, which releases yaw control, right after a fault happens. The unexpected yaw motion would affect the fault estimation On the other hand, the control law of the quadrotor would be modified, which releases yaw control, right after a fault happens. The unexpected yaw motion would affect the fault estimation result. Thus, the strategy is to take the biggest component of the estimated fault and examine it by using a threshold. In Figure 9, it is regarded as a fault happening when the estimated fault exceeds the threshold. result. Thus, the strategy is to take the biggest component of the estimated fault and examine it by using a threshold. In Figure 9, it is regarded as a fault happening when the estimated fault exceeds the threshold.  The transparent green region denotes the time when a gust disturbance is acting as a perturbation on the quad-rotor.
In Figure 10a, the fault happens at 3 s. It can be seen that the 20% LOE doesn't trigger the fault alarm since its effect to the motion of the quad-rotor is not serious. Hence, it is treated as a case of uncertainty. In Figure 10b, the fault happens at 3 s, which is highlighted by the transparent yellow block. During the 60% LOE of one rotor, the fault alarm is triggered at approximately the 5, 10, and 15 s, which are the time when quad-rotor is flying passing through the wait points and changing the attitude for the next tracking target.  The transparent green region denotes the time when a gust disturbance is acting as a perturbation on the quad-rotor.
In Figure 10a, the fault happens at 3 s. It can be seen that the 20% LOE doesn't trigger the fault alarm since its effect to the motion of the quad-rotor is not serious. Hence, it is treated as a case of uncertainty. In Figure 10b, the fault happens at 3 s, which is highlighted by the transparent yellow block. During the 60% LOE of one rotor, the fault alarm is triggered at approximately the 5, 10, and 15 s, which are the time when quad-rotor is flying passing through the wait points and changing the attitude for the next tracking target.
Appl. Sci. 2020, 10, x 14 of 19 result. Thus, the strategy is to take the biggest component of the estimated fault and examine it by using a threshold. In Figure 9, it is regarded as a fault happening when the estimated fault exceeds the threshold.  The transparent green region denotes the time when a gust disturbance is acting as a perturbation on the quad-rotor.
In Figure 10a, the fault happens at 3 s. It can be seen that the 20% LOE doesn't trigger the fault alarm since its effect to the motion of the quad-rotor is not serious. Hence, it is treated as a case of uncertainty. In Figure 10b, the fault happens at 3 s, which is highlighted by the transparent yellow block. During the 60% LOE of one rotor, the fault alarm is triggered at approximately the 5, 10, and 15 s, which are the time when quad-rotor is flying passing through the wait points and changing the attitude for the next tracking target. Due to the medium fault level of rotor, some motion with large attitude change of the quad-rotor would trigger the fault alarm. Nonetheless, the judgement of FDI returns to the normal flight successfully within the smooth flight periods. In Figure 10c, the fault happens at 3 s, which has been highlighted by the transparent red block. As one could see, the fault has been detected immediately after the rotor failure, which guarantees the safety flight of the quad-rotor. The result is acceptable, though there are some switching periods during the time the fault is happening. These are the result of a tradeoff between the correction for misjudgment of the FDI, which returns the fault control to the normal one, and the safety concern, which maintains the fault tolerant control. Nonetheless, the switching times are actually quite few that would not affect the safe flight of the quad-rotor. In Figure  10d, the perturbation caused by disturbance is shown within the 1 to 2 s, which is covered by the green block, and the fault happens at 10 s that last until the end of simulation.
As discussed before, the fault detection result would be affected by disturbances, which means misjudgment is inevitable. Nevertheless, with the proposed algorithm, the control law would be switched back to the normal one in a short period after the perturbation. Meanwhile, the short period that treated as fault happening would not be regarded as rotor fault, but rather as an external disturbance.

Quadcotor Flight Simulation with Rotor Fault
In the following, the flight behavior by using the proposed fault tolerance control strategies is visualized. Figure 11 shows the demonstration of flying path of the quad-rotor for simulation. Each corner between green lines represents the way point. To provide a smooth flight path, velocity as well as acceleration, the flight trajectories between each way point are generated by applying a second order low pass filter. Due to the medium fault level of rotor, some motion with large attitude change of the quad-rotor would trigger the fault alarm. Nonetheless, the judgement of FDI returns to the normal flight successfully within the smooth flight periods. In Figure 10c, the fault happens at 3 s, which has been highlighted by the transparent red block. As one could see, the fault has been detected immediately after the rotor failure, which guarantees the safety flight of the quad-rotor. The result is acceptable, though there are some switching periods during the time the fault is happening. These are the result of a tradeoff between the correction for misjudgment of the FDI, which returns the fault control to the normal one, and the safety concern, which maintains the fault tolerant control. Nonetheless, the switching times are actually quite few that would not affect the safe flight of the quad-rotor. In Figure 10d, the perturbation caused by disturbance is shown within the 1 to 2 s, which is covered by the green block, and the fault happens at 10 s that last until the end of simulation.
As discussed before, the fault detection result would be affected by disturbances, which means misjudgment is inevitable. Nevertheless, with the proposed algorithm, the control law would be switched back to the normal one in a short period after the perturbation. Meanwhile, the short period that treated as fault happening would not be regarded as rotor fault, but rather as an external disturbance.

Quadcotor Flight Simulation with Rotor Fault
In the following, the flight behavior by using the proposed fault tolerance control strategies is visualized. Figure 11 shows the demonstration of flying path of the quad-rotor for simulation. Each corner between green lines represents the way point. To provide a smooth flight path, velocity as well as acceleration, the flight trajectories between each way point are generated by applying a second order low pass filter. Due to the medium fault level of rotor, some motion with large attitude change of the quad-rotor would trigger the fault alarm. Nonetheless, the judgement of FDI returns to the normal flight successfully within the smooth flight periods. In Figure 10c, the fault happens at 3 s, which has been highlighted by the transparent red block. As one could see, the fault has been detected immediately after the rotor failure, which guarantees the safety flight of the quad-rotor. The result is acceptable, though there are some switching periods during the time the fault is happening. These are the result of a tradeoff between the correction for misjudgment of the FDI, which returns the fault control to the normal one, and the safety concern, which maintains the fault tolerant control. Nonetheless, the switching times are actually quite few that would not affect the safe flight of the quad-rotor. In Figure  10d, the perturbation caused by disturbance is shown within the 1 to 2 s, which is covered by the green block, and the fault happens at 10 s that last until the end of simulation.
As discussed before, the fault detection result would be affected by disturbances, which means misjudgment is inevitable. Nevertheless, with the proposed algorithm, the control law would be switched back to the normal one in a short period after the perturbation. Meanwhile, the short period that treated as fault happening would not be regarded as rotor fault, but rather as an external disturbance.

Quadcotor Flight Simulation with Rotor Fault
In the following, the flight behavior by using the proposed fault tolerance control strategies is visualized. Figure 11 shows the demonstration of flying path of the quad-rotor for simulation. Each corner between green lines represents the way point. To provide a smooth flight path, velocity as well as acceleration, the flight trajectories between each way point are generated by applying a second order low pass filter. Figure 11. Demonstration of flying path with connected wait points. Figure 11. Demonstration of flying path with connected wait points. Figure 12a shows the normal flight. Figure 12b shows that the quadrotor performs well even when a fault happens. Figure 12c represents a robust flight for the quadrotor in the face of an external wind disturbance. As one could see, the final state of fault judgment is normal flight, which means the control law is switched back to the normal one even when the disturbance has been treated as a fault. Finally, in Figure 12d, the quadrotor successfully completes the flight mission even in the presence of a rotor fault as well as an external wind disturbance. The associated flight dynamic simulation can refer to the Supplementary Material.
Appl. Sci. 2020, 10, 3503 16 of 19 Figure 12a shows the normal flight. Figure 12b shows that the quadrotor performs well even when a fault happens. Figure 12c represents a robust flight for the quadrotor in the face of an external wind disturbance. As one could see, the final state of fault judgment is normal flight, which means the control law is switched back to the normal one even when the disturbance has been treated as a fault. Finally, in Figure 12d, the quadrotor successfully completes the flight mission even in the presence of a rotor fault as well as an external wind disturbance. The associated flight dynamic simulation can refer to the supplementary material.

Conclusions
This paper proposed a strategy for quadrotor flight control for a single rotor failure. Under this circumstance, the developed flight strategy consists of normal and abnormal control modes. Therefore, the fault detection scheme, including fault detection and estimation used to determine current flight condition, plays an important role in our FTC strategy. To prevent an incorrect alarm from misjudgment of an actuator fault, the algorithm not only determines the fault alarm, but also provides a fault confirmation mechanism to rise the confidence of the fault decision making process. On the other hand, to provide robust flight control under external wind perturbation conditions, sliding mode control theory is considered. Most importantly, to deal with a drone flight subject to rotor failure, a real-time coordinate transformation-based control scheme is developed. This method is able to guarantee not only the stable flight under spinning motion, but completion of the prescribed flight task as well.
Author Contributions: Y.-H.L. wrote the paper and perform numerical simulation. C-C.P conceived and designed the algorithms; Y.-H.C. analyzed the data and edited the paper. All authors have read and agreed to the published version of the manuscript.

Conclusions
This paper proposed a strategy for quadrotor flight control for a single rotor failure. Under this circumstance, the developed flight strategy consists of normal and abnormal control modes. Therefore, the fault detection scheme, including fault detection and estimation used to determine current flight condition, plays an important role in our FTC strategy. To prevent an incorrect alarm from misjudgment of an actuator fault, the algorithm not only determines the fault alarm, but also provides a fault confirmation mechanism to rise the confidence of the fault decision making process. On the other hand, to provide robust flight control under external wind perturbation conditions, sliding mode control theory is considered. Most importantly, to deal with a drone flight subject to rotor failure, a real-time coordinate transformation-based control scheme is developed. This method is able to guarantee not only the stable flight under spinning motion, but completion of the prescribed flight task as well.