Actuator Fault Detection and Fault-Tolerant Control for Hexacopter

In this paper, fault detection and fault-tolerant control strategies are proposed to handle the issues of both actuator faults and disturbances in a hexacopter. A dynamic model of a hexacopter is first derived to develop a model-based fault detection system. Secondly, the altitude control based on a sliding mode and disturbance observer is presented to tackle the disturbance issue. Then, a nonlinear Thau observer is applied to estimate the states of a hexacopter and to generate the residuals. Using a fault detection unit, the motor failure is isolated to address the one or two actuator faults. Finally, experimental results are tested on a DJI F550 hexacopter platform and Pixhawk2 flight controller to verify the effectiveness of the proposed approach. Unlike previous studies, this work can integrate fault detection and fault-tolerant control design as a single unit. Moreover, the developed fault detection and fault-tolerant control method can handle up to two actuator failures in presence of disturbances.


Introduction
The multicopter unmanned aerial vehicles (UAVs) are drawing attention in the academic community. The have been developed and tested in several technologies, such as formation flight [1,2], precision landing [3,4], tracking control [5,6], remote sensing [7][8][9][10]. This significant growth has resulted from the following advantages that UAVs have, such as agility, economical cost, compactness, mechanical simplicity, and ability to operate in indoor and outdoor environments [11]. One of the control problems that a multicopter faces is actuator failure, which may cause many crashes and expose human beings to injury risks during operation [11]. Therefore, a fault-tolerant control (FTC) topic is a key factor in ensuring the safety and reliability demands of multicopters during flight missions. The goal of this paper is to propose a fault detection and fault-tolerant control method for hexacopters in the presence of one or two actuator failures.

Related Review
Studies on actuator fault detection (FD) and FTC for multicopter UAVs have been carried out intensively over the past decade. There are two types of failures in multicopter UAVs: partial loss and complete loss effectiveness in actuators. Several methods have been proposed to improve the stability and tracking performance for quadcopter UAVs in the presence of a partial actuator failure. Several control methods based on sliding mode control (SMC) [12][13][14] and adaptive SMC (ASMC) techniques [15][16][17] are proposed to handle model uncertainties, disturbances, and actuator faults. These studies show some acceptable results, but they cannot tolerate the fault in the case of complete failure [18,19]. Some control methods are investigated to overcome the complete failure issue. Merheb  into a tricopter [18]. The results can tolerate complete failure and demonstrate a good tracking performance. However, this method cannot detect the location of the fault and it requires an extra weight mounted on the opposite motor. There is another approach, based on backstepping [19], to transform the quadcopter into a birotor for emergency landing, but this method does not consider fault detection. In [20], a periodic solution combined with removing yaw motion was proposed to address one, two, or three propeller failures but this approach cannot use a fault detection scheme. Moreover, this work may not work in outdoor environments because GPS systems have a poor signal when removing yaw motion. It can be demonstrated that complete failure in one motor of a quadcopter requires removing yaw motion to ensure the controllability of the system because the quadcopter lacks redundancy in a dynamic model [11,20].
A hexacopter consists of six motors, including three motors rotating clockwise and three motors rotating counterclockwise. It was developed to increase the possibility of controllability of one or more actuator failures through its allocation matrix. Recent years have witnessed several works on the FTC problem of a hexacopter in the case of a motor failure. An attainable control set was proposed to evaluate the controllability of a hexacopter or an octocopter [21]. The optimal solution of thrust and torques is arrived at using parametric programming, which is obtained from the search tree method. In [22], an incremental backstepping fault-tolerant control is proposed for a hexacopter under an unknown control degradation occurring in the propulsion system. In [23], a Time Delay Control (TDC) method is presented to address single or multiple failure in the actuator. However, most of the above studies are tested and validated by simulation. A recent study presented experimental work on the FTC of a hexacopter using parametric programming formulation [24]. This work shows some good results in hovering or tracking performance after faults occur in one or two motors, but this design assumes that the location of motor failures is known to design the FTC approach. Although current studies proposed some good results on FTC of hexacopters, they lack experimental works or lack the fault detection unit to determine the location of a fault before designing the FTC method.

