Position and Attitude Control for Quadcopter UAV Carrying Time-Varying Loads

In recent years, quadcopter unmanned aerial vehicles (UAVs) have gained significant attention due to their versatility in applications such as payload delivery, surveillance, and inspection. However, controlling a quadcopter under external disturbances and time-varying loads presents substantial challenges due to its inherent nonlinear, underactuated, and coupled dynamics. This paper addresses the position and attitude control problem for a quadcopter subjected to unknown external disturbances and time-varying loads. We propose a parameter adaptive sliding mode control (PASMC) method that integrates adaptive techniques with sliding mode control to estimate and compensate for disturbances and load variations. The key contributions include achieving asymptotic convergence of tracking errors while ensuring continuous control signals and robust performance against uncertainties. Stability is rigorously analyzed using Lyapunov theory, and simulations validate the effectiveness of the proposed approach.

The dynamics of a quadcopter are derived from the Newton-Euler equations, considering the quadcopter as a rigid body with uniform mass distribution. The position and attitude dynamics are described in the inertial and body frames, respectively. Let $[x, y, z]^T$ denote the position of the quadcopter’s center of mass in the ground frame, and $[\phi, \theta, \psi]^T$ represent the roll, pitch, and yaw angles in the body frame. The angular velocities in the body frame are $[p, q, r]^T$. To avoid singularities, the attitude angles are constrained as $\phi, \theta \in (-\pi/2, \pi/2)$ and $\psi \in (-\pi, \pi)$. The dynamic model of the quadcopter is given by:

$$ \begin{align*}
\ddot{x} &= \frac{u_1}{m} (\cos \phi \sin \theta \cos \psi + \sin \phi \sin \psi) + d_1 \\
\ddot{y} &= \frac{u_1}{m} (\cos \phi \sin \theta \sin \psi – \sin \phi \cos \psi) + d_2 \\
\ddot{z} &= \frac{u_1}{m} (\cos \phi \cos \theta) – g + d_3 \\
\dot{\phi} &= \frac{l}{I_x} u_2 + qr \frac{I_y – I_z}{I_x} + d_4 \\
\dot{\theta} &= \frac{l}{I_y} u_3 + pr \frac{I_z – I_x}{I_y} + d_5 \\
\dot{\psi} &= \frac{u_4}{I_z} + pq \frac{I_x – I_y}{I_z} + d_6
\end{align*} $$

Here, $m$ is the total mass of the quadcopter, which includes the base mass $m_0$ and the time-varying load mass $M$, $g$ is the gravitational acceleration, $I_x$, $I_y$, $I_z$ are the moments of inertia, $l$ is the distance from the propeller to the center of mass, $u_1$ is the total thrust generated by the propellers, and $u_2$, $u_3$, $u_4$ are the control moments for roll, pitch, and yaw, respectively. The terms $d_i$ (for $i = 1, 2, \dots, 6$) represent external disturbances in each channel, which are assumed to be bounded but unknown.

The control objective is to design controllers for height, position, and attitude that ensure accurate tracking of desired trajectories despite external disturbances and time-varying loads. We employ a sliding mode control framework combined with parameter adaptation to estimate disturbances and load variations. The design process is divided into height control, attitude control, and position control subsystems.

Height Controller Design

The height dynamics of the quadcopter are given by:

$$ \ddot{z} = \frac{u_1}{m} \cos \phi \cos \theta – g + d_3 $$

Define the height tracking error as $e_z = z_d – z$, where $z_d$ is the desired height. The sliding manifold is chosen as:

$$ s_z = \dot{e}_z + c_z e_z $$

where $c_z > 0$ is a constant. Differentiating $s_z$ yields:

$$ \dot{s}_z = \ddot{z}_d – \left( \frac{u_1}{m} \cos \phi \cos \theta – g + d_3 \right) + c_z \dot{e}_z $$

We select the reaching law as:

$$ \dot{s}_z = -k_z s_z – \eta_z \tanh(s_z) $$

with $k_z > 0$ and $\eta_z > 0$. The control signal $u_1$ is designed as:

$$ u_1 = \frac{m \lambda_z}{\cos \phi \cos \theta} $$

where $\lambda_z = \ddot{z}_d + g – \hat{d}_3 + c_z \dot{e}_z + k_z s_z + \eta_z \tanh(s_z)$, and $\hat{d}_3$ is the estimate of $d_3$. The estimation error is $\tilde{d}_3 = \hat{d}_3 – d_3$. Assuming slow-varying disturbances, $\dot{\hat{d}}_3 = \dot{\tilde{d}}_3$. The adaptive law for $\hat{d}_3$ is:

$$ \dot{\hat{d}}_3 = -\frac{1}{\gamma_3} s_z $$

