![]() |
EVE 1.0
|
![]() |
Data Structures | |
struct | pid_controller_t |
PID controller instance data. More... | |
Functions | |
void | PidInit (struct pid_controller_t *Pid, float K, float Ti, float Td, float MinIntegral, float MaxIntegral) |
Initialize PID controller data. Function gets standard coefficients from PID formula: f(n) = K * ( Error(n) + SUM(Error(0) * dt(0)...Error(n) * dt(n)) / Ti + Td * Error(n) / dt(n)) More... | |
void | PidReset (struct pid_controller_t *Pid) |
Reset PID controller. More... | |
float | PidFunc (struct pid_controller_t *Pid, float Error, float ErrorDiff, float TimeDelta) |
Calculate PID function. More... | |
void PidInit | ( | struct pid_controller_t * | Pid, |
float | K, | ||
float | Ti, | ||
float | Td, | ||
float | MinIntegral, | ||
float | MaxIntegral | ||
) |
Initialize PID controller data. Function gets standard coefficients from PID formula: f(n) = K * ( Error(n) + SUM(Error(0) * dt(0)...Error(n) * dt(n)) / Ti + Td * Error(n) / dt(n))
Pid | Pointer to PID controller data |
K | K coefficient from standard PID formula. |
Ti | Ti coefficient from standard PID formula. |
Td | Td coefficient from standard PID formula. |
MinIntegral | Minimal allowed integrated part value. |
MaxIntegral | Maximal allowed integrated part value. |
|
inline |
Reset PID controller.
Pid | Pointer to PID controller data |
Definition at line 91 of file pid-controller.h.
References pid_controller_t::IntegralValue, PidFunc(), and pid_controller_t::PreviousErrorDiff.
float PidFunc | ( | struct pid_controller_t * | Pid, |
float | Error, | ||
float | ErrorDiff, | ||
float | TimeDelta | ||
) |
Calculate PID function.
Pid | Pointer to PID controller data |
Error | Desired value minus current value |
ErrorDiff | Error for differencial part. For classic PID it should be set equal to Error. To avoid peak output on sharp desired value change, tis can be set to (-) current value. |
TimeDelta | Time between this and previous Error calculation/measurement. |
Referenced by PidReset().