Class PIDController
Defined in File PIDController.hpp
Class Documentation
A simple PID (Proportional-Integral-Derivative) controller implementation.
Public Functions
Constructor.
Initializes the PID controller with output and reference range limits.
- Parameters:
min_ref – Minimum allowed input reference value.
max_ref – Maximum allowed input reference value.
min_output – Minimum output control value.
max_output – Maximum output control value.
Sets the PID gains.
- Parameters:
n_KP – Proportional gain.
n_KI – Integral gain.
n_KD – Derivative gain.
Computes the control output for the given reference input.
Applies the PID formula and returns the control command within the specified output limits.
- Parameters:
new_reference – The current reference input value (e.g., error signal).
dt – Time elapsed since last call in seconds.
- Returns:
The computed control output.
Reset internal integrator and derivative state.