|
bitsim
Model, simulate, estimate and control robots in C++
|
A PI controller whose output is limited to [-limit, limit], with anti-windup and a feedforward term. More...
#include <pi_controller.h>
Public Member Functions | |
| PIController (real_t kp, real_t ki, real_t limit) | |
| real_t | update (real_t error, real_t dt, real_t feedforward=0.0) |
| The output for the error after a step of dt [s]. | |
| void | reset () |
| Forget the integral. | |
| real_t | kp () const noexcept |
| real_t | ki () const noexcept |
| real_t | limit () const noexcept |
| real_t | integral () const noexcept |
A PI controller whose output is limited to [-limit, limit], with anti-windup and a feedforward term.
The output is \(u = u_{ff} + K_p e + K_i \int e\, dt\). While the output is at its limit the integral stops growing; otherwise it would wind up and make the controller overshoot once the error changes sign. The feedforward \(u_{ff}\) is the part of the output that can be predicted without feedback, such as the voltage a motor needs for a speed.
| kp | The proportional gain |
| ki | The integral gain |
| limit | The largest output, in either direction |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Forget the integral.
The output for the error after a step of dt [s].