Robust Dynamic Sliding Mode Control-Based PID – Super Twisting Algorithm and Disturbance Observer for Second-Order Nonlinear Systems : Application to UAVs

This paper introduces a robust dynamic sliding mode control algorithm using a nonlinear disturbance observer for system dynamics. The proposed method is applied to provide a rapid adaptation and strictly robust performance for the attitude and altitude control of unmanned aerial vehicles (UAVs). The procedure of the proposed method consists of two stages. First, a nonlinear disturbance observer is applied to estimate the exogenous perturbation. Second, a robust dynamic sliding mode controller integrated with the estimated values of disturbances is presented by a combination of a proportional–integral–derivative (PID) sliding surface and super twisting technique to compensate for the effect of these perturbations on the system. In addition, the stability of a control system is established by Lyapunov theory. A numerical simulation was performed and compared to recently alternative methods. An excellent tracking performance and superior stability of the attitude and altitude control of UAVs, exhibiting a fast response, good adaptation, and no chattering effect in the simulation results proved the robustness and effectiveness of the proposed method.


Introduction
The effects of undesirable disturbances widely occur in various practical engineering systems and provide an adverse performance to the precise control, and stability of a control system.Therefore, disturbance rejection is one of the crucial criteria and important objectives in designing a controller.Many advanced control algorithms to deal with this problem have been proposed in recent years.Generally, the existent research can be classified into two groups.In the first group, various controllers for a nonlinear system in the presence of disturbances have been introduced by using an adaptive or robust control technique to overcome the effects of these perturbations on the engineering systems.In the second group, a disturbance observer method is presented to estimate the unknown external disturbances and afterward a robust controller is achieved to compensate for the effect of perturbations on the system.

Related Works
Many approaches have been presented to attenuate the undesirable effects of disturbances on the engineering systems.The Sliding Mode Control (SMC) technique is well known for the strict robustness and efficiency of its control method in many complicated environments and system dynamics, because of its inherent ability to eliminate external disturbances.Therefore, classical SMC and advanced SMC are popular methods that are usually applied in various control systems, especially UAVs.However, the classical SMC method always generates the chattering phenomenon caused by a discontinuous term of the switching control law.This may result in the damage of the electrical and mechanical systems.Many studies on the advanced SMC or integration of extended SMC algorithm with other modern control techniques have been introduced that intend to overcome this disadvantage.The authors of [1,2] provided a second-order SMC and a global fast dynamic terminal SMC to improve the tracking performance of the attitude and position control for quadcopter UAVs.In [3,4], a continuous terminal SMC and dynamic SMC technique are proposed to improve the control performance of uncertainties nonlinear systems.Another approach is presented in [5] to overcome the instability of a quadrotor when actuator faults have occurred.An integration of adaptive fuzzy technique and SMC method to provide the robustness for the attitude control of the vehicle is introduced.In [6], an adaptive fuzzy PID-based nonsingular fast terminal SMC is presented to enhance the robustness for attitude control of a spacecraft.An adaptive fuzzy law is applied to estimate the parametric uncertainties of the system dynamics, and then, the PID non-singular fast terminal SMC is proposed to compensate for the effects of uncertainties on the nonlinear system.The authors of [7] introduced a robust adaptive SMC for the Takagi-Sugeno fuzzy system under the effect of exogenous disturbances and mismatched uncertainties.Both the sliding surface and SMC controller can be obtained by using the convex optimization technique.Although the combination of fuzzy technique and SMC method can be used to improve the control performance of an engineering system, the quality of fuzzy controller mostly depends on experience and knowledge of a controller designer about the system and uncertainties.Therefore, this method may not suitable for many engineering systems.In [8][9][10], a robust nonlinear controller is introduced by a combination of backstepping technique and sliding mode control methods to enhance the tracking performance of the attitude and position of a quadrotor UAV under bounded uncertainties and time-varying perturbations.In [11], a robust adaptive tracking controller for the attitude of a quadcopter is presented by designing an adaptive law to estimate the inertia matrix of the vehicle.The algorithm can also be extended to a general class of unstructured disturbances.In [12], an adaptive SMC method based on an adaptive law to estimate the unknown parameters of UAVs for stabilizing and tracking control of the vehicles is introduced.Although the procedure of designing controllers is very obvious, it is not easy to achieve the satisfactory controller gains.This method also exhibits limited performance in the presence of external disturbances.Another study is introduced in [13], where a robust adaptive tracking controller is proposed for quadcopter UAVs through the immersion and invariance methodology (I&I).In the attitude control, the integral of the signum of error method is applied to eliminate the external disturbances, while the I&I algorithm is used to control the position.In [14,15], an adaptive and robust controller for the attitude and position tracking of quadcopter aircrafts to reject the external disturbances, parametric uncertainties and delays is described.Other simple adaptive SMC methods to enhance the altitude and attitude tracking control for quadcopter UAVs are presented in [16,17].Although the adaptive law is clearly proven by Lyapunov stability and good adaptation, the chattering phenomenon still exists in the control system because the main approach of these controllers is based on the adaptive gain of a switching control law.The authors of [18] described the continuous SMC to strictly track a desired trajectory under the disturbance environment for a quadrotor.A sliding mode observer and cascaded continuous SMC are used for the altitude, yaw tracking control and horizontal tracking control, respectively.Other studies of conventional adaptive nonlinear control algorithms have been proposed to reject the perturbations.In [19], adaptive controllers based on direct and indirect model reference approaches for UAVs to enhance the tracking control performance under parametric uncertainties are proposed.The authors of [20] presented a continuous adaptive output feedback controller that obtains the globally asymptotic tracking of a reference model to eliminate the undesirable effect of external disturbances and uncertain parameters.The authors of [21] introduced a robust adaptive SMC algorithm based on an observer to stabilize the nonlinear system with external disturbances and sensor/actuator faults.However, a linearization process is a necessary requirement of the conventional adaptive control methods, and, sometimes, the singularity of the controller is available.Another approach to improve the robustness of a control performance for an unmanned micro-aerial vehicle based on mu-synthesis robust control techniques is proposed in [22,23].In [24][25][26][27][28], advanced robust adaptive controllers are introduced to guarantee the stability of attitude and position of UAVs in the presence of external disturbances and parametric uncertainties based on combining the radial basic function neural network method (RBFNN), integral SMC, and robust backstepping SMC.In this approach, the unknown parameters or external disturbances are approximated online by using the neural network technique.Therefore, the procedure to obtain these controllers is not a simple, especially it is not easy to determine the proper network structure.Furthermore, the intensive computation is inevitable.
Other approaches to attenuate the undesirable effects of perturbations or uncertainties are introduced by using disturbance observer techniques to estimate the external disturbances or unknown parameters from the measurable states, and then, many kinds of controller are designed to compensate for the effect of these perturbations.In [29,30], the disturbance observer integrated with a linear state feedback controller and linear quadratic regulator controller is proposed.However, the effect of external disturbance is not strongly eliminated.In [31][32][33], a nonlinear disturbance observer based on classical SMC methods is introduced to enhance the tracking control performance.Although the quality of control system is improved, the chattering effect is still existent due to a discontinuous term of the switching control law.The motivation of this paper is to design a superior controller with high quality robustness, good adaptation, and fast response without chattering effect on an engineering system.

