A Fuzzy Backstepping Attitude Control Based on an Extended State Observer for a Tilt-Rotor UAV

: In order to overcome the inﬂuence of internal and external disturbances caused by rotor tilt motion and gust disturbance on the full ﬂight mode control of a tilt-rotor unmanned aerial vehicle (UAV), a design method using fuzzy backstepping control based on an extended-state observer (FBS-ESO) is proposed. In this paper, fuzzy control is used to tune the parameters of the backstepping control law online, and the extended-state observer estimates the total disturbance of the controlled system to improve the controller’s robustness and anti-disturbance capability. This paper designs the attitude control system of a tilt-rotor UAV based on an FBS-ESO controller. The control performance of the FBS-ESO controller is tested in a hardware-in-loop simulation of the attitude control system. The simulation results show that changing the rotor tilt angle will destroy the stability of the traditional backstepping controller and active disturbance rejection controller (ADRC). In contrast, the FBS-ESO controller maintains good control performance. In addition, the performance of the FBS-ESO controller is not be signiﬁcantly affected by adding external gust disturbance or changing the UAV parameters in the simulation. These disturbances signiﬁcantly impact the traditional backstepping controller and ADRC. Therefore, the FBS-ESO controller has better anti-disturbance capabilities and robustness, as well as higher attitude control accuracy.


Introduction
An unmanned aerial vehicle (UAV) has many advantages: low cost, low loss, zero casualties, reusability, and high mobility [1][2][3]. Therefore, UAVs are widely used in military, civil, and scientific research. Compared with a fixed-wing UAV, a tilt-rotor UAV has unique vertical takeoff and landing characteristics, hovering capabilities, and maneuverability during flight, and so tilt-rotor UAVs have broader application prospects [4,5]. A tilt-rotor UAV has three flight modes: fixed-wing, transition flight, and helicopter. The aerodynamic characteristics of each mode are very different, and the nonlinearity and coupling are severe. Especially in the transition mode, with the tilt movement of the rotor, a UAV is in a variant process, and the structure and aerodynamics change significantly. Moreover, the coupling between the helicopter and the fixed-wing manipulation mechanisms is complex. The use of a traditional flight control system is challenging for realizing the stable control of the full flight mode of a tilt-rotor UAV [6][7][8]. Therefore, the realization of the full flight mode control of a tilt-rotor UAV is one of the research priorities in the academic community.
Researchers have proposed many flight control design methods for tilt-rotor UAVs. For example, using linear control, Papachristos et al. [9] designed a proportional integral derivative (PID) controller based on a transfer function for the pitch, roll, and yaw control loops. They analyzed the control performance using the root locus method and Bode diagram. The effectiveness of the PID controller was tested with a hovering experiment control system for a tilt-rotor UAV. The simulation and flight tests showed that the ADRC could effectively estimate and overcome the influence of the total disturbance of a tilt-rotor UAV. However, the state error nonlinear control law (SENCL) in the ADRC controller had a weak dynamic performance and poor rapidity [28]. The backstepping control had better dynamics and rapidity, which could compensate for the defects of SENCL [29,30]. Therefore, this paper absorbs the idea of an ESO in ADRC and proposes a fuzzy backstepping control based on an ESO (FBS-ESO). The disturbance of the external environment and the aerodynamic coupling between the rotor/wing and other components can be classified as external disturbance, according to the disturbance characteristics. The changes in its structural parameters caused by rotor tilt motion can be classified as an internal disturbance. The backstepping method designs a control law compensating for the internal and external total disturbances. An ESO is used to estimate the unknown total disturbances to realize the compensation of the control law. Fuzzy control can adaptively adjust the parameters of the backstepping control law online to improve the robustness of the controller. The FBS-ESO controller has the advantages of a simple design, easy implementation, and excellent control performance. An FBS-ESO controller can effectively overcome the influences of internal and external disturbances and meet the attitude control requirements of a tilt-rotor UAV in full flight mode.
The rest of this paper is arranged as follows: the second section describes the design of the FBS-ESO controller of the second-order nonlinear system. The third section describes the design of the attitude control system based on the FBS-ESO controller. In the fourth section, the attitude control hardware-in-loop simulation of the tilt-rotor UAV is described to prove the effectiveness of the FBS-ESO control method proposed in this paper. Finally, the fifth section draws the conclusions for this paper.

