Stabilization and Tracking of a Quadrotor Using Modified Sigmoid Sliding Mode Control

A modified sigmoid sliding mode control (MS-SMC) approach is proposed for stabilizing and tracking a quadrotor system with a nonlinear sliding surface, where the dynamics model is underactuated, highly coupled, and nonlinear. The constructed nonlinear sliding surface is based on the traditional sliding mode surface with a modified sigmoid function, allowing the initial value to quickly reach equilibrium. A new type of nonlinear SMC is applied for performance improvement of the quadrotor using the proposed modified sigmoid sliding surface. To control the quadrotor effectively, a double-loop control method is used to design the control rate, in which the position subsystem is the outer loop, and the attitude subsystem is the inner loop.With the Lyapunov function, the stability of the overall closed-loop system is ensured by stabilizing each subsystem step by step. Moreover, from a practical point of view, the system performance under the model uncertainties and external disturbances are also considered. The simulation results show that the proposed MS-SMC performs better than the conventional sliding mode control (CSMC) and the back-stepping sliding mode control (BS-SMC) in terms of stabilization and tracking against external disturbances.


Introduction
Unnamed aerial vehicles (UAVs) have advantages such as simple structure and high safety, and is very useful in disaster situations and agricultural fields. However, the performance of the PID controller is not satisfactory, to operate under uncertain environments. Therefore, in this paper, sliding mode control (SMC) was introduced to overcome the limitation of PID. SMC is an excellent robust controller and has advantages such as fast response speed and stability. However, in case of the widely used linear sliding mode control, the state cannot properly track the desired target. With the recent rapid expansion of the UAV market, quadrotor-a type of UAV-has attracted the attention of many researchers owing to its excellent control performance and convenience of vertical takeoff and landing. In contrast to fixed-wing aircraft, quadrotors have the advantages of vertical takeoff, landing, and fixed-point hovering. Compared to single-rotor helicopters, quadrotors have the advantages of a simple mechanical structure, high safety, and relatively low complexity of driving software owing to the absence of a tail rotor. Therefore, quadrotors have been widely used in logistics transportation [1], fire protection [2], and precision agriculture [3]. Among UAVs, the quadrotor is the most widely used rotor vehicle. There are various applications such as medical transportation, cargo delivery, emergency rescue, or resources delivery to isolated areas. The adaptability for industrial use proves its high prospects [4,5]. Since a quadrotor is a multi-input multi-output, highly coupled, under-driven system, stabilization and tracking control are the key issues associated with it. Although PID is a widely used controller, its linearity puts restrictions to control quadrotor systems with multiple inputs and multiple outputs properly. Therefore, the control output is limited, and it is difficult to fully derive the performance of the quadrotor. To overcome this problem, several controllers have been introduced. There are linear quadratic regulators, sliding mode control, back-stepping control, and adaptive control algorithms [6,7]. Among these controllers, SMC is a nonlinear controller that is robust against disturbance and shows excellent tracking ability.
As the advantage of conventional sliding mode control (CSMC) is that it can overcome the uncertainty of the system, it has robustness to disturbances and un-modeled dynamics [8][9][10]. In particular, it has a good control effect on nonlinear systems. Moreover, with the simple sliding mode structure algorithm, rapid response speed, robustness to external noise interference, and parameter perturbation, CSMC has been widely used in the field of quadrotor control. However, it is difficult for initial state to slide strictly along the sliding mode surface as it zigzags to approach the equilibrium point for a linear surface. The insecure sliding property cannot allow states to reach equilibrium within a finite time [11]. Therefore, Xiong created a terminal SMC [12]. However, the terminal sliding mode itself has a shortcoming of the singular problem [13]; hence, a nonsingular terminal sliding mode has been proposed to solve this problem in [14][15][16]. In [17], a fast terminal sliding mode control method for rigid manipulators was developed to achieve high accuracy tracking control. Based on this, a full-order end-sliding-mode control strategy was proposed to solve the chattering problem in [18]. Based on hybrid sliding mode algorithms, a fully robust back-stepping sliding mode controller has been constructed for both position control and attitude control [19,20]. In [21,22], an adaptive controller has been presented for attitude and position tracking based on combined integral sliding mode control, and the radial basic function neural network method, respectively. The unknown parameters are estimated through online using the neural network algorithm, requiring intensive computation. Hence, there exists a limit to be used for compact UAVs. For low-cost devices in measurement and control, a research suggested an accurate and economical method of estimating information on drone sensors [23]. As suggested in [23], if an advanced controller replaces the classical PID controller, a quadrotor with outstanding performance can be presented. In this study, we designed an SMC that enables quickly tracking and stabilizing the quadcopter. In general, quadrotor motion dynamics can be derived via the Newton-Euler and Euler-Lagrange methods. The Newton-Euler formalism provides physical insights through derivation. The Euler-Lagrange formalism provides the linkage between the classical framework and the Lagrangian or Hamiltonian method [24]. Herein, the dynamics of the quadrotor were formulated based on the Euler-Lagrange approach. The control input can be obtained through the SMC. The desired angle (ψ d , θ d ) can be derived from the target position and control input. To provide rapid stability and trajectory tracking, a nonlinear sliding mode plane was designed to reduce the time to reach equilibrium. Moreover, dual-loop control [21,25,26] is used to design the control law, in which the attitude subsystem is the inner loop, and the position subsystem is the outer loop. The intermediate command signals ψ d and θ d generated by the outer loop must be transmitted to the inner loop subsystem. The inner loop subsystem tracks two transmission signals through SMC. In dual-loop control, the attitude-angle tracking error of the inner loop system affects the stability of the outer loop, which induces the stability of the entire closed-loop control system. The stability problem is related to the inner and outer loop control, as the dynamic performance of the inner loop and the attitude-angle tracking error affect the stability of the outer loop, especially for an initial error, and, consequently, affect the stability of the entire closed-loop [27,28]. In this paper, position information is assumed to be detected by a three-axis accelerometer and is compared with location information of a virtual GPS. Attitude information is assumed to be detected through a three-axis gyroscope and compared with the desired angle values (θ d , ψ d ) generated by the position controller. To improve the flying performance of the quadrotor, various sensors are mounted on the structure. Recently, a vision sensor was used to provide accurate location information. In addition, the altitude of quadrotor is precisely detected through a rangefinder to improve landing performance. Accurate attitude information is obtained through an additional inertia measurement unit along with gyroscope. Continuous direction update of quadrotor can also improve flight performance by using a magnetometer [29,30]. The simulation compared the performance of CSMC, BS-SMC, and MS-SMC presented in this paper. Position control and attitude subsystem control were performed under various conditions. Disturbance was applied to determine the robustness of the controller. Compared to CSMC and BS-SMC, MS-SMC reached the desired target with more stable performance and confirmed the lessened sensitivity to disturbance. In addition, the reaching speed of MS-SMC being faster than CMSC and BS-SMC shows that the modified sigmoid function designed in this paper functions properly.
In this study, we focus on designing a nonlinear SMC denoted by MS-SMC for position and altitude control with external disturbance on the dynamics in 6 DOF (x, y, z, roll, pitch, and yaw). The proposed nonlinear SMC is based on a modified sigmoid sliding surface. All controllers of this study are obtained from Lyapunov stability to ensure a fast stabilization and tracking in the presence of disturbances. We demonstrate the technological advantages of our approach through a comparison of simulation results from CSMC and BS-SMC. As a result, the chattering effect can be eliminated, resulting in a more stable performance. Moreover, the stabilization and tracking performance of a quadrotor are more robust and faster to adapt when the disturbance is bounded.
To design the nonlinear SMC based on a modified sigmoid sliding surface, this paper is organized as follows. In Section 2, the dynamical model of a quadrotor is presented. The control design method with a nonlinear sliding surface is described in Section 3 in addition to the control strategy for constructing the sliding mode controller of the position and attitude of a quadrotor. In Section 4, we demonstrate the effectiveness of modified sigmoid sliding mode control(MS-SMC) through simulation results. Finally, our conclusions are presented in Section 5.