with $\gamma_3 > 0$. To handle time-varying loads, the total mass $m$ is expressed as $m = \alpha m_0$, where $\alpha > 0$ is an unknown correction factor. The estimated mass is $\hat{m} = \hat{\alpha} m_0$, and the control signal is adjusted to $U_1 = \hat{\alpha} u_1$. The adaptive law for $\hat{\alpha}$ is:

$$ \dot{\hat{\alpha}} = \frac{1}{\gamma_z} \lambda_z s_z $$

where $\gamma_z > 0$. The stability of the height control system is proven using the Lyapunov function:

$$ V_{2z} = \frac{1}{2} s_z^2 + \frac{1}{2\alpha} \gamma_z \tilde{\alpha}^2 + \frac{1}{2} \gamma_3 \tilde{d}_3^2 $$

Differentiating $V_{2z}$ and substituting the control and adaptive laws shows that $\dot{V}_{2z} \leq 0$, ensuring asymptotic stability of the height tracking error.

Attitude Controller Design

The attitude dynamics for roll, pitch, and yaw are controlled separately. Define the attitude tracking errors as $e_\phi = \phi_d – \phi$, $e_\theta = \theta_d – \theta$, and $e_\psi = \psi_d – \psi$. The sliding manifolds are:

$$ \begin{align*}
s_\phi &= \dot{e}_\phi + c_\phi e_\phi \\
s_\theta &= \dot{e}_\theta + c_\theta e_\theta \\
s_\psi &= \dot{e}_\psi + c_\psi e_\psi
\end{align*} $$

with $c_\phi, c_\theta, c_\psi > 0$. The reaching laws are:

$$ \begin{align*}
\dot{s}_\phi &= -k_\phi s_\phi – \eta_\phi \tanh(s_\phi) \\
\dot{s}_\theta &= -k_\theta s_\theta – \eta_\theta \tanh(s_\theta) \\
\dot{s}_\psi &= -k_\psi s_\psi – \eta_\psi \tanh(s_\psi)
\end{align*} $$

where $k_\phi, k_\theta, k_\psi > 0$ and $\eta_\phi, \eta_\theta, \eta_\psi > 0$. The control moments are designed as:

$$ \begin{align*}
u_2 &= \frac{I_x}{l} \left( \ddot{\phi}_d – qr \frac{I_y – I_z}{I_x} – \hat{d}_4 + c_\phi \dot{e}_\phi + k_\phi s_\phi + \eta_\phi \tanh(s_\phi) \right) \\
u_3 &= \frac{I_y}{l} \left( \ddot{\theta}_d – pr \frac{I_z – I_x}{I_y} – \hat{d}_5 + c_\theta \dot{e}_\theta + k_\theta s_\theta + \eta_\theta \tanh(s_\theta) \right) \\
u_4 &= I_z \left( \ddot{\psi}_d – pq \frac{I_x – I_y}{I_z} – \hat{d}_6 + c_\psi \dot{e}_\psi + k_\psi s_\psi + \eta_\psi \tanh(s_\psi) \right)
\end{align*} $$

The adaptive laws for disturbance estimates are:

$$ \begin{align*}
\dot{\hat{d}}_4 &= -\frac{1}{\gamma_4} s_\phi \\
\dot{\hat{d}}_5 &= -\frac{1}{\gamma_5} s_\theta \\
\dot{\hat{d}}_6 &= -\frac{1}{\gamma_6} s_\psi
\end{align*} $$

with $\gamma_4, \gamma_5, \gamma_6 > 0$. Lyapunov analysis similar to the height controller confirms the stability of the attitude control system.

Position Controller Design

The quadcopter is underactuated in the position channels, so virtual inputs are introduced. Define the position tracking errors as $e_x = x_d – x$ and $e_y = y_d – y$. The sliding manifolds are:

$$ \begin{align*}
s_x &= \dot{e}_x + c_x e_x \\
s_y &= \dot{e}_y + c_y e_y
\end{align*} $$

with $c_x, c_y > 0$. The reaching laws are:

$$ \begin{align*}
\dot{s}_x &= -k_x s_x – \eta_x \tanh(s_x) \\
\dot{s}_y &= -k_y s_y – \eta_y \tanh(s_y)
\end{align*} $$

where $k_x, k_y > 0$ and $\eta_x, \eta_y > 0$. The virtual control signals are:

$$ \begin{align*}
u_x &= \frac{m}{u_1} \left( \ddot{x}_d – \hat{d}_1 + c_x \dot{e}_x + k_x s_x + \eta_x \tanh(s_x) \right) \\
u_y &= \frac{m}{u_1} \left( \ddot{y}_d – \hat{d}_2 + c_y \dot{e}_y + k_y s_y + \eta_y \tanh(s_y) \right)
\end{align*} $$

The adaptive laws for disturbance estimates are:

$$ \begin{align*}
\dot{\hat{d}}_1 &= -\frac{1}{\gamma_1} s_x \\
\dot{\hat{d}}_2 &= -\frac{1}{\gamma_2} s_y
\end{align*} $$

