๐ 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.
I ยท Integral
Output โ the error added up over time.
D ยท Derivative
Output โ how fast the error is changing.
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