High-order sliding mode observer-based trajectory tracking control for a quadrotor UAV with uncertain dynamics

This paper investigates the trajectory tracking problem of the quadrotor unmanned aerial vehicles (UAV) with consideration of both attitude and position dynamics. First of all, the trajectory tracking problem is divided into the commands tracking in position and attitude loops by introducing the virtual attitude angle commands. Secondly, the high-order sliding mode observers (HSMOs) are introduced to estimate the lumped disturbances in position loop and the derivatives of the attitude angle tracking errors, the lumped disturbances in the attitude loop. And then the composite nonlinear dynamical inversion controller in position loop and the composite nonsingular terminal sliding mode controller in attitude loop are constructed by introducing the estimation information of HSMOs into controller design process. Finally, the simulations based on the data of a practical UAV are carried out to verify the effectiveness of the proposed method.


Introduction
Unmanned aerial vehicles (UAVs) have the advantages of low cost, high flexibility, no personal casualty, and they are being utilized in more and more fields such as aviation reconnaissance and rescue in disasters [1]. Due to its unique ability of hovering, vertical takeoff and landing, quadrotor UAVs have been widely applied in both the military and economic areas, such as tactics reconnaissance, pinpoint takeoff, and fixed point monitoring. Since most missions of quadrotor UAVs can be achieved by tracking a certain trajectory, highprecision trajectory tracking control is the core technique of quadrotor UAVs [2]. However, its characteris-tics of nature nonlinearity and strong couplings among different channels bring much challenges to the controller design of quadrotor UAVs. Besides, with the increasing complexity of the flight environment, multisource disturbances such as the external disturbances, model uncertainties and unmodeled dynamics also seriously limit the tracking precision of quadrotor UAVs.
To deal with the challenges in the trajectory tracking control of quadrotor UAVs, many effective linear control methods have been proposed. Based on the linearized model, traditional control method such as the proportional integral derivative (PID) and linear quadratic regulation (LQR) methods was employed in [3]. Although the PID and LQR methods realized the hovering action of quadrotor UAVs, the tracking precision deteriorates dramatically when the reference is a three-dimensional trajectory.
To attenuate the influence of nonlinearities and multi-source disturbances, many nonlinear control methods have been utilized in the quadrotor UAVs based on the nominal nonlinear model [4][5][6][7]. The nonlinear robust control method is employed in [4] to realize the path tracking missions, and it guarantees null tracking error and robustness in the presence of uncertainties. The adaptive output feedback control method is proposed in [5] based on an optimized filter, and the trajectory tracking experiment demonstrates its robustness to time delay and noises. The study in [6] proposed a parameter-scheduled backstepping method by combining the command filtered backstepping method with parameter scheduling technique, and the experiment test verifies its effectiveness. In [7], the model predictive control and H ∞ control are employed in position and attitude loops of the quadrotor UAVs separately, and the integral control scheme guarantees the null steady-state tracking error for quadrotor UAVs in the presence of disturbances. However, it should be noted that all the above methods handle the multi-source disturbances in a robust way, which implies that the robustness to disturbances is achieved at the price of sacrificing the nominal control performance.
Recently, the disturbances observer-based control (DOBC) method [8] has attracted wide attentions due to its fast disturbance rejection ability [9]. Inspired by the conception of DOBC, many composite trajectory tracking methods have been developed for the trajectory tracking of quadrotor UAVs such as the composite PID control method based on linear disturbance observer [10], the active disturbance rejection method based on extended state observer [11], the composite dynamic surface control method based on sliding mode observer [12], etc. These composite control methods not only obtain strong disturbance rejection ability in the presence disturbances but also guarantee the nominal performance of baseline controller.
Due to its simple design procedure and strong robustness against uncertainty, the sliding mode (SMC) methods have been widely employed in flight control systems such as the hypersonic vehicles [13,14], Mars entry process [15,16], missile guidance systems [17,18], unmanned helicopter systems [19,20]. Recently, the SMC methods are also widely utilized in the trajectory tracking missions of quadrotor UAVs such as the traditional sliding mode controller [21], integral sliding mode controller [22], terminal sliding mode controller [23], fast terminal sliding mode controller [24], etc. Among the SMC community, the nonsingular terminal sliding mode (NTSM) control [25] is a hot research topic since it guarantees not only the finite-time reach of sliding manifold but also finite-time convergence of system output. Inspired by the NTSM method and the DOBC conception, the author in [26] constructed a composite NTSM controller based on the estimation of single-hidden-layer feedforward network in the attitude loop and it guaranteed the finite-time convergence of attitude tracking error. However, the assumption that the attitude angles are small around the balance position limits the method only applicable to the simple trajectory cases.
In this paper, a dual composite control structure for the complex trajectory tracking of a quadrotor UAV is proposed. Firstly, the trajectory tracking problem is divided into commands tracking in position and attitude loops. Secondly, the high-order sliding mode observer (HSMO) [27] is introduced to estimate the lumped disturbances both in position and attitude loops. And then, the composite nonlinear dynamical inversion controllers are constructed in position loop by introducing the disturbance estimations of HSMOs. Finally, the composite NTSM controllers are constructed by introducing the estimation information of HSMOs into the NTSM controller design process. Compared with the existing studies, the proposed method has the following remarkable merits: (1) relaxing the restrictions on reference trajectory; (2) asymptotical convergence of position tracking error in the presence of time-varying disturbances; (3) nominal performance recovery of the baseline controller.
The remainder of this paper is organized as follows. The model of quadrotor UAVs is established, and the control problem is formulated in Sect. 2. Sect. 3 gives the controller design details. The comparative results between the proposed method and traditional method are shown in Sect. 4. Finally, a brief conclusion is summarized in Sect. 5.

