Robust Dual-Channel Disturbance Rejection Attitude Control for a Quadrotor UAV: Theory and Experiment

In this paper, a robust dual-channel disturbance rejection control based on an inner-outer loop control framework is proposed for the attitude control of the quadrotor under modeling uncertainties and unknown disturbances. In the outer loop, a tracking differentiator is introduced to obtain smooth tracking signals and their derivatives. In addi-tion, an outer loop controller is developed with the tracking signals set as the desired signals. In the inner loop, a robust dual-channel disturbance rejection controller based on a sliding mode observer is constructed, which contains an inner disturbance rejection channel (IDRC) and an outer disturbance rejection channel (ODRC). In the IDRC, a disturbance rejection compensator is designed to obtain the disturbance compensation values and to compensate a part of the lumped disturbances in the attitude dynamic model. In the ODRC, an inner loop controller with variable-gain switching terms and constant-gain switching terms is designed, whose switching terms are used to compensate the remaining part of the lumped disturbances in the attitude dynamic model. By using the proposed control scheme, the robustness is guaranteed, and the chattering phenomenon caused by the variable-gain switching terms is greatly reduced. The stability of the proposed scheme is analyzed by using the Lyapunov theory. Finally, the effectiveness is tested by the platform experiments.


Introduction
In recent years, unmanned aerial vehicles (UAVs) have received extensive attention from researchers. The quadrotor as a typical UAV is widely used in the fields of agriculture, military, aerial photography, transportation, communication due to its low cost, vertical take-off and landing, and precise hovering [1][2][3]. The mathematical model of a quadrotor has the characteristics of underactuated, strong coupling and nonlinearity. In addition, there are multiple uncertainties and disturbances such as modeling uncertainties, measurement delays, wind gusts in the actual flight [4,5]. These factors will bring challenges to the controller design. The attitude control of a quadrotor is an essential prerequisite to complete various tasks, which is investigated in this paper.
Multiple control schemes, such as proportional-integralderivative (PID) [6][7][8], backstepping control [9,10], adaptive control [11][12][13], model predictive control (MPC) [14,15], sliding mode control (SMC) [16][17][18], intelligent control [19][20][21], H ∞ control [22], robust control [23,24], are applied to the attitude control of the quadrotor. In this introduction, the trajectory tracking control of the quadrotor under modeling uncertainties and unknown disturbances is concerned. In [8], the torques generated by one of the propellers are attenuated to simulate the external disturbances, and a nonlinear PID controller is designed to improve the tracking performance of the quadrotor. Backstepping-based attitude and position controllers are provided in [10] for the trajectory tracking control of the quadrotor in the presence of partial actuator failures, wind gusts and unmodeled rotor dynamics. The disturbance observer is designed to estimate and compensate the lumped disturbance, and the switching terms are added to compensate the disturbance estimation errors. In [13], an adaptive finite time attitude control based on the supertwisting algorithm (STA) and the equivalent control is proposed. The adaptive gains are obtained to compensate the unknown disturbances. A recursive least squares (RL-S) algorithm is introduced to estimate model parameters of a quadrotor in [15], and an adaptive MPC is presented by using the model parameters. In [18], a high-order sliding mode observer (SMO) is introduced to estimate the lumped disturbances. A composite nonlinear dynamical inversion position controller and a composite nonsingular terminal sliding mode attitude controller are designed by using the estimation information. In [20], an adaptive fuzzy global SMC is proposed for the trajectory tracking control of the quadrotor under parameter uncertainties and external disturbances. The fuzzy system is used to replace the switching term of SMC to eliminate the chattering phenomenon. In [24], a robust control based on the hierarchical control scheme and the robust compensating technique is provided for the trajectory tracking control of the quadrotor under multiple timevarying uncertainties and delays, and the effectiveness of the scheme is verified by experimental results.
Active disturbance rejection control (ADRC) is a control algorithm with the characteristics of strong robustness and less relying on precise dynamic model, which has been widely applied and developed [25]. ADRC is composed of tracking differentiator (TD), extended state observer (ES-O) and nonlinear state error feedback control law (NSEFL) [26]. In [25], a novel nonlinear ESO is proposed by introducing a nonlinear function to further improve the estimation performance of the observer. By using the nonlinear ESO, an attitude controller based on an inner-outer loop control framework is designed. In [27], a nonsingular fast terminal sliding mode control based on the TD and the ESO is proposed by replacing the NSEFL of ADRC with the designed sliding mode controller to improve the attitude tracking performance of the quadrotor. The attitude and position controllers of the quadrotor based on ADRC are provided in [28] for the trajectory tracking control of the quadrotor under internal uncertainties and unknown external disturbances. In [29,30], the attitude controllers based on an inner-outer loop control framework are designed for the attitude tracking control of the quadrotor under wind gusts, and ADRC is adopted in inner loop controllers. In addition, platform experiments are carried out to evaluate the effectiveness of the control schemes. In [31], a fault tolerant controller based on ADRC is proposed for trajectory tracking control of the quadrotor subject to actuator faults, wind gusts and measurement noises. In the above control schemes, the ESOs are used to estimate and compensate the lumped disturbances of the systems. However, it is not the most effective scheme that the disturbance estimate is directly used to compensate the lumped disturbance due to modeling uncertainties and unknown disturbances. It can not guarantee that the estimation errors are in a small range at any time due to the characteristics of the observer error models. In fact, the disturbance estimation errors of the observers are large when the lumped disturbances are fast time-varying, which will reduce the trajectory tracking performance.
To solve the above problems, a robust dual-channel disturbance rejection control (RDCDRC) is proposed in this paper. The TD is introduced to obtain smooth tracking signals and their derivatives. The SMO is introduced to estimate the virtual disturbances. Compared with the previous work in [25][26][27][28][29][30][31], the main contributions of this paper are as follows.
(1) The RDCDRC based on an inner-outer loop control framework is proposed by introducing a disturbance rejection compensator (DRC) to improve the attitude tracking performance of the quadrotor under model uncertainties and unknown disturbances. The stability of the proposed method is analyzed by the Lyapunov theory. (2) The variable-gain switching terms are added to the inner loop controller, which can improve the robustness of the system and guarantee that the chattering phenomenon caused by the variable-gain switching terms is small.
The platform experiments are carried out to evaluate the effectiveness of the proposed control scheme.
The rest of this paper is organized as follows. In Sect. 2, the attitude model of the quadrotor is introduced. The control architecture is given in Sect. 3. In Sect. 4, the proposed control scheme is described in detail. In Sect. 5, the experimental results are shown. Finally, the conclusions of this paper are given in Sect. 6.

