The three terms โ intuition first
PID stands for Proportional-Integral-Derivative. Each term fixes a specific failure mode of the basic proportional controller:
- P (Proportional): Acts on the current error. Big error โ big correction. Provides responsiveness. Alone it leaves a steady-state offset (the motor needs some error to produce some torque).
- I (Integral): Acts on accumulated error over time. As long as any error remains, the integral term keeps growing, pushing the output until it reaches exactly the setpoint. Kills steady-state error โ but can cause slow windup.
- D (Derivative): Acts on the rate of change of error. If the error is shrinking fast, D applies a brake to prevent overshoot. It damps oscillations. Think of it as predicting where the error is heading.
The three terms work together: P drives toward the setpoint, I eliminates residual bias, D smooths the approach.
