freerobotics
← all playgrounds

Playground · Month 4 · control

Hold a drone in the air with three numbers.

Every robot you've seen balance, hover or hold a pose runs a feedback loop: measure the error, push against it, repeat hundreds of times a second. Start with the presets, then break it on purpose.

0.00 m0m1m2m3m4m0s2s4s6s8s10s

Dashed green line: the target height. Shaded band: within 10 cm. The flight replays in real time.

unstable

Bounces forever and never holds the height.

the controller

thrust = Kp·e + Ki·∫e dt + Kd·de/dt

e = target − height

overshoot35%settles inneverends at1.57 m

P: the spring

Push in proportion to the error. Alone, it overshoots and, against gravity, never quite gets there.

I: the memory

Add up the error over time. It slowly finds the exact thrust hovering needs and kills the leftover gap.

D: the brake

React to how fast the error changes. It damps the bouncing before it starts.