System modeling
The attitude model of the quadrotor is given in this section. According to [32], the attitude kinematic model and attitude dynamic model can be written as follows.
φ (t) = tan(θ (t)) sin(φ (t))q(t) + tan(θ (t)) cos(φ (t))r(t) where φ (t), θ (t), ψ(t) ∈ R are the roll, pitch and yaw angles, respectively; the terms p(t), q(t), r(t) ∈ R are the roll, pitch and yaw angular velocities, respectively; the terms u p (t), u q (t), u r (t) ∈ R are the roll, pitch and yaw control inputs in the attitude dynamic model, respectively; the terms J xx ,  Fig. 1: The diagram of the proposed control scheme J yy , J zz ∈ R are the moments of inertia along x-axis, y-axis and z-axis, respectively; the terms d p (t), d q (t), d r (t) ∈ R are the roll, pitch and yaw unknown external disturbances, respectively.
The relationship between the control inputs and the angular velocities of four propellers is given as where u z (t) ∈ R is the total thrust control input; k F > 0 and k T > 0 represent the thrust coefficient and the reaction torque coefficient of propellers, respectively; l > 0 is the distance between a propeller and the origin of the quadrotor; m > 0 is the mass of the quadrotor; ω i (t) ∈ R(i = 1, ..., 4) are the angular velocities of propellers, respectively.