Model of quadrotor UAVs
As shown in Fig. 1, a quadrotor UAV contains four independent rotors and its dynamics are governed by the angular velocities of the four rotors. Rotors 1, 3 and Rotors 2, 4 spin in the counter-clockwise and clockwise direction, respectively. The earth-based coordinate system {E} (O e , X e , Y e , Z e ) and the body-fixed coor- to describe the position [x, y, z] and attitude angles [φ, θ, ψ] of the quadrotor UAV.
Define the angular velocities of the four rotors as ω 1 , ω 2 , ω 3 , ω 4 , the total lift in the Z b direction as U L , and the torques around the body frame axis as τ x , τ y , and τ z , and then it can be obtained: where k L denotes the lift coefficient, b denotes the antitorque coefficient, and l is the length of the quadrotor arm. Considering the quadrotor UAV as a rigid body and its structure is symmetrical, the model of the quadrotor UAV can be obtained as: where x, y, z represent the position in inertial frame, m is the mass, g is the gravity coefficient, k t is the drag coefficient; φ, θ, ψ represent the roll angle, pitch angle and yaw angle, p, q, r denote the angular rates around the axes of the body frame, J x , J y and J z are the moments of inertia; F dx , F dy , and F dz denote the external disturbance forces, τ dx , τ dy , and τ dz denote the external disturbance torques.

Problem formulation
Since position and heading angle are the most important variables for a quadrotor UAV to realize certain tasks, we set the control objectives of controller design as to track a desired trajectory (x d , y d , z d ) with desired heading angle ψ d . To simplify the position dynamics (2), we introduce the following virtual control action in position loop: Define the trajectory tracking error as: where x d , y d , z d represent the desired position. With the definition of e x , e y and e z in mind, combining Eqs.
(2) and (5) yields the position tracking error dynamics in three channels as: It can be observed from Eqs. (5) and (6) that the position control of the quadrotor UAV is realized by regulating the virtual acceleration a xu , a yu and a zu through changing the attitude angles φ, θ and the lift force U L . Therefore, the control objective in the attitude loop (3)-(4) is set as to track the desired attitude angles required in position loop. The desired value of φ, θ and U L can be calculated based on Eq. (5) as: To simplify the attitude dynamics (3)-(4), we introduce the following definitions: Thus the attitude dynamics (3)-(4) can be rewritten in the following compact form: Define the tracking error of attitude angles as: T are the desired attitude angles, ψ d is the desired heading angle, and φ d and θ d are calculated from the transfer in Eq. (7). The tracking error dynamics of the attitude angles can be obtained from Eq. (8) as follows: with whereΘ d andΘ d are the derivatives and second-order derivatives of the desired attitude angles. Therefore, the control objectives of trajectory tracking with a desired heading angle for quadrotor UAVs are transferred to stabilize the tracking errors in position and attitude loops, i.e., stabilize e x , e y , e z in Eq. (6) and e Θ in Eq. (9).

Controller design and stability analysis
3.1 High-order sliding mode observer design Assumption 1 The external disturbance forces F dx , F dy , F dz in the position loop (2) and the external disturbance torques τ dx , τ dy , τ dz in attitude loop (4) are differentiable, and their derivatives are bounded.

Observer design in position loop
It deduces from Assumption 1 that there exist positive constants l po1 , l po2 , l po3 which satisfy: To estimate the external disturbance force F dx , F dy and F dz , the HSMOs in the position loop are designed based on Eqs.
(2) and (5) as follows: Define the disturbance estimation errors as: Since l po1 , l po2 , l po3 satisfy Eq. (10), based on the theorem in [27], we obtain that e dx , e dy and e dz converge to zero in finite time, i.e.,F dx ,F dy andF dz approach to F dx , F dy and F dz , respectively, in finite time.

Observer design in attitude loop
It should be noted thatΘ d in the attitude loop (9) is unmeasured variable since φ d and θ d are obtained based on Eq. (7) through calculations. As a result,ė Θ is unmeasured, we need to estimate not only the lumped disturbance D A but alsoė Θ in the observer design of the attitude loop.
To make the observer design more straightforward in attitude loop, the observers in different channels are designed separately and independently in the following step. The attitude angles tracking error dynamics (9) can be rewritten in a decoupling form as: It can be obtained from Assumption 1 that there exist positive constants l Ao1 , l Ao2 , l Ao3 which satisfy: To estimateė φ ,ė θ ,ė ψ and D A1 , D A2 , D A3 in Eq. (15), the HSMOs in attitude loop are designed as: Define the estimation errors of observers (17)- (19) as: Considering l Ao1 , l Ao2 and l Ao3 satisfy Eq. (16), it can be concluded based on the theorem in [27] that e A1 , e A2 , e A3 and e D1 , e D2 , e D3 converge to zero in finite time.

Composite controller design
Considering the fact that, the control action in the position loop of a quadrotor UAV is realized by changing the attitude angles in the attitude loop, we divided the controller design into two parts: position loop and attitude loop.

Controller design in position loop
Theorem 1 For the position loop subsystem (6), based on the estimation information of HSMOs (11)-(13), the following composite nonlinear dynamical inversion (CNDI) controller: It needs to point out that the virtual control action a xu , a yu and a zu in the position loop (6) are regulated by changing the attitude angles φ and θ . Therefore, the reference of attitude angles can be obtained by substituting the virtual control action a xu , a yu and a zu into the transfer (7).
It should be noted that the real control actions in the attitude loop (8) are τ x , τ y , τ z and they can be calculated by substituting τ 1 , τ 2 , τ 3 into the following equation:

Control action reconstruction for full control loop
Since the control actuators of the quadrotor UAVs are the four rotors, the real control actions for the full control loop are achieved by regulating the rotor speeds ω 1 , ω 2 , ω 3 and ω 4 . It deduces from Eq. (1) that the desired rotor speeds can be calculated based on the value of U L , τ x , τ y and τ z as: where U L is calculated based on Eq. (7) and (21) and τ x , τ y and τ z are calculated based on Eqs. (23) and (24). It can be concluded that if Theorem 1 and Theorem 2 are established, the real control actions ω 1 , ω 2 , ω 3 and ω 4 which are obtained based on Eq. (25) guarantee the quadrotor UAV converges to its desired trajectory with desired heading angle asymptotically. Therefore, it is only need to prove Theorem 1 and Theorem 2 in the following stability analysis part.

Stability analysis
It can be found from Eqs. (6), (9), (21) and (23) that both the dynamics and controllers in the three control channels of position and attitude loops are symmetrical. Therefore, it is only need to prove the stability in one channel. Without loss of generality, we choose the proof objectives as to prove following two statements: (i) a xu guarantees e x converges to zero asymptotically; (ii) τ 1 guarantees e φ converges to zero in finite time.

