|
libstp
Robotics library for Botball
|
#include <velocity_controller.hpp>
Public Member Functions | |
| VelocityController (foundation::PidGains g, foundation::Feedforward ff) | |
| void | setGains (const foundation::PidGains &g) |
| void | setFF (const foundation::Feedforward &ff) |
| const foundation::PidGains & | gains () const |
| const foundation::Feedforward & | ff () const |
| double | compute (double w_ref, double a_ref, double w_meas, double dt, double u_max, bool *out_saturated=nullptr) |
| void | reset () |
PID plus feedforward helper used for chassis velocity control.
The controller uses measured-derivative filtering and a simple back-calculation style anti-windup term when clamping is active.
Definition at line 16 of file velocity_controller.hpp.
| libstp::drive::VelocityController::VelocityController | ( | foundation::PidGains | g, |
| foundation::Feedforward | ff ) |
Construct a controller with the supplied PID and feedforward terms.
| double libstp::drive::VelocityController::compute | ( | double | w_ref, |
| double | a_ref, | ||
| double | w_meas, | ||
| double | dt, | ||
| double | u_max, | ||
| bool * | out_saturated = nullptr ) |
Compute the next controller output.
| w_ref | Reference velocity. |
| a_ref | Reference acceleration for the feedforward term. |
| w_meas | Measured velocity. |
| dt | Sample time in seconds. |
| u_max | Symmetric output clamp magnitude. |
| out_saturated | Optional flag set when clamping occurs. |
|
inline |
Definition at line 29 of file velocity_controller.hpp.
|
inline |
Definition at line 28 of file velocity_controller.hpp.
| void libstp::drive::VelocityController::reset | ( | ) |
Clear integrator, derivative filter, and measurement history.
| void libstp::drive::VelocityController::setFF | ( | const foundation::Feedforward & | ff | ) |
Replace the feedforward terms used by subsequent compute() calls.
| void libstp::drive::VelocityController::setGains | ( | const foundation::PidGains & | g | ) |
Replace the PID gains used by subsequent compute() calls.