Flight Dynamics & Intelligent Control Technologies Make the quad not tip over — the first loop that flies.
Recap → today
From a model to a flying machine
Wk 2–3: the 12-state nonlinear model \( \dot{\mathbf{x}}=f(\mathbf{x},\mathbf{u}) \).
Wk 4: hover trim & the linearized \( (A,B) \) — and its unstable poles.
Today: the first feedback loop that tames those poles — attitude control.
The whole course in one line:
open loop ⇒ the quad tips over. The job of control is to make the unstable plant track what we ask.
Learning objectives
By the end of today you can…
State the PID control law and what each term does — and its failure modes.
Explain the cascade architecture: slow outer position loop, fast inner attitude loop.
Derive the inner attitude loop: attitude error → body torques.
Predict response from gains via \( \omega_n,\ \zeta \) — and tune them.
Lab Implement the inner loop in StudentController and stabilize a tilt.
Why attitude first
A quad is underactuated
4 motors → 4 controls: total thrust \(T\) and 3 body torques \( \boldsymbol{\tau} \).
But 6 DOF to place (position + attitude). You cannot push sideways directly…
…you tilt, then thrust. So horizontal motion is a consequence of attitude.
⇒ Attitude is the inner, fastest loop. Everything else rides on it.
Control wrench (what your controller returns):
\[ \mathbf{u} = \begin{bmatrix} T \\ \tau_x \\ \tau_y \\ \tau_z \end{bmatrix} \]
The simulator mixes this into 4 motor thrusts and saturates them for you.
The tool
PID in one slide
\[ u(t) = \underbrace{K_p\, e(t)}_{\text{now}} \;+\; \underbrace{K_i\!\int_0^t\! e\,d\tau}_{\text{past}} \;+\; \underbrace{K_d\, \dot e(t)}_{\text{future}}, \qquad e = x_{\text{ref}} - x \]
P — stiffness; pulls toward the target. Too high ⇒ oscillation.
D — damping; resists velocity. Tames overshoot; amplifies noise.
I — kills steady-state bias (gravity, wind). Too high ⇒ windup.
For attitude we use mostly PD: the rate term \(K_d\) is our damping, and
there's little steady bias on angle. Integral comes back on altitude next week.
Architecture
The cascade: two nested loops
position ref ─►┌───────────────┐ desired tilt ┌───────────────┐ torques ┌──────────┐
│ OUTER loop ├────φ_d,θ_d───►│ INNER loop ├──τx,τy,τz►│ mixer ├─► motors
(slow ~5 Hz) └▲──────────────┘ + thrust T └▲──────────────┘ (fast) └──────────┘
position ──┘ state x attitude ──┘
This week: the inner loop (attitude → torques). Next week: the outer loop (position → desired tilt).
The mixer (Wk 3, params.mixer_matrix()) turns your wrench into 4 motor thrusts.
The derivation
Inner attitude loop → body torques
Rotational dynamics (Euler): \( \mathbf{I}\dot{\boldsymbol\omega} = \boldsymbol\tau - \boldsymbol\omega\times \mathbf{I}\boldsymbol\omega \).
Near hover the gyroscopic term is small, so to command an angular acceleration we just pick \( \boldsymbol\tau \).
Drive the attitude \( \boldsymbol\eta=(\phi,\theta,\psi) \) to a desired \( \boldsymbol\eta_d \) with a PD law: