Trajectory Tracking System for Quadcopter UAV Based on Active Disturbance Rejection Control

In recent years, quadcopter unmanned aerial vehicles (UAVs) have gained significant attention due to their versatility, low cost, and ability to perform vertical take-off and landing. These attributes make quadcopter systems ideal for applications such as transportation, mapping, and aerial photography. However, the flight performance of a quadcopter can be severely impacted by uncertainties including model inaccuracies and external disturbances like wind gusts. These factors often lead to control challenges, potentially causing instability or even crashes. To address these issues, I propose a trajectory tracking control system that integrates Active Disturbance Rejection Control (ADRC) with Proportional-Integral-Derivative (PID) controllers. This approach leverages ADRC’s ability to estimate and compensate for unknown disturbances in real-time, thereby enhancing the quadcopter’s trajectory tracking accuracy and robustness.

The dynamics of a quadcopter are inherently nonlinear, underactuated, and coupled, making precise control difficult. Traditional PID controllers, while widely used for their simplicity and model-independent nature, often struggle with nonlinear systems and disturbance rejection. In contrast, ADRC provides a framework that actively estimates and cancels out disturbances, offering improved performance. In this work, I design a dual-loop control structure: an inner loop for attitude control using PID and an outer loop for position control based on ADRC. This combination aims to achieve high-precision trajectory tracking even in the presence of uncertainties. Through simulations, I demonstrate that the proposed system outperforms conventional PID control in terms of tracking accuracy and disturbance suppression.

To model the quadcopter, I consider a standard “X” configuration where four rotors generate thrust and moments. The dynamic equations of motion are derived using Newton-Euler formulations, accounting for translational and rotational movements. The key variables include the position coordinates (x, y, z) and the Euler angles (φ, θ, ψ) representing roll, pitch, and yaw, respectively. The control inputs are the forces and moments generated by the rotors, which are related to the rotor speeds through aerodynamic coefficients. The mathematical model can be expressed as follows:

$$ \ddot{x} = -\frac{T}{m} (\cos\psi \sin\theta \cos\phi + \sin\psi \sin\phi) $$
$$ \ddot{y} = -\frac{T}{m} (\sin\psi \sin\theta \cos\phi – \cos\psi \sin\phi) $$
$$ \ddot{z} = g – \frac{T}{m} (\cos\phi \cos\theta) $$
$$ \ddot{\phi} = \dot{\theta} \dot{\psi} \frac{I_y – I_z}{I_x} + \frac{\tau_x}{I_x} $$
$$ \ddot{\theta} = \dot{\phi} \dot{\psi} \frac{I_z – I_x}{I_y} + \frac{\tau_y}{I_y} $$
$$ \ddot{\psi} = \dot{\phi} \dot{\theta} \frac{I_x – I_y}{I_z} + \frac{\tau_z}{I_z} $$

where \( T \) is the total thrust, \( m \) is the mass of the quadcopter, \( g \) is gravitational acceleration, \( \tau_x, \tau_y, \tau_z \) are the moments about the respective axes, and \( I_x, I_y, I_z \) are the moments of inertia. The control allocation from rotor speeds to forces and moments is given by:

$$ \begin{bmatrix} f \\ \tau_x \\ \tau_y \\ \tau_z \end{bmatrix} = \begin{bmatrix} c_T & c_T & c_T & c_T \\ -\frac{\sqrt{2}}{2} d c_T & \frac{\sqrt{2}}{2} d c_T & \frac{\sqrt{2}}{2} d c_T & -\frac{\sqrt{2}}{2} d c_T \\ \frac{\sqrt{2}}{2} d c_T & \frac{\sqrt{2}}{2} d c_T & -\frac{\sqrt{2}}{2} d c_T & -\frac{\sqrt{2}}{2} d c_T \\ c_M & -c_M & c_M & -c_M \end{bmatrix} \begin{bmatrix} \tilde{\omega}_1^2 \\ \tilde{\omega}_2^2 \\ \tilde{\omega}_3^2 \\ \tilde{\omega}_4^2 \end{bmatrix} $$

Here, \( c_T \) and \( c_M \) are the thrust and moment coefficients, \( d \) is the distance from the center of mass to a rotor, and \( \tilde{\omega}_i \) represents the speed of the i-th rotor. This model forms the basis for designing the control system, but it is often subject to uncertainties, necessitating robust control strategies like ADRC.