Main Contributions
In this paper, a fault-tolerant control approach is proposed for a hexacopter UAV to address one or two actuator faults with disturbances. Differing from previous studies, this article aims to integrate a fault detection unit into fault-tolerant control as a single unit. In detail, the fault detection unit is first used to detect the location of faults. Next, using this fault detection information, the motor failures are isolated and then a fault-tolerant control method is developed to hover the hexacopter through the reconfiguration technique. This paper is organized as follows. Section 2 describes the dynamic model of the hexacopter. The attitude and altitude controller design are shown in Section 3. Section 4 presents the fault detection and isolation scheme. The experimental results are presented in Section 5 to validate the effectiveness of the proposed method. Section 6 presents the conclusions and the possibilities for future research.

Mathematical Model of a Hexacopter
Let us examine the body frame B and inertial frame E to describe a hexacopter dynamic (see Figure 1). For the body frame, the X − Y plane is placed at the surface while the Z-axis is denoted by the right hand rule. The center of gravity (CoG) of the hexacopter is placed at the origin of the body frame. The body frame is transformed to inertia frame using rotation matrix in Equation (1).
where s denotes sin, c denotes cos, and ϕ, θ,ψ stand for Euler angles.
where s denotes sin, c denotes cos, and φ,θ, ψ stand for Euler angles. The hexacopter shown in Figure 1 includes three motors (1,3,4) where L is the arm length; are the torques and forces generated from th i motor; Ω i is the rotation speed; 1 U is the total thrust; 2 3 4 , , U U U are the torques in the directions φ,θ, ψ .
According to the Newton-Euler equation, the body dynamics is shown as [25]: where m is the mass of the hexacopter; ω is the angular velocity vector; g is the gravity; I is the inertia vector; r is the position in inertial frame; The hexacopter shown in Figure 1 includes three motors (1,3,4) rotating counterclockwise and three motors rotating clockwise. Four control inputs U 1 , U 2 , U 3 , and U 4 are defined as where L is the arm length; τ i = dΩ 2 i and F i = bΩ 2 i are the torques and forces generated from ith motor; Ω i is the rotation speed; U 1 is the total thrust; U 2 , U 3 , U 4 are the torques in the directions ϕ, θ, ψ.
According to the Newton-Euler equation, the body dynamics is shown as [25]: where m is the mass of the hexacopter; ω is the angular velocity vector; g is the gravity; I is the inertia vector; r is the position in inertial frame; Finally, the orientation and translation motion of the hexacopter can be derived as [26]  where Ω is the disturbance: Ω = Ω 3 + Ω 4 − Ω 1 − Ω 2 ; U 1 is the total thrust; U 2 , U 3 , U 4 are the torques in the directions ϕ, θ, ψ; I x , I y , I z are the moments of inertia of the hexacopter along the x, y, z axis; K ϕ , K θ , K ψ , K x , K y represent drag coefficients; J T is the inertia of each rotor. From Equation (4), the relationship between control variables and forces can be described by the allocation matrix T as:

Attitude Controller Design
The full control structure is shown in Figure 2. In this scheme, the disturbance-based sliding mode control method is proposed for attitude control and to handle disturbances, whereas the fault detection and isolation unit is used to detect fault occurrence. When the residuals from the fault detection unit exceed the threshold, the motor fault is isolated and then the allocation matrix is modified correspondingly to adopt the new geometry of the hexacopter.
where Ω is the disturbance: From Equation (4), the relationship between control variables and forces can be described by the allocation matrix T as:

Attitude Controller Design
The full control structure is shown in Figure 2. In this scheme, the disturbance-based sliding mode control method is proposed for attitude control and to handle disturbances, whereas the fault detection and isolation unit is used to detect fault occurrence. When the residuals from the fault detection unit exceed the threshold, the motor fault is isolated and then the allocation matrix is modified correspondingly to adopt the new geometry of the hexacopter.
as the state vector and control input vector, respectively. From Equation (4), each rotational movement equation has the following form: as the state vector and control input vector, respectively. From Equation (4), each rotational movement equation has the following form: The desired attitude is denoted as x d i . The control goal is to generate the control signal u i such that the hexacopter can track the desired attitude, i.e., The disturbance is assumed to be bounded and satisfied |d i | ≤ D i .

Assumption 3. The estimation error of disturbance is bounded by
According to [27], a nonlinear disturbance-based sliding mode control is proposed by whered i is the estimate of d i , z i is the observation auxiliary vector, δ i > 0 is the observer gain. The estimation error of disturbance is denoted as: From Assumption 2, the derivative of disturbance estimation error can be defined as: Denote the control error: The sliding surface is expressed by: where k i is the positive parameter.
Taking the derivative of sliding surface .
From Equations (7)- (9), . s i can be derived as Theorem 1. Consider the sliding surface is designed by Equation (11). Suppose that the following control law is implemented by Then the nonlinear system (Equation (6)) is stable and the control errors are forced to zero.

Proof of Theorem 1. Choose the Lyapunov function as follows [26]
Take the first derivative of the Lyapunov function Therefore, according to the control strategy (Equation (14)) and disturbance observer (Equation (9)), the closed-loop system can maintain stability when both actuator faults and external disturbances occur.

Remark 1.
With the proposed disturbance observer-based sliding mode control, the discontinuous control gain is decreased, and it is required to be larger than the bound of estimation error rather than that of disturbance.

Remark 2.
To handle the chattering issue due to the sign function from Equation (14), a saturation function is denoted as

Altitude Controller Design
A PID controller is applied to control the vertical movement of the hexacopter as follows .
where Z d are the desired altitude in the z directions, respectively; Z is actual value; and K pz , K dz , and K iz are the controller gains.

Fault Detection and Fault-Tolerant Control System
Fault detection consists of two modules: residual generation and residual validation. Residual generation is defined as the difference between system output and state observer. The information of residual generation is used for the residual validation module that determines fault-free or faulty case. When the output of residual validation module is in the faulty case, the fault isolation (FI) module is activated. The obtained FI information is used to determine the location of the fault, which is based on the magnitude and sign of residual validation module. Finally, the fault-tolerant control system aims to change the allocation matrix to hover and land the hexacopter.

Residual Generation
A nonlinear observer presented in [28] is applied for fault detection and isolation (FDI). Let us consider the following nonlinear model: . where are the state vector, control input vector, and the output vector; A, B, C are the system matrices; L 1 is the fault matrix; h(x(t), L 1 u(t)) is the nonlinear function.
From the state model in Equation (19), the following conditions are designed for a Thau observer [28]: If all conditions are satisfied, the Thau observer can be derived as [28]: z is the state observer vector;ŷ(t) is the observer output vector; K is the designed matrix and determined by The matrix P ε is achieved from the following equation where ε is a positive value such that P ε ≥ 0. The residuals are defined as the deviation between real output of system and state output:

Residual Validation
The residual validation module is used to detect the fault-free or faulty case of system, which is compared with upper or lower thresholds. The decision logic is determined as follows: Using this residual validation module, the fault isolation and fault-tolerant control methods will be designed in Section 4.3 to isolate the fault and to reconfigure the allocation matrix.

Fault Isolation and Fault-Tolerant Control
When residual validation of FD system detects the faulty case, the FI module is activated. To determine the location of the fault, the knowledge of residuals r 5 , r 6 , r 7 , r 8 should be used. The failure motor is isolated through the sign and magnitude of these residuals. The map of failure in one or two motors can be concluded in Tables 1 and 2, which depends on the sign and magnitude of residuals. In these Tables, the "Controllable" column means that the hexacopter can hover its position and make a landing mode during flight test. After the fault is isolated from the FI module, the allocation matrix is reconfigured correspondingly for fault accommodation.
Where f i is the fault occurring on motor i; the sign "−" denotes a normal negative value; the sign "+" denotes a normal positive value.

Experimental Setup
The fault-tolerant control, fault detection, and fault isolation methods in Sections 3 and 4 were tested on a DJI F550 platform [29]. These algorithms were developed on Pixhawk2 flight controller [30], which requires the C++ program for implementation [31]. The firmware version 3.5 was chosen for the flight controller. During testing, the faults were injected by limiting the pulse width modulation (PWM) [32] through a remote control that can switch to faulty mode from stabilize mode. The flight data were monitored using Mission Planner (MP) [33] software through Xbee wireless communication [34]. The fault detection data were achieved through a log file that is coded in C++ by the user. The experimental procedure is summarized in Figure 3. controller. During testing, the faults were injected by limiting the pulse width modulation (PWM) [32] through a remote control that can switch to faulty mode from stabilize mode. The flight data were monitored using Mission Planner (MP) [33] software through Xbee wireless communication [34]. The fault detection data were achieved through a log file that is coded in C++ by the user. The experimental procedure is summarized in Figure 3.

Results
To demonstrate the performance of the proposed control scheme, different simulation tests on a hexacopter are considered. The hexacopter parameters are shown in Table 3.

Results
To demonstrate the performance of the proposed control scheme, different simulation tests on a hexacopter are considered. The hexacopter parameters are shown in Table 3. The parameters of disturbance-based sliding mode control are chosen as: k i = 10, δ i = 3, i = 1, 2, 3. The parameters of fault detection scheme are chosen as: In scenario 1, partial loss effectiveness in actuator 2 is presented to verify the disturbance-based sliding mode control and residuals from Table 1. To show the fault detection and isolation effectiveness, scenarios 2, 3, and 4 show the case of one motor failure, two motor failure in sequence, or two motor failure simultaneously.

Partial Loss in Actuator 2
A 30% loss of control effectiveness in the actuator fault 2 is simulated. The hexacopter can hover at the altitude of 2 m and the fault occurs at t = 28 s. It can be seen in Figure 4 that the Euler angles can converge quickly to the desired angles after a fault occurrence due to the disturbance observer-based controller. Moreover, the actual altitude can also track the desired one after the fault occurrence.  The residuals are shown in Figure 5. Interestingly, the residuals are the same as those in the fault map presented in Table 1. Since the residuals do not exceed the thresholds, the attitude still uses the disturbance-based sliding mode control for accommodation without changing the allocation matrix. The output signals are illustrated in Figure 6. It should be noted that before the fault (up to t = 28 s), the six PWM signals are similar. After fault is injected in motor 2, the second PWM is decreased and then its value increases again to maintain the position of the hexacopter.
The experimental work can be found at https://www.youtube.com/watch?v=en-h_HwVh0k or in the Supplementary Materials.  The residuals are shown in Figure 5. Interestingly, the residuals are the same as those in the fault map presented in Table 1. Since the residuals do not exceed the thresholds, the attitude still uses the disturbance-based sliding mode control for accommodation without changing the allocation matrix.  The residuals are shown in Figure 5. Interestingly, the residuals are the same as those in the fault map presented in Table 1. Since the residuals do not exceed the thresholds, the attitude still uses the disturbance-based sliding mode control for accommodation without changing the allocation matrix. The output signals are illustrated in Figure 6. It should be noted that before the fault (up to t = 28 s), the six PWM signals are similar. After fault is injected in motor 2, the second PWM is decreased and then its value increases again to maintain the position of the hexacopter.
The experimental work can be found at https://www.youtube.com/watch?v=en-h_HwVh0k or in the Supplementary Materials.  The output signals are illustrated in Figure 6. It should be noted that before the fault (up to t = 28 s), the six PWM signals are similar. After fault is injected in motor 2, the second PWM is decreased and then its value increases again to maintain the position of the hexacopter.