Main Contributions
The contributions of this study are presented in three issues.First, a general procedure to design a robust dynamic sliding mode controller (RDSMC), which is integrated with the nonlinear disturbance observer (NDO), is presented by a combination of a proportional-integral-derivative sliding surface and super twisting algorithm for system dynamics.The highlight contribution of this method is to combine the advantages of PID controller and super twisting SMC.The PID function is used as a sliding surface to easily obtain the controller gain for the satisfactory control performance.Super twisting SMC function is considered as a switching control law to guarantee a fast response and no chattering effect.The NDO is added to eliminate the effect of external disturbance for improving the tracking performance of the proposed method.Second, the proposed method can be applied to attenuate the undesirable effects of exogenous disturbance in many different engineering systems by using this procedure.Third, the proposed algorithm was applied to UAVs, and the technological advantages of our method were demonstrated through a comparison of simulation results between the proposed method and existent approaches such as nonsingular terminal sliding mode control (NTSMC), classical super-twisting sliding mode control (STSMC), and modified super-twisting sliding mode control (M-STSMC) [34][35][36][37].

Organizations
The remainder of this article is organized as follows.Section 2 presents the general design procedure of a robust dynamic sliding mode control based on PID-Super twisting algorithm and nonlinear disturbance observer for a nonlinear system.In Section 3, the application of the proposed method to improve the tracking performance of attitude and altitude control of the quadcopter is presented.Section 4 provides the simulation results and discussions.Finally, the conclusions of this study are presented in Section 5.

Robust Dynamic Sliding Mode Controller Based on Nonlinear Disturbance Observer (RDSMC-NDO)
A second-order nonlinear system is considered as follows: .
where x = [x 1 , x 2 ] T , x 1 and x 2 represent states of system, y denotes output, u ∈ R denotes the controller input, f (x) and g(x) represent the smooth functions in term of x, and ξ(t) ∈ R denotes an external disturbance.
Equation ( 1) can be rewritten as: where T , and H(x) = x 1 A general procedure to design a robust dynamic sliding mode controller based on nonlinear disturbance observer is presented as following steps.
Step 1: An adaptive disturbance observer is applied to estimate the external disturbance ξ.
Step 2: The disturbance observer is integrated with a robust dynamic sliding mode control by replacing the external disturbance, ξ, with its estimation ξ.

Nonlinear Disturbance Observer
Let us assume that the external disturbance is considered as a harmonic disturbance with unknown amplitude but known frequency generated by an exogenous system as follows.

Robust Dynamic Sliding Mode Controller Based on Nonlinear Disturbance Observer (RDSMC-NDO)
A second-order nonlinear system is considered as follows: where x and 2 x represent states of system, y denotes output, u R ∈ denotes the controller input, ( ) f x and ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ denotes an external disturbance.

( ) H x x =
A general procedure to design a robust dynamic sliding mode controller based on nonlinear disturbance observer is presented as following steps.
Step 1: An adaptive disturbance observer is applied to estimate the external disturbance .
Step 2: The disturbance observer is integrated with a robust dynamic sliding mode control by replacing the external disturbance, , with its estimation  .

Nonlinear Disturbance Observer
Let us assume that the external disturbance is considered as a harmonic disturbance with unknown amplitude but known frequency generated by an exogenous system as follows. where , W is an m m × matrix, and E is a row matrix with dimension 1 m × .These matrices can be obtained by many existent approaches such as using an extended state observer [38], wind field estimation based on a Global Positioning System (GPS), Inertial Measurement Unit (IMU), airspeed, and magnetometer [39], or based on aerodynamics of motors and propellers [40].
be the estimates of ϒ and x , respectively; [ ] relative degree from the disturbance to the output.Now, referring to Chen's work [41], a nonlinear disturbance observer for a system as Equation ( 2) is obtained as follows: is the internal state of disturbance observer.The nonlinear function ( ) m p x R ∈ and observer gain ( ) l x are designed as follows: = W

Robust Dynamic Sliding Mode Controller Based on Nonlinear Disturbance Observer (RDSMC-NDO)
A second-order nonlinear system is considered as follows: where x and 2 x represent states of system, y denotes output, u R ∈ denotes the controller input, ( ) f x and ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ denotes an external disturbance.

( ) H x x =
A general procedure to design a robust dynamic sliding mode controller based on nonlinear disturbance observer is presented as following steps.
Step 1: An adaptive disturbance observer is applied to estimate the external disturbance .
Step 2: The disturbance observer is integrated with a robust dynamic sliding mode control by replacing the external disturbance, , with its estimation  .

Nonlinear Disturbance Observer
Let us assume that the external disturbance is considered as a harmonic disturbance with unknown amplitude but known frequency generated by an exogenous system as follows. where , W is an m m × matrix, and E is a row matrix with dimension 1 m × .These matrices can be obtained by many existent approaches such as using an extended state observer [38], wind field estimation based on a Global Positioning System (GPS), Inertial Measurement Unit (IMU), airspeed, and magnetometer [39], or based on aerodynamics of motors and propellers [40].relative degree from the disturbance to the output.Now, referring to Chen's work [41], a nonlinear disturbance observer for a system as Equation ( 2) is obtained as follows: is the internal state of disturbance observer.The nonlinear function ( ) m p x R ∈ and observer gain ( ) l x are designed as follows: A second-order nonlinear system is considered as follows: where x and 2 x represent states of system, y denotes output, u R ∈ denotes the controller input, ( ) f x and ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ denotes an external disturbance.

( ) H x x =
A general procedure to design a robust dynamic sliding mode controller based on nonlinear disturbance observer is presented as following steps.
Step 1: An adaptive disturbance observer is applied to estimate the external disturbance .
Step 2: The disturbance observer is integrated with a robust dynamic sliding mode control by replacing the external disturbance, , with its estimation  .

Nonlinear Disturbance Observer
Let us assume that the external disturbance is considered as a harmonic disturbance with unknown amplitude but known frequency generated by an exogenous system as follows. where , W is an m m × matrix, and E is a row matrix with dimension 1 m × .These matrices can be obtained by many existent approaches such as using an extended state observer [38], wind field estimation based on a Global Positioning System (GPS), Inertial Measurement Unit (IMU), airspeed, and magnetometer [39], or based on aerodynamics of motors and propellers [40].relative degree from the disturbance to the output.Now, referring to Chen's work [41], a nonlinear disturbance observer for a system as Equation ( 2) is obtained as follows: where Mode Controller Based on Nonlinear Disturbance Observer ystem is considered as follows: represent states of system, y denotes output, u R ∈ denotes the ) x represent the smooth functions in term of x , and ( ) t R x ∈ n as: [ ] ( ) sign a robust dynamic sliding mode controller based on nonlinear d as following steps.
ce observer is applied to estimate the external disturbance .ver is integrated with a robust dynamic sliding mode control by isturbance, , with its estimation  .er ternal disturbance is considered as a harmonic disturbance with frequency generated by an exogenous system as follows.
matrix, and E is a row matrix with dimension 1 m × .These y existent approaches such as using an extended state observer [38], a Global Positioning System (GPS), Inertial Measurement Unit eter [39], or based on aerodynamics of motors and propellers [40].nce to the output.ork [41], a nonlinear disturbance observer for a system as Equation ) te of disturbance observer.The nonlinear function ( ) m p x R ∈ and as follows: ∈ R m , W is an m × m matrix, and E is a row matrix with dimension 1 × m.These matrices can be obtained by many existent approaches such as using an extended state observer [38], wind field estimation based on a Global Positioning System (GPS), Inertial Measurement Unit (IMU), airspeed, and magnetometer [39], or based on aerodynamics of motors and propellers [40].
Let ˆ W 4 of 21

Mode Controller Based on Nonlinear Disturbance Observer
system is considered as follows: represent states of system, y denotes output, u R ∈ denotes the ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ e. tten as: ) 0, ( ) ( ) esign a robust dynamic sliding mode controller based on nonlinear ted as following steps.
nce observer is applied to estimate the external disturbance .erver is integrated with a robust dynamic sliding mode control by l disturbance, , with its estimation  .rver external disturbance is considered as a harmonic disturbance with n frequency generated by an exogenous system as follows. { m × matrix, and E is a row matrix with dimension 1 m × .These any existent approaches such as using an extended state observer [38], on a Global Positioning System (GPS), Inertial Measurement Unit meter [39], or based on aerodynamics of motors and propellers [40].bance to the output.work [41], a nonlinear disturbance observer for a system as Equation tate of disturbance observer.The nonlinear function ( ) m p x R ∈ and ed as follows: ∈ R m and ξ ∈ R be the estimates of

Robust Dynamic Sliding Mode Controller Based on Nonlinear Disturbance Observer (RDSMC-NDO)
A second-order nonlinear system is considered as follows: where , x and 2 x represent states of system, y denotes output, u R ∈ denotes the controller input, ( ) f x and ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ denotes an external disturbance.
Equation ( 1) can be rewritten as:

( ) H x x =
A general procedure to design a robust dynamic sliding mode controller based on nonlinear disturbance observer is presented as following steps.
Step 1: An adaptive disturbance observer is applied to estimate the external disturbance .
Step 2: The disturbance observer is integrated with a robust dynamic sliding mode control by replacing the external disturbance, , with its estimation  .

Nonlinear Disturbance Observer
Let us assume that the external disturbance is considered as a harmonic disturbance with unknown amplitude but known frequency generated by an exogenous system as follows. where

and
E is a row matrix with dimension 1 m × .These matrices can be obtained by many existent approaches such as using an extended state observer [38], wind field estimation based on a Global Positioning System (GPS), Inertial Measurement Unit (IMU), airspeed, and magnetometer [39], or based on aerodynamics of motors and propellers [40].relative degree from the disturbance to the output.Now, referring to Chen's work [41], a nonlinear disturbance observer for a system as Equation ( 2) is obtained as follows: is the internal state of disturbance observer.The nonlinear function ( ) m p x R ∈ and observer gain ( ) l x are designed as follows: constants to be given; L F denotes a Lie derivative of function F(x); and r is a relative degree from the disturbance to the output.Now, referring to Chen's work [41], a nonlinear disturbance observer for a system as Equation ( 2) is obtained as follows: Sliding Mode Controller Based on Nonlinear Disturbance Observer onlinear system is considered as follows: and 2 x represent states of system, y denotes output, u R ∈ denotes the ) and ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ isturbance.be rewritten as: ure to design a robust dynamic sliding mode controller based on nonlinear is presented as following steps.
disturbance observer is applied to estimate the external disturbance .ance observer is integrated with a robust dynamic sliding mode control by e external disturbance, , with its estimation  .nce Observer hat the external disturbance is considered as a harmonic disturbance with ut known frequency generated by an exogenous system as follows.
is an

