rllib  1
rlcontroller.h
Go to the documentation of this file.
1 /***************************************************************************
2  rlcontroller.h - description
3  -------------------
4  begin : Wed Jun 16 2004
5  copyright : (C) 2004 by R. Lehrig
6  email : lehrig@t-online.de
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This library is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU LESSER GENERAL PUBLIC LICENSE as *
13  * published by the Free Software Foundation *
14  * *
15  ***************************************************************************/
16 #ifndef _RL_CONTROLLER_H_
17 #define _RL_CONTROLLER_H_
18 
19 #include "rldefine.h"
20 #include "rlthread.h"
21 
27 class rlController : public rlThread
28 {
29 public:
31  {
32  P = 1,
33  I = 2,
34  D_T1 = 3,
35  PI = 4,
36  PD_T1 = 5,
37  PID_T1 = 6,
38  PI_SUM = 7,
39  PD_T1_SUM = 8,
41  };
42  rlController(double (*_getMeasurement)() ,void (_writeOutput)(double output));
43  ~rlController();
44  void start();
45  void stop();
49  void setReference (double _reference);
53  void setP (double _T, double _Kp);
60  void setI (double _T, double _T1);
67  void setD_T1 (double _T, double _TD, double _Td);
74  void setPI (double _T, double _Kp, double _Tn);
81  void setPD_T1 (double _T, double _Kp, double _TvP, double _Td);
88  void setPID_T1 (double _T, double _Kpp, double _TnP, double _TvP, double _Td);
95  void setPI_SUM (double _T, double _Kp, double _Tn);
102  void setPD_T1_SUM (double _T, double _Kp, double _Tv, double _Td);
109  void setPID_T1_SUM (double _T, double _Kp, double _Tn, double _Tv, double _Td);
113  void setLimits(double _yk_min, double _yk_max);
117  void resetLimits();
124  int type;
125  int running;
126  double d0,d1,d2,dD;
127  double c1,c2,cD;
128  double yk,yk_1,yk_2;
129  double ek,ek_1,ek_2;
130  double y1k,y1k_1,ydk,ydk_1;
131  int dt;
132  // callbacks
136  double (*getMeasurement)();
140  void (*writeOutput)(double output);
141 
154  double measurement;
158  double yk_min;
159  double yk_max;
160  int limited;
161 };
162 
163 #endif
void setLimits(double _yk_min, double _yk_max)
void setI(double _T, double _T1)
void(* writeOutput)(double output)
Definition: rlcontroller.h:140
rlController(double(*_getMeasurement)(), void(_writeOutput)(double output))
void setPID_T1(double _T, double _Kpp, double _TnP, double _TvP, double _Td)
void setPI_SUM(double _T, double _Kp, double _Tn)
double measurement
Definition: rlcontroller.h:154
void setPID_T1_SUM(double _T, double _Kp, double _Tn, double _Tv, double _Td)
void setP(double _T, double _Kp)
void setPI(double _T, double _Kp, double _Tn)
double(* getMeasurement)()
Definition: rlcontroller.h:136
void setPD_T1_SUM(double _T, double _Kp, double _Tv, double _Td)
void setReference(double _reference)
void setD_T1(double _T, double _TD, double _Td)
double reference
Definition: rlcontroller.h:123
void setPD_T1(double _T, double _Kp, double _TvP, double _Td)
void resetLimits()