PID Control
A PID controller is a feedback control method used to make a system follow a desired value or trajectory. The name comes from its three components:
- P — Proportional
- I — Integral
- D — Derivative
Each term is related to the error of the system.
What Is "Error"?
A PID controller continuously computes an error:
where:
- (r(t)) = setpoint (desired value)
- (y(t)) = measurement (current value)
The controller then uses this error to generate a control signal.
The Three Terms
1. Proportional Term (P)
The proportional term is defined by the current error:
- and a gain (K_p).
- Large (K_p) → fast response, but too large can cause oscillations.
The intuition is to apply more control when the error is large and less when the state is close to the target.
2. Integral Term (I)
The integral term reacts to accumulated error:
- Helps eliminate steady-state error.
- Too much integral gain can cause slow oscillations or drift.
The controller effectively gains “memory” of past errors.
3. Derivative Term (D)
The derivative term reacts to the rate of change of error:
- Acts as damping to reduce overshoot.
- Helps predict error trends.
Intuition: Slow down when approaching the target too fast.
Full PID Formula
Combining all three terms:
This control signal (u(t)) is applied to the system continuously.
Tuning PID
Common strategies:
- Start with P only; increase until oscillation starts, then reduce.
- Add D to damp oscillations.
- Add I last to remove steady-state error.
Automated tuning methods also exist (e.g., Ziegler–Nichols).
Why PID?
They are popular because they are:
- Simple
- Stable
- Easy to tune
- Widely understood
Closing Remarks, other Resources
With this control law, given good choices for our weights (K_p, K_i, K_d), we can control a system to our setpoint using this intuitive formulation.
Here are some resources for further reading: