Optimal New Sliding Mode Controller Combined with Modified Supertwisting Algorithm for a Perturbed Quadrotor UAV

This paper deals with the design of a novel modified supertwisting fast nonlinear sliding mode controller (MSTFNSMC) to stabilize a quadrotor system under time-varying disturbances. The suggested control strategy is based on amodified supertwisting controller with a fast nonlinear sliding surface to improve the tracking performance. The paper suggests a simple optimization tool built-in MATLAB/Simulink to tune the proposed controller parameters. Fast convergence of state variables is established by using a nonlinear sliding surface for rotational and translational subsystems. The modified supertwisting controller is developed to suppress the effect of chattering, reject disturbances, and ensure robustness against external disturbance effect. The stability of the proposed controller (MSTFNSMC) is proved using the Lyapunov theory. The performance of the proposed MSTFNSMC approach is compared with the supertwisting sliding mode controller (STSMC) by numerical simulations to verify its effectiveness.


Introduction
Quadrotor has attracted increasing attention in recent years. This vehicle has wide applications in civilian and military, such as photography, mapping, agriculture services, disaster monitoring, and maintenance [1,2]. This platform has some advantages compared with the traditional fixed-wing drones, such as stable hovering, low cost, small size, vertical takeoff and landing (VTOL), and convenient portability [1,2]. In order to fly autonomously with high reliability, attitude and position stabilization problem should be investigated. The problem of time-varying external disturbances is addressed by the authors of [3]. Recently, many nonlinear controllers have been developed to solve these problems, such as adaptive backstepping combined with fast terminal sliding mode controller in [4], backstepping approach in [5], adaptive prescribed performance control [6], and adaptive nonsingular fast terminal sliding-mode tracking controller [7].
Sliding mode control (SMC) is a robust and efficient tool to control nonlinear systems under time-varying external disturbances [8]; this method has been used in [9], to design the controller. Integral terminal SMC and adaptive backstepping are proposed in [3]. The problem of the chattering is one of the major disadvantages of SMC, which degrades the tracking performance of the quadrotor system [9,10]. In this context, the second-order SMC is used to deal with this problem by using a supertwisting algorithm in [11]. External disturbances affect the dynamics of the quadrotor in external flight, which can affect system stability [12][13][14]. To compensate the external disturbances, some excellent works can be mentioned in the following literatures.
In [15], a fractional-order controller based on nonsingular attitude control law is proposed under time-varying state constraints, which drives the attitude tracking errors to zero in finite time. The work developed in [16] proposes a nonlinear controller for a quadrotor, which ensures a globally asymptotically stability with good control performance. This controller uses a backstepping approach with a novel parameter-scheduling scheme. The authors of [17] combine a generalized proportional integral (GPI) controller and a nested saturation method to control the drone in the presence of disturbances. In [18], three controllers based on the second sliding mode controller are developed for altitude control. The authors of [18] propose a comparative study of these controllers by simulation and hardware implementation. The authors of [19] suggest a novel sliding mode controller for trajectory tracking of a 2-DOF robot manipulator using the extended grey wolf optimizer. The authors of [20] combine the sliding mode controller with a neural network adaptive approach to address the trajectory tracking of the quadrotor UAV in the presence of external disturbance and parametric uncertainties. In order to obtain faster convergence of tracking errors for altitude and position, a nonlinear fast sliding mode controller combined with the traditional supertwisting algorithm is presented in the work [21]. In order to compensate for the negative effects of completely unknown input saturation constraints, the study presented in [22] deals with this problem and proposes a novel adaptive robust controller in the presence of unmodeled nonlinear dynamics, input saturation, and external disturbances. The finite-time convergence of the state variables is achieved by the proposed controller, which introduces a backstepping technique and a novel neural network.
Motivated by the previous works and inspired by the works developed in [9,10,18,19], this paper focuses on designing a new control approach to enhance the performance tracking of the quadrotor trajectories in the presence of time-varying disturbances. A new supertwisting algorithm with some components from the traditional ST algorithm is proposed for the path-following of the quadrotor. The stability of the proposed controller is proved using the Lyapunov theory. The contributions of the present work are given as follows: firstly, the authors suggest a new second-order sliding mode controller that guarantee faster convergence of the state variables with a simple optimization; secondly, the proposed method uses a nonlinear surface to improve the tracking performance; thirdly, the proposed controller guaranteed the stability under disturbances; finally, the proposed control method is compared with a traditional ST algorithm to validate the efficiency of the proposed MSTNSMC technique.
The outline of the present paper is as follows. The model dynamics of the vehicle is presented in Section 2. The proposed methodology design based on modified STFNSMC is given in Section 3. The simulation results for different methods are presented in Section 4. The concluding remarks are shown finally in Section 5.

Mathematical Modeling of a Quadrotor
In this section, quadrotor dynamics are presented under time-varying disturbances. The earth-fixed frame E and the body frame B are defined as illustrated in Figure 1. Frames fEg and fBg are represented by ðO E , E, X e , Y e , Z e Þ and ðO B , E, X b , Y b , Z b Þ, respectively. Let X = ½x, y, z T and Q = ½ϕ, θ, ψ T be the position and attitude orientation of the quadrotor expressed in E, where ϕ is the yaw angle, θ is the pitch angle, and ψ is the roll angle. In order to describe the linear velocity relationship between the earth-frame and body-frame, the rotation matrix is defined by sequentially rotating around the three axes in quadrotor coordinates. The expression of the rotation matrix is given by Moreover, the transformations between the earth-fixed frame E and body-fixed frame B is introduced by the following matrix: We use Sð·Þ to denote the sin ð·Þ function and Cð·Þ to denote the cos ð·Þ function. According to Newton's laws, the model dynamics of the quadrotor is obtained. Based on the works developed in [7,9,16,23], the mathematical model in the presence of disturbances is given by the following equations: Figure 1: Quadrotor UAV. 2 International Journal of Aerospace Engineering where J i ði = x, y, zÞ ∈ ℝ + is the moment of inertia, k ι for ι = ð1, 2, 3, 4, 5, 6Þ denotes the aerodynamic-positive constants, and d i ðtÞ ∈ ℝ for i = ðx, y, z, ϕ, θ, ψÞ is the timevarying external disturbance effects on each DOF. u i ði = 1, 2, 3, 4Þ is the total thrust and the attitude control inputs, respectively. d is the arm length of the vehicle, and f is the scaling factor from force to moment. g and J r are the gravitational acceleration and inertia moment of the propeller: The input signals ½u 1 , u 2 , u 3 , u 4 T and the angular velocities of the rotors ½ω 1 , ω 2 , ω 3 , ω 4 T are related by the following relationship: In this section, the paper presents a modified STFTSM controller design for a quadrotor system under time-varying disturbances. The presented controller is developed to ensure tracking the desired trajectories ðx d , _ The position loop generates virtual controllers via the proposed approach for calculating the desired tilting angles ðϕ d , θ d Þ and the total thrust u 1 as shown in global Figure 2, while the attitude loop is used to obtain the pitching, yawing, and rolling torques ðu 2 , u 3 , u 4 Þ.

New Nonlinear Sliding Mode Control for a Quadrotor
System. In this part, a new attitude and position sliding mode surfaces are required to increase the control performance efficiency in terms of trajectory tracking and disturbance rejection.
First, let us introduce the tracking errors and its derivatives for the given quadrotor system: The new position and attitude sliding surfaces are given by 1 , 7 , s 9 = K py e 9 + K dy _ e 9 + γ 9 e μ 9 9 , where γ i , μ i , K pj , K ij , and K dj for j = ðϕ, θ, ψ, x, y, zÞ are positive parameters to be chosen. The purpose of this controller is to force tracking errors (8) and (10) to approach the sliding surface (12) and then move along the sliding surface to the origin. Moreover, it is required that these surfaces are stable, which means that the error vanishes asymptotically.

International Journal of Aerospace Engineering
The derivative of s i is given by , _ s 9 = K py _ e 9 + K dy € e 9 + γ 1 μ 9 _ e 9 e μ 9 −1 9 , _ s 11 = K pz _ e 11 + K dz € e 11 + γ 11 μ 11 _ e 11 e μ 11 −1 11 : Substituting the time derivative of the tracking errors (10) in equations (14) and (15) yields In order to obtain the equivalent of the proposed controller in this part, the time derivative of each sliding surface is selected as _ s i = 0, assuming that the disturbances d i = 0; then, the equivalent control laws are given as follows.
For the outer loop, For the inner loop, However, the equivalent control laws for a quadrotor system cannot guarantee favorable control performance if unpredictable external disturbances occur. In order to reduce these effects, the reaching control law u s for position and attitude is added to the equivalent control laws as where u s = −K s sign ðsÞ is the switching law. Then, the total laws are given by x d x d  International Journal of Aerospace Engineering where K js represents the reaching gain.

Theorem 1.
Consider the x-subsystem with the equivalent control u 2eq given in (17) and a hitting control term v s given in (21); the sliding surface s 7 converge to the origin value; then, the tracking error e 7 is stable.
Proof. Let us consider the following Lyapunov function candidate with V x ðtÞ > 0 and V x ð0Þ = 0 for s 7 ðtÞ ≠ 0. The derivative of V x is given by Substituting (15) into (24) produces Using v 1 the virtual law presented in (21), we get After a simple calculation, we have We assume that |ðd x ðtÞÞ/m | ≤K s7 ; then, the time derivative of the Lyapunov function presented in (26) will be less than zero. (17) and (18) applied to the dynamics system (7), and the STMFTSMC technique guarantees the overall closed-loop system stability.