Second-Order Nonlinear Expansion System
The second-order nonlinear uncertain plant including internal and external disturbances is as follows: where u and y are the input and output signals, f (x, w, t) is a nonlinear function with an unknown disturbance, and b(t) is an unknown function. If we let x 3 = f (x, w, t) + (b(t) − b 0 )u represent the new expanded-state variable, x 3 contains an internal disturbance and an external disturbance, b 0 is a constant, and .
x 3 = g(t), then system (1) becomes an extended system with three state variables, as follows: (2)

Fuzzy Backstepping Control Law
The errors between the output of system (2) and the target state (command signal x g ) are: .
x g .
To make the system meet the Lyapunov stable, it is required that . V 2 ≤ 0, and the design control law is: Then, when c 1 = c 2 = η 2 , c 2 > 0, and If we integrate 1 then The formula V 2 (t) = e 1 2 2 + e 2 2 2 , V 2 (t) converges exponentially, and so when t → ∞ , e 1 → 0, e 2 → 0 , and when e 2 = x 2 + c 1 e 1 − . x g , then x 2 → . x g . Thus, it is ensured that the system state quantities x 1 andx 2 can quickly track the command signals x g and .
x g . In the formula c 1 = c 2 = η 2 , for the backstepping control law (8), two parameters η and b 0 need to be adjusted, and η and b 0 affect the dynamics and stability of the control system, respectively. At the same time, with the change in the flight state and the external environment of the tilt-rotor UAV, the fixed η and b 0 cannot meet the control requirements, resulting in a decline in control performance. Therefore, according to the variation in error e 1 and e 2 , this paper adopts fuzzy control to adjust η and b 0 online automatically so that the controller can adapt to the variations in flight environment and disturbance. The operation process of the fuzzy control is shown in Figure 1. The input of the controller is e 1 and e 2 and the output is the adjustment ∆η and ∆b 0 of η and b 0 . Firstly, e 1 , e 2 , ∆η, and ∆b 0 are fuzzification, and then the fuzzy parameters of ∆η and ∆b 0 are obtained by fuzzy reasoning, according to fuzzy rules. Finally, the actual values of ∆η and ∆b 0 are obtained by ambiguity resolution.
Aerospace 2022, 9,724 5 of 17 controller is and and the output is the adjustment Δ and Δ of and . Firstly, , , Δ , and Δ are fuzzification, and then the fuzzy parameters of Δ and Δ are obtained by fuzzy reasoning, according to fuzzy rules. Finally, the actual values of Δ and Δ are obtained by ambiguity resolution. The and of the backstepping control law are: (1) Fuzzy Rules  (2) Fuzzy Reasoning According to the parameter tuning method of the backstepping controller, the fuzzy rules of Δ andΔ are formulated as shown in Tables 1 and 2.  The η andb 0 of the backstepping control law are: (1) Fuzzy Rules The input and output variables of the fuzzy controller are defined as five fuzzy levels in their respective domains: negative big (NB), negative small (NS), zero (Zo), positive small (PS), and positive big (PB). The membership function is triangular, as shown in Figure 2.
(2) Fuzzy Reasoning controller is and and the output is the adjustment Δ and Δ of and . Firstly, , , Δ , and Δ are fuzzification, and then the fuzzy parameters of Δ and Δ are obtained by fuzzy reasoning, according to fuzzy rules. Finally, the actual values of Δ and Δ are obtained by ambiguity resolution. The and of the backstepping control law are: (1) Fuzzy Rules The  (2) Fuzzy Reasoning According to the parameter tuning method of the backstepping controller, the fuzzy rules of Δ andΔ are formulated as shown in Tables 1 and 2.  According to the parameter tuning method of the backstepping controller, the fuzzy rules of ∆η and∆b 0 are formulated as shown in Tables 1 and 2. (3) Ambiguity Resolution  The membership of ∆η and∆b 0 under the current input value can be obtained using fuzzy rules. The center of gravity method is used to calculate ∆η and ∆b 0 in the domain, that is: where S i , g i , and N are the membership, fuzzy quantitative value, and fuzzy level, respectively.

Extended State Observer
The control law (8) needs to solve the unknown total disturbance x 3 . The effective solution is to design an extended-state observer to obtain the control law variables by estimating the state variables and the extended total disturbance.
The extended-state observer of the second-order system (2) is [20]: where λ i (i = 1, 2) and β i (i = 1,2,3) are the gain coefficients, ζ is the step size, and f al(e, λ, ζ) is a nonlinear function. The three state variables of the extended state observer (15) can track the state variables and total disturbances of the system (2) [20] as follows: The backstepping control law of equation (8) is rewritten as: In summary, the block diagram of the FBS-ESO controller is as shown in Figure 3.

Attitude Control Design of the Tilt-Rotor UAV
The attitude control system of the tilt-rotor UAV is shown in Figure 4, including the FBS-ESO attitude controller, manipulation strategy, and flight dynamics model. The FBS-ESO attitude controller calculates the control quantities of the three loops of roll, pitch, and yaw according to the input and output information of the system, and then it assigns the control quantities to each control surface of the tilt-rotor UAV through the manipulation strategy to act on the flight dynamics model of the tilt-rotor UAV. Under the action of aerodynamics, the attitude of the tilt-rotor UAV changes.

Attitude Dynamics Model
According to reference [31], the attitude nonlinear dynamic model of a tilt-rotor UAV is: where:

Attitude Control Design of the Tilt-Rotor UAV
The attitude control system of the tilt-rotor UAV is shown in Figure 4, including the FBS-ESO attitude controller, manipulation strategy, and flight dynamics model. The FBS-ESO attitude controller calculates the control quantities of the three loops of roll, pitch, and yaw according to the input and output information of the system, and then it assigns the control quantities to each control surface of the tilt-rotor UAV through the manipulation strategy to act on the flight dynamics model of the tilt-rotor UAV. Under the action of aerodynamics, the attitude of the tilt-rotor UAV changes.

Attitude Control Design of the Tilt-Rotor UAV
The attitude control system of the tilt-rotor UAV is shown in Figure 4, including the FBS-ESO attitude controller, manipulation strategy, and flight dynamics model. The FBS-ESO attitude controller calculates the control quantities of the three loops of roll, pitch, and yaw according to the input and output information of the system, and then it assigns the control quantities to each control surface of the tilt-rotor UAV through the manipulation strategy to act on the flight dynamics model of the tilt-rotor UAV. Under the action of aerodynamics, the attitude of the tilt-rotor UAV changes.

Attitude Dynamics Model
According to reference [31], the attitude nonlinear dynamic model of a tilt-rotor UAV is: where:

Attitude Dynamics Model
According to reference [31], the attitude nonlinear dynamic model of a tilt-rotor UAV is:  where: cos θ L = Qc lat C lat l δ lat M = Qc lon C lon l δ lon N = Qc tr C tr l δ tr Q = 0.5ρV 2 and (20) where φ, θ, and ψ are the Euler angles of roll, pitch, and yaw, respectively; p, q, and r are the angular velocities; L, M, and N are the moments of the components of the whole vehicle (rotor, fuselage, vertical tail, flat tail, wing, etc., including gravity); I x , I y , I z , and I xz are the inertia; C 0 = I x I z − I 2 xz , c lat , c lon , and c tr are the distances between the force and the center of gravity; C lat l , C lon l , and C tr l are the moment coefficients; δ lat , δ lon , and δ tr are the control amounts of roll angle, pitch angle, and yaw angle, respectively; ρ is the air density; and V is the relative incoming velocity.

