Quadrotor Altitude Control

Tune an altitude controller, add payload, or trigger a gust to see how a quadrotor holds one metre.

Hover at 1.0 m, gust-resistant

altitude (live) 0.00 m
overshoot —
gust dip —
SSE —
what to try
  • Drop Kd to zero. The drone oscillates around the setpoint with no damping: overshoot becomes the next undershoot, forever. This is the double-integrator failure mode P alone can't fix. Bring Kd back to ~3.
  • Crank Kp to 18 with Kd = 0. Same problem, but faster: the drone violently oscillates. P-gain determines speed; D-gain determines whether you survive the ride.
  • Trigger the wind gust mid-flight. A downward push lasting 0.3s. Without Ki, a steady wind would leave a permanent offset; the integrator kills it. Try Ki = 0 vs Ki = 3 with the gust active.
  • Hang a 2 kg payload (mass slider all the way right). The controller was tuned for 1 kg; suddenly the plant is twice as sluggish. Same lesson as Lesson 01: gains tuned for a nominal plant degrade as the real plant deviates.

What you are looking at

Drone
The simulated quadrotor seen from the side.
Dashed line
The one-metre altitude setpoint.
Altitude trace
The height over time as the controller reacts.

Try this

  1. Trigger a wind gust to see the dip and recovery.
  2. Set derivative gain to zero to see how much more the drone bounces around its target.
  3. Use integral gain to trim the steady hover error.

Key idea

Proportional gain pushes toward the target, derivative gain brakes the approach, and integral gain corrects lingering error.