A hybrid robust adaptive control for a quadrotor UAV via mass observer and robust controller

The flight stability and safety of the quadrotor unmanned aerial vehicle (UAV) with variable mass are the key problems that limit its application. In order to improve the stability and steady-state control precision of the quadrotor system against slow-varying mass and external disturbance, a new robust adaptive flight control algorithm is developed and analyzed in detail in this paper. Firstly, a mass observer based on adaptive control theory is designed to estimate the real-time mass and correct the mass parameter of the UAV. Then, a hyperbolic tangent function and a proportional integral (PI) controller is added into the attitude controller to eliminate the effect of the external disturbances. Finally, a hybrid robust adaptive controller (HRAC) developed with backstepping control method is used here for the trajectory tracking of quadrotor. The boundedness of the nonlinear system is verified by Lyapunov stability theory and uniformly ultimately bounded theorem. The trajectory tracking simulation experiments are presented in MATLAB/SIMULINK simulation environment. According to the simulation results, the real-time mass of quadrotor can be estimated by HRAC satisfactorily under the condition of external disturbances, while the estimate error of mass is only 6.4% of its own. In addition, HRAC can provide a higher trajectory tracking accuracy compared with robust optimal backstepping control (ROBC) and robust generalized dynamic inversion (RGDI). The results suggest a promising route based on the mass observer and hybrid robust controller toward slow-varying mass and the external disturbance as effective robustness control strategy for quadrotor UAV.


Introduction
As a new kind of unmanned aerial vehicle (UAV), quadrotor has been developed as a promising contender in small UAV research field for its compact size, light weight and flexible operation, compared with helicopter and fixed-wing airplane. [1][2][3] Furthermore, quadrotor has been widely concerned and used in military surveillance, border interdiction, rescue missions, agriculture services, photography, etc., due to its functions of performing vertical taking-off and landing, low-altitude hovering and low-speed cruising. [4][5][6][7][8][9] Though quadrotor has many advantages compared with other vehicles, the application of quadrotor has been restricted because the quadrotor system is underactuated (six control outputs and only four control inputs), high nonlinear, strongly coupled and has a time-varying nature.
Therefore, the improvement of the flight control system appears to be quite important and challenging. [10][11][12] Recently, many different control methods like linear control, nonlinear control, and intelligent control are used for the control system of quadrotor UAV. For example, a linear matrix inequality (LMI) based robust quadrotor control algorithm by Ryan and Kim 13 ; a fuzzy backstepping algorithm has been used to study the problem of trajectory tracking according to Yacef et al., 14 ; Nikolakopoulos and Alexis's 15 studied an attitude control through switching networked; a disturbance observer based on sliding mode control is proposed by Besnard et al. 16 to eliminate the effect of the external disturbances; Shirzadeh et al. 17 has studied a tracking problem of moving targets by neural network. The flight control system of quadrotor has been improved greatly with the efforts of scientists in the past few years. However, most of these researchers concentrate mainly on the control technology of quadrotor with constant mass instead of taking the mass change into account.
When the quadrotor is used to carry out some special tasks such as pesticide spraying, pollination, and firefighting, its mass could change significantly during the release of the carried substances with a difference of more than two third of its initial mass. At the same time, quadrotor can be affected by the external disturbances caused by air stream as well. Due to these factors, a huge control error usually occurs during the quadrotor flight, with the side-effect of some undesirable consequences. Therefore, it is very important to design a high performance control algorithm for the quadrotor UAV system with slow-varying mass to ensure the flight safety and flight quality of the UAV. One focus of this study is to supplement the previous studies, where the mass of the quadrotor is assumed to be constant despite the mass change. While the effects of the mass varying on quadrotor has been overly ignored. The mass changes are viewed as disturbances or model errors such as an active model control scheme proposed in literature, 18 in which the model error was used to describe the load variation. This scheme is only applicable to mass mutation systems. However, for the slow-varying mass system, the control performance is not ideal. The steady state error is large, because there is no real-time estimation of the slow variable quality parameters of the UAV. Real-time estimation of quality parameters is the key difficulty to improve the control performance of slow-variable quality UAV control system at present. Therefore, in this paper, in order to solve the problems caused by the slow-varying mass and the external disturbance, a new hybrid robust adaptive flight control algorithm is designed and developed for the quadrotor UAV. The design process of the control method is as follows: Firstly, a mass observer based on adaptive control theory was designed for the quadrotor UAV with slow-varying mass to estimate the real-time mass and correct the mass parameter of the quadrotor. Secondly, a hyperbolic tangent function of the second kind of error and a PI controller was added into attitude controller to eliminate the effect of the external disturbances. At last, a hybrid robust adaptive controller (HRAC) was developed with backstepping control method and the boundedness of the nonlinear system was verified by Lyapunov stability theory and uniformly ultimately bounded theorem. Simulation results show that HRAC can provide a higher trajectory tracking accuracy compared with robust optimal backstepping control (ROBC) 19 and robust generalized dynamic inversion (RGDI). 20 Because the external disturbance can be eliminated effectively and the real-time mass of the quadrotor can be estimated satisfactorily using HRAC with an estimate error of only 6.4% of its own mass. In this paper, the estimation accuracy of the quality parameters using the quality observer is obviously improved in the proposed control algorithm. In addition, the anti-interference ability of the system is also improved by using the hybrid robust controller. Then, the steady-state control accuracy of the system is improved. Therefore, according to the results of this study, HRAC is proved to be a promising technology to be applied effectively in controlling quadrotor UAV with slow-varying mass under the external disturbance.
This paper is organized as follows: a detailed dynamics model of quadrotor is presented in Section 2. Design process of classical backstepping controller is described in Section 3. The hybrid robust adaptive controller for the quadrotor UAV are proposed in Section 4. The trajectory tracking simulation results are presented in Section 5. Conclusions are given in Section 6.