Active Disturbance Rejection Control (ADRC) is composed of three main components: a Tracking Differentiator (TD), an Extended State Observer (ESO), and a Nonlinear State Error Feedback (NLSEF). The TD arranges a transient process for the reference signal and provides its derivative, reducing overshoot and improving response. The ESO estimates the system states and total disturbances, including internal model errors and external perturbations, by expanding the state space. The NLSEF generates a control signal based on the error between the desired and estimated states, using nonlinear functions to enhance performance. The structure of ADRC allows it to handle uncertainties effectively without requiring a precise model of the quadcopter.

For the TD, I use a discrete-time implementation to generate a smooth reference trajectory and its derivative. The algorithm is based on the fastest synthesis function, which ensures rapid and monotonic convergence. The TD equations are:

$$ v_1(k+1) = v_1(k) + h v_2(k) $$
$$ v_2(k+1) = v_2(k) + h \cdot \text{fhan}(v_1(k) – v_0(k), v_2(k), r_0, h_0) $$

where \( v_0 \) is the input signal, \( v_1 \) tracks \( v_0 \), \( v_2 \) is the derivative, \( h \) is the sampling time, \( r_0 \) is the speed factor, and \( h_0 \) is the filter factor. The function \( \text{fhan} \) is defined as:

$$ \text{fhan}(x_1, x_2, r, h) = \begin{cases} -r \cdot \text{sign}(a), & |a| > d \\ -r \frac{a}{d}, & |a| \leq d \end{cases} $$
$$ a = \begin{cases} x_2 + \frac{a_0 – d}{2} \text{sign}(y), & |y| > d_0 \\ x_2 + \frac{y}{h}, & |y| \leq d_0 \end{cases} $$
$$ y = x_1 + h x_2, \quad d = r h, \quad d_0 = h d, \quad a_0 = \sqrt{d^2 + 8 r |y|} $$

This TD ensures that the reference signal is processed smoothly, reducing sudden changes that could excite unstable dynamics in the quadcopter.

The ESO is crucial for disturbance estimation. I design it to estimate the states and total disturbance of the quadcopter system. Consider a general second-order system with disturbance:

$$ \dot{x}_1 = x_2 $$
$$ \dot{x}_2 = f(x_1, x_2, \xi) + b u + d $$
$$ y = x_1 $$

where \( f \) represents unknown dynamics, \( \xi \) denotes internal disturbances, \( d \) is external disturbance, and \( b \) is a control gain. By defining an extended state \( x_3 = f + d \), the system becomes:

$$ \dot{x}_1 = x_2 $$
$$ \dot{x}_2 = b u + x_3 $$
$$ \dot{x}_3 = g(x_1, x_2, x_3, u) $$
$$ y = x_1 $$

The ESO for this system is implemented as:

$$ e = z_1 – y $$
$$ \dot{z}_1 = z_2 – \beta_1 e $$
$$ \dot{z}_2 = z_3 – \beta_2 \text{fal}(e, \alpha_1, \delta) + b u $$
$$ \dot{z}_3 = -\beta_3 \text{fal}(e, \alpha_2, \delta) $$

where \( z_1, z_2, z_3 \) estimate \( x_1, x_2, x_3 \), respectively, \( \beta_i \) are observer gains, and \( \text{fal} \) is a nonlinear function defined as:

$$ \text{fal}(e, \alpha, \delta) = \begin{cases} \frac{e}{\delta^{1-\alpha}}, & |e| \leq \delta \\ |e|^\alpha \text{sign}(e), & |e| > \delta \end{cases} $$

This ESO provides accurate estimates of the states and disturbances, enabling real-time compensation. The stability of the ESO can be analyzed using Lyapunov methods, ensuring that the estimation errors converge to zero under certain conditions.

For the NLSEF, I use a nonlinear combination of the tracking errors to compute the control signal. For a second-order system, the control law is:

$$ u_0 = \beta_1 \text{fal}(e_1, \alpha_1, \delta_1) + \beta_2 \text{fal}(e_2, \alpha_2, \delta_2) $$

where \( e_1 = v_1 – z_1 \) and \( e_2 = v_2 – z_2 \) are the errors between the desired and estimated states, and \( \beta_i, \alpha_i, \delta_i \) are tuning parameters. The final control input is then \( u = (u_0 – z_3) / b \), which compensates for the estimated disturbance.

