Control Systems - Level 5
The D Term
Concept
The derivative term looks at how fast the error is changing. If the error is shrinking rapidly, the mass is about to blow past the target — so the D term pulls back to damp the approach.
u(t) = Kp · e(t) + Ki · ∫ e(t) dt + Kd · de(t)/dt
Intuitively: Kp reacts to where you are. Ki reacts to where you’ve been. Kd reacts to where you’re heading.
Try it:
- Set Kp high (say 15). See the big overshoot.
- Add Kd gradually. The overshoot flattens out, but the response stays quick.
- Too much Kd: the system becomes over-damped and sluggish, or starts reacting to noise (in real life — here there is no sensor noise).
Derivative is the most delicate term. In real hardware, noisy encoders can
make de/dt explode; engineers often filter the derivative or differentiate
the measurement rather than the error.
Goal
Get to the setpoint (±0.05) with less than 0.12 overshoot, tighter than Level 3 allowed. Hint: crank Kp high (say 20) for snappy response, then add Kd (say 5-6) to suppress the overshoot.