Attitude Control Law
If we define the following variables: then we can obtain the following by combining Equations (19) and (20): From Equation (23), we can obtain: ..
where b 0 is the attitude control gain matrix and the expanded state quantity x 3 is defined as: Then, Equation (24) is transformed into a second-order nonlinear expansion system (26) in the form of Equation (2): .
Therefore, the pitch, roll, and yaw attitude control loops can all be designed as a secondorder FBS-ESO control structure. The attitude control loop's output is superimposed with the trim base offset to form the δ lon δ lat δ tr acts on the tilt-rotor UAV. From the foregoing analysis, the longitudinal pitch control δ lon is designed as: where θ g is the target pitch attitude angle command signal, θ is the actual pitch angle of the tilt-rotor UAV, δ trim θ is the longitudinal control trim, b 0θ and η θ are the attitude control gains, ∆b 0θ and ∆η θ are the adjustments of b 0θ and η θ for the output of the fuzzy control, x 1 andx 2 are the estimated values of the angle and differential value, andx 3 is the estimate of the total disturbance.
The design of the roll loop control δ lat and the yaw loop control δ tr are similar and will not be repeated.

Manipulation Strategy
The manipulation strategy of the tilt-rotor UAV is shown in Table 3. The control weight coefficient is used to adjust the control influence degree of each control surface in different flight modes to ensure the smooth transition of the UAV. The control weight coefficient adopts trigonometric function: where ω r is the control weight coefficient of the rotor, ω q is the control weight coefficient of the fixed wing's control surface, and β t is the tilt angle. When β t = 90 • is the helicopter mode, when β t = 0 • is the fixed wing mode, and when the tilt-rotor UAV transitions from helicopter mode to fixed wing mode, the control weight coefficient of the rotor gradually decreases from 1 to 0 while the control weight coefficient of the fixed-wing aircraft gradually increases from 0 to 1 to complete the smooth transition of the tilt-rotor UAV. The manipulation quantity is as shown in Equation (29): where δ zxz and δ zjz are the longitudinal periodic variation and collective of the left rotor, respectively; δ zxy andδ zjy are the longitudinal periodic variation and collective of the right rotor, respectively; δ f xd , δ f y , and δ sjd are the control quantity of rudder, aileron, and elevator, respectively; and δ col is the collective pitch reference of the rotor.

Hardware-in-Loop Simulation System
Hardware-in-loop (HIL) systems provide a virtual flight environment and a mathematical model of a UAV, but they use the key hardware of flight control systems. HIL simulation has high credibility. HIL is more reliable than pure digital simulation [32]. Compared with physical simulation, HIL simulation has lower costs and higher efficiency. As shown in Figure 5, the real-time HIL simulation system of the unmanned helicopter built in this paper adopts the flight control computer with STM32F405ZGT6 as the core processor. In the Keil environment, the FBS-ESO attitude control law is written as C code to run in the flight control computer. The attitude dynamics model of the tilt-rotor UAV is built based on MATLAB/SIMULINK numerical simulation software. The operation process of the HIL simulation system is as follows: the ground control station transmits the target attitude command to the flight control computer via the radio station. The flight control computer runs the FBS-ESO attitude control law and calculates the manipulation amount of the rotor and rudder surfaces, according to the target and actual attitude. Then, the manipulation amount is transmitted to MATLAB/SIMULINK through serial communication. We use the Serial Receive module in SIMULINK to receive the data of the manipulation amount. After the data is unpacked, it acts on the attitude dynamics model of the tilt-rotor UAV to obtain the real-time attitude. Finally, the actual attitude is transmitted to the FlightGear visual simulation software and flight control computer through the Serial Send module. FlightGear can display the three-dimensional flight animation of the tilt-rotor UAV in real-time, and the flight control computer stores the actual attitude and target attitude in the SD data memory card, which is convenient for subsequent data analysis.

