wbc
|
The PIDController class implements an n-dimensional PID controller. More...
#include <PIDController.hpp>
Public Member Functions | |
PIDController (uint dimension) | |
virtual | ~PIDController () |
void | update (const double delta_t) |
void | setPID (const PIDCtrlParams ¶ms) |
const PIDCtrlParams & | getPID () |
void | setMaxCtrlOutput (const base::VectorXd &max) |
const base::VectorXd & | maxCtrlOutput () |
void | setDeadZone (const base::VectorXd &dz) |
const base::VectorXd & | deadZone () |
void | applySaturation (const base::VectorXd &in, const base::VectorXd &max, base::VectorXd &out) |
void | applyDeadZone (const base::VectorXd &in, const base::VectorXd &min, base::VectorXd &out) |
uint | getDimension () |
base::VectorXd | getControlError () |
virtual const base::VectorXd & | computeDerivative (const double delta_t) |
Protected Attributes | |
PIDCtrlParams | pid_params |
uint | dimension |
base::VectorXd | control_error |
base::VectorXd | prev_control_error |
base::VectorXd | dead_zone |
base::VectorXd | max_ctrl_output |
base::VectorXd | integral |
base::VectorXd | derivative |
base::VectorXd | control_output |
base::VectorXd | setpoint |
base::VectorXd | feedback |
The PIDController class implements an n-dimensional PID controller.
\[ u = k_p \cdot e + k_i\sum e \cdot dt + k_d\frac{d}{dt}e \]
with integral windup
\[ \sum e \cdot dt \leq w_i \]
and dead zone
\[ e = \left \lbrace \begin{array}{ccc}x_r-x & if & |x_r-x| > d_e \\ \\ 0 & else \end{array}\right. \]
\(u\) - Control output
\(k_p,k_i,k_d\) - Proportional, integral and derivative gain
\(e\) - Control error
\(w_i\) - Integral windup
\(d_e\) - Dead zone
\(x_r,x\) - Reference and actual controlled value
wbc::PIDController::PIDController | ( | uint | dimension | ) |
|
inlinevirtual |
void wbc::PIDController::applyDeadZone | ( | const base::VectorXd & | in, |
const base::VectorXd & | min, | ||
base::VectorXd & | out ) |
void wbc::PIDController::applySaturation | ( | const base::VectorXd & | in, |
const base::VectorXd & | max, | ||
base::VectorXd & | out ) |
|
virtual |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void wbc::PIDController::setDeadZone | ( | const base::VectorXd & | dz | ) |
void wbc::PIDController::setMaxCtrlOutput | ( | const base::VectorXd & | max | ) |
void wbc::PIDController::setPID | ( | const PIDCtrlParams & | params | ) |
void wbc::PIDController::update | ( | const double | delta_t | ) |
Compute control output
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |