Fault Tolerant Control Algorithm of Hexarotor UAV

As the best representative of the current cutting-edge technology, unmanned aerial vehicle (UAV) is widely used in various fields such as electric power inspection, agriculture, forestry and plant protection, fire rescue, and film and television shooting. With the rapid development of UAV, the safety work of UAV has becomemore important. In order to improve the safety of hexarotor UAV during flight, a fault-tolerant control scheme independent of basic control law and control distribution is designed in this paper. Firstly, the linear active disturbance rejection control (LADRC) was used as the basic control law for attitude control of hexarotor UAV. Secondly, in the case of actuator failure of hexarotor UAV, a fault observer was used to estimate fault information accurately. -en, on this basis, the control distribution matrix was adjusted to reduce the use of the faulty motor, and the purpose of fault-tolerant control was achieved. Finally, simulation experiments and actual flight experiments were carried out to verify the effectiveness of the proposed scheme. Experimental results show that the proposed scheme can improve the robustness of the control system and the flight safety of UAV.


Introduction
In recent years, with the continuous progress of science and technology, unmanned aerial vehicles (UAVs) have also made rapid development, especially in the field of multirotor UAV. Multirotor UAV is an aircraft equipped with airborne equipment such as data processing and transmission systems, sensors, automatic control systems, and communication systems. It can perform certain steady-state control and flight and has certain autonomous flight capabilities [1]. Multirotor aircrafts have been widely used in agriculture, forestry, plant protection, power inspection, logistics, and transportation, which have greatly facilitated people's production and life. Among them, the quadrotor UAV and the hexarotor UAV occupy a large proportion. However, due to the lack of redundancy of the rotor components of the quadrotor UAV, once the transmission failure occurs, the flight attitude changes abruptly, which will cause inestimable consequences in some application areas. As for the hexarotor UAV, due to the redundant actuators in the system, the optimized control algorithm can enable the hexarotor UAV to have good fault tolerance, greater load capacity, and higher stability, so as to complete more complex tasks. erefore, it is of great significance to study the fault-tolerant control of the hexarotor UAV. e hexarotor UAV has the characteristics of high nonlinearity, strong coupling, and difficulty in modeling. To study the fault-tolerant control of the hexarotor UAV, it is necessary to choose a basic control law with certain robustness. Chen et al. [2] proposed a UAV control system based on the integral sliding mode, and the control system has certain immunity. Ma [3] designed a UAV control system based on the active disturbance rejection controller and realized the attitude control of the UAV through the active disturbance rejection control (ADRC). As the ADRC controller does not rely on the precise mathematical model of the controlled object and is easy to implement, the control system is robust.
Next, equally important is the fault-tolerant control. Cao et al. [4] took the missile as the research object and designed a fault-tolerant control of the actuator based on compensation. Wang and Ni [5] proposed a fault diagnosis method of the actuator based on an adaptive observer, which provided relatively accurate fault information for fault-tolerant control. Nguyen and Hong [6] proposed a conventional adaptive sliding mode control method for chattering and system uncertainty to realize fault-tolerant control of UAV. In [7], a hardware circuit is designed to estimate the actuator fault for the hexarotor UAV. Finally, the control distribution matrix is calculated for different types of actuator fault, and the fault-tolerant control is realized.
Based on the above analysis, this paper takes the "X" hexarotor UAV as the research object and proposes a faulttolerant control scheme for the hexarotor UAV based on control distribution. e rest of this work is structured as follows: In Section 2, some related works on hexarotor UAV fault-tolerant control strategies are presented. In order to carry out simulation experiments, we have established mathematical models of the hexarotor UAV under normal conditions and fault conditions. en, Section 3 provides some technical details about the UAV used to deploy our proposal, highlighting the basic control law based on linear active disturbance control (LADRC) and fault-tolerant control law based on control distribution. e main results are then presented in Section 4, which are the results of simulation experiments and actual flight experiments. Finally, Section 5 concludes this work and refers to future works.

