Full PID configuration including anti-windup, derivative filtering, and output limits.
Units: error and the controller output are in whatever units the caller chose. PidController is unit-agnostic — pass it errors in rad/s, m, or normalised speed-scale, and the same units come back as output. The defaults below are sized for the legacy "drive in
normalised [-1, 1] command space" use case from libstp; new integrations should override them.
Defaults rationale:
- kp = 1.0, ki = 0, kd = 0 — proportional-only baseline; the user is expected to tune the gains, not inherit them.
- integral_max = 10.0 — integrator clamp in output units. The default assumes output is roughly bounded to ±10 (matches output_min/max below). If your output range is normalised speed ([-1, 1]), set this to ~1.0 instead, or the integrator can take seconds to recover from saturation.
- integral_deadband = 0.01 — error magnitudes below this don't accumulate into the integrator. In the legacy "normalised speed" convention this is 1% of full output.
- derivative_lpf_alpha = 0.1 — IIR weight on the new derivative sample (0 = use only history, 1 = no filter). 0.1 corresponds to a ~10-sample moving-average response, suitable for ~10 ms control loops with noisy feedback.
- output_min/max = ±10 — output saturation in caller units. Override when feeding a downstream controller with a different scale.
Definition at line 35 of file pid.hpp.