-
Notifications
You must be signed in to change notification settings - Fork 0
Controller Concept
Alex edited this page Aug 18, 2026
·
2 revisions
Wiki navigation: Controller Concept · Header File · Source File · API Reference · Detailed Calc Flow · Example Configuration · Recommended Tuning Procedure · Important Notes
A robust Arduino-compatible PID controller implementation with improved behavior for slow or overshoot-prone processes.
This implementation extends a basic PID controller with:
- Correct time-based integral and derivative calculations
- Derivative-on-measurement
- Derivative low-pass filtering
- Integral activation range
- Integral tolerance band
- Conditional integration / anti-windup
- Configurable controller direction
- Output limiting
- Output slew-rate limiting
- Rollover-safe
millis()handling - Safe use with multiple PID instances
The controller can be described as a PI-D controller:
+----------------+
error -----------------> | P | ----+
+----------------+ |
|
+----------------+ |
error -----------------> | I | ----+----> Output limit
| Anti-Windup | | |
+----------------+ | v
| Slew-rate
actual ---> derivative ---> LPF ---> D --------+ |
v
output
The proportional and derivative terms are always active.
The integral term is conditionally active depending on:
- the configured tolerance around the setpoint
- the configured integral activation range
- output saturation
This prevents excessive integral accumulation and therefore helps reduce overshoot.