Frontiers in Computing and Intelligent Systems ISSN: 2832-6024 | Vol. 5, No. 2, 2023 90 Attitude Control of Quadrotor UAV Using Improved Active Disturbance Rejection Control Yinian Li 1, Gongquan Tan 1, 2, * 1 School of Automation and Information Engineering, Sichuan University of Science & Engineering, Zigong, China 2 Artificial Intelligence Key Laboratory of Sichuan Province, Yibin, China * Corresponding author: Gongquan Tan (Email: 43180229@qq.com) Abstract: The quadrotor UAV has complex aerodynamics, unstable altitude, and easy to be disturbed by internal and external uncertainties during flight, so good attitude control becomes a challenge, this paper improves the active disturbance rejection controller to improve the system's anti-jamming ability and response speed in response to the above problems. Firstly, a quadrotor UAV dynamics model is established; then the Ifal function is constructed, which solves the problems that the inflection point of the fal function is not smooth, which is easy to cause the system jitter and the system gain is large when the error is large, and finally the performance is verified by using MATLAB/Simulink simulation software. The simulation results show that the constructed Ifal function is smoother and has better convergence, and compared with the traditional active disturbance rejection control, the improved active disturbance rejection control system has faster response speed, stronger anti-jamming ability and robustness in the attitude control of quadrotor UAV. Keywords: Quadrotor UAV; Active Disturbance Rejection Controller (ADRC); Improved fal Function; Attitude Control. 1. Introduction In recent years quadrotors have been widely used in education, agriculture, and military due to their advantages of simple structure and low production cost [1-4]. Given that a quadrotor UAV is a nonlinear, strongly coupled, underdriven and complex system, which is difficult to model accurately, and at the same time the flight of a quadrotor UAV is unstable under the influence of external disturbances and model uncertainty, designing fast and stable control algorithms is the basis for the wide application of quadrotor UAVs. Traditional flight control methods for quadrotor UAVs mainly include PID control, sliding film control, backstepping, etc. Kara [5] combined linear and nonlinear controllers, and the proposed control scheme combines the simplicity of the PID controller and the robustness of the sliding film control (SMC), and then proved that the PID- SMC has good robustness under system uncertainty and Boussad Abci [6] proposed an improved sliding mode control algorithm based on Lyapunov function theory to improve the robustness of the controller against external disturbances. Mei Wu [7] used backstepping method to decompose the system into subsystems not exceeding the order of the system, and then designed the Lyapunov function for each subsystem to obtain the control law, which has the advantages of low overshooting This method has the advantages of low overshooting and fast regulation time, but this method generally needs to meet the strict feedback control system, all the limitations are high. With the development of modern control theory, there are more and more control methods, but the most used in engineering applications is still PID control. ADRC considers the external perturbation and the internal uncertainty of the system as a total perturbation, which is estimated and compensated, and retains the advantages of PID control that does not depend on the accurate model of the control object while solving the contradiction between rapidity and overshoot in PID control by arranging the transition process. Existing ADRC control research focuses on the improvement of the macro level, the working mechanism of ADRC has not been improved, X. Y. Qiao [8] improves the fal nonlinear function into the faln function and uses it to improve the ESO, and the experiments show that the improved ADRC in the quadrotor system can make the quadrotor system more resistant to the strong external disturbances. Yang [9] designed galn function based on normal distribution function and used it to improve ESO, and the simulation results show that the improved ESO has better error following performance and better observation performance. Liu and Chen [10-11] also applied the improved fal function to ESO and nonlinear state error feedback law (NLSEF) to obtain the improved ADRC, and verified that it has better speed, interference resistance and robustness than the traditional ADRC, but the function is too complicated. This paper firstly establishes a quadrotor UAV dynamics model and constructs an improved fal nonlinear curve function (Ifal) based on the trigonometric function, and finally verifies the anti-jamming ability of the improved ADRC in this paper by designing multiple sets of jamming experiments through simulation and the results are compared with the traditional ADRC control effects, confirming the enhanced disturbance resistance of the improved ADRC proposed in this paper. 2. Quadrotor UAV Modelling 2.1. Working Principle of Quadrotor A quadrotor UAV controls the position and attitude of the quadrotor by adjusting the rotational speeds of the four motors to achieve changes in lift, and there are common quadrotors with “+” type layout and “×” type layout. Because the “×” layout allows more rotors to participate in the pitch and roll attitude control, which provides better maneuverability, this paper adopts the “×” layout quadrotor UAV, which achieves the pitch and roll attitude control by controlling the rotational speeds of different motors, and the symmetrical arrangement of the motors can also balance the 91 reversing torque, which is the best way to control the position and attitude. The symmetrical arrangement of the motors can also balance the reversal torque to keep the quadrotor flying stably. In order to sort out the individual channel variables more intuitively, the earth solid-link coordinate system e(OeXeYeZe) and the airframe coordinate system b(obxbybzb) are defined, and the quadrotor coordinates are converted into attitude through the three attitude angles, namely, the roll angle φ, the pitch angle θ, and the yaw angle ψ [12], and the relationship between the airframe coordinate system and the earth solid- link coordinate system is shown in Figure. 1. Figure 1. 6-DOF quadrotor system The rotation matrix from the quadrotor coordinate system b(obxbybzb) to the Earth solid link coordinate system e(OeXeYeZe) is as follows. 1 0 0 ( ) 0 cos sin 0 sin cos xR               (1) cos 0 sin ( ) 0 1 0 sin 0 cos yR               (2) cos sin 0 ( ) sin cos 0 0 0 1 zR               (3) Where Rx(φ) denotes the rotation matrix of φ angle around the x-axis, Ry(θ) denotes the rotation matrix of θ angle around the y-axis, and Rz(ψ) denotes the rotation matrix of ψ angle around the z-axis. The coordinate system transformation usually adopts the sequence of “pitch-roll-yaw”, i.e., rotating according to the sequence of z-y-x axes, then the rotation matrix Rb e from the airframe coordinate system to the earth fixed coordinate system is shown in equation (4). c c s s c c c c s c s s c s s s s c c c s c s c s s c c c E BR                                         (4) Where c denotes cosine, s denotes sine. 2.2. Quadcopter UAV Modelling The following assumptions are usually made during modelling to simplify the quadrotor UAV dynamics model [13]: 1. the quadrotor is a uniformly symmetric rigid body; 2. the mass and moment of inertia of the quadrotor do not change; 3. the geometric center of the quadrotor is coincident with its center of gravity; 4. the quadrotor is subject only to gravity and propeller pull. Modelled in the Earth solid-linked coordinate system, the quadrotor UAV is modelled as. 1 1 1 2 3 4 (cos sin cos sin sin ) (sin sin cos cos sin ) cos cos y z x x z x y y x y z z U x m U y m U z g m I I U I I I I U I I I I U I I                                                          (5) In equation. (5): m is the mass of the quadrotor UAV; g is the acceleration of gravity; Ix, Iy, and Iz are the rotational inertia of the x, y, and z axes, respectively, l is the distance from the center of the rotational axis of the quadrotor UAV to the center of the fuselage, U1 is the amount of the quadrotor UAV's lifting force control, and U2, U3, and U4 are the amount of the control of the tumbling angle, the pitching angle, and the yawing angle. 2 2 2 2 1 1 2 3 4 2 2 2 2 2 1 2 3 4 2 2 2 2 3 1 2 3 4 2 2 2 2 4 1 2 3 4 ( ) 2 2 2 2 ( ) 2 2 2 2 2 2 2 2 ( ) 2 2 2 2 ( ) t t t m U C U lC U lC U C                                 (6) where Cm is the propeller moment coefficient, Ct is the propeller tension coefficient, and Ωi is the ith propeller speed. 3. Improved Active Disturbance Rejection Control 3.1. ADRC Controller Basic Structure ADRC controller evolved from the classical PID controller, because the traditional PID controller directly takes the difference between the reference given and the output feedback as the control signal, which leads to the contradiction between response rapidity and overshooting. ADRC algorithm is a nonlinear control algorithm proposed by researcher Han Jingqing [14] in response to the shortcomings of the PID control algorithm, which adopts the core concept of PID error feedback control, and on the basis of the basic idea of the PID control algorithm, the nonlinear feedback control law (NLSEF), the expansion state observer 92 (ESO) and the tracking differentiator (TD) link are added. Among them, the tracking differentiator arranges the transition process of the closed-loop system according to the differential output and the most rapid synthesis function, reasonably extracts the continuous signals (tracking given) and differential signals, gives reasonable control signals, and solves the contradiction between response speed and overshooting. The extended state observer designs an extended state quantity to track the influence of unknown parts of the model and unknown external perturbations, and gives the control quantity to compensate these perturbations, making it an ordinary integral series type control object. The nonlinear error feedback control law gives the control strategy of the controlled object, and the basic framework of ADRC is shown in Figure. 2. Figure 2. ADRC controller 3.2. Improved Tracking Differentials The traditional structure and basic properties of nonlinear tracking differentiators are investigated in Researcher Kyung- Ching Han's book. A second-order nonlinear tracking differentiator based on a second-order bang-bang switching system is proposed. 1 2 2 2 2 1 0( ( ) ) 2 x x x x x rsign x v t r          (7) where x1 is the desired trajectory and x2 is its derivative. Note that the parameter r is application-dependent and is set to speed up or slow down the transient profile accordingly. Denote 2 as the “trace differentiator” of v(t). 3.3. Improvement of the Expansion State Observer ESO is the heart of the ADRC controller, which improves the performance of the system by transforming all uncertain and nonlinear perturbations, both internal and external, into a deterministic and linear form by determinizing and linearizing the perturbations. The system controlled in this paper is of second order, so the ESO expands the total perturbation to a third order system state. Its expression is given below. 1 1 2 01 2 3 02 1 0 3 03 2 3 0 0 e fal( , , ) ( ) fal( , , ) e z y z z z z e b u t z e z u u b                             (8) In equation (8): e is the observation error; y is the system output; z1 is the system output observation; z2 is the output differential observation; z3 is the perturbation observation; β01, β02, and β03 are the observer filter coefficients; b0 is the controller gain; α1, α2, and δ are the adjustable parameters; and the fal function is as follows. 1 , fal( , , ) ( ), e e e e sign e e             (9) The selection of nonlinear function follows the principle of “small error, large gain, large error, small gain”, and its curve has good continuity, convergence, smoothness. The derivation of equation (9) can be obtained [15]. 1 1 1 ,0 fal '( , , ) , 0 , e e e e                 (10) Its characteristics directly affect the observation performance, which in turn affects the performance of the control system. From equation (9) and (10), it can be seen that the fal function is not smooth and conductible although it is continuous in the domain of definition, and the sudden change of the derivative affects the performance of the system and leads to oscillations in the system. To overcome this phenomenon, the fal function needs to be improved. Given that the trigonometric function has better continuity and smoothness near the far point, in order to avoid the inflection point, the trigonometric function is used to fit the function and finally an Ifal function is constructed in the form shown below. 2 1 2 3( , , , ) sin sin tanhIfal e k e k e k e      (11) To satisfy that the function is continuous and derivable when |e|=δ, 93 1 2 1 4 2 1 3 4 tanh tanh 3(1 tanh ) 0 3(1 tanh ) k k k                                  (12) The improved Ifal function is as follows. 3 1 3sin sin , fal( , , , ) ( ), k e k e e I e e sign e e              (13) From Figures 3 and 4, it can be seen that the Ifal function can avoid the problem that the slope of the fal function is too large near the origin and there is an inflection point, and it is smoother near the origin. Ifal function in |e| <= δ, the function gain is larger, and there is no sudden increase, the gain control effect will be better. Figure 3. Enlargement of the function curve origin Figure 4. Gain diagram of function curve error Figure 5. Quadrotor UAV control system 3.4 Attitude Control Based on Active Disturbance Rejection Control For the three channels of pitch, yaw and roll, both internal and external disturbances are regarded as total disturbances, and the total disturbances of each channel are independently estimated and compensated in real time using the expanded state observer, so as to achieve the goal of decoupling. The structure of the system is shown in Figure. 5, and the system is divided into four independent loops, namely, altitude control loop, pitch control loop, roll control loop and yaw control loop, and the ADRC controller is applied to each of the four loops. 4. Simulation and Analysis of Results Table 1. Three Scheme comparing Parametric Physical Meaning Value m Gross weight of quadrotor 1.4kg l Quadrotor airframe radius (1/2 wheelbase) 0.225 m g gravitational acceleration 9.8 m/s² Ix Moment of inertia about the x-axis 1.349e-2 kg.m² Iy Moment of inertia about the y-axis 1.349e-2 kg.m² Iz Moment of inertia about the z-axis 2.352e-2 kg.m² CT Lift coefficient 8.102e-6 N/(rad/s)² CM inverse torsion coefficient (ITC) 1.051e-7 N.m/(rad/s)² 94 In order to verify the control effect of the improved ADRC above, the mathematical model of the quadrotor UAV is built in MATLAB/Simulink according to the control structure and compared with the traditional ADRC control. The parameters of the unmanned helicopter are shown in Table 1, and the parameters of the improved ADRC are shown in Table 2. In order to ensure the rigor of the experiment, the traditional ADRC control parameters are set the same as the improved ADRC parameters. Table 2. Three Scheme comparing Segment Parametric Roll Pitch Yaw TD r0 20 20 20 h0 0.05 0.05 0.05 ESO β01 30 30 30 β02 300 300 300 β03 1000 1000 1000 α1 0.75 0.75 0.75 α2 0.5 0.5 0.5 α3 0.25 0.25 0.25 δ 0.006 0.006 0.006 b0 0.06 0.9 102 λ 2 2 2 NLSEF β1 200 150 180 β2 120 120 120 α1 0.5 0.5 0.5 α2 0.05 0.05 0.05 δ0 1 3 3 Based on the parameters established in the controller model, UAV attitude simulation experiments were conducted in this study. The dynamic response curves of each controller for the UAV pitch angle channel when the step input r(t) = 0.2 and the time-varying input r(t) = 0.2sin(2t) are given in Figure. 6 in the absence of the internal model and external environmental disturbances. (a). r(t)=0.2 (b). r(t)=0.2sin(2t) Figure 6. Dynamic response of controllers without interference From Figure. 6(a) and (b), it can be seen that for pitch angle, both control schemes have small-amplitude errors in tracking the sinusoidal signal, but the improved control system has a faster dynamic response and smaller tracking errors. A quadrotor UAV often encounters external wind disturbances during flight, which causes a large deviation of its actual pitch angle. In order to verify the anti-jamming capability using the improved ADRC, the random sudden wind disturbance received during the flight of the quadrotor UAV is simulated with white noise at 3 seconds. The dynamic response curves of the UAV pitch angle channel controller in the presence of random mutant wind disturbances are given in Fig. 7 when the step input r(t) = 0.2 and the time-varying input r(t) = 0.2sin(2t). (a). r(t)=0.2 (b). r(t)=0.2sin(2t) Figure 7. Dynamic response of controllers with external environmental interference From Figure. 7(a) and (b), it can be seen that the UAV pitch angle tracking curve shows some fluctuations under the white noise interference, and the control system designed in this paper demonstrates a stronger anti-interference ability to effectively suppress the disturbance when the quadrotor UAV is subjected to a stronger random wind interference in the flight process. 5. Conclusion In this paper, a quadrotor UAV dynamics model is established, and the fal function is improved by combining the trigonometric function to address the problems that the fal function is not smooth and conductible, and the sudden change of the derivative affects the performance of the system. 95 The improved fal function is applied to the ADRC controller. Through MATLAB/Simulink simulation, the fastness, overshoot and anti-jamming performance of the improved ADRC in quadrotor UAV attitude control are better than that of the traditional ADRC. Acknowledgments This work was supported by School of Automation and Information Engineering, Sichuan University of Science & Engineering. References [1] L. Deng, Y. He and Q. Liu, “Research on Application of Fire Uumanned Aerial Vehicles in Emergency Rescue,” in 2019 9th International Conference on Fire Science and Fire Protection Engineering (ICFSFPE), Chengdu, China, 2019, pp. 1-5. [2] S. Umeda, N. Yoshikawa,Y. Seo,“Cost and Workload Assessment of Agricultural Drone Sprayer: A Case Study of Rice Production in Japan,”Sustainability, vol.14, pp.10850- 10850, Aug. 2022. [3] H. Alsulami, “Implementation analysis of reliable unmanned aerial vehicles models for security against cyber-crimes: Attacks, tracebacks, forensics and solutions,” Computers and Electrical Engineering, vol.100, pp.107870-107870, May. 2022. [4] M. J. Ren, J. H .Guo, “Design of small attack quadrotor UAV system,” Electronics Optics & Control, vol.24, pp. 88-90+99, Aug. 2017. [5] Kara, Tolgay, A. H. Mary, “Robust trajectory tracking control of robotic manipulators based on model-free PID-SMC approach,”Journal of Engineering Research, vol.6, pp. 170-188, May. 2018. [6] B. Abci, Z. Gang, D. Efimov, et al,“Robust Aititude and Atitude Sliding Mode Contollers for Quadrotors,”IFAC - Papers Online, vol.50, pp. 170-188, Jun. 2017. [7] M. Wu,B. Tu, Y. Luo, “Trajectory-tracking control for quad- rotor aircraft based on back-stepping sliding mode,” Flight Dynamics, vol.36, pp. 47-51, Feb. 2018. [8] X. Y .Qiao,W. Y. Zhou,G. Q. Wu, “Fal Function Improvement of ADRC and its Application in Drag-Free Satellite,” Aerospace Control, vol.40, pp. 38-44, Aug. 2022. [9] W. Q. Yang, J. H. Lu, X. Jiang, “Design of quadrotor attitude active disturbance rejection controller based onimproved ESO,” Systems Engineering and Electronics, vol.44, pp. 3792-3799, Sep. 2022. [10] B. Y. Liu, M. Q. Li, J. W. Yang, “Attitude control of quadrotoraircraft based on improved active disturbance rejection,” Command control and simulation, vol.43, pp. 398- 102, Mar. 2021. [11] Z. W. Chen, Z. Z. Zhang,Y. J. Cao, “Improvement of activedisturbance rejection fal function and its application in attitudecontrol of quadrotor,” Control and Decision, vol.33, pp. 1901-1907, Mar. 2018. [12] Q. Quan, Multi-rotor Vehicle Design and Control. Beijing: Electronic Industry Press, 2018: 89-105. [13] H. Liang, Y. Xu and X. Yu, “ADRC vs LADRC for quadrotor UAV with wind disturbances, ” in 2019 Chinese Control Conference (CCC), Guangzhou, China, 2019, pp. 8037-8043. [14] J. Q. Han , “Auto-disturbances-rejection Controller and It‘s Applications,” Control and Decision, vol.13, pp. 19-23, Jan. 1998. [15] S. Gu, J. Zhang and Y. Li, "Generalized Variable Gain ADRC for Nonlinear Systems and Its Application to Delta Parallel Manipulators," in IEEE Transactions on Circuits and Systems I: Regular Papers, vol. 70, no. 2, pp. 921-930, Feb. 2023.