Stateful PID controller with integral clamping and a low-pass filtered derivative term.
More...
#include <pid.hpp>
|
| | PidController (PidConfig config={}) |
| double | update (double error, double dt) |
| | Update the controller using error for both the proportional and derivative signals.
|
| double | update (double error, double dt, double deriv_signal) |
| void | reset () |
| | Clear accumulated integral and derivative state.
|
| void | setGains (double kp, double ki, double kd) |
| | Replace only the proportional, integral, and derivative gains.
|
| double | getIntegral () const |
| double | getDerivative () const |
Stateful PID controller with integral clamping and a low-pass filtered derivative term.
Definition at line 68 of file pid.hpp.
◆ PidController()
| libstp::foundation::PidController::PidController |
( |
PidConfig | config = {} | ) |
|
|
explicit |
◆ getDerivative()
| double libstp::foundation::PidController::getDerivative |
( |
| ) |
const |
|
inlinenodiscard |
◆ getIntegral()
| double libstp::foundation::PidController::getIntegral |
( |
| ) |
const |
|
inlinenodiscard |
◆ reset()
| void libstp::foundation::PidController::reset |
( |
| ) |
|
Clear accumulated integral and derivative state.
◆ setGains()
| void libstp::foundation::PidController::setGains |
( |
double | kp, |
|
|
double | ki, |
|
|
double | kd ) |
Replace only the proportional, integral, and derivative gains.
◆ update() [1/2]
| double libstp::foundation::PidController::update |
( |
double | error, |
|
|
double | dt ) |
Update the controller using error for both the proportional and derivative signals.
◆ update() [2/2]
| double libstp::foundation::PidController::update |
( |
double | error, |
|
|
double | dt, |
|
|
double | deriv_signal ) |
Update with separate derivative signal (derivative-on-measurement). P and I terms use error, D term uses deriv_signal.
The documentation for this class was generated from the following file:
- /home/runner/work/raccoon-lib/raccoon-lib/modules/libstp-foundation/include/foundation/pid.hpp