Robust Quadcopter Attitude Control via Second-Order Sliding Mode

In modern power systems, the installation and removal of grounding wires for medium and low voltage overhead lines present critical challenges, where traditional manual operations incur significant safety risks and inefficiencies. The adoption of unmanned aerial vehicles, particularly quadcopter UAVs, has revolutionized this process by enhancing safety and operational precision. However, executing such tasks demands exceptional attitude stability and accurate control capabilities from the quadcopter. To address this, I propose a novel attitude control algorithm based on second-order sliding mode control for quadcopter UAVs. This approach designs a robust flight controller that accommodates the underactuated nature of quadcopters, enabling precise position tracking and attitude stabilization despite model uncertainties. The controller ensures robust performance in tracking desired positions and adjusting yaw angles while stabilizing pitch and roll angles. Through simulations, I demonstrate that the designed controller effectively stabilizes the quadcopter, underscoring its potential for real-world applications in power systems and beyond.

The quadcopter UAV, a vertical take-off and landing vehicle, consists of a rigid frame with four rotors generating independent thrusts. Its dynamics are derived from Lagrangian mechanics, capturing the interplay between translational and rotational motions. The simplified model accounts for forces, moments, and aerodynamic effects, as described by the following equations:

$$ \ddot{x} = \frac{1}{m} (\cos\phi \sin\theta \cos\psi + \sin\phi \sin\psi) u_1 – \frac{K_1 \dot{x}}{m} $$
$$ \ddot{y} = \frac{1}{m} (\cos\phi \sin\theta \sin\psi – \sin\phi \cos\psi) u_1 – \frac{K_2 \dot{y}}{m} $$
$$ \ddot{z} = \frac{1}{m} (\cos\phi \cos\theta) u_1 – g – \frac{K_3 \dot{z}}{m} $$
$$ \ddot{\phi} = \dot{\theta} \dot{\psi} \frac{I_y – I_z}{I_x} + \frac{J_r}{I_x} \dot{\theta} \Omega_r + \frac{l}{I_x} u_2 – \frac{K_4 l}{I_x} \dot{\phi} $$
$$ \ddot{\theta} = \dot{\psi} \dot{\phi} \frac{I_z – I_x}{I_y} – \frac{J_r}{I_y} \dot{\phi} \Omega_r + \frac{l}{I_y} u_3 – \frac{K_5 l}{I_y} \dot{\theta} $$
$$ \ddot{\psi} = \dot{\phi} \dot{\theta} \frac{I_x – I_y}{I_z} + \frac{1}{I_z} u_4 – \frac{K_6}{I_z} \dot{\psi} $$

Here, \( (x, y, z) \) denote the position coordinates; \( (\phi, \theta, \psi) \) represent the roll, pitch, and yaw Euler angles, with \( \phi, \theta, \psi \in (-\pi/2, \pi/2) \); \( m \) is the mass; \( g \) is gravitational acceleration; \( l \) is the half-length of the quadcopter; \( I_x, I_y, I_z \) are the moments of inertia; \( J_r \) is the propeller inertia; \( K_i \) (for \( i = 1, \dots, 6 \)) are drag coefficients; and \( u_i \) (for \( i = 1, \dots, 4 \)) are the virtual control inputs defined as:

$$ u_1 = F_1 + F_2 + F_3 + F_4 $$
$$ u_2 = -F_2 + F_4 $$
$$ u_3 = -F_1 + F_3 $$
$$ u_4 = \frac{d}{b} (-F_1 + F_2 – F_3 + F_4) $$

where \( F_i = b \Omega_i^2 \) are the thrusts from the rotors, \( b \) is the lift coefficient, \( d \) is a moment scaling factor, and \( \Omega_r = \Omega_1 – \Omega_2 + \Omega_3 – \Omega_4 \) is the overall propeller speed. The quadcopter’s underactuated nature, with four inputs and six outputs, necessitates a control strategy that ensures robustness against uncertainties. To incorporate model parameter uncertainties, I consider variations in mass and moments of inertia, leading to modified dynamics with disturbance terms \( \Delta f_i \).

For controller design, I transform the dynamics into a decoupled form to facilitate sliding mode control. The system is expressed as:

$$ \ddot{z} = f_1 + g_1 u_1 + \Delta f_1 $$
$$ \ddot{y} = f_2 + g_2 u_2 + \Delta f_2 $$
$$ \ddot{\phi} = f_3 + g_3 u_2 + \Delta f_3 $$
$$ \ddot{x} = f_4 + g_4 u_3 + \Delta f_4 $$
$$ \ddot{\theta} = f_5 + g_5 u_3 + \Delta f_5 $$
$$ \ddot{\psi} = f_6 + g_6 u_4 + \Delta f_6 $$

