ReadonlyderivativeSignal the derivative term acts on.
Derivative gain, in seconds. Mutable for live tuning.
Integral gain, per second. Mutable for live tuning.
Proportional gain. Mutable for live tuning; see the class note.
Readonlyoutput[minimum, maximum] output bounds (§111 outputLimits). Frozen copy.
∫e dt so far, in error·seconds. Zero after PIDController.reset.
setpoint − measurement of the most recent update; 0 after a reset.
The value the most recent PIDController.update returned; 0 after a reset.
Whether a previous sample exists, i.e. whether the next step has a derivative.
Clears the integrator, the derivative history, and the reported last output/error, returning the controller to its just-constructed state. The gains, limits, and derivative convention are untouched.
Reset when the loop is re-enabled, when the plant is teleported, or when a replay rewinds (§33) — anything that makes the accumulated history describe a plant that no longer exists.
Advances the controller by deltaSeconds and returns the clamped output.
Only deltaSeconds is validated: the setpoint and the measurement come from
the plant on the hot path and are taken as given, so a NaN measurement
propagates into the integrator rather than throwing. Validate sensor data
before it reaches a controller.
Desired value of the controlled quantity.
Current value of the controlled quantity.
Step in seconds (§7a); finite and > 0.
A textbook PID controller with the §111 constructor, clamped output, and the anti-windup and derivative conventions documented on this module.
The three gains are plain mutable fields so a control-system demonstration can retune them live (§111's stated use). They are validated at construction only; assigning a non-finite gain afterwards is the caller's responsibility. PIDController.outputLimits and PIDController.derivativeOn are fixed for the controller's lifetime — both change what the accumulated integral means, so changing them would need a reset to be meaningful, and building a second controller is clearer.