UAV Modeling Normal Condition.
e kinematics and dynamics models of the "X" hexarotor UAV were established under normal conditions. e simplified structure of "X" hexarotor UAV is shown in Figure 1. Since the flight environment and movement mode of the hexarotor UAV are relatively complex, the following assumptions are made to simplify the modeling work for the convenience of analysis [8]: (1) Assume that the mass of the hexarotor UAV is uniform, and the structure center of the hexarotor UAV is its centroid (2) It is assumed that the hexarotor UAV is a rigid body, that is, its basic structure and propeller will not deform during flight (3) It is assumed that the effects of the rotation and revolution of the Earth are not considered (4) Hexarotor UAVs fly at low speeds, so the effect of air resistance is ignored (5) Ignoring the gyro effect of the hexarotor 2.1.1. Dynamic Model. First of all, the coordinate system, pitch angle, roll angle, and yaw angle are defined. As shown in Figure 1(b), the x-axis of the body coordinate system points to the forward direction of the aircraft through the center of gravity of the body, the y-axis points to the left wing of the body through the center of gravity of the body, and the z-axis passes through the center of gravity of the aircraft, perpendicular to the x-axis and y-axis, pointing to the top of the aircraft. e geodetic coordinate system is parallel to the geodetic horizontal plane pointing to the north, the y-axis is parallel to the geodetic horizontal plane pointing to the west, and the z-axis is perpendicular to the geodetic horizontal plane pointing upward.
Pitch (θ): the angle between the x-axis of the body coordinate system and the geodetic horizontal plane is positively downward. Roll (φ): the angle between the z-axis of the body coordinate system and the geodetic vertical plane passing through the x-axis of the body coordinate system. When the plane flies to the right, the roll angle is positive. Yaw (ψ): the angle between the x-axis of the body coordinate system between the projection on the geodetic horizontal plane and the x-axis in the geodetic coordinate system. e yaw angle is positive when the nose turns left. e hexarotor UAV has 4 control channels, a roll angle control channel, a pitch angle control channel, a yaw angle control channel, and an altitude channel. e deflection of the three attitude angles of the UAV is caused by the combined external torque, as reported in [9]. e lift generated by each rotor is proportional to the square of its angular velocity: where b is the lift coefficient and Ω i is the angular velocity of six motors. e structure of the hexarotor UAV used in this paper is shown in Figure 1(a). e included angle between the rotors is 60°. erefore, its roll, pitch, and yaw torques can be obtained separately.
Roll torque can be expressed as where l is the distance between the center of rotors on the diagonal. In equation (2), cos 60°is equal to 1/2, representing the torque component of motors 1, 2, 4, and 5 on the x-axis in the frame of the body.
Pitch torque can be expressed as In equation (3), sin 60°is equal to � 3 √ /2, representing the torque component of motors 1, 2, 4, and 5 on the y-axis in the frame of the body.
Yaw torque can be expressed as where d is the reverse torque coefficient. From what has been discussed above, roll, pitch, and yaw torques can be expressed as 2 Journal of Robotics Equation (5) is the external closing torque of the hexarotor UAV. In equation (5), U R , U P , and U Y are roll torque, pitch torque and yaw torque, respectively.
From equation (5), we can get the following formula: e torque balance experienced by the hexarotor UAV can be expressed as Newton-Euler's formula as follows: According to equations (5) and (7), it can be obtained that where I is the torque of inertia of the hexarotor UAV about the triaxial axis of its carrier coordinate system, ω is the triaxial angular velocity of the hexarotor UAV about the carrier coordinate system, and V is the controlled quantity of three channels of roll, pitch, and yaw the amount. Because the hexarotor UAV generally only performs small-angle motion, the Euler angle generated by the moment during flight is small, so the Euler angular velocity of the fuselage is approximately equal to the angular velocity of the fuselage coordinate system [10], that is, In summary, the dynamic model of a hexarotor UAV can be expressed as

Kinematic
Model. e main forces of the hexarotor UAV include the gravity of the aircraft itself and the lift generated by the rotation of each propeller. e combined direction of the six lifts is perpendicular to the surface of the propeller disc and opposite to gravity. erefore, the total lift of the hexarotor UAV is From Newton's second law of motion, F � ma, the kinematic model of the hexarotor UAV can be obtained as  Figure 1: Information of the "X" hexarotor UAV: (a) simplified structure of the "X" hexarotor UAV and (b) coordinate system of the "X" hexarotor UAV.
Journal of Robotics 3 P � x y z T is the position vector of the UAV in the geodetic coordinate system, € P is the position acceleration vector of the UAV in the geodetic coordinate system, F g is the triaxial gravity component of the hexarotor UAV in the geodetic coordinate system, and R e b is attitude conversion matrix from the geodetic coordinate system to the body coordinate system. ere are three main kinds of attitude calculation algorithms that are widely used nowadays: the quaternion method, Euler angles, and rotation matrix method [11,12]. e quaternion method is most widely used in the field of engineering. Its calculation is relatively small, and this method is also used in the UAV attitude calculation.
F � 0 0 U T T is the total lift force of all rotors of the hexarotor UAV.
In summary, the kinematic model of a hexarotor UAV can be expressed as e mathematical model of a hexarotor UAV under normal conditions can be summarized by equations (10) and (14):

UAV Modeling under Fault Condition.
e main fault types of the UAV are rotor fault, motor fault, sensor fault, control signal loss, and so on. Among them, rotor fault and motor fault are collectively referred to as actuator fault. Actuator fault is common and most important for UAV flight safety, so this paper mainly discusses the actuator fault of the hexarotor UAV.
When the hexarotor UAV is flying normally, the force efficiency of the actuator is 100%. When the actuator fails, the force efficiency of the UAV actuator is k. When k � 0, the actuator of the hexarotor UAV fails completely, and the efficiency is 0. When k � 1, the hexarotor UAV is faultless and flying normally. When 0 < k < 1, the actuator of the hexarotor UAV partly fails, and the output is insufficient.
Take the motor fault as an example. Suppose motor No. 1 is faulty. Ω i is the speed output of motor No. 1 without fault, which is constant, and Ω f i is the speed output of motor No. 1 with fault. en, the mathematical expression of the motor fault is e lift and counter torque generated by the faulty motor at this time can be obtained as follows: where F f i is the lift generated by the faulty motor at this time and Q f i is the counter torque generated at this time. At this point, the torque balance equation is where ω f is the triaxial acceleration of the UAV under fault state and V f is the input torque matrix of the UAV under the fault state. When the actuator of the hexarotor UAV fails, it can be converted into the loss of control input of four channels including roll, pitch, yaw, and altitude [13].
en, the mathematical model of the hexarotor UAV under the fault state is as follows: Journal of Robotics where f Z , f R , f P , and f Y are the control losses of the altitude, roll, pitch, and yaw channels.

Control Law Design
e control law design is mainly divided into two parts: basic control law design and fault-tolerant control law design. ese two parts are designed independently, which greatly simplify the fault-tolerant control process of UAV.

Basic Control Law Design.
e core of ensuring the stable flight of a hexarotor UAV under normal circumstances is to design a basic control law with certain robustness. As linear active disturbance control (LADRC) has the characteristics of not relying on the precise mathematical model of the controlled object and is easy to implement, this paper adopts the improved attitude control algorithm of LADRC to control the flight of UAV, so as to ensure the robustness of UAV in the flight process. e LADRC controller is mainly divided into two parts: the transition process-tracking differentiator (TD) and a linear extended state observer (LESO).
Firstly, this paper introduces the transition process. In LADRC, we use a second-order isovolumetric link instead of the tracking differentiator as the transition process. In PID control, when the input of the system is a step signal, the input "jumps." However, the output of the system is dynamic inertia and cannot jump, so a transition process is arranged to convert the input from a jump to a slow change.
erefore, the second-order isovolumetric link can fully meet the requirements of the transition process, effectively solving the contradiction between "fastness" and "overshooting" of the PID controller. e commonly used second-order link is shown in equation (20). In the equation, T can be 1/50∼1/10 of the expected transition time.
Secondly, this paper introduces the LESO [14]. is is the core part of the LADRC, which can track the variables of the system in real time.
Generally, when ignoring the higher-order characteristics of a linear controlled object, its mathematical model is as follows: e above formula can be transformed into where u is the input, y is the output, w is the external disturbance, a 1 and a 2 are the system parameters, and b is the control gain, b ≈ b 0 . e state space equation of the system is established to realize the real-time tracking of variables in the model: where x 1 , x 2 and x 3 are the state variables of the system, h � f(y, _ y, w). e linear extended state observer can be established as follows: By selecting the appropriate observer gain, β 1 , β 2 , and β 3 , the linearly expanded state observer can achieve realtime tracking of each variable in the system, thus ensuring the stability of attitude control.

Tolerant-Control Law Design.
Based on Section 2.2, the mathematical model of the hexarotor UAV is summarized. Based on this, this paper designs a fault-tolerant control law to ensure the stable flight of the hexarotor UAV when the actuator fails. e idea of controlling distribution is as follows: Given the virtual control amount (torque), the actual input (motor speed) of each actuator is obtained through mapping to obtain the desired output. Figure 2 shows the basic structure of control distribution.
In Figure 2, R is the input of the entire control loop, which is the desired attitude we need; V is the virtual control amount, that is, roll, pitch, and yaw torque; and y is the output of the entire control loop.
According to Section 2.1, the control efficiency matrix A of the hexarotor UAV under normal conditions can be obtained, which is determined by the hardware mechanical structure of the hexarotor UAV, mainly by the wheelbase, lift Journal of Robotics 5 coefficient, antitorque coefficient, and the included angle between the axes, V � AΩ 2 . According to equation (6), For the quadrotor UAV, the control distribution matrix under normal circumstances can be obtained by simply inverting the control efficiency matrix. However, for a hexarotor UAV, the control efficiency matrix A is nonsingular, and the control assignment matrix of the hexarotor UAV cannot be obtained directly by inversion. erefore, we obtain the normal control distribution matrix N of the hexarotor UAV by finding the pseudo-inverse, N ∈ R 6×3 .  Under normal fault-free conditions, the hexarotor UAV distributes the desired torque proportionally to the six motors through the control distribution matrix N. Upon the failure of the actuator, due to the insufficient output of the faulty motor, the torque required for flight cannot be achieved by using the normal pseudo-inverse control distribution method.
According to the obtained fault matrix, we need to use the pseudo-inverse weighting control algorithm to reduce the use of the fault motor and redistribute the remaining motor to compensate the control quantity which is lost due to the insufficient output of a motor. At this time, where K � diag k 1 , k 2 , . . . , k 6 is the fault matrix, 0 ≤ k i ≤ 1.
We set the weighted matrix as W. If the fault matrix K is known, the control distribution matrix can be adjusted as  Due to the limitation of experimental conditions, the laboratory does not have some structural parameters. erefore, the aerodynamic parameters such as the moment of inertia of the six-rotor drone involved in the simulation experiments in this paper mainly come from pertinent literature [15], lift coefficient, and antitorque coefficient given by the merchant. e main parameters are the mass of the  Journal of Robotics hexarotor UAV, the distance between the center of the rotor and center of the mass, the lift coefficient, the antitorque coefficient, and the moment of inertia of the UAV when it moves around three axes. We set the mass of UAV as m � 5 kg, the distance between the center of the rotor and the center of the mass as l � 0.45 m, the gravitational acceleration as g � 9.8 N/kg, the lift coefficient as b � 0.0000542 N · s 2 , and the antitorque as D � 0.0000011 N · ms 2 . e moment of inertia of the hexarotor UAV built in this paper is shown in Table 1.

