![]() |
Controlpp
|
A PID (proportional + integral + differential) controller with variable sample-times. More...
#include <controlpp/TimeVariantControl.hpp>
Public Member Functions | |
| PIDControl (const T &kp, const T &ki, const T &kd, const T &omega) | |
| constructs a PID controller form gain parameters | |
| constexpr T | input (const T &u, const T &Ts) |
| Input a new sample to the controller. | |
| constexpr T | operator() (const T &u, const T &Ts) |
| resets (clears) the internal states resets the internal states ( \(u_{k-1}\), \(u_{k-2}\), \(y_{k-1}\) and \(y_{k-2}\)) to zero | |
| constexpr void | reset () |
| resets (clears) the internal states resets the internal states ( \(u_{k-1}\), \(u_{k-2}\), \(y_{k-1}\) and \(y_{k-2}\)) to zero | |
Static Public Member Functions | |
| static PIDControl | from_alpha_tune (const T &alpha, const T &omega_c, const T &mag_G) |
| Constructa a PID controller using the alpha tuning method. | |
Friends | |
| constexpr ValueSampletimePair< T > | operator>> (const ValueSampletimePair< T > &p, PIDControl &c) |
A PID (proportional + integral + differential) controller with variable sample-times.
with the transfer function:
\[ PID(s) = \left( k_p + \frac{k_i}{s} + k_d s \right)\frac{1}{1 + \frac{s}{\omega}} \]
The therm:
\[ \frac{1}{1 + \frac{s}{\omega}} \]
has been added to:
|
inline |
constructs a PID controller form gain parameters
| kp | The proportional gain |
| ki | The integral gain |
| kd | The differential gain |
| omega | The thaming frequency |
|
inlinestatic |
Constructa a PID controller using the alpha tuning method.
TODO: insert image with explanation of how the alpha tuning works
| alpha | Design parameter
|
| mag_G | The magnitude of the plant that should be controlled at the desired cutoff frequency |
| omega_c | The desired cutoff frequency |
|
inlineconstexpr |
Input a new sample to the controller.
| u | The control input |
| Ts | The sample-time |
|
inlineconstexpr |
resets (clears) the internal states resets the internal states ( \(u_{k-1}\), \(u_{k-2}\), \(y_{k-1}\) and \(y_{k-2}\)) to zero
|
inlineconstexpr |
resets (clears) the internal states resets the internal states ( \(u_{k-1}\), \(u_{k-2}\), \(y_{k-1}\) and \(y_{k-2}\)) to zero
|
friend |