Enhanced Flight Control for Quadrotor Drones: A Dual-Loop Strategy with Second-Order PD and Integral Sliding Mode Control

In recent years, the quadrotor drone has emerged as a pivotal platform for a wide range of applications, from aerial photography and inspection to logistics and emergency response, owing to its ability to perform tasks deemed dangerous or difficult for humans. This versatility has spurred intensive research into advanced control methodologies to enhance its flight stability, trajectory tracking accuracy, and robustness against disturbances. Achieving fast convergence to a desired flight path and maintaining stable hover or motion in the presence of external perturbations like wind gusts remain significant challenges.

Various control strategies have been explored. For instance, fuzzy logic has been used to adapt PID parameters online, yet the subjective nature of rule definition can limit precision. Neural network-based approaches combined with sliding mode control can handle uncertainties but often suffer from computational complexity. Some methods decompose the system but use simple PD control for subsystems, which may lack the necessary robustness. Backstepping sliding mode control offers good performance but typically exacerbates the inherent chattering problem of sliding mode techniques. Therefore, developing a control scheme that ensures rapid convergence, high accuracy, and effectively mitigates chattering is crucial for reliable quadrotor drone operation. This article presents a novel dual-loop control architecture. The outer loop, responsible for position tracking, employs a second-order PD control law for improved accuracy. The inner loop, managing attitude dynamics, utilizes an integral sliding mode controller with a saturation function to suppress chattering. The stability of the closed-loop system is rigorously proven using Lyapunov theory. Comprehensive simulations demonstrate that the proposed controller enables a quadrotor drone to accurately track aggressive trajectories and rapidly recover from sudden disturbances, validating its effectiveness and robustness.

The dynamic model of a quadrotor drone is fundamental for controller design. We consider two coordinate frames: the Earth-fixed inertial frame $E\{O_E, x_E, y_E, z_E\}$ and the body-fixed frame $B\{O_B, x_B, y_B, z_B\}$ attached to the drone’s center of mass. The configuration is defined by its position $\boldsymbol{\xi} = [x, y, z]^T$ in the inertial frame and its orientation expressed by the Euler angles $\boldsymbol{\Theta} = [\phi, \theta, \psi]^T$ (roll, pitch, yaw). The simplified dynamics, under common assumptions neglecting aerodynamic effects and assuming symmetric structure, are given by:

$$
\begin{align}
m\ddot{\boldsymbol{\xi}} &= \begin{bmatrix} 0 \\ 0 \\ -mg \end{bmatrix} + \mathbf{R}_B^E \begin{bmatrix} 0 \\ 0 \\ u_1 \end{bmatrix} \\
\mathbf{I} \dot{\boldsymbol{\omega}} + \boldsymbol{\omega} \times \mathbf{I} \boldsymbol{\omega} &= \mathbf{u}_2
\end{align}
$$

Here, $m$ is the mass, $g$ the gravitational acceleration, and $\mathbf{I} = \text{diag}(I_{xx}, I_{yy}, I_{zz})$ is the inertia matrix. $\mathbf{R}_B^E$ is the rotation matrix from frame $B$ to $E$:

$$
\mathbf{R}_B^E = \begin{bmatrix}
c_\theta c_\psi & s_\phi s_\theta c_\psi – c_\phi s_\psi & c_\phi s_\theta c_\psi + s_\phi s_\psi \\
c_\theta s_\psi & s_\phi s_\theta s_\psi + c_\phi c_\psi & c_\phi s_\theta s_\psi – s_\phi c_\psi \\
-s_\theta & s_\phi c_\theta & c_\phi c_\theta
\end{bmatrix}
$$

where $s_\cdot$ and $c_\cdot$ denote $\sin(\cdot)$ and $\cos(\cdot)$, respectively. The control inputs are the total thrust $u_1 = F_1 + F_2 + F_3 + F_4$ and the torque vector $\mathbf{u}_2 = [u_2, u_3, u_4]^T$, related to the individual motor thrusts $F_i$ and the arm length $L$:

$$
\mathbf{u}_2 = \begin{bmatrix} L(F_4 – F_2) \\ L(F_3 – F_1) \\ M_1 + M_3 – M_2 – M_4 \end{bmatrix}
$$

The angular velocity in the body frame $\boldsymbol{\omega} = [p, q, r]^T$ is related to the Euler rate $\dot{\boldsymbol{\Theta}}$ by:

$$
\boldsymbol{\omega} = \begin{bmatrix}
1 & 0 & -s_\theta \\
0 & c_\phi & s_\phi c_\theta \\
0 & -s_\phi & c_\phi c_\theta
\end{bmatrix} \dot{\boldsymbol{\Theta}} \quad \text{or} \quad \dot{\boldsymbol{\Theta}} = \mathbf{W} \boldsymbol{\omega}
$$

The proposed control architecture employs a hierarchical, dual-loop structure, which is standard for quadrotor drone control due to its underactuated nature. The overall block diagram of the controller is summarized in the concept below, illustrating the flow from reference trajectories to control signals.

Control Loop Inputs Control Law Outputs
Outer Loop (Position) Desired Trajectory $\boldsymbol{\xi}_d$, Actual Position $\boldsymbol{\xi}$ Second-Order PD Commanded Attitude $\phi_c, \theta_c$, Total Thrust $u_1$
Inner Loop (Attitude) Commanded Attitude $\boldsymbol{\Theta}_c$, Actual Attitude $\boldsymbol{\Theta}$ Integral Sliding Mode with Saturation Torque Vector $\mathbf{u}_2$

The outer loop controller is designed for precise trajectory tracking. Let the desired trajectory be $\boldsymbol{\xi}_d(t) = [x_d, y_d, z_d]^T$ and define the tracking errors $\mathbf{e}_p = \boldsymbol{\xi}_d – \boldsymbol{\xi}$ and $\mathbf{e}_v = \dot{\boldsymbol{\xi}}_d – \dot{\boldsymbol{\xi}}$. A second-order PD control law is formulated to provide a commanded acceleration $\ddot{\boldsymbol{\xi}}_c$:

$$
\ddot{\boldsymbol{\xi}}_c = \ddot{\boldsymbol{\xi}}_d + \mathbf{K}_d \mathbf{e}_v + \mathbf{K}_p \mathbf{e}_p
$$

where $\mathbf{K}_d = \text{diag}(k_{dx}, k_{dy}, k_{dz})$ and $\mathbf{K}_p = \text{diag}(k_{px}, k_{py}, k_{pz})$ are positive definite gain matrices. This formulation incorporates not just the error and its derivative, but also the desired acceleration, improving tracking performance for dynamic trajectories. This commanded acceleration must be generated by the thrust $u_1$ and the orientation. From the translational dynamics, we have:

$$
\ddot{\boldsymbol{\xi}} = \begin{bmatrix} 0 \\ 0 \\ -g \end{bmatrix} + \frac{1}{m} \mathbf{R}_B^E \begin{bmatrix} 0 \\ 0 \\ u_1 \end{bmatrix}
$$

By equating $\ddot{\boldsymbol{\xi}}$ to $\ddot{\boldsymbol{\xi}}_c$ and solving, we can extract the commanded total thrust $u_1$ and the commanded roll ($\phi_c$) and pitch ($\theta_c$) angles. The calculation for the commanded thrust is:

$$
u_1 = m \| \begin{bmatrix} 0 & 0 & g \end{bmatrix}^T + \ddot{\boldsymbol{\xi}}_c \|
$$

To find the attitude commands, we first compute a desired body-frame $z_B$ direction from the acceleration command. Defining $\mathbf{a}_c = \ddot{\boldsymbol{\xi}}_c + [0, 0, g]^T$, the third column of the desired rotation matrix $\mathbf{R}_{des}$ is $\mathbf{z}_{B,des} = \mathbf{a}_c / \|\mathbf{a}_c\|$. Given a desired yaw angle $\psi_d$, the full desired rotation matrix can be constructed. From $\mathbf{R}_{des}$, the commanded roll and pitch angles are derived as:

$$
\begin{align}
\phi_c &= \text{atan2}( \mathbf{R}_{des}(2,3), \mathbf{R}_{des}(3,3) ) \\
\theta_c &= \text{asin}( -\mathbf{R}_{des}(1,3) )
\end{align}
$$