Quadrotor Dynamic Modeling
The quadrotor used in this study was set up in the body frame and the earth frame as shown in Figure 1. More details of the configuration can be found in [31][32][33]. The dynamic model of the quadrotor can be derived via the Euler-Lagrange method, and a simplified model is found as follows: where vector [x, y, z] T denotes the quadrotor position; vector [φ, θ, ψ] T represents the angles of roll, pitch, and yaw, respectively; K i denotes the drag coefficients; I i is the body inertia, l is the lever length; g is gravity, and m is the mass of the quadrotor. Here, u i ∈ R, i = 1, 2, 3, 4, are the control inputs for a quadrotor, described as where F i is the thrust generated by four rotors, and C denotes the force-to-moment scaling factor. To consider unknown perturbations such as noise, uncertainty, unmodeled dynamics, and external disturbances in the real environment, the dynamic model of Equation (1) includes ; thus, it leads to errors between the measured and estimated values of the states. Regarding the unknown disturbances, we redefine d x , d y , d z , d φ , d θ , and d ψ after changing Equation (1) to the form of the state space as in Equation (5). To drive the control law, Equation (1) can be written in the state-space T be a state variable vector, defined as: In Equation (1), the mechanical structure can be written as u x = cos x 11 sin x 7 cos x 9 + sin x 11 sin x 9 , u y = sin x 11 sin x 7 cos x 9 − cos x 11 sin x 9 , u z = cos x 11 cos x 9 .
In Equation (4), a 1 through a 6 , are parameters comprising body inertia, lever length, and rotor inertia. u x and u y are the control inputs of the quadrotor, using roll, pitch, and yaw. From Equations (1) and (3), the dynamics of the quadrotor can be obtained using Equation (5):ẋ From a practical point of view, we updated Equation (1) to state-space form and added environmental noise, uncertainty, unmodeled dynamic, and external disturbances in Equation (5). ∆u i , ∆a i , and d i , i = 1, 2, · · · , 6 are the nonlinear functions that introduce the system uncertainties, unmodeled dynamic, and external disturbance, respectively. n i , i = 1, 2, · · · , 6 is a term that simulates a noisy environment. To handle better the system uncertainties, unmodeled dynamic, external disturbances, and environmental noise are redefined as d 6 . Therefore, Equation (5) can be considered as: The structure of the entire control system is shown in Figure 2. The control system in Equation (6)

Nonlinear Sliding Surface
As a CSMC, a linear sliding surface was applied owing to the simple design procedure. For better performance, we consider the nonlinear sliding surface of a quadrotor controller for fast transient response. In Equations (7) and (8), σ(e i , t) indicates the sliding plane. The sliding surface function allows the state to move swiftly to the desired state in SMC. The traditional sliding plane can be written in the following form: where λ i is a positive integer, and e i denotes the error between the state value(x i ) and the desired value(x id ). For a fast stabilization and tracking response, a new nonlinear sliding surface is proposed as follows: where is an exponential function, and b i , c i , and h i are positive constants. The sigmoid function has the same basic form as e x /(e x + 1). In this paper, it is modified as in Equation (8) to increase the reaching speed to equilibrium. Figure 3 shows the modified sigmoid sliding surface. In Figure 3, parameters b i , c i , and h i are set to 1, 50, and 2, respectively. The sliding mode plane can be divided into two parts. The first part is from infinity to N, and the second part is from N to 0. The first part is the linear plane that is controlled by h i e i from Equation (8), and the second part is the nonlinear part that is controlled by (8). When the initial value reaches the first part of the sliding mode plane, it will first move to 0 along the linear sliding mode plane, and then accelerate to 0 along the nonlinear sliding mode plane after reaching point N. When the initial value reaches the second part of the sliding mode plane, it will converge to 0 directly along the nonlinear sliding mode plane. It can be seen from Figure 3 that the inclination angle of the second part is much larger than that of the first part, so the convergence speed is much faster than the speed of the first part. Contrary to the traditional linear sliding mode plane, the sliding mode plane that we designed has nonlinear acceleration parts. Therefore, MS-SMC converges faster than the CSMC. We design the controller according to the sliding surface in Equation (8).