where the functions \( f_i \) and \( g_i \) encapsulate the nominal dynamics and control gains, while \( \Delta f_i \) represent uncertainties. For instance, \( f_1 = -g – K_3 \dot{z}/m \), \( g_1 = (\cos\phi \cos\theta)/m \), and \( \Delta f_1 = (K_3 \dot{z}) \cdot \Delta m / [m(m + \Delta m)] \). Similar definitions apply to other states, accounting for variations in inertia and mass.

I define sliding manifolds to enforce desired tracking performance. For each subsystem, the sliding variable \( s_i \) is formulated as a linear combination of tracking errors:

$$ s_i = a_{i1} (\dot{q}_{i1d} – \dot{q}_{i1}) + a_{i2} (q_{i1d} – q_{i1}) + a_{i3} (\dot{q}_{i2d} – \dot{q}_{i2}) + a_{i4} (q_{i2d} – q_{i2}) $$

where \( i = 1, 2, 3, 4 \), and \( a_{ij} \) are positive coefficients chosen for stability. Specifically, for the quadcopter, the manifolds are:

$$ s_1 = a_{11} (\dot{z}_d – \dot{z}) + a_{12} (z_d – z) $$
$$ s_2 = a_{21} (\dot{y}_d – \dot{y}) + a_{22} (y_d – y) + a_{23} (\dot{\phi}_d – \dot{\phi}) + a_{24} (\phi_d – \phi) $$
$$ s_3 = a_{31} (\dot{x}_d – \dot{x}) + a_{32} (x_d – x) + a_{33} (\dot{\theta}_d – \dot{\theta}) + a_{34} (\theta_d – \theta) $$
$$ s_4 = a_{41} (\dot{\psi}_d – \dot{\psi}) + a_{42} (\psi_d – \psi) $$

with \( a_{11}, a_{12}, a_{41}, a_{42} > 0 \) and \( a_{13} = a_{14} = a_{43} = a_{44} = 0 \). The derivatives of these manifolds are:

$$ \dot{s}_1 = a_{11} (\ddot{z}_d – \ddot{z}) + a_{12} (\dot{z}_d – \dot{z}) $$
$$ \dot{s}_2 = a_{21} (\ddot{y}_d – \ddot{y}) + a_{22} (\dot{y}_d – \dot{y}) + a_{23} (\ddot{\phi}_d – \ddot{\phi}) + a_{24} (\dot{\phi}_d – \dot{\phi}) $$
$$ \dot{s}_3 = a_{31} (\ddot{x}_d – \ddot{x}) + a_{32} (\dot{x}_d – \dot{x}) + a_{33} (\ddot{\theta}_d – \ddot{\theta}) + a_{34} (\dot{\theta}_d – \dot{\theta}) $$
$$ \dot{s}_4 = a_{41} (\ddot{\psi}_d – \ddot{\psi}) + a_{42} (\dot{\psi}_d – \dot{\psi}) $$

To achieve finite-time convergence, I set \( \dot{s}_i = -\eta_i s_i – \varepsilon_i \text{sgn}(s_i) \) for \( i = 1, 2, 3, 4 \), where \( \eta_i > 0 \) and \( \varepsilon_i \) are robustness gains. Solving for the control inputs yields:

$$ u_1 = \frac{1}{a_{11} g_1} \left[ a_{11} (\ddot{z}_d – f_1) + a_{12} (\dot{z}_d – \dot{z}) + \eta_1 s_1 + \varepsilon_1 \text{sgn}(s_1) \right] $$
$$ u_2 = \frac{1}{a_{21} g_2 + a_{23} g_3} \left[ a_{21} (\ddot{y}_d – f_2) + a_{22} (\dot{y}_d – \dot{y}) + a_{23} (\ddot{\phi}_d – f_3) + a_{24} (\dot{\phi}_d – \dot{\phi}) + \eta_2 s_2 + \varepsilon_2 \text{sgn}(s_2) \right] $$
$$ u_3 = \frac{1}{a_{31} g_4 + a_{33} g_5} \left[ a_{31} (\ddot{x}_d – f_4) + a_{32} (\dot{x}_d – \dot{x}) + a_{33} (\ddot{\theta}_d – f_5) + a_{34} (\dot{\theta}_d – \dot{\theta}) + \eta_3 s_3 + \varepsilon_3 \text{sgn}(s_3) \right] $$
$$ u_4 = \frac{1}{a_{41} g_6} \left[ a_{41} (\ddot{\psi}_d – f_6) + a_{42} (\dot{\psi}_d – \dot{\psi}) + \eta_4 s_4 + \varepsilon_4 \text{sgn}(s_4) \right] $$

Here, \( \varepsilon_i \) are chosen to dominate uncertainties, e.g., \( \varepsilon_1 = |a_{11} \Delta f_1| + \delta_1 \) with \( \delta_1 > 0 \). The stability analysis employs Lyapunov functions, such as \( V = s_2^2 / 2 \) for the \( \ddot{y} \) and \( \ddot{\phi} \) subsystems, demonstrating that \( \dot{V} \leq 0 \) ensures asymptotic stability.

To validate the controller, I conduct simulations with parameter uncertainties. The nominal parameters for the quadcopter are: mass \( m = 1.1 \, \text{kg} \), gravity \( g = 9.81 \, \text{m/s}^2 \), moments of inertia \( I_x = I_y = 1.22 \, \text{Ns}^2/\text{rad} \), \( I_z = 2.2 \, \text{Ns}^2/\text{rad} \), drag coefficients \( K_1 = K_2 = K_3 = 0.1 \, \text{Ns/m} \), \( K_4 = K_5 = K_6 = 0.12 \, \text{Ns/rad} \), half-length \( l = 0.21 \, \text{m} \), lift coefficient \( b = 5 \, \text{Ns}^2 \), moment scaling factor \( d = 2 \, \text{N/m s}^2 \), and propeller inertia \( J_r = 0.2 \, \text{Ns}^2/\text{rad} \). The initial conditions are zero for all states and their derivatives. Desired values are set to \( x_d = 1 \, \text{m} \), \( y_d = 1 \, \text{m} \), \( z_d = 1 \, \text{m} \), \( \phi_d = 0 \, \text{rad} \), \( \theta_d = 0 \, \text{rad} \), and \( \psi_d = \pi/6.2 \, \text{rad} \). Controller parameters are selected as \( a_{11} = a_{12} = 1 \), \( \eta_1 = 2 \), \( \delta_1 = 0.01 \), \( \eta_2 = 2 \), \( \delta_2 = 0.01 \), \( a_{41} = a_{42} = 1 \), \( \eta_3 = 2 \), \( \delta_3 = 0.01 \), \( \eta_4 = 2 \), \( \delta_4 = 0.01 \), and eigenvalues \( k_{11} = k_{21} = k_{31} = 2 \), \( k_{12} = k_{22} = k_{32} = 2 \). Uncertainties are introduced as \( \Delta m = 0.1 \, \text{kg} \), \( \Delta I_x = \Delta I_y = 0.1 \, \text{Ns}^2/\text{rad} \), and \( \Delta I_z = 0.2 \, \text{Ns}^2/\text{rad} \).

The simulation results confirm the controller’s effectiveness. The positions \( (x, y, z) \) and angles \( (\phi, \theta, \psi) \) converge to their desired values within finite time, as shown in the response plots. The sliding manifolds \( s_1, s_2, s_3, s_4 \) reach zero, indicating that the system trajectories remain on the sliding surfaces. The control inputs \( u_1, u_2, u_3, u_4 \) stabilize to bounded values, ensuring practical implementability. Notably, the quadcopter achieves robust tracking despite parameter variations, highlighting the superiority of second-order sliding mode control in handling uncertainties for quadcopter applications.

Quadcopter Parameters and Controller Gains
Parameter Value Description
\( m \) 1.1 kg Mass of quadcopter
\( I_x, I_y \) 1.22 Ns²/rad Roll and pitch inertia
\( I_z \) 2.2 Ns²/rad Yaw inertia
\( l \) 0.21 m Half-length
\( \eta_1, \eta_2, \eta_3, \eta_4 \) 2 Sliding mode gains
\( \delta_1, \delta_2, \delta_3, \delta_4 \) 0.01 Robustness margins

In conclusion, I have developed a second-order sliding mode control strategy for quadcopter UAVs that ensures robust attitude and position tracking under model uncertainties. The controller leverages sliding manifolds to achieve finite-time convergence, with stability proven via Lyapunov analysis. Simulations validate its performance, showing precise tracking and disturbance rejection. This work underscores the potential of advanced control techniques for enhancing quadcopter reliability in critical applications like power system maintenance. Future research will focus on extending this approach to handle external disturbances, such as wind gusts and actuator faults, further improving the quadcopter’s resilience in dynamic environments.

Scroll to Top