Control architecture
In this section, the control architecture of the proposed control scheme is described. The control scheme is based on an inner-outer loop control framework. An outer loop controller is designed in the outer loop. In particular, a robust dual-channel disturbance rejection controller is designed in the inner loop, which contains an inner disturbance rejection channel (IDRC) and an outer disturbance rejection channel (ODRC). The diagram of the proposed control scheme is shown in Fig. 1. Firstly, the TD is designed according to [33] to reduce the high-frequency noise in the reference signals and to avoid the actuator saturation caused by the large derivatives of the reference signals. The tracking signal vector η r1 (t) can be obtained by the TD according to the reference signal vector η r (t), where η r (t) := [φ r (t), θ r (t), ψ r (t)] T ∈ R 3 and η r1 (t):= [φ r1 (t),θ r1 (t), ψ r1 (t)] T ∈ R 3 . The terms φ r (t), θ r (t), ψ r (t) are the reference signals of roll, pitch and yaw angles, respectively; the terms φ r1 (t), θ r1 (t), ψ r1 (t) are the tracking signals of φ r (t), θ r (t), ψ r (t), respectively. The angles are controlled by the outer loop controller with the tracking signal vector η r1 (t) as the desired trajectory vector, and the angular velocities are controlled by the robust dual-channel disturbance rejection controller with the output vector of the outer loop controller as the desired trajectory vector.
Similarly, the coupling part of the attitude dynamic model (4)-(6) is regarded as a disturbance. The model (4)-(6) is rewritten aṡ where the control input vector Assumption 3 Suppose that the lumped disturbances f p (t), f q (t), f r (t) are bounded and differentiable, and their derivatives are bounded.

Let the output vector of the inner loop controller
are the outputs of the inner loop controller of roll, pitch, yaw angles, respectively. Let the disturbance compensation vector are the disturbance compensation values of roll, pitch and yaw angles, respectively. f c σ (t) is used to compensate a part of f σ (t), and let According to (9), the model (8) can be rewritten aṡ where The are the virtual disturbances of roll, pitch and yaw angles, respectively.
In the inner loop, the DRC is designed, which can obtain the disturbance compensation vector f c are the virtual disturbance estimates of roll, pitch, yaw angles, respectively. In order to estimate the virtual disturbances in real time, the input vectors of the SMO in the proposed control scheme are the output vector of the inner loop controller u I (t) and the angular velocity vector σ (t).

Tracking differentiator
The high-frequency noise is usually contained in the reference signals. In order to obtain smooth reference trajectories, the TD is designed according to [25] as follow.
), respectively. r 0 > 0 is the speed factor. The physical limits of the quadrotor should be considered in the selection of r 0 . The tracking speed of the TD can be improved by increasing r 0 , but the overlarge r 0 will lead to overshoot. In order to carry out the experiments, the discrete form of TD (12)-(13) is given as where h is the sampling period, and Ξ h (k): Taking the roll angle as an example, and f han(·) is expressed as

Sliding mode observer
In this part, the SMO is designed to estimate the virtual disturbances in real time. The lumped disturbances of the attitude dynamic model are limited in Assumption 3. According to (11), the SMO can be designed to estimate the virtual disturbance vector f v σ (t) if the disturbance compensation values f c p (t), f c q (t), f c r (t) satisfy the same limits. In the following controller design, the disturbance compensation values are designed as bounded and differentiable variables with bounded derivatives. In this case, we have the following assumption.
The estimation error vectorsσ (t),f v σ (t) are defined as The termsp(t),q(t),r(t) are the angular velocities estimation errors of the roll, pitch and yaw angles, respectively. The termsf v p (t),f v q (t),f v r (t) are the virtual disturbance estimation errors of the roll, pitch and yaw angles, respectively.

Controller design
In this part, the RDCDRC based on the inner-outer loop framework is described. Firstly, the DRC is designed as where k w > 0 is a constant, the term According to (19) and (24), we can conclude that the disturbance compensation values f c p (t), f c q (t), f c r (t) are differentiable. From (11) and (21), we havê Take the derivative of (24). From (25), we can get thaṫ which is a low-pass filter (LPF). k w is the cut-off frequency of the LPF. f a is the input vector of the LPF, and f c σ (t) is the output vector of the LPF. According to (26), Assumptions 3 and 5, it can be given that the disturbance compensation values f c p (t), f c q (t), f c r (t) are bounded, and their derivatives are bounded.
From (11), (21) and (26), we havė which is a high-pass filter(HPF). k w is the cut-off frequency of the HPF, and f a σ (t) is the input vector of the HPF at the same time.f v σ (t) is the output vector of the HPF.

Remark 1
The LPF (26) and the HPF (27) can be derived if the DRC is designed as (24), and they are derived to explain the relationship between f c σ (t) and f a σ (t) and the relationship betweenf v σ (t) and f a σ (t).
Let the angular velocity error vector e σ (t) The terms e p (t), e q (t), e r (t) are the angular velocity tracking errors of the roll, pitch and yaw angles, respectively. The terms p r (t), q r (t), r r (t) are the reference signals of the roll, pitch and yaw angular velocities, respectively.
Considering the attitude dynamic model (10), the inner loop controller is designed as where k 1 > 0, k 2 > 0, k 3 > 0, δ > 0 are adjustable coefficients, the variable switching gain vector Λ (t) := [a p (t), a q (t), a r (t)] T ∈ R 3 , the constant-gain switching term κ 1 (k 3 , e σ (t)) := [k 3 sign(e p (t)), k 3 sign(e q (t)), k 3 sign(e r (t))] T , and the variable-gain switching term κ 2 (Λ (t), e σ (t), δ ) := [a p (t) sat(e p (t)), a q (t) sat(e q (t)), a r (t) sat(e r (t))] T . In addition, the variable switching gains a p (t), a q (t), a r (t) are defined as a p (t):= |f v p (t)|, a q (t) := |f v q (t)|, a r (t) := |f v r (t)|, respectively. The function sat(·) is defined as According to the DRC (24) and the inner loop controller (28), the robust dual-channel disturbance rejection controller is designed as Remark 2 In the IDRC, a part of the lumped disturbance vector is compensated by the disturbance compensation vector. The remaining part of the lumped disturbance vector, that is the virtual disturbance vector, is compensated by the constant-gain switching terms and the variable-gain switching terms in the ODRC.
Then, the outer loop controller is designed to improve the attitude tracking performance. The attitude angles cannot be directly controlled by the outer loop controller, but they can be indirectly controlled by changing the reference signals of the inner loop controller. Let the output vector of the outer loop controller is used as the reference signal vector of the inner loop controller, that is From (30), the attitude kinematic model (7) can be rewritten aṡ Let the angle tracking error vector e η (t) := η(t)−η r1 (t), where e η (t) := [e φ (t), e θ (t), e ψ (t)] T ∈ R 3 . The terms e φ (t), e θ (t), e ψ (t) are the roll, pitch and yaw tracking errors, respectively.
According to the attitude kinematic model (31), the outer loop controller is designed as

Stability analysis
Theorem 2 Considering the attitude dynamic model (8) with the robust dual-channel disturbance rejection controller (29), the angular velocity tracking errors e p (t), e q (t), e r (t) can be arbitrarily small by increasing k 2 , k 3 and decreasing δ if the SMO (18)- (19) is effective and the outer loop controller is designed as (32).
From (21), inequality (36) can be rewritten as It can be obtained from (37) that the allowable range of the virtual disturbance estimation errorf v p (t) is related to the virtual disturbance estimatef v p (t), D 1 , k 1 and k 3 . When the absolute value of the virtual disturbance estimatef v p (t) increases, a larger range of the virtual disturbance estimation errorf v p (t) can be allowed. Case 2: According to (35) and Assumption 2, if |e p (t)| ≥ δ , and (36) is not satisfied, we can get thaṫ It can be given that if |e , δ ) can be obtained as t → ∞, where the function max(x 1 , x 2 ) represents the maximum value in x 1 and x 2 . In this case, the angular velocity tracking error e p (t) can be arbitrarily small by increasing k 2 , k 3 and decreasing δ .
Case 3: According to (35), Assumptions 2 and 4, if |e p (t)| < δ , theṅ , δ ) can be obtained as t → ∞, where the function min(x 1 , x 2 ) represents the minimum value in x 1 and x 2 . In this case, e p (t) can be arbitrarily small by increasing k 2 , k 3 and decreasing δ .
The Lyapunov functions of the pitch and yaw dynamic model are taken as V Dq (t) = 1 2 e 2 q (t) and V Dr (t) = 1 2 e 2 r (t), respectively.
Similarly, it can be obtained that the angular velocity tracking errors e q (t), e r (t) can be arbitrarily small by increasing k 2 , k 3 and decreasing δ . ⊓ ⊔ Remark 3 According to the above proof, the tracking performance of the system can be improved by increasing k 3 , but the overlarge k 3 will cause chattering phenomenon. When fast time-varying disturbances are added, the disturbance estimation errors will increase due to the dynamic characteristics of the observer error model (22)- (23). According to (27), when fast time-varying disturbances are added, the absolute values of the virtual disturbance estimates are larger. According to (37), the range of the allowable disturbance estimation error is large at this time. This is helpful to reduce the influence of virtual disturbance estimation errors.

Theorem 3
Considering the attitude kinematic model (31) with the outer loop controller (32), the angle tracking errors e φ (t), e θ (t), e ψ (t) can be arbitrarily small by increasing k 1 , k 2 , k 3 and decreasing δ if the robust dual-channel disturbance rejection controller (29) is effective.
Proof Take the Lyapunov function of the roll angle Take the derivative of (40) . Therefore, the roll tracking error can be arbitrarily small by increasing k 1 , k 2 , k 3 and decreasing δ .
The Lyapunov functions of the pitch and yaw angles are taken as V Oθ (t) = 1 2 e 2 θ (t) and V Oψ (t) = 1 2 e 2 ψ (t), respectively. Similarly, the pitch and yaw tracking errors can be arbitrarily small by increasing k 1 , k 2 , k 3 and decreasing δ . ⊓ ⊔