Proof in position loop
The proof is divided into following two steps: (i) asymptotical convergence of system states after the lumped disturbances F dx being estimated accurately; (ii) finite-time boundness of system states before the lumped disturbances F dx being estimated accurately. (i) Asymptotical convergence of system states after disturbance being estimated accurately; With Eq. (14) in mind, substituting the control law (21) into the position tracking error dynamics (6) yields: Since the disturbance estimation error e dx converges to zero in finite time, there exists a bounded constant t x which satisfies that when t ≥ t x , e dx = 0 is kept. When t ≥ t x , the close-loop dynamics of e x in Eq. (26) is governed by the following dynamics: Define a Lyapunov function in terms of e x andė x as: Taking the derivative of V x along Eq. (27) yields: It can be deduced from Eqs. (27) and (29) thatV x = 0 can be kept only at the point e x = 0,ė x = 0. Based on the LaSalle theorem in [28], it concludes that the dynamics (27) guarantee e x converges to zero asymptotically.

(ii) Finite-time boundness of system states;
Before the lumped disturbances F dx being estimated accurately, the tracking error dynamics of e x are governed by Eq. (26). Considering the fact that e dx is the estimation error of HSMO (11) and m is a constant, e dx m is bounded. Let us view the term e dx m in Eq. (26) as the system input, since e dx m is bounded and the autonomous system (27) is asymptotically stable, it can be obtained from the bounded input and bounded output (BIBO) theorem in [28] that system states e x andė x in Eq. (26) are bounded. This denotes the position tracking error e x and its derivativeė x are bounded no matter F dx is accurately estimated or not.
It can be concluded from the above proof that under the controller (21), system states of the tracking error dynamic (6) are bounded, and after the disturbance being estimated accurately, the tracking error e x converges to zero asymptotically. Therefore, the controller (21) guarantees the tracking error e x converges to zero asymptotically.

Proof in attitude loop
The proof is divided into following three steps: (i) finite-time boundness of system states; (ii) finite-time convergence of sliding variable; (iii) finite-time convergence of system states. with Define a finite time bounded function [29] in terms of e φ ,ė φ and σ 1 as: Taking the derivative of V eφ along Eqs. (30) and (31) yields: Note that for arbitrary α ∈ (0 1), |x| α ≤ 1 + |x| is always established and m 1 , n 1 are odds and satisfy 0 < m 1 < n 1 < 2m 1 , it can be deduced from above equation thaṫ The above equation can be rewritten in a compact form: with Since c 1 , k 1 are positive bounded constants and e D1 , e A1 are the estimation errors of HSMO (17), e eë φ is the derivative of e A1 , both K V and L V are positive and bounded. It yields from Eq. (32) that Therefore, for any bounded time T, V eφ is bounded, i.e., V eφ and e φ ,ė φ will not escape to infinity when t ≤ T .

(iii) Finite-time convergence of attitude angle tracking error;
Since σ 1 converges to zero in finite time, there exists a bounded constant t σ 1 which satisfies that when t ≥ t σ 1 , σ 1 = 0 is kept. Since the disturbance estimation error e A1 and e D1 converge to zero in finite time, there exits a bounded constant t Ae which satisfies that when t ≥ t Ae , e A1 = 0 and e D1 = 0 are kept. Define a bounded constant t T as Since t T is bounded, system states e φ (t T ) andė φ (t T ) are bounded. When t ≥ t T , the first equation in Eq. (22) is reduced to In this case, the dynamics of e φ in system (9) are governed by Eq. (36). According to the conclusion in [30], e φ will start from e φ (t T ) and then converge to zero in finite time, i.e., the attitude angle tracking error e φ converges to zero in finite time, which completes the proof. Similar to the above proof, it can be proved that the proposed controller also guarantees the quadrotor UAV to track its reference trajectory in y and z position channels. The whole control structure of the proposed sliding mode observer-based composite method is demonstrated as Fig. 2.  13) and (17)-(19) only need to be designed to satisfy Eqs. (10) and (16). If there is no prior knowledge onḞ dx ,Ḟ dy ,Ḟ dz andḊ A1 , D A2 ,Ḋ A3 , we can choose relative big observer gains l po1 , l po2 , l po3 and l Ao1 , l Ao2 , l Ao3 by trial and error.