In the context of the quadcopter, I apply ADRC to the outer loop for position control, while the inner loop for attitude control uses PID controllers. This hierarchical structure simplifies design and improves performance. The position controller generates desired attitude angles and thrust, which are then tracked by the attitude controller. The control allocation block converts the desired moments and thrust into rotor speeds. The overall control system is depicted in the figure above, showing the flow from position commands to rotor inputs.

To compute the desired roll (\( \phi_d \)) and pitch (\( \theta_d \)) angles from the position control outputs, I use the following equations:

$$ U_1 = m \sqrt{U_x^2 + U_y^2 + (U_z – g)^2} $$
$$ \phi_d = \sin^{-1} \left( \frac{m (U_x \sin\psi_d – U_y \cos\psi_d)}{U_1} \right) $$
$$ \theta_d = \sin^{-1} \left( \frac{m (U_x \cos\psi_d + U_y \sin\psi_d)}{U_1 \cos\phi_d} \right) $$

where \( U_x, U_y, U_z \) are the control outputs from the ADRC position controllers for the x, y, z axes, and \( \psi_d \) is the desired yaw angle. This decoupling allows the inner PID loops to manage the attitude dynamics effectively.

For simulation, I implement the system in MATLAB/Simulink, using the quadcopter model and the proposed controller. The simulations are conducted under two scenarios: without disturbances and with disturbances, to evaluate performance. In the disturbance case, I introduce sinusoidal perturbations on the x and y axes to mimic wind effects. The trajectory command is a spiral path defined by:

$$ x_d(t) = 20 \cos(0.5t), \quad y_d(t) = 20 \sin(0.5t), \quad z_d(t) = -t $$

The initial conditions are set to zero position and velocity, with a yaw angle of 0 degrees. The performance is assessed using Root Mean Square Error (RMSE) between the desired and actual trajectories.

In the no-disturbance case, both ADRC and PID controllers achieve trajectory tracking, but ADRC shows better accuracy. The RMSE values are summarized in the table below:

Controller Axis Command RMSE
PID X 20 cos(0.5t) 2.2811
PID Y 20 sin(0.5t) 1.1329
ADRC X 20 cos(0.5t) 2.0576
ADRC Y 20 sin(0.5t) 0.9274

These results indicate that ADRC reduces tracking error, demonstrating its superiority in nominal conditions. The quadcopter’s trajectory under ADRC closely follows the reference, as visualized in the simulation plots.

When disturbances are added, such as \( d_x(t) = 3 \sin(t) \) and \( d_y(t) = 3 \sin(t) \), the ADRC-based system maintains robust performance. The ESO effectively estimates the disturbances, as shown in the estimation plots, where the estimated disturbance \( z_3 \) closely matches the actual perturbation. The control law then compensates for this, minimizing its impact. In contrast, the PID controller exhibits larger deviations and higher RMSE values, as shown in the following table:

Controller Axis Command Disturbance RMSE
PID X 20 cos(0.5t) 3 sin(t) 3.0223
PID Y 20 sin(0.5t) 3 sin(t) 2.2627
ADRC X 20 cos(0.5t) 3 sin(t) 2.0470
ADRC Y 20 sin(0.5t) 3 sin(t) 1.0874

The ADRC controller’s ability to reject disturbances is evident from the lower RMSE values, highlighting its advantage in real-world scenarios where uncertainties are prevalent. The quadcopter’s path under ADRC remains stable and accurate, whereas PID control leads to significant deviations.

Further analysis of the ESO performance shows that the estimation error converges quickly, validating the design. The nonlinear functions in ADRC contribute to this by providing smooth and efficient control actions. Additionally, the parameter tuning of ADRC components, such as the observer gains and nonlinear factors, plays a critical role in achieving optimal performance. I recommend systematic tuning methods, like frequency-domain analysis or optimization algorithms, for practical implementations.

In conclusion, the integration of ADRC with PID control offers a robust solution for quadcopter trajectory tracking. The ADRC’s disturbance estimation and compensation capabilities address the limitations of traditional PID controllers, especially in the presence of model uncertainties and external perturbations. Simulation results confirm that the proposed system achieves higher tracking accuracy and better disturbance rejection, making it suitable for demanding applications. Future work could focus on real-time implementation, adaptive tuning, and extension to more complex quadcopter models or swarm operations. Overall, this approach enhances the reliability and performance of quadcopter UAVs in dynamic environments.

Scroll to Top