Experimental results
In this section, the control performance of the proposed control scheme will be evaluated, and the comparison experiments with PID and composite disturbance rejection control (CDRC) [26] are carried out. In this paper, the attitude control of the quadrotor is mainly considered. Hence, let the total thrust control input u z (t) = 11m/s 2 . The parameters of the quadrotor are m = 0.81kg, l = 0.18m, J xx = The control performance of the quadrotor is tested by using the experimental platform as shown in Fig. 2. The data in the quadrotor, remote controller and ground station are exchanged through wireless data transmission modules. The reference signals of roll, pitch and yaw angles are sent from the remote controller to the quadrotor, and the system states are sent from the quadrotor to the ground station. The period of sending the reference signals is 5 milliseconds, and the period of sending the system states is 66 milliseconds. The hardware of the quadrotor is composed of one flight control board (FCB) and four electronic speed controllers (ESCs). The motor speed commands are sent from the FCB to the ESCs through serial peripheral interface (SPI) bus. The microcontroller and the inertial measurement unit (IMU) of the FCB are STM32F405RGT6 and BMI055, respectively. The attitude angles are calculated in the microcontroller of the FCB according to the angular velocities and accelerations of the quadrotor obtained by the IMU. The calculation of the control algorithm is also completed in the microprocessor of the FCB. The microcontroller, gate drivers, and metaloxide-semiconductor field effect transistors (MOSFETs) of the ESCs are STM32F103T8U6, FD6288Q and IRFH7440, respectively. The brushless direct current motors (BLDCMs), propellers and power supply are EMAX RS2205 KV2300, EMAX 6038 and 3S 2200mAh 45C LIPO battery, respectively. The speed of BLDCMs can be controlled by the ESCs according to the motor speed commands. The control period and the period for the FCB to send the motor speed commands are 1 millisecond.
The tracking performance and the disturbance rejection performance of the quadrotor are tested, respectively. In order to facilitate the comparative experiments, the quadrotor is connected with the bracket through the spherical cardan As shown in Fig. 3, the quadrotor can effectively track the reference trajectory with fast response speed and low tracking error by using RDCDRC. In the experiments, the bracket will produce disturbances in roll and pitch angles. As shown in Fig. 4, the roll and pitch angular velocities of the quadrotor can still effectively track the reference angular velocities. As shown in Fig. 5, the designed controller can respond quickly and suppress the disturbances.
Scenario 2: In this part, the disturbance rejection performance of the quadrotor is evaluated under step disturbances. The step disturbances are produced by suddenly applying and removing the weights of 0.1kg and 0.2kg, as shown in Fig. 6a. The distances between the hanging points of the weights and the origin of the quadrotor are 0.1m, respectively. The torques of 0.1Nm and 0.2Nm are produced by the  As shown in Fig. 7, the tracking errors of the attitude angles are smaller by using RDCDRC. The maximum absolute values of the roll, pitch and yaw tracking errors in the experiments are shown in Table 1. As shown in Fig. 8, when the weights are suddenly applied and removed, the angular velocities change rapidly. Then, the angular velocities quickly return to the reference trajectories due to the action of the controller. As shown in Fig. 9, the virtual disturbance estimates change rapidly when the weights are suddenly applied and removed, while the changes of the disturbance compensation values are relatively slow. When the weights remain suspended, the virtual disturbance estimates return to the origin, while the disturbance compensation values are in a certain range. The variable switching gains are larger when the lumped disturbances are fast time-varying, which is helpful to reduce the influence of virtual disturbance estimation errors. The variable switching gains are smaller when the disturbances are slowly time-varying, which is helpful to reduce the chattering phenomenon caused by the variablegain switching terms. The control inputs of RDCDRC are shown in Fig. 10.  Scenario 3: In this part, the disturbance rejection performance is evaluated under wind gusts. As shown in Fig. 6b, the high-pressure gas of 0.6MPa is produced by the air compressor, which is triggered by two air blow guns. When the air blow guns are triggered, the wind speed at 0.13m away from the nozzle is 26m/s, and then gradually decreases to 7m/s. The air blow guns are respectively placed at 0.13m below two propellers and triggered at 10s. The reference trajectories of roll, pitch and yaw angles are set to zero. The experimental results are shown in Figs. 11-13. As shown in Fig. 11, when the wind gusts are applied suddenly, the quadrotor can suppress the wind gusts more quickly by using RDCDRC. The maximum absolute values  Table 2. The torques produced by wind gusts are time-varying. As shown in Fig. 12, when wind gusts are applied, the virtual disturbance estimates change rapidly, while the disturbance compensation values change relatively smooth. When the wind gusts are applied, the variable switching gains increase, which is helpful to reduce the influence of disturbance estimation errors. When the wind speeds are small, the variable switching gains decrease, which is helpful to reduce the chattering phenomenon caused by the variable-gain switching terms. As shown in Fig. 13, the controller can respond quickly to reduce the influence of wind gusts.

Conclusion
In this paper, the RDCDRC based on an inner-outer loop control framework is proposed for the attitude control of the quadrotor in the presence of modeling uncertainties and unknown disturbances. The robust dual-channel disturbance  rejection controller based on the SMO is designed in the inner loop. When the disturbances are suddenly applied, the variable switching gains are larger. At this time, a larger range of virtual disturbance estimation errors can be allowed. When the disturbances are slow time-varying, the variable switching gains are small, which can effectively reduce the chattering phenomenon caused by the variable-gain switching terms.

Data availability statement
The datasets of the current study are available from the corresponding author on reasonable request.

Conflicts of interest
The authors declare that they have no conflict of interest.