and
E is a row matrix with dimension 1 m × .These ed by many existent approaches such as using an extended state observer [38], based on a Global Positioning System (GPS), Inertial Measurement Unit magnetometer [39], or based on aerodynamics of motors and propellers [40].Chen's work [41], a nonlinear disturbance observer for a system as Equation ws: ] [ ] ∈ and e designed as follows: amic Sliding Mode Controller Based on Nonlinear Disturbance Observer ) rder nonlinear system is considered as follows: ] T , 1 x and 2 x represent states of system, y denotes output, u R ∈ denotes the t, ( ) f x and ( ) g x represent the smooth functions in term of x , and ) can be rewritten as: ( ) procedure to design a robust dynamic sliding mode controller based on nonlinear erver is presented as following steps.
aptive disturbance observer is applied to estimate the external disturbance .isturbance observer is integrated with a robust dynamic sliding mode control by ing the external disturbance, , with its estimation  .isturbance Observer me that the external disturbance is considered as a harmonic disturbance with tude but known frequency generated by an exogenous system as follows. { W is an

and
E is a row matrix with dimension 1 m × .These obtained by many existent approaches such as using an extended state observer [38], ation based on a Global Positioning System (GPS), Inertial Measurement Unit , and magnetometer [39], or based on aerodynamics of motors and propellers [40].ring to Chen's work [41], a nonlinear disturbance observer for a system as Equation s follows: s the internal state of disturbance observer.The nonlinear function ( ) x are designed as follows: (4) where z ∈ R m is the internal state of disturbance observer.The nonlinear function p(x) ∈ R m and observer gain l(x) are designed as follows: According to the second-order nonlinear system in Equation ( 1), we can get m = 2. Therefore, the function p(x) can be achieved from Equations ( 2) and ( 5) as follows: From Equations ( 6) and ( 7), l(x) can be computed as: The general structure of nonlinear disturbance observer is constructed as shown in Figure 1.
Electronics 2019, 8, x FOR PEER REVIEW 5 of 21 According to the second-order nonlinear system in Equation ( 1), we can get m = 2. Therefore, the function ( ) p x can be achieved from Equations ( 2) and ( 5) as follows: ( ) e e e e e e e e From Equations ( 6) and ( 7), ( ) l x can be computed as: e e e e e e The general structure of nonlinear disturbance observer is constructed as shown in Figure 1.
General structure of NDO for harmonic disturbances.

Robust Dynamic Sliding Mode Controllers Design Based on Nonlinear Disturbance Observer
A robust dynamics sliding mode control algorithm is presented in this section.A controller is designed by a combination of the PID sliding surface and Super Twisting algorithm, and it also integrated the nonlinear disturbance observer to strictly eliminate the undesirable effects of exogenous disturbances on the second-order nonlinear systems.
Let d y denote a desired state of the system in Equation (1).A tracking error and its first derivative are defined as The PID sliding surface in space of error is chosen by: From Equations ( 10) and (11), it can be seen that, if

Robust Dynamic Sliding Mode Controllers Design Based on Nonlinear Disturbance Observer
A robust dynamics sliding mode control algorithm is presented in this section.A controller is designed by a combination of the PID sliding surface and Super Twisting algorithm, and it also integrated the nonlinear disturbance observer to strictly eliminate the undesirable effects of exogenous disturbances on the second-order nonlinear systems.
Let y d denote a desired state of the system in Equation .. e = ..
The PID sliding surface in space of error is chosen by: where k p , k i and k d are strictly positive constants.The derivative, .s(t), can be obtained from Equation (10), as follows: .
From Equations ( 10) and (11), it can be seen that, if s(t) = . s(t) = 0, then lim e(t) = 0 is strictly Hurwitz.It means that the close loop control system is globally asymptotically stable.
Let σ(t) be a new dynamic sliding surface given by: where λ is positive constant.Obviously, if the value of σ = 0, then the system .s + λs = 0 is asymptotically stable.Hence, lim t→∞ e(t) = 0, which implies that the robust controller can be designed based on σ(t).
The proposed RDSMC-NDO is presented in two methods as follows.
The dynamics sliding surface, σ(t), asymptotically converges to zero if a controller, .
where β is a positive value.
From Equation ( 16), it can be seen that, The dynamics sliding surface, σ(t), asymptotically converges to zero as the Lyapunov stability.
The dynamics sliding surface, σ(t), asymptotically converges to zero if a controller, .
u, is chosen as follows: .
where γ satisfies the below expression: Let a state vector υ = [υ 1 , υ 2 ] T be defined by: The derivative of υ is computed from Equations ( 26) and ( 28) as follows: Now, let us refer to a Lyapunov approach for super twisting algorithm of Moreno's work for the perturbed dynamics [42,43].The Lyapunov function is considered as: where The derivative of V 2 is computed from Equation (30) as follows: . where Using the bounded condition in Equation ( 27) for the disturbance as given in [42], the derivative of the Lyapunov function in Equation (31) satisfies the following expression: .
V 2 is negative definite if Q > 0, meaning that the controller gains k 1 , k 2 satisfy Equation (24).

Apply the RDSMC-NDO to UAVs
In this section, the proposed RDSMC-NDO is applied to enhance the tracking performance of attitude and altitude control of a quadcopter UAV to demonstrate the strict robustness and effectiveness of the proposed method in the presence of exogenous disturbances.

Dynamics Model of Quadcopter UAVs
The dynamics model of a quadcopter is described in many existent approaches [44][45][46][47][48][49][50][51].The essential frames include an Earth frame, E, and body frame, B, as shown in Figure 2 , represent the roll, pitch and yaw angles, respectively.x, y, z ∈ R denote the position of a quadrotor in the Earth frame.F i (i = 1,2,3,4) represents the thrust force generated by motors i. Ω i denotes the speed of the rotor i. ξ φ , ξ θ , ξ ψ , ξ h denote exogenous disturbances which impact on roll, pitch, yaw, and altitude dynamics of the vehicle, respectively.In this paper, the exogenous disturbance is considered as a harmonic disturbance with unknown amplitude but known frequency described by Equation (3).The dynamics model of the vehicle including exogenous disturbances can be described as follows [44].
where , 1, 2,3, 4 denote the control inputs of a quadrotor, which are computed as [44]: where Ω r represents the total residual angular speed of motors and g = 9.81 m/s 2 denotes the gravitational acceleration.The remaining parameters from Equations ( 32) and ( 33) are shown in Table 1.
Table 1.System parameters of a quadcopter.

System Parameters Descriptions
Moments of inertia along three axes x,y and z in the Earth frame m (kg) Total mass of a quadcopter The dynamics model of the vehicle including exogenous disturbances can be described as follows [44].
where U i ∈ R, i = 1, 2, 3, 4 denote the control inputs of a quadrotor, which are computed as [44]: where Ω r represents the total residual angular speed of motors and g = 9.81 m/s 2 denotes the gravitational acceleration.The remaining parameters from Equations ( 32) and ( 33) are shown in Table 1.
Table 1.System parameters of a quadcopter.

System Parameters Descriptions
I xx , I yy , I zz (kgm 2 ) Moments of inertia along three axes x,y and z in the Earth frame m (kg) Total mass of a quadcopter l (m) Arm length of the quadcopter frame b (Ns 2 ) Thrust coefficient Moment of inertial of a rotor Let X denotes a state vector defined by:
where f (X(t), , and

Attitude Controller
The full control scheme of quadcopter UAVs is constructed as multi-loop comprising an inner loop to control attitude and an outer loop that controls position, as shown in Figure 3.  Let d f be a desired state of roll control.The tracking error of roll angle and its first derivative are given by: The second derivative of tracking error, e f  , is computed by: . A sliding surface of roll control, s f , and its derivative, s f  , are chosen from Equations ( 10) and ( 11) as follows: (

k e t k e t k e t k e t k e t k f x g x U
where , , A dynamic sliding surface of roll control, f s , is given by Equation (12): Roll controller is obtained from Method 1: RDSMC-PID-NDO is given from Equation ( 17) as follows: where are positive values and satisfy the condition in Equation ( 16).
Roll controller is obtained from Method 2: RDSMC-PIDSTA-NDO is given in Equation ( 23) as follows where 1 2 , k k f f are positive values and satisfy the condition in Equation (24).
The pitch subsystem described in Equation ( 35) can be rewritten as follows: The roll subsystem described in Equation ( 35) can be rewritten as follows: .
Let us define A NDO to estimate the exogenous disturbance in roll subsystem is obtained by Equation ( 4), as follows: represent states of system, y denotes output, u R ∈ denotes the ( ) x represent the smooth functions in term of x , and ( ) t R x ∈ .en as: [ ] ce observer is applied to estimate the external disturbance .rver is integrated with a robust dynamic sliding mode control by disturbance, , with its estimation  .er ternal disturbance is considered as a harmonic disturbance with frequency generated by an exogenous system as follows. { m matrix, and E is a row matrix with dimension 1 m × .These ny existent approaches such as using an extended state observer [38], n a Global Positioning System (GPS), Inertial Measurement Unit eter [39], or based on aerodynamics of motors and propellers [40].ance to the output.ork [41], a nonlinear disturbance observer for a system as Equation ate of disturbance observer.The nonlinear function ( ) m p x R ∈ and d as follows: nlinear system is considered as follows: and 2 x represent states of system, y denotes output, u R ∈ denotes the and ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ urbance.rewritten as: [ ] isturbance observer is applied to estimate the external disturbance .ce observer is integrated with a robust dynamic sliding mode control by external disturbance, , with its estimation  .
ce Observer t the external disturbance is considered as a harmonic disturbance with t known frequency generated by an exogenous system as follows. { an m m × matrix, and E is a row matrix with dimension 1 m × .These d by many existent approaches such as using an extended state observer [38], based on a Global Positioning System (GPS), Inertial Measurement Unit agnetometer [39], or based on aerodynamics of motors and propellers [40].disturbance to the output.Chen's work [41], a nonlinear disturbance observer for a system as Equation s: ternal state of disturbance observer.The nonlinear function ( ) m p x R ∈ and designed as follows: where W φ , E φ are matrix of exogenous disturbance impacting on the roll subsystem with dimension 2 × 2 and 1 × 2, respectively.The functions p φ (x) and l φ (x) are obtained from Equations ( 7) and ( 8): and U 2 is RDSMC controller of the roll subsystem obtained by the two methods in Section 2. .. e φ (t) = ..
where β φ , k φ s are positive values and satisfy the condition in Equation ( 16).Roll controller is obtained from Method 2: RDSMC-PIDSTA-NDO is given in Equation ( 23) as follows . where are positive values and satisfy the condition in Equation ( 24).The pitch subsystem described in Equation ( 35) can be rewritten as follows: .
Let us define T , and H θ (x) = x 3 .A NDO to estimate the exogenous disturbance in pitch subsystem is obtained by Equation ( 4), as follows: x represent the smooth functions in term of x , and ( ) t R x ∈ e. ten as: ( ) esign a robust dynamic sliding mode controller based on nonlinear ed as following steps.
nce observer is applied to estimate the external disturbance .rver is integrated with a robust dynamic sliding mode control by disturbance, , with its estimation  .ver xternal disturbance is considered as a harmonic disturbance with n frequency generated by an exogenous system as follows. { m matrix, and E is a row matrix with dimension 1 m × .These ny existent approaches such as using an extended state observer [38], n a Global Positioning System (GPS), Inertial Measurement Unit eter [39], or based on aerodynamics of motors and propellers [40].
be the estimates of ϒ and x , T m e e e = , e given; F L denotes a Lie derivative of function ( ) F x ; and r is a ance to the output.ork [41], a nonlinear disturbance observer for a system as Equation

]
[ ] tate of disturbance observer.The nonlinear function ( ) m p x R ∈ and d as follows: and 2 x represent states of system, y denotes output, u R ∈ denotes the and ( ) g x represent the smooth functions in term of x , and turbance.e rewritten as: H x x = re to design a robust dynamic sliding mode controller based on nonlinear presented as following steps.
isturbance observer is applied to estimate the external disturbance .ce observer is integrated with a robust dynamic sliding mode control by external disturbance, , with its estimation  .
ce Observer at the external disturbance is considered as a harmonic disturbance with t known frequency generated by an exogenous system as follows. { an

and
E is a row matrix with dimension 1 m × .These d by many existent approaches such as using an extended state observer [38], based on a Global Positioning System (GPS), Inertial Measurement Unit agnetometer [39], or based on aerodynamics of motors and propellers [40].Chen's work [41], a nonlinear disturbance observer for a system as Equation s: ternal state of disturbance observer.The nonlinear function ( ) m p x R ∈ and designed as follows: Pitch controller is obtained from Method 1: RDSMC-PID-NDO is given from Equation ( 17) as follows: .
where β θ , k θ s are positive values and satisfy the condition in Equation ( 16).Pitch controller is obtained from Method 2: RDSMC-PIDSTA-NDO is given in Equation ( 23) as follows: .
where k θ 1 , k θ 2 are positive values and satisfy the condition in Equation ( 24).The yaw subsystem described in Equation ( 35) can be rewritten as follows: .
Let us define and H ψ (x) = x 5 .A NDO to estimate the exogenous disturbance in yaw subsystem is obtained by Equation ( 4), as follows: x represent the smooth functions in term of x , and ( ) t R x ∈ .n as: sign a robust dynamic sliding mode controller based on nonlinear d as following steps.
ce observer is applied to estimate the external disturbance .ver is integrated with a robust dynamic sliding mode control by disturbance, , with its estimation  .er ternal disturbance is considered as a harmonic disturbance with frequency generated by an exogenous system as follows. { m matrix, and E is a row matrix with dimension 1 m × .These y existent approaches such as using an extended state observer [38], n a Global Positioning System (GPS), Inertial Measurement Unit eter [39], or based on aerodynamics of motors and propellers [40].
be the estimates of ϒ and x , T m e e e = , given; F L denotes a Lie derivative of function ( ) F x ; and r is a ance to the output.ork [41], a nonlinear disturbance observer for a system as Equation te of disturbance observer.The nonlinear function ( ) m p x R ∈ and as follows: x represent states of system, y denotes output, u R ∈ denotes the and ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ urbance.rewritten as: ( ) H x x = re to design a robust dynamic sliding mode controller based on nonlinear presented as following steps.
isturbance observer is applied to estimate the external disturbance .ce observer is integrated with a robust dynamic sliding mode control by xternal disturbance, , with its estimation  .e Observer t the external disturbance is considered as a harmonic disturbance with t known frequency generated by an exogenous system as follows. an

and
E is a row matrix with dimension 1 m × .These by many existent approaches such as using an extended state observer [38], based on a Global Positioning System (GPS), Inertial Measurement Unit agnetometer [39], or based on aerodynamics of motors and propellers [40].hen's work [41], a nonlinear disturbance observer for a system as Equation s: ] [ ] ternal state of disturbance observer.The nonlinear function ( ) m p x R ∈ and designed as follows: where W ψ , E ψ are matrix of exogenous disturbance impacting on yaw subsystem with dimension 2 × 2 and 1 × 2, respectively.The functions p ψ (x) and l ψ (x) are computed from Equations ( 7) and ( 8): and U 4 is RDSMC controller of yaw subsystem obtained by the two methods in Section 2.2.Let ψ d be a desired state of yaw control.The tracking error of yaw angle and its first derivative are given by: e ψ = ψ d − x 5 , ... e ψ (t) = ..
A sliding surface of yaw control, s ψ , and its derivative, .s ψ , are chosen from Equations ( 10) and ( 11) as follows: .
where β ψ , k ψ s are positive values and satisfy the condition in Equation ( 16).Yaw controller is obtained from Method 2: RDSMC-PIDSTA-NDO is given in Equation ( 23) as follows .
where k

Altitude Controller
The altitude subsystem described in Equation ( 35) can be rewritten as follows: .
T , and H h (x) = x 7 .A NDO to estimate the exogenous disturbance in altitude subsystem is obtained by Equation ( 4), as follows: 2 x represent states of system, y denotes output, u R ∈ denotes the ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ nce.ritten as: [ ] rbance observer is applied to estimate the external disturbance .bserver is integrated with a robust dynamic sliding mode control by nal disturbance, , with its estimation  .server e external disturbance is considered as a harmonic disturbance with own frequency generated by an exogenous system as follows. { m m × matrix, and E is a row matrix with dimension 1 m × .These many existent approaches such as using an extended state observer [38], d on a Global Positioning System (GPS), Inertial Measurement Unit tometer [39], or based on aerodynamics of motors and propellers [40].'s work [41], a nonlinear disturbance observer for a system as Equation l state of disturbance observer.The nonlinear function ( ) m p x R ∈ and gned as follows: nonlinear system is considered as follows: 1 x and 2 x represent states of system, y denotes output, u R ∈ denotes the ( ) x and ( ) g x represent the smooth functions in term of x , and ( ) t R x ∈ disturbance.n be rewritten as: H x x = edure to design a robust dynamic sliding mode controller based on nonlinear r is presented as following steps.
e disturbance observer is applied to estimate the external disturbance .bance observer is integrated with a robust dynamic sliding mode control by he external disturbance, , with its estimation  .
bance Observer that the external disturbance is considered as a harmonic disturbance with but known frequency generated by an exogenous system as follows.
is an

and
E is a row matrix with dimension 1 m × .These ined by many existent approaches such as using an extended state observer [38], on based on a Global Positioning System (GPS), Inertial Measurement Unit magnetometer [39], or based on aerodynamics of motors and propellers [40].the disturbance to the output.to Chen's work [41], a nonlinear disturbance observer for a system as Equation lows: internal state of disturbance observer.The nonlinear function ( ) m p x R ∈ and are designed as follows: where W h , E h are matrix of exogenous disturbance impacting on the altitude subsystem with dimension 2 × 2 and 1 × 2, respectively.The functions p h (x) and l h (x) are computed from Equations ( 7) and (8): .. e h (t) = ..
A sliding surface of altitude control, s h , and its derivative, .s h , are chosen from Equations ( 10) and ( 11) as follows: .
where k h p , k h i , k h d are positive values.A dynamic sliding surface of altitude control, σ h , is given by Equation (12): Altitude controller is obtained from Method 1: RDSMC-PID-NDO is given from Equation ( 17) as follows: .
where β h , k h s are positive values and satisfy the condition in Equation ( 16).Altitude controller is obtained from Method 2: RDSMC-PIDSTA-NDO is given in Equation ( 23) as follows .
where k h 1 , k h 2 are positive values and satisfy the condition in Equation ( 24).

Simulation Results and Discussions
A numerical simulation was performed on the attitude and altitude control of UAVs to demonstrate the strict robustness and efficiency of the proposed algorithm, as presented in this section.The advantage of two controllers (i.e., RDSMC-PID-NDO and RDSMC-PIDSTA-NDO) of the proposed RDSMC-NDO method are discussed and compared to recent methods, such as NTSMC, STSMC, and M-STSMC.

Simulation Assumptions
The numerical simulation was carried out through several assumptions: (i) the parameters of a quadcopter UAV, initial conditions, controller gains, and desired states are given in Tables 2 and 3; and (ii) the dynamics of attitude (i.e., roll, pitch, and yaw) and altitude were simultaneously affected by the different exogenous disturbances as follows: t ∈ [5, 10] sec :

Simulation Results
The performance of nonlinear disturbance observer in dynamics of roll, pitch, yaw and altitude is shown in Figure 4.It is easy to see that the disturbance estimation ξφ , ξθ , ξψ , and ξh asymptotically tracked the exogenous disturbances, even if the time-varying oscillation amplitude of perturbation occurred in the movement process of the vehicle.simulations on three other methods (i.e., M-STSMC, NTSMC, and STSMC) with the same flight conditions.The comparison of simulation results is shown in Figures 5 and 6.Obviously, the disturbance-free first flight time of the vehicle (t < 5 s), and the responses of φ(t),θ(t), ψ(t), and h(t) were identical for all five controllers, considering both time response and tracking performance (Figure 5).In the second flight stage (5 s ≤ t ≤ 10 s), the various disturbances impacted the system following Equation (64).The proposed RDSMC-NDO exhibited excellent tracking performance with a high robustness compared to other methods (i.e., M-STSMC, NTSMC, and STSMC).It presented small initial oscillation and fast convergence to a steady state, while the other methods generated a large oscillation amplitude and resulted in an unstable performance of the system.In the last flight stage, (t > 10 s), the effect of disturbances on the vehicle suddenly became zero following Equation (65).The proposed method also showed a significantly superior performance for attitude and altitude control with a fast convergence to a steady state.Figure 6 shows the performance of controller signals of attitude (U2, U3, and U4) and altitude (U1).Once the disturbances impacted on the dynamics of the vehicle, the proposed RDSMC-NDO immediately compensated for the influence of perturbations with the chattering effect being strongly eliminated, while the other methods (i.e., M-STSMC, NTSMC, and STSMC) were slower to compensate and generated a chattering in controllers U2 and U3 (Figure 6b,c).In addition, it is easy to see that, in the second flight stage (5 s ≤ t ≤ 10 s), when the various disturbances impacted on the system, the sliding surfaces (sφ, sθ, sψ, and sh) and dynamic sliding surfaces (σφ, σθ, σψ, and σh) of the proposed RDSMC-NDO rapidly converged to zero (about 0.2 s for attitude control and 1 s for altitude control, as shown in Figure 7).The sliding surfaces (sφ, sθ, sψ, and sh) of M-STSMC, NTSMC, and STSMC oscillated and never converged to zero.To compare the tracking performance of the two proposed controllers of the RDSMC-NDO (i.e., RDSMC-PID-NDO and RDSMC-PIDSTA-NDO) with other methods, we also carried out numerical simulations on three other methods (i.e., M-STSMC, NTSMC, and STSMC) with the same flight conditions.The comparison of simulation results is shown in Figures 5 and 6.Obviously, the disturbance-free first flight time of the vehicle (t < 5 s), and the responses of ϕ(t),θ(t), ψ(t), and h(t) were identical for all five controllers, considering both time response and tracking performance (Figure 5).In the second flight stage (5 s ≤ t ≤ 10 s), the various disturbances impacted the system following Equation (64).The proposed RDSMC-NDO exhibited excellent tracking performance with a high robustness compared to other methods (i.e., M-STSMC, NTSMC, and STSMC).It presented small initial oscillation and fast convergence to a steady state, while the other methods generated a large oscillation amplitude and resulted in an unstable performance of the system.In the last flight stage, (t > 10 s), the effect of disturbances on the vehicle suddenly became zero following Equation (65).The proposed method also showed a significantly superior performance for attitude and altitude control with a fast convergence to a steady state.Figure 6 shows the performance of controller signals of attitude (U 2 , U 3 , and U 4 ) and altitude (U 1 ).Once the disturbances impacted on the dynamics of the vehicle, the proposed RDSMC-NDO immediately compensated for the influence of perturbations with the chattering effect being strongly eliminated, while the other methods (i.e., M-STSMC, NTSMC, and STSMC) were slower to compensate and generated a chattering in controllers U 2 and U 3 (Figure 6b,c).In addition, it is easy to see that, in the second flight stage (5 s ≤ t ≤ 10 s), when the various disturbances impacted on the system, the sliding surfaces (s ϕ , s θ , s ψ , and s h ) and dynamic sliding surfaces (σ ϕ , σ θ , σ ψ , and σ h ) of the proposed RDSMC-NDO rapidly converged to zero (about 0.2 s for attitude control and 1 s for altitude control, as shown in Figure 7).The sliding surfaces (s ϕ , s θ , s ψ , and s h ) of M-STSMC, NTSMC, and STSMC oscillated and never converged to zero.
In summary, from the results of simulation, it can be seen that all five tested approaches presented an equally excellent performance in the disappearance of exogenous disturbances, i.e., they provided both rapid response and fast convergence to a steady state.However, the different performance appeared once the exogenous disturbances impacted on the dynamics of the vehicle.M-STSMC, NTSMC and STSMC could not adapt well to the fast variation of these perturbations, resulting in a large oscillation amplitude and unstable performance of the control system.This issue was solved by the proposed RDSMC-NDO algorithm.The presented method guaranteed an excellent tracking performance and superior stability of the vehicle with a fast response, good adaptation, and no chattering effect.In summary, from the results of simulation, it can be seen that all five tested approaches presented an equally excellent performance in the disappearance of exogenous disturbances, i.e., they provided both rapid response and fast convergence to a steady state.However, the different performance appeared once the exogenous disturbances impacted on the dynamics of the vehicle.M-STSMC, NTSMC and STSMC could not adapt well to the fast variation of these perturbations, resulting in a large oscillation amplitude and unstable performance of the control system.This issue was solved by the proposed RDSMC-NDO algorithm.The presented method guaranteed an excellent tracking performance and superior stability of the vehicle with a fast response, good adaptation, and no chattering effect.

Conclusions
In this study, we proposed a robust dynamic sliding mode controller based on PID, super twisting algorithm and nonlinear disturbance observer for a second-order nonlinear system, and then the robustness and effectiveness of the proposed method was demonstrated through the control state of disturbance observer.The nonlinear function ( )

FL
denotes a Lie derivative of function ( ) F x ; and r is a

FL
denotes a Lie derivative of function ( ) F x ; and r is a

FL
denotes a Lie derivative of function ( ) F x ; and r is a

FL
denotes a Lie derivative of function ( ) F x ; and r is a he disturbance to the output.
be given; F L denotes a Lie derivative of function ( ) F x ; and r is a rom the disturbance to the output.
second derivative, e  , can be computed by Equation (1) as follows:

Figure 1 .
Figure 1.General structure of NDO for harmonic disturbances.
(1).A tracking error and its first derivative are defined as e = y d − y and .e = .y d − .x 1 .The second derivative, .. e, can be computed by Equation (1) as follows: t→∞ e(t) = 0 when the controller gains k p , k i and k d are appropriately chosen.Therefore, the characteristic polynomial in the right side of Equation (11) k p .e(t) + k i e(t) + k d ..

Figure 3 .
Figure 3. Block diagram of full controller of a quadcopter, the proposed algorithm is applied in the attitude and altitude control only.The traditional PID is used in horizontal position control.

Figure 3 .
Figure 3. Block diagram of full controller of a quadcopter, the proposed algorithm is applied in the attitude and altitude control only.The traditional PID is used in horizontal position control.
dynamic sliding mode controller based on nonlinear d as following steps.
be the estimates of ϒ and x , respectively; L denotes a Lie derivative of function ( ) F x ; and r is a a robust dynamic sliding mode controller based on nonlinear presented as following steps.
given; F L denotes a Lie derivative of function ( ) F x ; and r is a

2 . 1 .
Let φ d be a desired state of roll control.The tracking error of roll angle and its first derivative are given by: e φ = φ d − x 1 , .The second derivative of tracking error, .. e φ , is computed by:

FL
ˆRx ∈ be the estimates of ϒ and x , respectively; denotes a Lie derivative of function ( ) F x ; and r is a e disturbance to the output.

FL
be the estimates of ϒ and x , respectively; denotes a Lie derivative of function ( ) F x ; and r is a disturbance to the output.

5 .
The second derivative of tracking error, .. e ψ , is computed by:

ψ 1 , k ψ 2
are positive values and satisfy the condition in Equation(24).
robust dynamic sliding mode controller based on nonlinear ented as following steps.

R
be the estimates of ϒ and x , respectively; ; F L denotes a Lie derivative of function ( ) F x ; and r is a turbance to the output.

FL
nd ˆRx ∈ be the estimates of ϒ and x , respectively; denotes a Lie derivative of function ( ) F x ; and r is a

Figure 4 .
Figure 4. Performance of disturbance observer: (a) in roll dynamics; (b) in pitch dynamics; (c) in yaw dynamics; and (d) in altitude dynamics.

Figure 4 .
Figure 4. Performance of disturbance observer: (a) in roll dynamics; (b) in pitch dynamics; (c) in yaw dynamics; and (d) in altitude dynamics.

Electronics 2019, 8 , 21 Figure 5 .
Figure 5.Comparison of attitude and altitude performance between the proposed RDSMC-NDO method and other approaches: (a) roll control performance; (b) pitch control performance; (c) yaw control performance; and (d) altitude control performance.

Figure 5 .
Figure 5.Comparison of attitude and altitude performance between the proposed RDSMC-NDO method and other approaches: (a) roll control performance; (b) pitch control performance; (c) yaw control performance; and (d) altitude control performance.

Figure 5 .
Figure 5.Comparison of attitude and altitude performance between the proposed RDSMC-NDO method and other approaches: (a) roll control performance; (b) pitch control performance; (c) yaw control performance; and (d) altitude control performance.

Figure 6 .
Figure 6.Comparison of attitude and altitude controller between the proposed RDSMC-NDO method and other approaches: (a) altitude controller U 1 ; (b) roll controller U 2 ; (c) pitch controller U 3 ; and (d) yaw controller U 4 .Electronics 2019, 8, x FOR PEER REVIEW 18 of 21

Figure 7 .
Figure 7.Comparison the sliding surfaces of attitude and altitude controller between the proposed RDSMC-NDO method and other approaches: (a) roll control; (b) pitch control; (c) yaw control; and (d) altitude control.

Figure 7 .
Figure 7.Comparison the sliding surfaces of attitude and altitude controller between the proposed RDSMC-NDO method and other approaches: (a) roll control; (b) pitch control; (c) yaw control; and (d) altitude control.

2. Robust Dynamic Sliding Mode Controller Based on Nonlinear Disturbance Observer (RDSMC-NDO)
ξ = E 2.2.2.Method 2: Robust Dynamic Sliding Mode Controller based on PID-Super Twisting Algorithm and Nonlinear Disturbance Observer (RDSMC-PIDSTA-NDO) Let us assume that ∃ϑ, ν, δ ∈ R + are constant values and always satisfy the below expression: 59)and U 1 is RDSMC controller of altitude subsystem obtained by the two methods in Section 2.2.Let h d be a desired state of altitude control.The tracking error of altitude angle and its first derivative are given by: e h = h d − x 7 ,

Table 2 .
System parameters of the quadcopter for simulation.

Table 3 .
Parameters of the proposed RDSMC-NDO for simulation.