Attitude Control Test
The controlled plant in this paper is shown in the Figure 6. The tilt-rotor UAV changes the tilt angle of the rotor to realize the transition from helicopter mode to fixedwing mode. The basic parameters of the tilt-rotor UAV are shown in the initial values in Table 4. The attitude controller adopts the BS, ADRC, and FBS-ESO controller designed in this paper. The initial parameters of the FBS-ESO controller and the parameters of the BS controller and ADRC controller are shown in Table 5. The above three controllers operate in the hardware-in-loop simulation system.

Attitude Control Test
The controlled plant in this paper is shown in the Figure 6. The tilt-rotor UAV changes the tilt angle of the rotor to realize the transition from helicopter mode to fixed-wing mode. The basic parameters of the tilt-rotor UAV are shown in the initial values in Table 4. The attitude controller adopts the BS, ADRC, and FBS-ESO controller designed in this paper. The initial parameters of the FBS-ESO controller and the parameters of the BS controller and ADRC controller are shown in Table 5. The above three controllers operate in the hardware-in-loop simulation system.
The controlled plant in this paper is shown in the Figure 6. The tilt-rotor UAV changes the tilt angle of the rotor to realize the transition from helicopter mode to fixedwing mode. The basic parameters of the tilt-rotor UAV are shown in the initial values in Table 4. The attitude controller adopts the BS, ADRC, and FBS-ESO controller designed in this paper. The initial parameters of the FBS-ESO controller and the parameters of the BS controller and ADRC controller are shown in Table 5. The above three controllers operate in the hardware-in-loop simulation system.  The initial attitude angle of the tilt-rotor UAV is 0°, the expected target value is 10°, and the simulation time is 10 s. If we keep the parameters of the attitude controller in Table 5

Stability Test
The initial attitude angle of the tilt-rotor UAV is 0 • , the expected target value is 10 • , and the simulation time is 10 s. If we keep the parameters of the attitude controller in Table 5 unchanged and conduct the attitude control simulation experiments of 90 • , 45 • , and 0 • of the rotor tilt angle, respectively, then the simulation results are as shown in Figure 7. The simulation results show that the FBS-ESO controller has the best control effect under the three flight modes. The rise time of the FBS-ESO controller is short, and the overshoot, steady-state error, and vibration amplitude are slight. The decreased rotor tilt angle decreases the ADRC and BS controller performance gradually. The ADRC controller has obvious chattering and overshoot when switching to fixed-wing mode. In contrast, the performance of the BS controller decreases more violently. It cannot control the pitch and yaw angle, indicating that the ADRC and BS controller cannot realize the full mode attitude control of a tilt-rotor UAV. The performance of the FBS-ESO controller does not change significantly with the change in tilt angle and has the attitude control ability of full flight mode.

Anti-Disturbance Test
The external wind disturbance will interfere with the flight of a tilt-rotor UAV. A rectangular wave signal simulates the sudden wind disturbance in a period. At the fifth second, a rectangular wave with an amplitude of 20 and pulse width of 3 s is added to the three-axis incoming velocity term of the nonlinear flight dynamics model as the external disturbance to test the anti-disturbance of the attitude controllers. If we keep the controller parameters in Table 5 unchanged, then the simulation results are as shown in Figure 8. When the external disturbance is added to the UAV, the FBS-ESO controller has good stability in any flight mode. The BS controller fluctuates the most, the roll angle has a noticeable rectangular jump, and the pitch angle and yaw angle fluctuate obviously. The results above show that the FBS-ESO controller has a better anti-disturbance ability.
three-axis incoming velocity term of the nonlinear flight dynamics model as the external disturbance to test the anti-disturbance of the attitude controllers. If we keep the controller parameters in Table 5 unchanged, then the simulation results are as shown in Figure 8. When the external disturbance is added to the UAV, the FBS-ESO controller has good stability in any flight mode. The BS controller fluctuates the most, the roll angle has a noticeable rectangular jump, and the pitch angle and yaw angle fluctuate obviously. The results above show that the FBS-ESO controller has a better anti-disturbance ability.