Complete Loss in Actuator 4
In this test, complete failure is introduced to motor 4. The hexacopter is made to hover at the height of 2 m and the fault is injected at t = 47.8 s. As can be seen in Figure 7, the attitude angles can track the desired angles although the they have some small oscillations after a fault occurs. The residuals of system are presented in Figure 8. It is shown that when fault occurs, all signs of residuals are similar to those in Table 1 at the beginning and then they go back to the zero. Unlike previous case, the residuals here converge to the original point because the magnitude of residuals exceed the threshold and then the motor 4 is isolated after fault occurrence.

Complete Loss in Actuator 4
In this test, complete failure is introduced to motor 4. The hexacopter is made to hover at the height of 2 m and the fault is injected at t = 47.8 s. As can be seen in Figure 7, the attitude angles can track the desired angles although the they have some small oscillations after a fault occurs. The residuals of system are presented in Figure 8. It is shown that when fault occurs, all signs of residuals are similar to those in Table 1 at the beginning and then they go back to the zero. Unlike previous case, the residuals here converge to the original point because the magnitude of residuals exceed the threshold and then the motor 4 is isolated after fault occurrence.

Complete Loss in Actuator 4
In this test, complete failure is introduced to motor 4. The hexacopter is made to hover at the height of 2 m and the fault is injected at t = 47.8 s. As can be seen in Figure 7, the attitude angles can track the desired angles although the they have some small oscillations after a fault occurs. The residuals of system are presented in Figure 8. It is shown that when fault occurs, all signs of residuals are similar to those in Table 1 at the beginning and then they go back to the zero. Unlike previous case, the residuals here converge to the original point because the magnitude of residuals exceed the threshold and then the motor 4 is isolated after fault occurrence.  The detection unit of motors 2 and 4 is presented in Figure 9. It is clear that only motor 4 is detected from the FD unit. Figure 10 shows the corresponding output signals. It shows that the PWM of motor 4 has a minimum value due to fault injection. The other PWMs are changed correspondingly to maintain the position of hexacopter because the motor 4 is isolated from the allocation matrix.
The experimental work can be found at https://www.youtube.com/watch?v=rSSoVS4nDaE or in the Supplementary Materials.  The detection unit of motors 2 and 4 is presented in Figure 9. It is clear that only motor 4 is detected from the FD unit. Figure 10 shows the corresponding output signals. It shows that the PWM of motor 4 has a minimum value due to fault injection. The other PWMs are changed correspondingly to maintain the position of hexacopter because the motor 4 is isolated from the allocation matrix. The detection unit of motors 2 and 4 is presented in Figure 9. It is clear that only motor 4 is detected from the FD unit. Figure 10 shows the corresponding output signals. It shows that the PWM of motor 4 has a minimum value due to fault injection. The other PWMs are changed correspondingly to maintain the position of hexacopter because the motor 4 is isolated from the allocation matrix.
The experimental work can be found at https://www.youtube.com/watch?v=rSSoVS4nDaE or in the Supplementary Materials.

Complete Loss of Two Motors in Sequence
In this test, the faults are injected into motors 4 and 2 at 48 and 54.5 s, respectively. The hexacopter is made to hover at the height of 1.35 m. As can be seen in Figure 11, the attitude angles can track the desired angles although the they have some small oscillations after faults occur in motors 4 and 2. The residuals of system are presented in Figure 12. Unlike the case in Section 5.2.2, after the fault occurs in motor 4, the system can still detect and isolate the fault of motor 2. The experimental work can be found at https://www.youtube.com/watch?v=rSSoVS4nDaE or in the Supplementary Materials.