Results and Discussion
In this experiment, it is assumed that the initial values of roll angle, pitch angle, and yaw angle are 0°, and the three expected attitude angles set are (15°, 15°, and 15°). If motor No. 1 fails and fails 50% and 70% of the time, the simulation test is conducted to verify whether the fault-tolerant control law can stabilize the expected value set by tracking.    Due to experimental conditions, this paper simulates motor failure by cutting off the rotor.
A simple hexarotor UAV propeller lift test is shown in Figure 9. e middle of the device consists of the remote control receiver, and one side consists of the propeller and the motor. By fixing the position of the throttle stick of the remote control and comparing the propeller lift without failure, the lift of the faulty propeller is obtained. After several experimental tests, the average value was obtained to obtain the power effect of the damaged propeller. Figure 10 shows the flight experiment diagram when the propeller force effect is 50%. Instructions such as   take-off, hover, and attitude angle change are sent to the UAV through the remote control to observe the attitude change during the flight of the UAV, and then the flight data are analyzed through the MAVLINK flash log in the Mission Planner Earth station. In the Mission Planner ground station, the effect of the fault-tolerant control algorithm was verified mainly through the comparison between the expected attitude angle and the real-time attitude angle, as well as the oscillation degree of IMU and other sensors. Figures 11-13 are the actual following curves of the three attitude angles when the propeller power efficiency is 50%. In these figures, the red curves represent the desired attitude angle, and the green curves represent the real-time attitude angle of the hexarotor UAV. It can be seen from the figures that the hexarotor UAV can still track the changes of the 3 attitude angles well, and the vibration is small during flight. Figure 14 shows the flight experiment diagram when the propeller force effect is 30%. Figures 15-17 are the actual following curves of the three attitude angles when the propeller power efficiency is 30%. In these figures, the red curves represent the desired attitude angle, and the green curves represent the real-time attitude angle of the hexarotor UAV. It can be seen from the figures that the hexarotor UAV can also track the changes of the 3 attitude angles well, and the vibration is small during flight.
Finally, on the basis of the above experimental analysis, it is verified whether the fault-tolerant control scheme can still keep the six-rotor UAV stable after the complete removal of a propeller. Figure 18 shows the flight experiment.  Figures 19-21 are the actual following curves of the three attitude angles when the propeller power efficiency is 0%. In these figures, the red curves represent the desired attitude angle, and the green curves represent the real-time attitude angle of the hexarotor UAV. It can be seen from the figures that the tracking effect of the UAV is not good during take-off and landing, and the actual attitude angle deviates from the expected attitude angle. However, in the process of flight, the UAV can better track the change of the attitude angle.

Conclusions
Compared with the quadrotor, the hexarotor unmanned aerial vehicle (UAV) has redundant actuators and a larger load capacity, so it has a stronger anti-interference ability, higher safety, and is able to adapt to more severe flight environment and complete more complex tasks. erefore, this paper takes the hexarotor UAV as the experimental platform to carry out a series of research works. In this paper, the fault-tolerant control technology of the hexarotor UAV in the case of actuator failure is studied, and the fault-tolerant control method is verified by MATLAB simulation and actual flight experiments. is paper mainly completed the following work: (1) Firstly, this paper studied and established the dynamic and kinematic model of the UAV without fault, which laid a foundation for the attitude control experiment of the UAV. As future work, it is planned to improve the accuracy of the established mathematical models. Furthermore, the fault-tolerant control algorithm will be improved to make it more effective when the UAV takes off and lands.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.