Robustness Test
We can change the parameter value of the tilt-rotor UAV as an internal disturbance to simulate the parameter uncertainty of the UAV. The modified values in Table 4 are controlled plants. The controller parameters in Table 5 are still used, the attitude control simulation of attitude controllers for the tilt-rotor UAV is carried out again, and the results are shown in Figure 9. The simulation results show that even if the dynamic characteristics of the controlled plant change significantly, the FBS-ESO controller can still achieve an excellent dynamic response curve under full flight mode, and the control performance is excellent. The ADRC and BS controller performance decrease significantly compared with the steady-state test. When the rotor tilts, the performance of the BS controller decreases

Robustness Test
We can change the parameter value of the tilt-rotor UAV as an internal disturbance to simulate the parameter uncertainty of the UAV. The modified values in Table 4 are controlled plants. The controller parameters in Table 5 are still used, the attitude control simulation of attitude controllers for the tilt-rotor UAV is carried out again, and the results are shown in Figure 9. The simulation results show that even if the dynamic characteristics of the controlled plant change significantly, the FBS-ESO controller can still achieve an excellent dynamic response curve under full flight mode, and the control performance is excellent. The ADRC and BS controller performance decrease significantly compared with the steady-state test. When the rotor tilts, the performance of the BS controller decreases rapidly, and the BS controller cannot effectively control the attitude angle of the tilt-rotor UAV, which shows that the FBS-ESO controller has strong robustness.
Based on the stability test, anti-disturbance test, and robustness test, it can be found that the FBS-ESO controller can better overcome the internal and external disturbances encountered by a tilt-rotor UAV in actual flight than a traditional backstepping controller and ADRC. The FBS-ESO controller is more suitable for the full flight mode control of the tilt-rotor UAV.
rapidly, and the BS controller cannot effectively control the attitude angle of the tilt-rotor UAV, which shows that the FBS-ESO controller has strong robustness.
Based on the stability test, anti-disturbance test, and robustness test, it can be found that the FBS-ESO controller can better overcome the internal and external disturbances encountered by a tilt-rotor UAV in actual flight than a traditional backstepping controller and ADRC. The FBS-ESO controller is more suitable for the full flight mode control of the tilt-rotor UAV.

Conclusions
This paper proposes a design method for a fuzzy backstepping controller based on an extended-state observer. Fuzzy control is used to tune the parameters of the backstepping control law online, and the extended-state observer estimates the total disturbance of the controlled system. Through the hardware-in-loop simulation of attitude control of tilt-rotor UAV, the following conclusions are drawn in this paper: (1) Changing the rotor tilt angle will destroy the stability of a traditional backstepping controller and ADRC. In contrast, the FBS-ESO controller maintains good control performance. (2) The performance of the FBS-ESO controller will not be significantly affected by adding an external gust disturbance or changing the UAV parameters in the simulation. These disturbances significantly impact a traditional backstepping controller and ADRC.

Conclusions
This paper proposes a design method for a fuzzy backstepping controller based on an extended-state observer. Fuzzy control is used to tune the parameters of the backstepping control law online, and the extended-state observer estimates the total disturbance of the controlled system. Through the hardware-in-loop simulation of attitude control of tilt-rotor UAV, the following conclusions are drawn in this paper: (1) Changing the rotor tilt angle will destroy the stability of a traditional backstepping controller and ADRC. In contrast, the FBS-ESO controller maintains good control performance. (2) The performance of the FBS-ESO controller will not be significantly affected by adding an external gust disturbance or changing the UAV parameters in the simulation. These disturbances significantly impact a traditional backstepping controller and ADRC.