System modeling of quadrotor UAV
As shown in Figure 1, an earth fixed frame E (x e , y e , z e ) and a body fixed frame B (x b , y b , z b ) are used to study the system motion of quadrotor. j = ½x, y, z T and h = ½f, u, c T are the vectors of linear displacement and angular displacement in earth fixed frame E, where the roll angle (f), the pitch angle (u) and the yaw angle (c) are the three Euler angles around x-axis, y-axis, and z-axis, respectively. The linear velocity and the angular velocity of the airframe are denoted as V = ½u, v, w T and X = ½p, q, r T in the body fixed frame B. The relation of velocities in the earth fixed frame E and the body fixed frame B can be given as where, R and N are the translation matrices which can be written as sin(Á), cos(Á), and tan(Á) are denoted as S (Á) , C (Á) , and T (Á) , respectively. The three Euler angles (roll, pitch, and yaw) of quadrotor produced by varying the four rotor speeds reasonably are shown in Figure 1. Then, the corresponding movements of quadrotor arose in the direction of x, y, and z, and the flight movements of quadrotor are shown in Figure 2.
Considering the properties like the structure of the quadrotor which has a very strong rigidity and symmetry, or its usual operation at low speed and limited attitude angles, some reasonable assumptions listed as follows are made first in order to simplify the modeling as well as to accommodate the controller design 21,22 : Assumption 1: The quadrotor system has a rigid body and strictly symmetric structure.

Assumption 2:
The quadrotor's center of mass coincides exactly with the body fixed frame origin.
Using the Newton-Euler approach, the dynamic equations of quadrotor can be written as below: where F f , F d , and F g are the thrust force, the aerodynamic drag force and the gravitational force respectively; X 3 I X , M f , and M d are the gyroscopic torque, rotor torque, and aerodynamic torque, respectively. Substituting equations (1)-(3) into (4), and considering assumptions 1-4, the final dynamic model of the quadrotor system can be formulated as where J r is the rotor inertia and the control inputs are given as follows: The control input vector is given as where u x and u y are the two virtual control inputs which are defined as Design process of classical backstepping controller The aerodynamic drag force F d and the aerodynamic torque M d are ignored in this section because of the low speed of quadrotor, while the external disturbance is taken into account. Then the nonlinear dynamic equation of quadrotor system is represented as 19 where ð11Þ the abbreviations are given as Remark 1. The control input U 1 and the parameters m, b 1 , b 2 , and b 3 are nonzero, and C f .0, C u .0 according to Assumption 4, the diagonal elements of g X ð Þ are nonzero.
The state vector can be expressed as and the external disturbance can be expressed as The desired reference trajectory is defined as Based on Lyapumov theory, the design process of classical backstepping control (CBC) is given as follows: Step 1. The tracking error is introduced as then the derivative of E 1 can be obtained as Consider the Lyapunov candidate V 1 as where the V 1 is positive definite and the time derivative is For the purpose of stabilizing E 1 , a stabilizing function is designed as _ X is substituted for a 1 , then the equation (18) can be rewritten as where K 1 = k 1 k 3 k 5 k 7 k 9 k 11 ½ is the parameterized vector, and each parameter is a positive constant.
Step 2. The second tracking error is introduced as the derivative of E 2 can be obtained as The second Lyapunov candidate V 2 is considered as the derivative of V 2 with respect to time is Step 3. In order to stabilizing E 2 , the control law of control inputs U is given as where K 2 = k 2 k 4 k 6 k 8 k 10 k 12 ½ is the parameterized vector, and each parameter is a positive constant.
Substituting (25) into (24), the derivative of V 2 can be rewritten as namely _ V 2 is negative definite. Thus, the nonlinear system (10) is asymptotically stabilized using the control law (25).