These commanded angles, along with $\psi_d$, form the reference $\boldsymbol{\Theta}_c = [\phi_c, \theta_c, \psi_d]^T$ for the inner loop.

The inner loop controller’s objective is to make the quadrotor drone’s attitude $\boldsymbol{\Theta}$ track $\boldsymbol{\Theta}_c$ robustly and with minimal chattering. For controller design near hover, we approximate $\dot{\boldsymbol{\Theta}} \approx \boldsymbol{\omega}$. The attitude error is defined as $\mathbf{e}_\Theta = \boldsymbol{\Theta}_c – \boldsymbol{\Theta}$ and $\mathbf{e}_\omega = \dot{\boldsymbol{\Theta}}_c – \boldsymbol{\omega}$. An integral sliding surface $\mathbf{s}$ is designed to improve robustness and steady-state accuracy:

$$
\mathbf{s} = \mathbf{e}_\omega + \mathbf{\Lambda} \mathbf{e}_\Theta + \mathbf{\Delta} \int \mathbf{e}_\Theta \, dt
$$

where $\mathbf{\Lambda}$ and $\mathbf{\Delta}$ are positive definite diagonal matrices. The derivative of the sliding surface is:

$$
\dot{\mathbf{s}} = \ddot{\boldsymbol{\Theta}}_c – \dot{\boldsymbol{\omega}} + \mathbf{\Lambda} \mathbf{e}_\omega + \mathbf{\Delta} \mathbf{e}_\Theta
$$

Substituting the approximate rotational dynamics $\dot{\boldsymbol{\omega}} \approx \mathbf{I}^{-1} \mathbf{u}_2$ (since $\boldsymbol{\omega} \times \mathbf{I} \boldsymbol{\omega}$ is relatively small near hover) yields:

$$
\dot{\mathbf{s}} = \ddot{\boldsymbol{\Theta}}_c – \mathbf{I}^{-1} \mathbf{u}_2 + \mathbf{\Lambda} \mathbf{e}_\omega + \mathbf{\Delta} \mathbf{e}_\Theta
$$

To enforce sliding mode, we choose the control law $\mathbf{u}_2$ such that $\dot{\mathbf{s}} = -\mathbf{K} \text{sat}(\mathbf{s}/\boldsymbol{\Phi}) – \mathbf{E} \mathbf{s}$, where $\mathbf{K}, \mathbf{E} > 0$ are diagonal gain matrices, and $\text{sat}(\cdot)$ is the saturation function defined element-wise as:

$$
\text{sat}\left(\frac{s_i}{\phi_i}\right) = \begin{cases}
\text{sign}(s_i) & \text{if } |s_i| > \phi_i \\
s_i / \phi_i & \text{if } |s_i| \le \phi_i
\end{cases}
$$

Here, $\boldsymbol{\Phi}$ is the boundary layer thickness vector. This replaces the discontinuous sign function, effectively suppressing chattering. Solving for $\mathbf{u}_2$ gives the inner loop control law:

$$
\mathbf{u}_2 = \mathbf{I} \left[ \ddot{\boldsymbol{\Theta}}_c + \mathbf{\Lambda} \mathbf{e}_\omega + \mathbf{\Delta} \mathbf{e}_\Theta + \mathbf{K} \text{sat}(\mathbf{s}/\boldsymbol{\Phi}) + \mathbf{E} \mathbf{s} \right]
$$

Stability is proven using the Lyapunov function candidate $V = \frac{1}{2} \mathbf{s}^T \mathbf{s}$. Its derivative is:

$$
\dot{V} = \mathbf{s}^T \dot{\mathbf{s}} = \mathbf{s}^T \left( -\mathbf{K} \text{sat}(\mathbf{s}/\boldsymbol{\Phi}) – \mathbf{E} \mathbf{s} \right) \le 0
$$

This inequality ensures that the sliding surface $\mathbf{s}$ reaches zero in finite time, guaranteeing that the attitude tracking errors $\mathbf{e}_\Theta$ and $\mathbf{e}_\omega$ converge to zero asymptotically.

The performance of the proposed second-order PD and integral sliding mode controller for the quadrotor drone is evaluated through numerical simulations. The physical parameters of the drone model used are listed in the table below.

Table 1: Quadrotor Drone System Parameters
Parameter Symbol Value
Mass $m$ 0.18 kg
Gravity $g$ 9.81 m/s²
Arm Length $L$ 0.12 m
$x$-axis Inertia $I_{xx}$ 2.50e-3 N·m·s²/rad
$y$-axis Inertia $I_{yy}$ 2.32e-3 N·m·s²/rad
$z$-axis Inertia $I_{zz}$ 3.74e-3 N·m·s²/rad

The controller gains are tuned for optimal performance. A challenging spiral ascending trajectory is chosen as the reference to test the controller’s dynamic tracking capability. The desired path is given by:

$$
\boldsymbol{\xi}_d(t) = \begin{bmatrix} 2\sin(0.2t) \\ 2\cos(0.2t) \\ 0.1t \end{bmatrix}, \quad \psi_d = 0
$$

Table 2: Controller Parameters
Gain Matrix Value (Diagonal Elements)
Position: $\mathbf{K}_p$ $\text{diag}(1.5, 1.5, 3.0)$
Position: $\mathbf{K}_d$ $\text{diag}(2.0, 2.0, 4.0)$
Sliding Surface: $\mathbf{\Lambda}$ $\text{diag}(8, 8, 8)$
Sliding Surface: $\mathbf{\Delta}$ $\text{diag}(2, 2, 2)$
Attitude: $\mathbf{K}$ $\text{diag}(5, 5, 5)$
Attitude: $\mathbf{E}$ $\text{diag}(0.5, 0.5, 0.5)$
Boundary Layer: $\boldsymbol{\Phi}$ $[0.1, 0.1, 0.1]^T$

First, the simulation is run without any external disturbance. The quadrotor drone successfully takes off and accurately tracks the three-dimensional spiral trajectory. The position tracking errors in the $x$, $y$, and $z$ axes remain very small, demonstrating the high precision afforded by the second-order PD outer loop. The attitude angles smoothly follow their computed commanded values ($\phi_c, \theta_c$). Crucially, the control torques in $\mathbf{u}_2$ generated by the inner-loop integral sliding mode controller are smooth and exhibit no high-frequency chattering, confirming the effectiveness of the saturation function within the boundary layer.

To rigorously test robustness, a significant wind gust disturbance is introduced at $t = 25$ seconds. The disturbance is modeled as a sudden, sustained velocity vector $\mathbf{V}_{wind} \approx [5, 5, 5]^T$ m/s applied to the quadrotor drone’s translational dynamics, simulating a strong, oblique wind gust. Upon the disturbance onset, transient errors in position and attitude are observed. However, the controller reacts swiftly. The position errors are corrected, and the quadrotor drone re-converges to the desired spiral path within approximately 5 seconds. The attitude controller maintains stability throughout the event. The control signals, particularly the torque inputs in $\mathbf{u}_2$, show a brief spike in activity to counteract the disturbance but quickly return to smooth operation without persistent chattering. This rapid recovery highlights the strong disturbance rejection capability and robustness inherent in the sliding mode-based inner loop. The stable and chattering-free control effort is vital for the longevity of the quadrotor drone’s actuators and for safe flight.

In conclusion, this article has presented and validated a sophisticated dual-loop control strategy for a quadrotor drone. The architecture synergistically combines a second-order PD controller for precise outer-loop position tracking with an integral sliding mode controller featuring a saturation function for robust, chatter-free inner-loop attitude regulation. The second-order PD structure enhances tracking accuracy for dynamic trajectories, while the integral sliding mode with a saturation function provides robust stability against disturbances and actively suppresses the undesirable chattering phenomenon. Lyapunov stability analysis confirms the global convergence properties of the system. Simulation results under both nominal and disturbed conditions demonstrate that the proposed controller enables a quadrotor drone to accurately follow complex paths like a spiral ascent and to recover rapidly from severe wind gusts. The control inputs remain smooth and practical for real-world implementation. This work confirms the proposed algorithm as an effective and robust solution for enhancing the flight performance and reliability of quadrotor drones in challenging operational environments.

Scroll to Top