In recent years, quadcopter unmanned aerial vehicles (UAVs) have gained significant attention due to their simplicity, reliability, and cost-effectiveness. As a multi-degree-of-freedom and strongly coupled system, the quadcopter faces challenges in attitude control, especially when subjected to internal and external disturbances. One critical issue often overlooked is the center of gravity (CoG) offset, which arises from assembly errors or payload imbalances. This offset introduces additional moments and complicates the dynamics, leading to degraded performance. In this article, I propose an optimal sliding mode control (SMC) integrated with active disturbance rejection control (ADRC) to address the attitude control problem for a quadcopter with CoG offset. The approach leverages ADRC’s disturbance estimation capabilities and SMC’s robustness, while a time-varying sliding surface enhances convergence and reduces chattering.

The dynamics of a quadcopter are derived using the Newton-Euler method. For a quadcopter with CoG offset, the mathematical model must account for the shifted center, which affects the moment arms. The general equations of motion are given by:
$$ \ddot{z} = -g + \frac{\cos\theta \cos\phi}{m} f $$
$$ \ddot{\phi} = \frac{I_y – I_z}{I_x} \dot{\theta} \dot{\psi} + \frac{1}{I_x} \tau_x $$
$$ \ddot{\theta} = \frac{I_z – I_x}{I_y} \dot{\phi} \dot{\psi} + \frac{1}{I_y} \tau_y $$
$$ \ddot{\psi} = \frac{I_x – I_y}{I_z} \dot{\phi} \dot{\theta} + \frac{1}{I_z} \tau_z $$
Here, $z$ represents altitude, $\phi$, $\theta$, and $\psi$ are roll, pitch, and yaw angles, respectively. $\tau_x$, $\tau_y$, and $\tau_z$ are the moments generated by the propellers along the body axes, $I_x$, $I_y$, $I_z$ are moments of inertia, $f$ is the total thrust, $m$ is the mass, and $g$ is gravitational acceleration. For a quadcopter with CoG offset $(\Delta x, \Delta y, \Delta z)$, the moments are modified. Considering a symmetric X-type quadcopter, the total thrust $f$ is:
$$ f = \sum_{i=1}^{4} f_i = c_T (\omega_1^2 + \omega_2^2 + \omega_3^2 + \omega_4^2) $$
where $c_T$ is the thrust coefficient and $\omega_i$ is the angular velocity of the $i$-th motor. The moments due to thrust forces with CoG offset are derived from the cross product of force vectors and lever arms. For motor 1, the moment is:
$$ \mathbf{M}_1 = \mathbf{r}_1 \times \mathbf{F}_1 = \begin{vmatrix} \mathbf{i} & \mathbf{j} & \mathbf{k} \\ d – \Delta x & d – \Delta y & -\Delta z \\ 0 & 0 & -f_1 \end{vmatrix} = -f_1 (d – \Delta y) \mathbf{i} + f_1 (d – \Delta x) \mathbf{j} $$
Similarly, for all motors, the moments can be summarized as:
$$ \tau_x = -f_1 (d – \Delta y) + f_2 (d + \Delta y) + f_3 (d + \Delta y) – f_4 (d – \Delta y) $$
$$ \tau_y = f_1 (d – \Delta x) – f_2 (d + \Delta x) + f_3 (d – \Delta x) – f_4 (d + \Delta x) $$
$$ \tau_z = c_M (\omega_1^2 + \omega_2^2 – \omega_3^2 – \omega_4^2) $$
where $c_M$ is the drag coefficient. The control allocation matrix relates motor speeds to forces and moments. Defining control inputs as $U_1 = f / c_T$, $U_2 = \tau_x / c_T$, $U_3 = \tau_y / c_T$, and $U_4 = \tau_z / c_M$, the inverse allocation matrix can be used for control design.
To handle the CoG offset and disturbances, I design an ADRC-based controller for each attitude channel. ADRC consists of a tracking differentiator (TD), an extended state observer (ESO), and a nonlinear state error feedback (NLSEF). For the roll channel, the dynamics with disturbance $\omega$ are:
$$ \ddot{\phi} = \frac{I_y – I_z}{I_x} \dot{\theta} \dot{\psi} + \frac{U_2}{I_x} + \omega $$
Defining state variables $x_1 = \phi$ and $x_2 = \dot{\phi}$, the system is rewritten as:
$$ \ddot{\phi} = b_0 U_2 + f_1(\phi, \dot{\phi}, \omega, t) $$
where $f_1$ aggregates internal couplings and external disturbances, and $b_0$ is a tunable gain. The TD smooths the reference signal and provides its derivative:
$$ v_1(k+1) = v_1(k) + h \cdot v_2(k) $$
$$ v_2(k+1) = v_2(k) + h \cdot \text{fhan}(v_1(k) – v_{\text{ref}}(k), v_2(k), r, h) $$
The ESO estimates the total disturbance and states:
$$ e = z_1 – y $$
$$ \dot{z}_1 = z_2 – \beta_{01} e $$
$$ \dot{z}_2 = z_3 – \beta_{02} \text{fal}(e, \alpha_1, \delta) + b_0 U_2 $$
$$ \dot{z}_3 = -\beta_{03} \text{fal}(e, \alpha_2, \delta) $$
where $\text{fal}(x, \alpha, \delta)$ is a nonlinear function defined as:
$$ \text{fal}(x, \alpha, \delta) = \begin{cases} \frac{x}{\delta^{1-\alpha}} & |x| \leq \delta \\ \text{sign}(x) |x|^\alpha & |x| > \delta \end{cases} $$
Traditional NLSEF uses nonlinear combinations, but I replace it with an optimal SMC to improve response and robustness. For the roll channel, the optimal sliding surface is designed as:
$$ s = c(t) (\phi_d – \phi) + (\dot{\phi}_d – \dot{\phi}) $$
where $c(t)$ is a time-varying parameter derived from minimizing a performance index:
$$ J = \int_0^t \left[ w_1 x_1^2(t) + w_2 x_2^2(t) \right] dt $$
Solving the Euler-Lagrange equation yields:
$$ c(t) = \sqrt{\frac{w_1}{w_2}} \tanh\left( \sqrt{w_1 w_2} \left( d – \frac{t}{w_2} \right) \right) $$
The reaching law is modified to reduce chattering:
$$ \dot{s} = -\epsilon |\phi_d – \phi| f(s) – k s $$
where $f(s) = \frac{s}{\sqrt{1 + s^2}}$ is a saturation function. The control law for the roll channel becomes:
$$ u_0 = \frac{ \ddot{\phi}_d + \epsilon |\phi_d – \phi| \frac{s}{\sqrt{1 + s^2}} + k s + c(t) (\dot{\phi}_d – \dot{\phi}) }{b_0} $$
Lyapunov stability is ensured with $V = \frac{1}{2} s^2$, leading to $\dot{V} < 0$. Similar designs apply to pitch and yaw channels.
For simulation, I use MATLAB to validate the controller. The quadcopter parameters are listed in the table below:
| Parameter | Value |
|---|---|
| Mass, $m$ (kg) | 1 |
| Arm length, $d$ (m) | 0.2 |
| Moments of inertia, $I_x$, $I_y$, $I_z$ (kg·m²) | 0.02, 0.03, 0.04 |
| Thrust coefficient, $c_T$ | 1.105 × 10^{-5} |
| Drag coefficient, $c_M$ | 1.779 × 10^{-7} |
| Gravity, $g$ (m/s²) | 9.8 |
The controller parameters for each channel are:
| Parameter | Roll | Pitch | Yaw |
|---|---|---|---|
| TD $r$ | 1 | 0.2 | 1 |
| TD $h$ | 0.004 | 0.004 | 0.004 |
| ESO $\beta_{01}$ | 250 | 50 | 250 |
| ESO $\beta_{02}$ | 2000 | 1500 | 2000 |
| ESO $\beta_{03}$ | 3000 | 8000 | 3000 |
| ESO $\alpha_1$ | 0.1 | 0.1 | 0.1 |
| ESO $\alpha_2$ | 0.1 | 0.1 | 0.1 |
| ESO $b_0$ | 35 | 45 | 1 |
| ESO $\delta$ | 0.2 | 0.2 | 0.2 |
| SMC $\epsilon$ | 2 | 2 | 2 |
| SMC $k$ | 3 | 3 | 3 |
| SMC $d$ | 4 | 4 | 4 |
| SMC $w_1$ | 0.6 | 0.6 | 0.6 |
| SMC $w_2$ | 0.4 | 0.4 | 0.4 |
In simulations, the quadcopter is subjected to a CoG offset of $0.2d$ along the x-axis. The desired attitude angles are set to $(15^\circ, 20^\circ, 10^\circ)$. Under no disturbances, the optimal SMC-ADRC shows no overshoot and faster convergence compared to traditional ADRC, which exhibits a $1.5^\circ$ overshoot in pitch. When disturbances are added—such as a continuous sinusoidal wave (0.08 rad amplitude, 6 rad/s frequency), white noise, and a step disturbance (0.1 rad at 8 s)—the proposed controller maintains smaller deviations and quicker recovery. For instance, the pitch angle response under combined disturbances remains stable with minimal oscillation, demonstrating high robustness. Additionally, tests with increasing CoG offsets (e.g., up to $0.8d$) show that the quadcopter stabilizes effectively, though initial oscillations rise with offset magnitude.
The integration of ADRC and optimal SMC provides a robust solution for quadcopter attitude control with CoG offset. The time-varying sliding surface accelerates convergence, while the modified reaching law mitigates chattering. Simulation results confirm that this approach enhances disturbance rejection and maintains stability under various conditions, making it suitable for real-world quadcopter applications where precision and reliability are critical.