Complete Loss of Two Motors in Sequence
In this test, the faults are injected into motors 4 and 2 at 48 and 54.5 s, respectively. The hexacopter is made to hover at the height of 1.35 m. As can be seen in Figure 11, the attitude angles can track the desired angles although the they have some small oscillations after faults occur in motors 4 and 2. The residuals of system are presented in Figure 12. Unlike the case in Section 5.2.2, after the fault occurs in motor 4, the system can still detect and isolate the fault of motor 2.

Complete Loss of Two Motors in Sequence
In this test, the faults are injected into motors 4 and 2 at 48 and 54.5 s, respectively. The hexacopter is made to hover at the height of 1.35 m. As can be seen in Figure 11, the attitude angles can track the desired angles although the they have some small oscillations after faults occur in motors 4 and 2. The residuals of system are presented in Figure 12. Unlike the case in Section 5.2.2, after the fault occurs in motor 4, the system can still detect and isolate the fault of motor 2.

Complete Loss in Two Motors at the Same Time
In this scenario, the faults are injected to motors 2 and 4 at the same time. The hexacopter is made to hover at the height of 2 m and the fault occur at 44 s. As can be seen in Figure 15, the attitude angles can track the desired angles although the they have some oscillations after faults occur in motors 4 and 2. The residuals of system are presented in Figure 16. It is shown that when a fault occurs, all signs of the residuals are similar to those in Table 1 at the beginning and then they converge to zero. This convergence is because the residuals exceed the threshold values and two motor failures are isolated.

Complete Loss in Two Motors at the Same Time
In this scenario, the faults are injected to motors 2 and 4 at the same time. The hexacopter is made to hover at the height of 2 m and the fault occur at 44 s. As can be seen in Figure 15, the attitude angles can track the desired angles although the they have some oscillations after faults occur in motors 4 and 2. The residuals of system are presented in Figure 16. It is shown that when a fault occurs, all signs of the residuals are similar to those in Table 1 at the beginning and then they converge to zero. This convergence is because the residuals exceed the threshold values and two motor failures are isolated.

Complete Loss in Two Motors at the Same Time
In this scenario, the faults are injected to motors 2 and 4 at the same time. The hexacopter is made to hover at the height of 2 m and the fault occur at 44 s. As can be seen in Figure 15, the attitude angles can track the desired angles although the they have some oscillations after faults occur in motors 4 and 2. The residuals of system are presented in Figure 16. It is shown that when a fault occurs, all signs of the residuals are similar to those in Table 1 at the beginning and then they converge to zero. This convergence is because the residuals exceed the threshold values and two motor failures are isolated.  Figure 17 shows the detection unit of system. It is clear that the faults in motors 4 and 2 are detected from the FD unit at the same time because their residuals' magnitudes exceed the threshold values. Figure  18 shows the corresponding output signals. It shows that the PWMs of motors 4 and 2 have minimum values due to fault injections. The other PWMs are changed correspondingly to maintain the position of the hexacopter because motors 4 and 2 are isolated from the allocation matrix.
The experimental work can be found at https://www.youtube.com/watch?v=uZuG44NqL8s or in the Supplementary Materials.   Figure 17 shows the detection unit of system. It is clear that the faults in motors 4 and 2 are detected from the FD unit at the same time because their residuals' magnitudes exceed the threshold values. Figure 18 shows the corresponding output signals. It shows that the PWMs of motors 4 and 2 have minimum values due to fault injections. The other PWMs are changed correspondingly to maintain the position of the hexacopter because motors 4 and 2 are isolated from the allocation matrix.  Figure 17 shows the detection unit of system. It is clear that the faults in motors 4 and 2 are detected from the FD unit at the same time because their residuals' magnitudes exceed the threshold values. Figure  18 shows the corresponding output signals. It shows that the PWMs of motors 4 and 2 have minimum values due to fault injections. The other PWMs are changed correspondingly to maintain the position of the hexacopter because motors 4 and 2 are isolated from the allocation matrix.
The experimental work can be found at https://www.youtube.com/watch?v=uZuG44NqL8s or in the Supplementary Materials.