Theorem 2. The ultimate inputs presented in
Proof. Consider the Lyapunov function for the quadrotor system as follows: with VðtÞ > 0 and Vð0Þ = 0 for s i ðtÞ ≠ 0. The derivative of V is given by Using the same calculation procedure presented in Theorem 1, we have We assume that the |ðd i ðtÞÞ/m | ≤K si and |ðd j ðtÞÞ/J | ≤K sj ; then, the time derivative of the Lyapunov function presented in (29) will be less than zero.  5 International Journal of Aerospace Engineering of disturbances, a modified supertwisting strategy is added to the controller presented in the previous subsection, which can be defined as

Modified
where u nsmc is the new sliding mode control defined in the previous subsection and u mst denotes the proposed modified supertwisting control law, which can be defined as follows [18]: where c 1 , c 2 , c 3 , and c 4 are positive constants. Using this controller, the closed-loop sliding surface dynamics are rewritten as We define The block diagram of the proposed controller with the optimization tool is shown in laws Figure 3.
So, the novel virtual laws are modified as and the novel controllers of the attitude loop are given as where C 1i , C 2i , C 3i , and C 4i for i = ðϕ, θ, ψ, x, y, zÞ are positive parameters. The closed-loop error dynamics _ s i can be written as Defining new variables Z 1 and Z 2 as International Journal of Aerospace Engineering We obtained the following dynamics system: Theorem 3. Suppose that the derivative of the disturbances affecting the subsystem is globally bounded, and according to [18], we select the positive parameters. Then, the modified supertwisting with the new nonlinear SMC yields finite time convergence of the sliding surface s i = 0, and the tracking error e i and its derivative _ e i will converge to zero [18,[23][24][25][26][27].

Results and Discussion
To illustrate the effectiveness of the MSTFNSMC proposed in this work, numerical simulations were carried out in MATLAB software. Additionally, the performance of the proposed approach is compared with a traditional supertwisting sliding mode control method. To further assess the performances of the presented controller, disturbances are considered as follows: d i ðtÞj x,y,z,ϕ,θ,ψ = 0:4 cos ðtÞ. The desired trajectory is determined by The effect of the initial conditions of the state variables is considered ½x 0 , y 0 , z 0 , ψ 0 = ½0,−2,−2, 0. The quadrotor parameters used in the simulation are given in Table 1. After optimizing the MSTFTSMC by the method presented in [28], the controller parameters are resulted as presented in Table 2.  7 International Journal of Aerospace Engineering Remark 4. All controller gains can be computed by using the optimization toolbox in MATLAB software; the main objective of this optimization is to minimize the attitude and position tracking errors. We define some tracking performance of the quadrotor in the block Check Step Response Characteristics such as rise time, percentage of rise, settling time, percentage of settling, percentage of overshoot, and percentage of undershoot. Then, the controller parameters are initialized; after many tests, the optimization gives the best values of these parameters, which make the tracking errors converge.
The simulation results of the proposed approach and STSMC are illustrated in Figures 4-9.
From this simulation, we can see the behavior of the proposed controller compared with the STSMC. Note that the suggested method is able to properly mitigate the effect of time-varying disturbances. The tracking performance of the attitude and position are plotted in Figures 4 and 5. It is clear that the MSTFTSMC is able to steer the position and attitude to the origin faster than STSMC. Control inputs are presented in Figure 6; these signals are characterized by a faster low-frequency responses and chattering-free smooth responses. Besides, the 3D trajectory tracking is depicted in Figure 7, and we can see from this result that the proposed technique is able to track the desired path in the presence of disturbances. The sliding surface responses of the position and attitude are, respectively, shown in Figures 8 and 9.  Clearly, it can be observed that the nonlinear sliding surfaces of the system converge to the origin quickly. Noticeably, the results confirm the efficiency of the MSTFTSMC proposed in this work. The presented curves are not able to demonstrate the differences between the proposed controller and the twisting sliding mode control. Therefore, the integral absolute error (IAE) performance indexes are given in Table 3 to make a quantitative comparison of these control strategies. From the results, it can be seen that in the presence of disturbances/uncertainties, the proposed control approach provides a more accurate tracking.

Conclusions
This paper addressed the tracking control problem of a quadrotor with external disturbances. An improved supertwisting combined with a fast nonlinear sliding mode controller is proposed for the system. The presented control technique improves tracking performance against time-varying disturbances and reduces the chattering phenomenon. Also, the parameters of the suggested controller are obtained using a simple optimization method in MATLAB/Simulink software. This controller shows strong robustness with respect to timevarying disturbances. The simulation results of the proposed MSTFTSMC illustrate a better performance tracking in comparison with the classical supertwisting sliding mode controller.
In future work, the implementation of the proposed method in a real quadrotor system will be addressed.

Data Availability
No new data were created during the study.

Conflicts of Interest
The authors declare that they have no conflicts of interest.