with $\gamma_1, \gamma_2 > 0$. The desired roll and pitch angles are computed from the virtual inputs as:

$$ \begin{align*}
\phi_d &= \arcsin(u_x \sin \psi_d – u_y \cos \psi_d) \\
\theta_d &= \arcsin\left( \frac{u_x \cos \psi_d + u_y \sin \psi_d}{\cos \psi_d} \right)
\end{align*} $$

This transformation ensures that the position control is achieved through attitude commands.

Simulation Results

To validate the proposed PASMC method, simulations are conducted under various scenarios involving external disturbances and time-varying loads. The quadcopter parameters are listed in Table 1.

Table 1: Quadcopter Parameters
Parameter Value
$l$ 1.0 m
$I_x$, $I_y$ 122 Ns²/rad
$I_z$ 220 Ns²/rad
$J_r$ 2.0 Ns²/rad
$g$ 9.81 m/s²

The initial conditions are set as $x(0) = 0$, $y(0) = 0$, $z(0) = 0$, $\phi(0) = 0$, $\theta(0) = 0$, $\psi(0) = 0$, $p(0) = 0$, $q(0) = 0$, $r(0) = 0$. The controller gains are chosen as $k_x = 20$, $k_y = 20$, $k_z = 10$, $k_\phi = 10$, $k_\theta = 30$, $k_\psi = 10$, $\gamma_1 = 100$, $\gamma_2 = 100$, $\gamma_3 = 1$, $\gamma_4 = 100$, $\gamma_5 = 100$, $\gamma_6 = 100$, $\eta_x = 10$, $\eta_y = 10$, $\eta_z = 30$, $\eta_\phi = 5$, $\eta_\theta = 20$, $\eta_\psi = 5$, $c_x = 1$, $c_y = 1$, $c_z = 10$, $c_\phi = 1$, $c_\theta = 1$, $c_\psi = 10$. The desired trajectories are $x_d = 2.0$ m, $y_d = 2.0$ m, $z_d = t$ m, and $\psi_d = \pi/6.28$ rad.

The time-varying load mass and external disturbances are defined as follows. The total mass $m$ varies as shown in Table 2.

Table 2: Time-Varying Mass Profile
Time (s) Mass $m$ (kg)
$0 \leq t < 20$ 12
$20 \leq t < 25$ 30
$25 \leq t$ $18e^{-0.33(t-25)} + 12$

External disturbances $d_i$ are modeled as combinations of aerodynamic drag and sinusoidal signals, as summarized in Table 3.

Table 3: External Disturbance Models
Time (s) Disturbance
$t < 20$ $d_1 = 0$, $d_2 = 0$, $d_3 = 0$, $d_4 = 0$, $d_5 = 0$, $d_6 = 0$
$20 \leq t < 25$ $d_1 = -k_1 \dot{x}/m$, $d_2 = -k_2 \dot{y}/m$, $d_3 = -k_3 \dot{z}/m$, $d_4 = -k_4 l \dot{\phi}/I_x + 0.2\cos(\pi t) + \sin(5\pi t)$, $d_5 = -k_5 l \dot{\theta}/I_y + 0.2\cos(\pi t) + \sin(5\pi t)$, $d_6 = -k_6 \dot{\psi}/I_z + 0.2\cos(\pi t) + \sin(5\pi t)$
$25 \leq t$ $d_1 = -k_1 \dot{x}/m$, $d_2 = -k_2 \dot{y}/m$, $d_3 = -k_3 \dot{z}/m$, $d_4 = -k_4 l \dot{\phi}/I_x$, $d_5 = -k_5 l \dot{\theta}/I_y$, $d_6 = -k_6 \dot{\psi}/I_z$

where $k_1 = k_2 = k_3 = 1.0$ and $k_4 = k_5 = k_6 = 1.2$. The simulation results demonstrate that the proposed PASMC method achieves accurate tracking of position, height, and attitude trajectories despite the presence of disturbances and load variations. The control signals remain continuous and smooth, avoiding chattering effects commonly associated with traditional sliding mode control. Comparative analysis with a conventional sliding mode controller highlights the superior performance of PASMC in handling time-varying loads and external disturbances.

Conclusion

This paper presents a parameter adaptive sliding mode control strategy for a quadcopter UAV carrying time-varying loads under external disturbances. The proposed method ensures asymptotic convergence of tracking errors while maintaining continuous control signals, thereby eliminating chattering. Adaptive laws effectively estimate and compensate for unknown disturbances and load variations, enhancing the robustness of the quadcopter control system. Lyapunov-based stability analysis and simulation results confirm the efficacy of the approach. Future work will focus on extending this method to handle actuator faults and more complex environmental conditions, further improving the reliability of quadcopter operations in practical scenarios.

Scroll to Top