Design and Simulation of Eight-Rotor Unmanned Aerial Vehicle Based on Hybrid Control System

. In order to control the position and attitude of unmanned aerial vehicle (UAV) better in di ﬀ erent environments, this study proposed a hybrid control system with backstepping and PID method for eight-rotor UAV in di ﬀ erent ﬂ ight conditions and designed a switching method based on altitude and attitude angle of UAV. The switched process of hybrid controller while UAV taking o ﬀ , landing, and disturbance under the gust is veri ﬁ ed in MATLAB/Simulink. A set of appropriate controllers always matches to the ﬂ ight of UAV in di ﬀ erent circumstances, which can speed up the system response and reduce the steady-state error to improve stability. The simulation results show that the hybrid control system can suppress the drift e ﬃ ciently under gusts, enhance the dynamic performance and stability of the system, and meet the position and attitude of ﬂ ight control requirements.


Introduction
In recent years, multirotor UAVs have attracted increasing attention.As early as World War II, many countries, such as the United Kingdom and the United States, have investigated in the development of UAVs.With its flexibility, simple structure, and low cost, multirotor UAV has broad prospects for development in military and scientific research and many other fields [1,2].Compared with fixed wing UAVs, the eight-rotor UAVs can hover, vertically takeoff and landing, and perform indoor flight.The control of the eight-rotor UAV is mainly divided into attitude control and position control.The change of the attitude of the eight rotors will cause a corresponding position change.Thus, the flight attitude control of the eight rotors is critical to the control of the technology as a whole.The common control algorithms are classical PID control [3], fuzzy PID attitude control [4], neural network control [5], sliding mode control [6], backstepping control [7], dynamic surface control [8], visual feedback control, and adaptive control [9].Those methods are based on the mathematical model of the normal flight of an eight-rotor UAV.However, it is difficult to establish an accurate mathematical model in practice.This situation leads to the discrepancy between the actual control effect of the eight-rotor UAV and the simulation results.In the literature [10], the problem of stabilization of the threerotor UAV is studied using the method of fuzzy control and pole assignment.However, fuzzy control of the actual system will lead to the decrease of control precision and the variation of the dynamic quality.The improvement of the control accuracy will inevitably increase the fuzzy rules of the quantization series, which will lead to the expansion of the scope of the rule search and the reduction of the decision-making speed, leading to poor real-time performance of the system.In [11], the hybrid high-order sliding mode control method is addressed to control the eightrotor UAV, but the effect of suppressing the jitter caused by sliding mode control is not very good, and the control precision is insufficient.In [12], the vertical takeoff and control of the four-rotor UAV are studied based on the state feedback and the neural network adaptive hybrid control method.The approach achieves the height control of the four-rotor UAV; however, the attitude angle control is neglected.Therefore, the important problem in the study of the UAV control system is to design a UAV with stronger ability to control the flight attitude and the adaptability to the environment based on the hybrid control theory.
In view of the above shortcomings and disadvantages, this paper presents an eight-rotor UAV controller design based on a hybrid control method.Adopting the idea of hybrid control, the backstepping controller, PID controller, and hybrid switcher are combined to realize the switching of the controller in different flight modes.It not only inherits the reliability, low static error, and interference ability of a traditional PID algorithm but also maintains the advantages of backstepping control method.The two methods complement each other to achieve good control of the UAV in a complex environment and to improve the control accuracy.

The Building of the System Model
The eight-rotor UAV is an underdamped system with four inputs and six outputs, according to the distribution of the rotor.Given its overall layout, it belongs to the noncoaxial multirotor aircraft [13].The eight-rotor UAV works on the principle of changing the eight motors' velocity to drive the propeller and the paddle.The change of motor speeds results in the alteration of lift and spin and affects the vertical, front, rear, left, and right planes of movement.Through these basic combination of actions, the UAV is able to complete the diverse range of missions.This paper mainly focuses on the study of the uniformly distributed eight-rotor UAV.
In order to study the dynamic performance of the eight-rotor UAV better, a relatively accurate mathematical model of the eight-rotor UAV must be established.Without losing the generality, a sufficient condition for the model is established.Based on the above assumptions, the motion force structure and dynamic analysis of the eight-rotor unmanned aerial vehicle are implemented, and the Euler angles are defined and two basic coordinate systems are established: the inertial coordinate system E (OXYZ) and the body coordinate system B (oxyz), as shown in Figures 1 and 2.
From Figures 1 and 2, the transformation rotation matrix between the body coordinate system and the inertial coordinate system is as follows: The mathematical model of the line motion of the eightrotor UAV given by the kinetic analysis of Newton's second law is as follows [14]: where m is defined as the quality of UAV, g as the gravity of body, v as the flight speed, r as the displacement, F as the role of the UAV on the external force, F i i = 1, ⋯, 8 as a single rotor rotation generated by the lift, F i = K t Ω i with K t as the lift coefficient, and Ω i as the motor speed.
From the angular momentum theorem of centroid motion, the angular motion model of the eight-rotor UAV is written as follows: According to the relationship between the angular velocity of the eight-rotor unmanned aerial vehicle and the Euler angle, (4) can be reduced to where l is the distance from the center of the propeller to the origin of the coordinate system of the body; J x , J y , and J z are the moments of inertia of the X, Y, and Z shafts, respectively; ω x , ω y , and ω z are the angular velocity components of the X-axis, Y-axis, and Z-axis, respectively.The control input for the eight independent control channels of the eight-rotor UAV is determined by the rotor speed as follows: where U 1 is defined as the vertical direction control input quantity, U 2 as the control direction for the rolling direction input, U 3 as the input for the pitch direction, U 4 as the control input for the yaw direction, and K d as the air resistance coefficient.In summary, the mathematical model of the eight-rotor UAV system is as follows:

The Design of Hybrid Control System
The purpose of the design is to provide the UAV with a set of appropriate control strategies in different states or flight environments, in order to change the flight control curve appropriately [15].The flight control of the eight-rotor UAV studied in this paper adopts the method of backstepping control and PID control and through the hybrid control method attempts to control the eight-rotor UAV in different environments and improve the flight stability and antijamming capability of the UAV.When the UAV is in normal flight, it can be approximated that the smaller the value of roll angle and pitch angle, the smoother the flight state.However, in the actual situation, when the UAV flies in the takeoff and landing state, subjected to gust and other interference factors, it will often cause the UAV to lose stability or even crash out of control.Therefore, the flight height z, roll angle φ, and pitch angle θ are taken as the switched variables between the controllers, that is, when the height, roll angle, and pitch angle exceed the set threshold, the backstepping controller will be switched to the PID controller, to achieve enhanced anti-interference ability.When the UAV is faulty or the roll angle and pitch angle exceed the threshold, the backstepping controller or PID controller can be switched to the runaway protection controller for motor braking and landing.
From the above mathematical model of the eight-rotor UAV system, we can see that the angular velocity and attitude angle do not depend on linear motion.We also see that the spatial position of the line motion depends on the angular motion, and there is a semicoupling relationship between the line motion and the angular motion.The control system of the eight-rotor UAV can be divided into the inner ring (attitude loop) and outer ring (position loop) control [16].Therefore, the eight-rotor unmanned aerial vehicle control structure based on hybrid control system is shown in Figure 3, where x d , y d , z d are the desired position input and φ d , θ d , ψ d are the desired gesture input.
According to the flight control requirements, the eightrotor UAV control system for the discrete state of the collection is Q = q 1 , q 2 , q 3 , q 4 , where q 1 is the takeoff state, q 2 is the normal flight state, q 3 is the stability of the flight state, and q 4 is out-of-control state.Let the discrete event 3 International Journal of Aerospace Engineering corresponding to the set of discrete states be ∑ = w 12 , w 21 , w 13 , w 31 , w 23 , w 32 , w 24 , w 34 .In the formula, w 12 is the condition of the switching event that the system changes from continuous state q 1 to continuous state q 2 ; w 21 is expressed as the switching event condition of the system from continuous state q 2 to continuous state q 1 .The discrete state transition of the hybrid control system is shown in Figure 4.
When the UAV is in the takeoff or landing state, there is a need for the controller to have a fast response and small overshoot features.When the UAV is in the gust, the controller is needed to have good robustness and a soft control system.When the tilt angle of the UAV is greater than the out-of-control set threshold, the controller switches to the runaway state to prevent a crash occurring.Compared with a single control system, a hybrid control system can provide improved flight status, enhanced the UAV flight stability, and suited to the current flight environment better.
3.1.Backstepping Controller Design.Since the eight-rotor unmanned aerial vehicle (UAV) is an underactuated system that controls the six degrees of freedom of space by adjusting the rotational speed of the eight rotors, there is a nonlinear relationship between the degrees of freedom of the direct excitation portion and the degrees of freedom of the underactuated portion.The backstepping control method is one of the commonly used methods for designing nonlinear system controllers.It is a linear regression design method combining Lyapunov function and controller design.The main design idea is to decompose the complicated system into several subsystems which do not exceed the order of the system.The Lyapunov function and the intermediate virtual control quantity are designed for each subsystem, respectively, until the system stability state is reached, thus completing the entire system controller design [17].The underactuated system controller designed by backstepping method has the advantages of a short adjustment time and a small overshoot and has been widely used in aircraft, missile, and robot system [18].
The system state of UAV is defined as follows: R = φ φ θ θ ψ ψ z z x x y y 7 The system variables are divided into six control channels: roll channel, pitch channel, yaw channel, Z-axis channel, X-axis channel, and Y-axis channel, which are defined by the literature [19].The variables U 1 , U 2 , U 3 , U 4 , U x , and U y , respectively, are as follows: The backstepping controller of the rolling channel is The pitch channel backstepping controller is 4 International Journal of Aerospace Engineering The yaw channel backstepping controller is The height channel backstepping controller is The X-axis channel backstepping controller is The Y-axis channel backstepping controller is