Remark 3.
In this research, two motor failures are presented. It should be mentioned that the total thrust generated from remaining motors should be larger than the gravity force of the hexacopter. Therefore, users should choose suitable motors and hexacopter masses for safety purposes.

Remark 4.
Some previous studies assume that the location of fault is known, and they only focus on faulttolerant control design to handle fault. In comparison with previous studies, our research can maintain the hexacopter up to two motor failures in presence of disturbances with two scenarios: sequential faults and simultaneous faults. We believe that our research could be innovative in commercial software of the Pixhawk2 flight controller.

Remark 5.
In several flight tests on the Pixhawk2 flight controller, the hexacopter crashed because it lacks the fault detection and fault-tolerant control algorithm. Therefore, it is difficult to gather data of the Pixhawk2 flight controller for comparison.

Remark 6.
Consider the frames that have more than six motors, the fault detection and fault-tolerant control schemes are more complex, which is out of scope of this research and will be investigated in further research.

Conclusion
In this paper, the dynamic model of a hexacopter was explored with regard to disturbances and actuator faults. A fault detection based on a Thau observer was applied to monitor the location of one or two rotor failures. When the residuals exceeded the threshold values, the motor failure was isolated and then allocation matrix was changed. The results show that the proposed fault detection and isolation can be used to reconfigure the geometry of a hexacopter, hence making a safe flight when a fault occurs. Compared with previous studies, this research is innovative in several ways. First, the fault detection is integrated into fault-tolerant control as a single unit. Second, with the proposed disturbance observerbased sliding mode control, the discontinuous control gain is reduced, and it is required to be larger than the bound of estimation error rather than that of disturbance. Finally, the experimental works show that the hexacopter can handle complete fault in two cases: sequential fault and simultaneous fault. However, this study may not cover all cases of one motor or two motor failures. This limitation can be addressed The experimental work can be found at https://www.youtube.com/watch?v=uZuG44NqL8s or in the Supplementary Materials.

Remark 3.
In this research, two motor failures are presented. It should be mentioned that the total thrust generated from remaining motors should be larger than the gravity force of the hexacopter. Therefore, users should choose suitable motors and hexacopter masses for safety purposes.

Remark 4.
Some previous studies assume that the location of fault is known, and they only focus on fault-tolerant control design to handle fault. In comparison with previous studies, our research can maintain the hexacopter up to two motor failures in presence of disturbances with two scenarios: sequential faults and simultaneous faults. We believe that our research could be innovative in commercial software of the Pixhawk2 flight controller.

Remark 5.
In several flight tests on the Pixhawk2 flight controller, the hexacopter crashed because it lacks the fault detection and fault-tolerant control algorithm. Therefore, it is difficult to gather data of the Pixhawk2 flight controller for comparison.

Remark 6.
Consider the frames that have more than six motors, the fault detection and fault-tolerant control schemes are more complex, which is out of scope of this research and will be investigated in further research.

Conclusions
In this paper, the dynamic model of a hexacopter was explored with regard to disturbances and actuator faults. A fault detection based on a Thau observer was applied to monitor the location of one or two rotor failures. When the residuals exceeded the threshold values, the motor failure was isolated and then allocation matrix was changed. The results show that the proposed fault detection and isolation can be used to reconfigure the geometry of a hexacopter, hence making a safe flight when a fault occurs. Compared with previous studies, this research is innovative in several ways. First, the fault detection is integrated into fault-tolerant control as a single unit. Second, with the proposed disturbance observer-based sliding mode control, the discontinuous control gain is reduced, and it is required to be larger than the bound of estimation error rather than that of disturbance. Finally, the experimental works show that the hexacopter can handle complete fault in two cases: sequential fault and simultaneous fault. However, this study may not cover all cases of one motor or two motor failures. This limitation can be addressed by rotation of the coordinates or scarifying the yaw control. Future work should consider this problem and propose a suitable method for implementation. Funding: The authors would like to thank the organizations that provided funding for this work.