Design of mass observer and position controller
For the quadrotor system with slow-varying mass, a mass observer based on the adaptive control theory is designed to estimate the real-time mass of the quadrotor UAV. Because the system mass is only related to the control inputs u x , u y , and U 1 from equation (25), the mass observer is used for position controller of the control system only as shown in Figure 3. The design process of mass observer is given as follows: Step 1. The system mass m of u x , u y , and U 1 in equation (25) is replaced by mass estimatorm, then and the nonlinear control functions g(x 1 ), g(x 2 ), and g(x 3 ) can further be rewritten aŝ g X 1 ð Þ=ĝ where X 1 = x 1 x 2 x 3 ð Þ . Similar to g X ð Þ, theĝ x 1 ð Þ, g x 2 ð Þ, andĝ x 3 ð Þ are nonzero as shown in Remark 1. Step 2. The observation error of the system mass is defined as the derivative of m with respect to time is approximate to zero, due to the slow change of the mass. Thus, the derivative of m d with respect to time is Step 3. The Lyapunov candidate V 3 is considered as the derivative of V 3 can be obtained as Step 4. In order to make the observation error convergence, the derivative ofm with respect to time is designed as where k m .0 is a mass adaptive parameter and e m = e 2 k 2 e 2 À e 1 À k 1 _ e 1 À € x 1d ð Þ + e 4 k 4 e 4 À e 3 À k 3 _ e 3 À € x 2d ð Þ + e 6 k 6 e 6 À e 5 À k 5 _ e 5 À € x 3d À g ð Þ Substituting (33) into (32), we have namely _ V 3 is negative semi-definite. Therefore, according to Lyapunov stability theorem, the mass observation error m d1 is asymptotically stabilized using the adaptive law (33).
The main external disturbance comes from the torques around x, y, and z-axis, because the disturbing forces on the three axes are small in practical application of quadrotor. Thus, the disturbing forces f d1 , f d2 , and f d3 can be ignored when the mass variation of quadrotor is large. Therefore, the position controller, namely control law of control inputs u x , u y , and U 1 can be rewritten as follows: Substituting (36) into (24), the _ V 2 e i , e i + 1 ð Þ , i = 1, 3, 5 can be obtained as follows: Design of attitude controller Due to the existence of the unpredictable external disturbance, a hybrid robust adaptive controller which is comprised of a PI controller and the hyperbolic tangent function of the second kind of error is added into attitude control law. The improved control law can be represented as follows: ð Þ À1 e 9 À f x 5 ð Þ+ € x 5d + k 9 _ e 9 À k 10 e 10 + l 3 e 9 + l 4 p 2 + l 8 q 2 ð Þ U 4 = g x 6 ð Þ À1 e 11 À f x 6 ð Þ+ € x 6d + k 11 _ e 11 À k 12 e 12 + l 5 e 11 + l 6 p 3 + l 9 q 3 ð Þ where l 1 , l 3 , and l 5 are the parameters of proportional, l 2 , l 4 , and l 6 are the parameters of integral, l 7 , l 8 , and l 9 are the parameters of the hyperbolic tangent function. The integral of e j j = 7, 9, 11 ð Þwith respect to time p i i = 1;3 ð Þ and the hyperbolic tangent function of e j j = 8, 10, 12 ð Þ q i i = 1;3 ð Þ can be given as HRAC proposed in this study is composed of a position controller (36) and an attitude controller (38). The position controller is designed by adding the mass observer (33) on the basis of the backstepping control law (25). The attitude controller is designed by adding PI controller and the hyperbolic tangent function on the basis of the backstepping control law (25).
Theorem 1: Considering Assumptions 1-4, if the system error is controlled with position controller (36) and attitude controller (38), the solutions to the nonlinear system of quadrotor (equation (10)) will be uniformly ultimately bounded.
Proof. For position controller: _ V 2 is negative semidefinite according to the equation (37). Thus, the position control system will be asymptotically stable according to Lyapunov theorem.
For attitude controller: Taking U 2 as an example. The Lyapunov candidate V 2 is the derivative of V 2 e 7 , e 8 ð Þwith respect to time is Substituting U 2 of (38) into (41), the _ V e 7 , e 8 ð Þcan be rewritten as Let A = l 2 p 1 + l 7 q 1 + d 4 , A is bounded because d 4 , l 7 q 1 , and l 2 p 1 after limiting the amplitude are bounded. Equation (42) can be obtained as where g is constants, and (43) can be represented as Let c = min 2 k 7 À l 2 which implies According to the uniformly ultimately bounded theorem of the nonvanishing perturbation, 23 errors e 7 and e 8 are uniformly ultimately bounded. In the same way, errors e 9 , e 10 , e 11 , and e 12 are all uniformly ultimately bounded with attitude controller (38). Since X d and _ X d are bounded, the solutions to the nonlinear system of quadrotor (equation (10)) will be uniformly ultimately bounded. 24 The quadrotor control scheme is shown in Figure 3.
The overall control performance of HRAC control method is much higher than that of CBC, ROBC, RGDI, and other control methods. This is mainly attributed to the following two aspects: On the one hand, the mass observation results was added in the position controller in HRAC, which can reduce the influence of mass parameter changes on position control. On the other hand, in the HRAC control method, a hybrid robust controller was introduced into the attitude controller, which can reduce the influence of external disturbance on attitude control.