Position Subsystem Control
Owing to the complex characteristics of the quadrotor system, the proposed control scheme adopts a feedback dual-loop system, as shown in Figure 2. The position system is in the outer loop, and the attitude subsystem is in the inner loop. First, the position system controller was designed. From Equation (1), the subsystems u x , u y , u z for position control can be defined as u x = u 1 (cos φ sin θ cos ψ + sin φ sin ψ), u y = u 1 (sin φ sin θ cos ψ − cos φ sin ψ), u z = u 1 cos φ cos ψ, (9) where u 1 is associated with pitch and yaw angle. Using Equation (9), the formula for Equation (1) can be modified. The position-related parts in Equation (1) can be represented in the following form:ẍ To overcome the time delay owing to the deceleration curve in SMC, the nonlinear sliding surface that reduces the convergence time with a modified deceleration curve was proposed [34]. With Equation (8), the novel modified sigmoid sliding surfaces can achieve the fast-tracking trajectory owing to a nonlinear term in the sliding surfaces. Using the new nonlinear sliding surface in Equation (8) to design a sliding mode controller, the nonlinear sliding surfaces can be represented as: where e 1 , e 2 , and e 3 are the errors of x 1 , x 3 , and x 5 , respectively;ė 1 ,ė 2 , andė 3 are the errors of x 2 , x 4 , and x 6 , respectively: where σ x , σ y , and σ z are the three sliding surfaces for u x , u y , and u z , respectively. For the first position subsystem, the controller can be designed as follows: where η 1 and α 1 have conditions of η 1 ≥ d x and, α 1 > 0, respectively. Proposition 1. For the position system in x-direction described by Equation (10), if the sliding mode surface σ(e i , t) is selected as in Equation (8), the quadrotor in x-direction guarantees stability and tracks the desired value fast.
Proof. The stability of u x can be proved by the Lyapunov function of V(σ x ) = σ 2 Substituting Equation (12) into Equation (13), Equation (14) can be simplified as follows: This completes the proof of stability. By following the same design procedures for u y and u z , we obtain: where η 2 and α 2 have conditions that are η 2 ≥ d y and α 2 > 0, respectively; η 3 and α 3 have conditions that are η 3 ≥ d z and α 3 > 0, respectively.

Virtual Attitude Angles
To achieve θ and ψ tracking for θ d and ψ d , we need to obtain the solution in a closed analytic form. The subsystem łfor and in Equation (9) can be expressed in matrix form: For the first row of Equation (18), ψ d can be found as: For the second row of Equation (18), θ d can be found as: Since the value of the sine function is between −1 and 1, the value of sin θ d is bounded as −1 < sin θ d < 1. To prevent sinθ d from taking a real value out of the [−1, +1] range, we define an intermediate value H, which is cos φ d (cos φ d u x + sin φ d u y )/u z . When H is out of the range [−1, +1], θ d does not exist. We thus assign values to achieve the continuity of Equation (20), i.e., if H < −1, sin θ d = −1 and θ d = −π/2 ; if H > 1, sin θ d = 1 and θ d = π/2; finally, when |H| ≤ 1, θ d is calculated as follows: Since u 1 is related to roll and yaw angle, after obtaining θ d and ψ d , the control law of position u 1 is as follows:

Attitude Subsystem Control
As the outer loop system of the two angles (roll and yaw) generated by the position system needs to be processed in the inner loop, three inputs (roll, pitch, and yaw) are passed to the position system. The design of the attitude subsystem is important for deciding a control input that is closely related to the location output. By using the new nonlinear sliding surface in Equation (8) to design the attitude controller, the nonlinear sliding surface can be represented as: where e 4 , e 5 , and e 6 are the errors of x 7 , x 9 , and x 11 , respectively,ė 4 ,ė 5 , andė 6 are the errors of x 8 , x 10 , and x 12 , respectively.
σ θ , σ ψ , and σ φ are three sliding surfaces for u 2 , u3, and u 4 , respectively. Following the same design procedures as the secondary position subsystem, an attitude controller can be designed. Therefore, the controllers for the attitude angle (θ, ψ, φ) are as follows: where η 4 , η 5 , and η 6 have conditions that η 4 ≥ d θ , η 5 ≥ dψ , η 6 ≥ d φ , and α 4 , α 5 , and α 6 are positive. u 3 is the controller related to the attitude angle of pitch, and u 4 controls the attitude angle of yaw, which can realize the fast convergence of θ and ψ. Moreover, u 2 controls the roll angle φ, which can track the desired angle of φ d . Due to the existence of the discontinuous switching function sgn(.) in Equations (13), (16), (17) and (25)- (27), the chattering problem occurs after the initial value reaches the sliding surface; therefore, the nonlinear quadrotor system with uncertainty may appear to be an undesired response.
To solve this problem, the function sgn(.) can be replaced by the following continuous saturation function: where Λ is the boundary layer thickness. The Lyapunov candidate function for overall closed-loop system in Equation (5) is selected as The derivative of Equation (29) with respect to time can be written as Equation (30) with u x , u y , u z , u θ , u ψ , and u φ being substituted by Equations (13), (16), (17) and (25)- (27), respectively. Therefore, the stability of overall closed-loop system is guaranteed by Equations (29) and (30), ensuring trajectory tracking capability of position and attitude subsystem:

