This document outlines the mathematical modeling, state-space formulation, and Model Predictive Control (MPC) design for a quadcopter Unmanned Aerial Vehicle (UAV). The objective of the control system is to track predefined 3D spatial trajectories while respecting rigid body dynamics and hardware actuator constraints.
The quadcopter is modeled as a 12-state system. The state vector
State Variables:
-
$x, y, z$ : Inertial positions (m) -
$u, v, w$ : Linear velocities in the body frame (m/s) -
$\phi, \theta, \psi$ : Euler angles representing roll, pitch, and yaw (rad) -
$p, q, r$ : Angular velocities in the body frame (rad/s)
Control Inputs:
-
$\Delta F$ : Difference in total thrust from the hover state (N). Total thrust is$F_{total} = mg + \Delta F$ . -
$\tau_\phi, \tau_\theta, \tau_\psi$ : Control torques about the body x, y, and z axes (N·m).
Figure 1: Quadcopter "X" configuration body frame definition and virtual control input mapping.**
The true physics of the quadcopter are governed by highly coupled, nonlinear 2nd-order ordinary differential equations (ODEs). Let
Translational Dynamics:
Rotational Dynamics:
(Note:
To transition from 2nd-order differential equations to a format suitable for control design, the system is rewritten as twelve 1st-order differential equations in the nonlinear state-space form:
By mapping the 2nd-order translational and rotational accelerations to the derivatives of our specific grouped state vector
To implement linear MPC, we apply a Taylor series first-order expansion around a stable hover equilibrium point.
Hover Assumptions:
-
Small Angles: Roll and pitch are near zero (
$\phi \approx 0, \theta \approx 0, \psi \approx 0$ ). Therefore,$\cos(0) \approx 1$ and$\sin(\alpha) \approx \alpha$ . -
Zero Velocity: Angular velocities are near zero. Cross-coupled terms (
$\dot{\theta}\dot{\psi}$ ) and gyroscopic rotor drag terms ($\dot{\theta}\Omega$ ) approach zero and are removed. -
Thrust Equivalency: At hover, total thrust equals gravity (
$U_1 = mg + \Delta F$ ).
Deriving the Linearized Equations:
Applying these assumptions to the nonlinear equations yields the simplified linear dynamics:
-
X-Axis:
$$\ddot{x} = (1 \cdot \theta \cdot 1 + 0)\frac{mg}{m} \Rightarrow \ddot{x} = g\theta$$ (Note: In our specific coordinate frame implementation, pitch-up yields negative X acceleration, so we define
$\dot{u} = -g\theta$ ). -
Y-Axis:
$$\ddot{y} = (1 \cdot 0 \cdot 0 - \phi \cdot 1)\frac{mg}{m} \Rightarrow \ddot{y} = -g\phi$$ (Implemented as
$\dot{v} = g\phi$ depending on left/right hand coordinate orientation). -
Z-Axis:
$$\ddot{z} = -g + (1 \cdot 1)\frac{mg + \Delta F}{m} \Rightarrow \ddot{z} = \frac{\Delta F}{m}$$ -
Rotations: With cross-coupling removed,
$$\ddot{\phi} = \frac{\tau_\phi}{I_{xx}}$$ $$\ddot{\theta} = \frac{\tau_\theta}{I_{yy}}$$ $$\ddot{\psi} = \frac{\tau_\psi}{I_{zz}}$$
Linearization via Jacobian:
The linear system matrices
By splitting the 2nd-order ODEs into twelve 1st-order equations (
Sensor Output Assumption:
The output equation defines what the sensors can physically measure (
System Matrix (
Input Matrix (
The MPC calculates the optimal control sequence by solving a Quadratic Program (QP) over a finite prediction horizon
graph TD
R[Reference Trajectory r_k] -->|+ e| Sum
Sum --> Optimizer[MPC QP Solver]
Optimizer -->|Torques u_k| Plant[Quadcopter Dynamics]
Plant -->|States x_k| Obs
Obs[Full State Feedback] -->|-| Sum
Figure 2: Closed-loop Model Predictive Control architecture utilizing full state feedback.
At each time step, the controller minimizes a cost function
Subject to:
Where:
-
$Q$ : State error penalty matrix. -
$R$ : Control effort increment penalty matrix ( penalizes$\Delta u_k = u_k - u_{k-1}$ to prevent aggressive actuator chatter ). -
$r_k$ : The reference state vector at step$k$ .
The control inputs are strictly bounded by the physical geometry and motor capabilities of the specific UAV. Using the max absolute thrust per motor (
$\max(\Delta F) = (4 \cdot F_{max}) - mg$ $\max(\tau_\phi, \tau_\theta) = F_{max} \cdot L$
The reference trajectory
To prevent the linear solver from calculating artificial
[1] T. Veness, Controls Engineering in the FIRST Robotics Competition. https://file.tavsys.net/control/controls-engineering-in-frc.pdf
[2] B. Landry, "Planning and control for quadrotor flight through cluttered environments," M.S. thesis, Dept. Elect. Eng. Comput. Sci., Massachusetts Institute of Technology, Cambridge, MA, USA, 2015. [Online]. Available: https://dspace.mit.edu/handle/1721.1/100608
[3] S. Bouabdallah, P. Murrieri, and R. Siegwart, "Design and Control of an Indoor Micro Quadrotor," in Proceedings of the 2004 IEEE International Conference on Robotics and Automation (ICRA), New Orleans, LA, USA, 2004, pp. 4393-4398. https://ieeexplore.ieee.org/document/1302409
[4] S. K. Phang, K. Li, K. H. Yu, B. M. Chen, and T. H. Lee, "Systematic Design and Implementation of a Micro Unmanned Quadrotor System," Unmanned Systems, vol. 2, no. 2, pp. 121-141, 2014. https://doi.org/10.1142/S2301385014500083
[5] M. Hamer, L. Widmer, and R. D'Andrea, "Fast Generation of Collision-Free Trajectories for Robot Swarms Using GPU Acceleration," IEEE Access, vol. 7, pp. 6679-6690, 2019. https://ieeexplore.ieee.org/document/8587164
