Quadrotor dynamics in 15 minutes
Four propellers, six degrees of freedom, four control inputs. Underactuated, fast, and gorgeous to control. The minimal model, the controller hierarchy, and the differential-flatness trick that makes it work.
A quadrotor has 6 DOF (3 position + 3 orientation) but only 4 actuators (rotor speeds). It's underactuated. It's fast. The dynamics are nonlinear but exhibit a special property — differential flatness — that lets you plan smooth trajectories analytically. That's why drone racing exists. Here's the model and the control hierarchy that flies one.
The body
Four rotors at the corners of an X (or +) frame. Each rotor produces:
- Thrust — proportional to rotor angular velocity squared, perpendicular to the rotor plane.
- Reaction torque — about the rotor's spin axis, opposite to its rotation.
Diagonal rotors spin in the same direction; adjacent rotors spin opposite. Net reaction torque cancels in hover. Differential changes produce yaw.
Four control inputs
Combine the four rotor speeds into four virtual inputs:
- : total thrust (sum of all four)
- : roll torque (left vs right)
- : pitch torque (front vs back)
- : yaw torque (diagonal vs diagonal)
Map them back to per-rotor speeds via a 4×4 mixer matrix:
Inversion is constant; computed once at boot.
The dynamics
Let be position, be the rotation matrix from body to world, and be body angular velocity. Newton-Euler:
is the body inertia tensor. The first equation says: total thrust acts along the body z-axis (upward through the body), gravity always pulls down. The second is rotational dynamics with cross-product Coriolis term.
Crucially: there's no input that produces lateral force directly. To translate sideways, the quadrotor must tilt first — that's the underactuation.
The controller hierarchy
Almost every quadrotor controller has three nested loops, fastest to slowest:
- Rate controller (1–4 kHz): given desired body angular velocities , command rotor torques . Usually PID per axis.
- Attitude controller (~500 Hz): given desired body orientation , output . Often an SO(3) error, .
- Position controller (~100 Hz): given desired position trajectory, output desired thrust and desired body orientation . PID or LQR or MPC.
The position controller computes a desired total acceleration vector . Total thrust = . Desired body z-axis = direction of . Combined with desired yaw, that gives , which feeds the attitude loop.
Differential flatness
Quadrotor dynamics have a remarkable property: any sufficiently smooth trajectory in the four "flat outputs" — (position + yaw) — can be tracked exactly. Given , you can analytically recover the required orientation and rotor torques.
This is huge. Without flatness, planning a quadrotor trajectory is a nonlinear-control problem. With it, you plan a smooth (e.g. a 7th-degree polynomial through waypoints, minimizing snap), and the controller can follow it perfectly.
This is why aggressive drone racing trajectories work: they're polynomial-flat-output trajectories with provable feasibility. Mellinger and Kumar's 2011 paper formalized it; every modern quadrotor planner uses it.
Snap-minimization for trajectories
What polynomial degree to use? It turns out:
- Snap = 4th derivative of position. Roughly proportional to the rate of change of body forces.
- A trajectory that minimizes integrated snap squared, subject to passing through waypoints, is the smoothest physically feasible motion.
- Closed-form solution via QP. Each segment is a 7th-order polynomial.
Result: smooth, fast, dynamically-feasible drone flights from waypoints. Run on tiny CPUs. The math is in Mellinger's paper.
Hover linearization
For most stationary or slow-moving applications, linearize around hover ():
Where are roll, pitch, yaw. Decoupled; LQR or PID per axis works directly.
This is what consumer-drone autopilots (Pixhawk, ArduPilot) do at the low level. Aggressive flight needs the full nonlinear model.
The state estimation problem
Position and orientation aren't directly measured. You fuse:
- IMU (gyro + accelerometer) at 1 kHz — gives angular rate and "specific force."
- GPS at 5–10 Hz — outdoor position, slow.
- Visual-inertial odometry (camera + IMU) — indoor or GPS-denied positions.
- Optical flow from downward camera — short-range velocity estimate.
- Barometer — altitude.
Standard fusion: EKF or UKF. Recent state-of-the-art uses tightly-coupled VIO (e.g., VINS-Fusion) for indoor flight without GPS.
Common gotchas
- Saturation: max rotor speed is finite. Aggressive maneuvers can saturate one rotor while others have headroom — the actual achievable acceleration is bounded by the most-saturated rotor.
- Battery sag: as battery voltage drops, max thrust decreases. The same throttle command produces less force. Compensate with model-predictive thrust.
- Wind: substantial unmodeled disturbance. Use disturbance observers or wind-feedforward.
- Yaw drift: pure IMU integration of yaw drifts. Magnetometer or visual yaw is required for long flights.
The 2026 quadrotor stack
- PX4 / ArduPilot: the open autopilots. PID + complementary filter; production-ready.
- Crazyswarm: research swarm framework on Crazyflie hardware.
- Differential-flatness MPC: aggressive racing controllers, e.g., the recent Swift drone-racing work from UZH.
- Learning-augmented controllers: residual policies on top of differential-flatness MPC. Used for unmodeled dynamics like ground effect.
Exercise
In a quadrotor sim (Crazyflie sim, or PyBullet's quadrotor), implement the three-loop hierarchy. Tune the rate loop first, then attitude, then position — outside-in won't work. Achieve hover, then track a circle, then a figure-8. The small step from "hover" to "fly a path" is bigger than it looks; once you've debugged it, you've earned the right to read aggressive-flight papers.
That's the Kinematics track done
You've covered the full progression: forward kinematics → rigid-body transforms → DH and PoE notation → analytical and iterative IK → Jacobians → Lagrangian dynamics → mobile robots → quadrotors. With this, you can write the kinematics layer of any robot project from scratch, and read the literature without flinching at the math. Next steps depend on your project: dynamics-rich research (read more in the Control track), or applied work (jump to Manipulation, Mobile & Legged, or SLAM).
Comments
Sign in to post a comment.