Remark 2
The attitude angle references φ d , θ d are obtained based on the virtual control actions a xu , a yu and a zu through Eq. (7). To guarantee the continuity of φ d , θ d , the virtual control actions should be continuous. Two strategies are utilized in this paper to improve the continuity degree of virtual control actions: (1) the dynamical inversion controller rather than NTSM controller is designed in position loop; (2) although the second-order HSMOs can guarantee the finite-time estimation of disturbance in position loop, the thirdorder HSMOs (11)-(11) are designed to improve the continuity of disturbance estimation.

Simulation setting
The tracking performance of the proposed sliding mode observer-based composite trajectory tracking controller is tested in this part through numerical simulations. The traditional method without sliding mode observer is also employed here as a comparison. The body parameters of the quadrotor UAV in the simulation are set as Table 1. The initial states of the quadrotor UAV are set as: The reference trajectory is set as a complex cylindrical spiral curve which is defined as The traditional method has the similar structure and control parameters with the proposed method except for the disappear of the disturbance estimation termŝ F dx ,F dy ,F dz in Eq.
The traditional controller in attitude loop is designed as: It should be noted thatê φ ,ê θ andê ψ in the above traditional controller are obtained by self-contained differentiator of MATLAB.

Simulation results
The trajectory tracking responses under the proposed composite controller and traditional controller are shown in Fig. 3. As shown in Fig. 3a, the reference trajectory is a complex cylindrical spiral curve, and the proposed controller guarantees the quadrotor UAV track the reference with high precision, while the quadrotor UAV under the traditional controller deviates its reference seriously. It also can be observed from Fig. 3b-d that the composite controller guaran- The heading angle tracking response is shown in Fig. 5. It can be observed from the zoomed in figure of Fig. 5b that under the proposed composite controller, the setting time is less than 3 s and the steady-state tracking error is smaller than 0.1 • . While Fig. 5 also shows that the traditional controller cannot guarantee the heading angle converge to its reference.  Figure 6 illustrates the virtual control action responses. As shown in Fig. 6a, the response curve of lift force U L i.e., τ x , τ y and τ z , are nonsmooth due to the existence of the signal function in attitude controller (23). Figure 6 also demonstrates that the traditional method has similar control response curves with the proposed method, and this denotes the comparison of the two methods is reasonable. Figure 7 illustrates the rotor speed response of the four rotors. It can be observed from Fig. 7 that the maximum speed of the four rotors is less than 4000 r/min, which is acceptable for the rotors. By zooming in the response curves of the four rotors during the time period 4 ≤ t ≤ 6, it can be found that the response curves are smooth and the maximum changing rates of the rotor speed are less than 500 rad/s 2 and this is also acceptable in practical engineering. It concludes from the comparison between Figs. 6 and 7 that although the virtual control actions τ x , τ y and τ z are nonsmooth, the real control actions ω 1 , ω 2 , ω 3 and ω 4 are continuous and they can be realized by practical quadrotor UAVs.
The estimation performance of the HSMOs is given in Figs. 8 and 9. As shown in Fig. 8, the lumped disturbance in three channels of the position loop, i.e., F dx , F dy and F dz , is estimated with high precision after a short interval (less than 3 s), and the maximum estimation errors of the three channels are less than 5 N, 3 N and 6 N, respectively. Figure 9 demonstrates the estimation performance of angular rates in attitude loop. It can be observed from the zoomed in figure of Fig. 9 that the angular rates can be estimated with high precision. This verifies the effectiveness of the sliding mode observer in position loop.

Conclusion
This paper has investigated the complex trajectory tracking problem of a quadrotor UAV with consideration of both attitude and position loop dynamics. A new composite control method based on HSMO techniques has been proposed to handle the external disturbances and serious couplings of the quadrotor UAV. The proposed method not only relaxes the restrictions on the types of reference trajectory but also guarantees the asymptotical convergence of trajectory tracking error in the presence of multi-source disturbances. The simulation results based on the data of a practical quadrotor UAV have validated the effectiveness of the proposed method. Considering the wide applications of artificial intelligence techniques in the driving systems [31,32], we will try to introduce the artificial intelligence techniques to recognize the situations of quadrotor UAVs to achieve the autonomous control of the quadrotor UAVs.