Simulation results
In order to validate the new controller HRAC, the simulation experiments of trajectory tracking by sfunction of MATLAB/SIMULINK are implemented using RGDI, ROBC, and HRAC in this section. The physical and control parameters of the quadrotor UAV system are listed in Tables 1 and 2, respectively.
The desired inclined circular trajectory is generated using the following command:  Considering the practical application, the control performance requirements are as follows: the steady-state error of x, y, and z three-axis trajectory tracking is ł 0.3 m, and the steady-state error of yaw angle is ł 1 rad. In the simulation process, the expected trajectory of UAV tracking were recorded using RGDI, ROBC, and HRAC control algorithms, respectively. The steady-state tracking accuracy of various control methods is investigated under the influence of quality parameter change and external disturbance. Simulation results of trajectory tracking are shown in Figures 4 to 6, the tracking errors and the results of mass estimation are shown in Figures 7 and 8 respectively, Figures 9 to 11 show the control inputs with RGDI, ROBC, and HRAC.
As shown in Figures 4 to 6, the trajectory using HRAC is much closer to the desired trajectory than those using other two control methods, which indicates that HRAC can eliminate the effects from the slowvarying mass and the external disturbance more effectively than RGDI and ROBC. This can also been confirmed by the studies on the tracking errors of trajectory as shown in Figure 7. The tracking errors of trajectory are very large on the z-axis using RGDI and ROBC, which demonstrates that the tracking accuracy on the z-axis can be affected by the varying mass of quadrotor seriously. In contrast, the tracking error on the z-axis using HRAC has been reduced by 57.5% and 71.4% than those using RGDI and ROBC, which indicates that the HRAC method has an excellent robustness to the mass varying. The steady-state tracking errors of x, y, and z axes using HRAC are 0.12,    0.07, and 0.17 m, respectively and the steady-state error of yaw angle is 0.09 rad, which meets the requirements of control performance indicators.
In the process of simulation experiment, the realtime quality parameters of various control algorithms are also tested. From Figure 8, the real-time mass of the quadrotor that could not be estimated is always 1.555 kg using the RGDI and ROBC. Although there are some vibrations caused by external disturbance, the estimated value of mass using HRAC approaching the real mass incrementally over time with the average estimate error in 20 s being 6.4% of quadrotor's own mass.
As shown in Figures 9 to 11, each of the control inputs for the three controllers shows some vibrations at the beginning, and asymptotically gets stable after a second. Certainly there's an argument to be made that the control inputs of the three controllers are undersaturated and feasible because of the maximum value of the controller input U1 in the simulation experiments is no more than 20 N (The theoretical value of maximum thrust of the quadrotor is 40 N.).

Conclusions
In this paper, a mass observer is designed based on adaptive control theory, and a new controller HRAC is developed by combining the backstepping control    method, hyperbolic tangent function and PI control with the designed mass observer. The performance of HRAC controller is achieved by controlling the flight of quadrotor UAV with mass-varying under external disturbance effectively. The boundedness of the nonlinear system is verified by Lyapunov stability theory and uniformly ultimately bounded theorem. Simulation experiment results indicate that HRAC can accomplish the trajectory tracking of quadrotor accurately and be used as an effective flight controller in the actual quadrotor UAV controlling.

Future recommendation
In the future work, the mass observer should be further optimized to improve the accuracy of mass estimation. At the same time, the estimation performance of the system for the abrupt change of quality parameters would be investigated comprehensively.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.