rllib
1
|
#include <rlcontroller.h>
Public Types | |
enum | ControllerType { P = 1, I = 2, D_T1 = 3, PI = 4, PD_T1 = 5, PID_T1 = 6, PI_SUM = 7, PD_T1_SUM = 8, PID_T1_SUM = 9 } |
Public Member Functions | |
rlController (double(*_getMeasurement)(), void(_writeOutput)(double output)) | |
~rlController () | |
void | start () |
void | stop () |
void | setReference (double _reference) |
void | setP (double _T, double _Kp) |
void | setI (double _T, double _T1) |
void | setD_T1 (double _T, double _TD, double _Td) |
void | setPI (double _T, double _Kp, double _Tn) |
void | setPD_T1 (double _T, double _Kp, double _TvP, double _Td) |
void | setPID_T1 (double _T, double _Kpp, double _TnP, double _TvP, double _Td) |
void | setPI_SUM (double _T, double _Kp, double _Tn) |
void | setPD_T1_SUM (double _T, double _Kp, double _Tv, double _Td) |
void | setPID_T1_SUM (double _T, double _Kp, double _Tn, double _Tv, double _Td) |
void | setLimits (double _yk_min, double _yk_max) |
void | resetLimits () |
Public Member Functions inherited from rlThread | |
rlThread (int max_semphore=1000) | |
virtual | ~rlThread () |
int | create (void *(*func)(void *), void *argument) |
int | trylock () |
int | lock () |
int | unlock () |
int | waitSemaphore () |
int | incrementSemaphore () |
int | join (void **status) |
int | cancel () |
void | threadExit (void *status) |
Public Attributes | |
double | Kp |
double | Kpp |
double | T |
double | T1 |
double | Td |
double | TD |
double | Tn |
double | TnP |
double | TvP |
double | Tv |
double | reference |
int | type |
int | running |
double | d0 |
double | d1 |
double | d2 |
double | dD |
double | c1 |
double | c2 |
double | cD |
double | yk |
double | yk_1 |
double | yk_2 |
double | ek |
double | ek_1 |
double | ek_2 |
double | y1k |
double | y1k_1 |
double | ydk |
double | ydk_1 |
int | dt |
double(* | getMeasurement )() |
void(* | writeOutput )(double output) |
int | sleepLocally |
double | measurement |
double | yk_min |
double | yk_max |
int | limited |
Public Attributes inherited from rlThread | |
pthread_t | tid |
pthread_attr_t | attr |
pthread_mutex_t | mutex |
WSEMAPHORE | semaphore |
class for closed loop control According to: F. Doerrscheid/W. Latzel, Grundlagen der Regelungstechnik, B.G. Teubner Stuttgart Page 436-437, Regelalgorithmen mit der Trapezregel
Definition at line 27 of file rlcontroller.h.
Enumerator | |
---|---|
P | |
I | |
D_T1 | |
PI | |
PD_T1 | |
PID_T1 | |
PI_SUM | |
PD_T1_SUM | |
PID_T1_SUM |
Definition at line 30 of file rlcontroller.h.
rlController::rlController | ( | double(*)() | _getMeasurement, |
void(_writeOutput)(double output) | |||
) |
Definition at line 79 of file rlcontroller.cpp.
rlController::~rlController | ( | ) |
Definition at line 103 of file rlcontroller.cpp.
void rlController::resetLimits | ( | ) |
void rlController::setD_T1 | ( | double | _T, |
double | _TD, | ||
double | _Td | ||
) |
TD * s Transfer function: Gr(s) = --------- 1 + Td*s T = cycle time in seconds
Definition at line 159 of file rlcontroller.cpp.
void rlController::setI | ( | double | _T, |
double | _T1 | ||
) |
1 Transfer function: Gr(s) = ------ T1 * s T = cycle time in seconds
Definition at line 146 of file rlcontroller.cpp.
void rlController::setLimits | ( | double | _yk_min, |
double | _yk_max | ||
) |
void rlController::setP | ( | double | _T, |
double | _Kp | ||
) |
Transfer function: Gr(s) = Kp
Definition at line 135 of file rlcontroller.cpp.
void rlController::setPD_T1 | ( | double | _T, |
double | _Kp, | ||
double | _TvP, | ||
double | _Td | ||
) |
1 + TvP*s Transfer function: Gr(s) = Kp * --------- 1 + Td*s T = cycle time in seconds
Definition at line 187 of file rlcontroller.cpp.
void rlController::setPD_T1_SUM | ( | double | _T, |
double | _Kp, | ||
double | _Tv, | ||
double | _Td | ||
) |
Tv*s Transfer function: Gr(s) = Kp * ( 1 + -------- ) 1 + Td*s T = cycle time in seconds
Definition at line 232 of file rlcontroller.cpp.
void rlController::setPI | ( | double | _T, |
double | _Kp, | ||
double | _Tn | ||
) |
1 + Tn*s Transfer function: Gr(s) = Kp * -------- Tn*s T = cycle time in seconds
Definition at line 173 of file rlcontroller.cpp.
void rlController::setPI_SUM | ( | double | _T, |
double | _Kp, | ||
double | _Tn | ||
) |
1 Transfer function: Gr(s) = Kp * ( 1 + ---- ) Tn*s T = cycle time in seconds
Definition at line 220 of file rlcontroller.cpp.
void rlController::setPID_T1 | ( | double | _T, |
double | _Kpp, | ||
double | _TnP, | ||
double | _TvP, | ||
double | _Td | ||
) |
1 + TnP*s 1 + TvP*s Transfer function: Gr(s) = Kpp * --------- * --------- TnP*s 1 + Td*s T = cycle time in seconds
Definition at line 202 of file rlcontroller.cpp.
void rlController::setPID_T1_SUM | ( | double | _T, |
double | _Kp, | ||
double | _Tn, | ||
double | _Tv, | ||
double | _Td | ||
) |
1 Tv*s Transfer function: Gr(s) = Kp * ( 1 + ---- + -------- ) Tn*s 1 + Td*s T = cycle time in seconds
Definition at line 246 of file rlcontroller.cpp.
void rlController::setReference | ( | double | _reference | ) |
void rlController::start | ( | ) |
Definition at line 108 of file rlcontroller.cpp.
void rlController::stop | ( | ) |
Definition at line 124 of file rlcontroller.cpp.
double rlController::c1 |
Definition at line 127 of file rlcontroller.h.
double rlController::c2 |
Definition at line 127 of file rlcontroller.h.
double rlController::cD |
Definition at line 127 of file rlcontroller.h.
double rlController::d0 |
Definition at line 126 of file rlcontroller.h.
double rlController::d1 |
Definition at line 126 of file rlcontroller.h.
double rlController::d2 |
Definition at line 126 of file rlcontroller.h.
double rlController::dD |
Definition at line 126 of file rlcontroller.h.
int rlController::dt |
Definition at line 131 of file rlcontroller.h.
double rlController::ek |
Definition at line 129 of file rlcontroller.h.
double rlController::ek_1 |
Definition at line 129 of file rlcontroller.h.
double rlController::ek_2 |
Definition at line 129 of file rlcontroller.h.
double(* rlController::getMeasurement) () |
You have to supply this function for getting the measurement
Definition at line 136 of file rlcontroller.h.
double rlController::Kp |
Don't set the controller parameters directly Use the set methods, because they will also set the coefficients Controller parameters are for reading only
Definition at line 123 of file rlcontroller.h.
double rlController::Kpp |
Definition at line 123 of file rlcontroller.h.
int rlController::limited |
Definition at line 160 of file rlcontroller.h.
double rlController::measurement |
last measurement
Definition at line 154 of file rlcontroller.h.
double rlController::reference |
Definition at line 123 of file rlcontroller.h.
int rlController::running |
Definition at line 125 of file rlcontroller.h.
int rlController::sleepLocally |
Default sleepLocally = 1 But: Sleeping locally might me inaccurate. It might be better to have a central timer and wait for it in double (*_getMeasurement)(); T = cycle time in seconds
Definition at line 150 of file rlcontroller.h.
double rlController::T |
Definition at line 123 of file rlcontroller.h.
double rlController::T1 |
Definition at line 123 of file rlcontroller.h.
double rlController::Td |
Definition at line 123 of file rlcontroller.h.
double rlController::TD |
Definition at line 123 of file rlcontroller.h.
double rlController::Tn |
Definition at line 123 of file rlcontroller.h.
double rlController::TnP |
Definition at line 123 of file rlcontroller.h.
double rlController::Tv |
Definition at line 123 of file rlcontroller.h.
double rlController::TvP |
Definition at line 123 of file rlcontroller.h.
int rlController::type |
Definition at line 124 of file rlcontroller.h.
void(* rlController::writeOutput) (double output) |
You have to supply this function for writing the output
Definition at line 140 of file rlcontroller.h.
double rlController::y1k |
Definition at line 130 of file rlcontroller.h.
double rlController::y1k_1 |
Definition at line 130 of file rlcontroller.h.
double rlController::ydk |
Definition at line 130 of file rlcontroller.h.
double rlController::ydk_1 |
Definition at line 130 of file rlcontroller.h.
double rlController::yk |
Definition at line 128 of file rlcontroller.h.
double rlController::yk_1 |
Definition at line 128 of file rlcontroller.h.
double rlController::yk_2 |
Definition at line 128 of file rlcontroller.h.
double rlController::yk_max |
Definition at line 159 of file rlcontroller.h.
double rlController::yk_min |
limits
Definition at line 158 of file rlcontroller.h.