PID Controller Design
. PID control is one of the most widely used control laws in engineering practice.It is a control rate that includes proportional, integral, and differential control.Its advantage is that only three parameter values need to be set and properly debugged to achieve good control effect, especially in the absence of accurate mathematical model and model error, PID control more practical.The control rate for each channel of the eight-rotor UAV is designed as follows: The rolling channel PID controller is The pitch channel PID controller is The yaw channel PID controller is The height channel PID controller is The X-axis channel PID controller is The Y-axis channel PID controller is 3.3.System Stability Analysis.Taking the rolling channel as an example, in the controller stability analysis, the state variable is set as v = x x φ φ , assuming that the expected roll angle is bounded and changes in the range of − π/2 < φ < π/2 ; thus, the roll angle signal tracking error μ 1 must be bounded.The boundedness of μ 1 can obtain that in the backstepping control method where the virtual control signal is bounded, the roll angular velocity error is bounded, and the roll control channel input is bounded.Therefore, all signals within the roll channel are bounded.By defining the amount of error change as μ 1 = x 1 − x 1d , we can derive Among which, μ 2 = x 2 − α 1 is the system error, and α 1 is the amount of virtual control to be determined.
The Lyapunov function is chosen as follows: 1 , where we can derive V 1 by taking it into (20) and get 0 is the system parameter; in order to meet the stability requirements of the closed loop system, eliminating the coupling term μ 1 μ 2 , the closed loop of (20) can be obtained as follows: The remaining variables are as follows: For the guidance, μ 2 is presented as follows: where μ 3 = x 3 − α 2 is expressed as a systematic error and α 2 as the dummy variable to be determined.The Lyapunov function is chosen as , where we can derive V 2 by taking it into (24) and get Equations ( 21) and ( 25) are obtained by the virtual control formula (20).
Tracking error index μ 1 is gradually stabilized.Substituting the resulting control amount U 2 into (25) yields The error index is asymptotically stable and the tracking error μ 1 is different from that of the differential homeomorphism μ 2 .The positive V 2 and negative definite of the function V 2 are given.According to the Lyapunov stability principle, the eight-rotor UAV backstepping control method is progressively stable.Similarly, other control channels can be seen as gradually stable; we can see that the various subsystems in the hybrid control system are stable.
Consider the model of the general switched linear system as x = Ax + BK σ u, where x ∈ R n , A ∈ R n , and σ t : 0, ∞ → 1, ⋯, q is switching signal, and q represents the number of subsystems: K i ∈ R m×n i ∈ 1, ⋯, q is switching gain and B ∈ R m×n .
Introduce the following variables: , ⋯, q satisfies the conditions: If the system switches to i subsystem, then ℘ i t = 1.If the system switches to j ≠ i subsystem, then ℘ i t = 0; it means that there is only one controller works at any time.Then, Hence, satisfying ℘ T t ℘ t ≤ I, where I is the identity matrix with suitable dimension, the switched system can be equivalent to x = A + B℘ t K x, adopting the Common Lyapunov function to study the system stability.Some lemmas are required to prove the main results.
Lemma 1 (see [20]).M, Σ, and N are real matrices with appropriate dimension; if they satisfy Σ T Σ ≤ I, then there always exists MΣN + N T Σ T M T ≤ MM T + N T N.
Lemma 2 (see [19]).(Schur's lemma) For the given symmetric matrix, , 29 where S 11 and S 22 are square matrices, and then there exists the following equivalent conditions: Theorem 1.The switched system is said to be asymptotically stable if there exists positive definite matrix P > 0 to make Choosing the Lyapunov function V x = x T Px P > 0 , then we have

32
by taking a derivative with it.
According to ℘ T t ℘ t ≤ I, applying Lemma 1, we have It is seen that the system is asymptotically stable, if it satisfies A T P + PA + PBB T P + K T K < 0. According to Lemma 2, it is equivalent to This completes the proof.
Taking the pitching motion of eight-rotor aircraft, we construct its linearized mode as x = Ax + Bu, where x = v x v y θ θ and u = u 1 u 4 , according to the small 6 International Journal of Aerospace Engineering disturbance linearization theory in literature [21].Taking the related parameters of the aircraft, we have P is a positive definite matrix; satisfying the theorem condition, it is obtained that the switched hybrid system is asymptotically stable.
The reason for the instability of the system is that the energy generated by the system is not absorbed during switching, so that the "slow switch" is carried out on the stable subsystem, that is, the average stay of the switching is sufficiently large so that the energy generated at the time of switching is sufficiently absorbed, which can guarantee the stability of the system [22].

System Simulation and Analysis
Based on the model of the eight-rotor UAV, the related literature and the relevant parameters of the eight-rotor UAV are shown in Table 1.
Based on the above design process and parameters, the MATLAB/Simulink simulation model is established.Taking the pitch channel as an example, the simulation model of the hybrid control system is shown in Figure 5.The simulation model is mainly composed of UAV dynamics model, switcher, controller, and state flow module.Among them, the UAV kinematics module mainly describes the aerodynamic characteristics of the UAV.The switch makes the corresponding controller switch based on the output signal of the state flow.The controller is mainly composed of three parts, such as the PID controller, backstepping controller, and runaway protection module for controlling the attitude and position of the unmanned aerial vehicle so that the UAV can reach the desired state from the initial state.The function of the state flow module is to calculate the number of the selected controller according to the input signal.Hybrid controller performance will be verified by three experiments: fixed point hovering, expected tracking, and antijamming capability test.Due to the complexity of aerodynamic effects and large influence of external conditions, precise aerodynamic analysis of UAV is difficult to model accurately, so the UAV parameters are uncertain.Based on the idea of hybrid control system, the backstepping control   International Journal of Aerospace Engineering method is used to complete the trajectory tracking control of the UAV.The backstepping control method adopts the reverse design method.The Lyapunov function is used to derive the corresponding control rate, which can control the nonlinear system of the N-order to make the design process more structured and systematic.However, the method is more dependent on the model aerodynamic parameters, and the change of factors such as external disturbance is slower.So, the backstepping control method is taken as the UAV hybrid control system with the normal flight state controller.In the case of system perturbation, the PID control method is used to suppress the influence of disturbance and improve the control precision.Therefore, the PID control method is used as the control system of the hybrid control system and the uncontrolled state controller to achieve the precise control of the purpose.In the analysis of antijamming capability, random white noise is used as the simulated gust interference source, and the square wave signal is used to simulate the obstacle information.When the system has reached the steady state, it is applied to the corresponding system feedback state variable, and then the effect of the interference information for UVA stability is analyzed.The UAV spatial displacement trajectory simulation results are shown in Figure 6, pitch angle control simulation results are shown in Figure 7, obstacle avoidance control simulation results are shown in Figure 8, and the height control simulation results are shown in Figure 9.
In Figure 6, the initial position coordinates of the spatial displacement trajectory of the eight-rotor UAV are set as x, y, z = 0 m.The initial attitude angle is φ, θ, ψ = 0rad, the expected position coordinate is x, y, z = 1 m, the expected attitude angle is φ, θ, ψ = 0rad, the simulation time is 10 s, and the calculation method is ode4.It can be seen from the figure that the overshoot of the system is small, although there are some errors due to the influence of interference; the trajectory of the response characteristic curve is smooth, the control output distortion is small, and the control of the eight-rotor unmanned aerial vehicle has better control effect in line with the actual flight needs.In Figure 7, the system reaches the expected value of the pitch angle at 0.7 s, the system response time is faster, the rising trend is smooth, and there is no overshoot.White noise interference signals are added between 2 s and 4 s, and the system is switched to PID controller to reach the desired target stability value again at 4.7 s.Besides, the range of interference effect changed slightly, and the steady-state error is almost 0. In Figure 8, the detection result signal of the UAV external sensor obstacle is simulated by the square wave signal, and the detection result is used as the switching signal of the hybrid control system.Taking the height obstacle as an example, the simulation results show that the square wave interference signal appears at 3.5 s to 4.5 s and 5.5 s to 6.5 s.As can be seen from Figure 9, the system achieves a high expected value at 0.6 s, and the system response time is fast and no overshoot.Adding a white noise interference signal in 2 s to 4 s time, the system switches to the PID controller and reaches a stable state within 5.2 s.The degree that the system affected by the interference amplitude is small and the interference output response curve is smooth.System is affected by the interference signal in 7 s, the rotor motor began to slow down, and the UAV began landing, at 7.9 s.Due to ground gravity and reaction force, there is a slight "reverse" overshoot phenomenon.But the curve of UAV Landing characteristics is smooth, with slightly longer landing time.The advantage is not to cause injuries and other incidents of UAV.
In order to verify the actual performance of hybrid controller, a physical test platform is set up as shown in Figure 10.The platform takes STM32F103 as the main controller chip and MPU6050 chip as the inertial measurement unit to real-time measurement of eight-rotor UAV attitude data.The main controller chip calculates the acceleration and angular velocity data collected by the inertial measurement into the attitude angle and then passes through the main controller to generate the corresponding duty cycle PWM wave to control the speed of the relevant brushless DC motor to realize the correlation of the UAV action.The experimental results show that the hybrid controller can effectively and stably control the roll, pitch, and yaw of the eight-rotor UAV, and it is reliable and satisfies the requirement of attitude control.

Conclusion
The continuous development of space technology and the maturation of eight-rotor UAV have led to the availability of low-cost, high-performance, uniquely structured system that is widely used in military and civilian areas.In this paper, the eight-rotor UAV is used as the research object, and the dynamic modeling of the system is expounded in detail.The hybrid control system is based on the backstepping control method and PID control of the eight-rotor UAV in different environments or states.The simulation model of the hybrid control system is built in a MATLAB/ Simulink environment.The spatial displacement trajectory of the UAV and the switching process of the pitch angle and the height control channel of the UAV under the interference signal are simulated.The simulation results show that the hybrid control system can choose the appropriate control method according to the change of the environment and better adapt to the current flight environment.Finally, by establishing the physical test platform of the eight-rotor UAV, the reliability, stability, and anti-interference ability of the hybrid control system are verified, and the control requirements of flight attitude and position are satisfied.The stability control of the drone in a complex environment is realized, and the flight stability is improved.
(a) The body is a uniform symmetrical steel structure (b) The inertial coordinate system is the ground coordinate system (c) Air resistance and gravity suffered during flight are not changed by flight altitude (d) Body coordinate system B origin and the body of the center of mass and geometric center are in the same position (e) The lift generated by the propeller is proportional to the square of the motor speed

Table 1 :
Main parameters of UAV model.