Simulations
In this section, a simulation is performed to confirm the effectiveness of the quadrotor controller based on the proposed MS-SMC. MS-SMC exhibited high performance compared with CSMC and BS-SMC. To prove the feasibility of the proposed control algorithm, we used MATLAB/Simulink and chose ODE45 as a solverin Simulink. In our simulation, d x , d y , d z , d φ , d θ , and d ψ are set to −0.2 + 0.4 · rand(t). The parameters of the UAV model are listed in Table 1. h 1 , h 2 , and h 3 are the parameters of the position controller, and the values are set to 1.1. h 4 , h 5 , and h 6 are related to the parameters of the attitude controller, and the values are all 50. α 1 , α 2 , and α 3 are parameters related to the control rate of the position controller, with the value of 0.10. α 4 , α 5 , and α 6 are parameters related to the attitude control rate, with the value of 0.10. η is a parameter to adjust the chattering of the sliding mode controller. The position parameters are η 1 , η 2 , and η 3 , with the value of 0.1. The attitude controller's parametersη 1 , η 2 , and η 3 with the value of 50. Moreover, the boundary layer thickness is set to 0.2 in the saturation function. The angle that we track is 72°, and the desired altitude in the z-axis direction is 3.0 m.
Figures 4 and 5 show the performances on tracking and stability, respectively. Figure 4 shows the simulation results for stability, which correspond to the pitch and yaw angles. θ d and ψ d are derived from x, y, and z in the position subsystem and are related to the roll value. Therefore, θ d and ψ d change over time, as shown in Figure 4. Figure 4a,b show the tracking trajectories of attitude angles (θ, ψ) controlled by CSMC, BS-SMC, and MS-SMC, respectively. In Figure 4, the red, blue, cyan, and black dashed lines represent the desired angle, the quadrotor angles of CSMC, BS-SMC, and MS-SMC, respectively. As shown in Figure 4, the CSMC and BS-SMC have a large deviation, and the MS-SMC follows the desired angle of θ d and ψ d with less fluctuation. In Figure 4a, the pitch angle θ of each method tracks its desired signal θ d at t = 1.2 s by CSMC, at t = 1.1 s by BS-SMC, and at t = 0.8 s by MS-SMC. In Figure 4b, the yaw angle ψ of each method tracks its desired signal ψ d at t = 1 s by CSMC and BS-SMC, and at t = 0.1 s by MS-SMC. Therefore, tracking time is effectively lessened by MS-SMC. Figure 5 shows the tracking of degrees of freedom such as x, y, z, and roll angle, which are represented by subgraphs (a), (b), (c), and (d), respectively, and the designed MS-SMC is compared with CSMC and BS-SMC. Figure 5a,b describe the movement in the x and y directions, respectively.In Figure 5 Figure 5b. In Figure 5c, CSMC, BS-SMC, and MS-SMC take the same time of 1.4 s to reach the desired value in the z-direction. In Figure 5d, the desired angle of φ is tracked by MS-SMC after 0.14 s while the tracking time is 0.2 s for CSMC and BS-SMC. We checked the tracking performance in the z-axis and roll angle. After setting the initial value in the z-axis to 0, the target value is put as 3.0 m. At this time, the controller has the role of adjusting the roll angle from the initial value 0 • to 72 • . In this paper, it can be checked that MS-SMC reaches the target value quickly compared to CSMC. As disturbances are applied, the system controlled by the CSMC and BS-SMC becomes unstable. On the contrary, MS-SMC makes it easier to maintain the stability after reaching the target. The simulation results show that MS-SMC reaches the target value faster than CSMC and BS-SMC. Figure 6 shows the control input comparison for CMSC, BS-SMC, and MS-SMC. The control input u 1 represents the total force applied for the altitude control of the quadrotor. Other control inputs (u 1 , u 2 , u 3 ) are the force values for control of pitch, yaw, and roll angles, respectively. MS-SMC demonstrates better control behavior in Figure 6.

Conclusions
In this study, we applied the MS-SMC based on a new nonlinear sliding surface to improve the stabilization and tracking of a quadrotor. Compared with CSMC and BS-SMC, a nonlinear sliding surface can reduce the time required to reach equilibrium. The position control (u x , u y , u z , u 1 ) can be derived from the position subsystem using the proposed MS-SMC algorithm. Attitude control (u 2 , u 3 , u 4 ) can be obtained by the attitude subsystem using the proposed MS-SMC. The desired angles of roll and pitch are obtained by the control inputs of x, y, and z. According to our design method, the pitch and yaw angles (θ, ψ) can converge quickly to θ d and ψ d . Similarly, x, y, z, and φ can achieve good tracking effects compared to the CSMC and BS-SMC.