๐Ÿš A drone is trying to hover at a target height. A controller decides how hard to push the rotors, using the error โ€” how far the drone is from the target. In class we build this with real hardware; here you can turn on the P, I and D parts one at a time and watch exactly what each one does.

Step 1
P โ€” Proportional
Push harder the farther you are from the target. It reacts โ€” but settles below the line and wobbles.
Step 2
P + I โ€” add Integral
Adds up the leftover error over time to erase the steady droop โ€” but too much makes it overshoot.
Step 3
P + I + D โ€” add Derivative
Reacts to how fast the error changes and applies the brakes โ€” smooths out the wobble.

Controller

P ยท Proportional
Output โˆ the current error.
3.0
I ยท Integral
Output โˆ the error added up over time.
1.20
D ยท Derivative
Output โˆ how fast the error is changing.
2.0
Try: Step 1 with only P โ€” watch it hang below the line. Flip I on and it climbs to target. Add D to calm the bounce. Press ๐Ÿ’จ Gust to disturb it and see the controller fight back.

Height vs. time

Target Drone height P I D
โ€“
Error (m)
โ€“
Overshoot
โ€“
Settling (s)
โ€“
Thrust