The PID Controller extension (pid_control.ts) implements closed-loop proportional-integral-derivative feedback control algorithms for robot line following, self-balancing rovers, and motor speed stabilization.
1. Mathematical Control Loop
The controller computes output adjustment based on setpoint vs. current input:
- Proportional (): Instant error correction proportional to deviation.
- Integral (): Accumulates long-term offset error to overcome friction or slope.
- Derivative (): Predicts future error trend to prevent overshoot and oscillations.
