Pascal Keller
/
GRT_VC_PIDT1
Regler von Kellep15
PID_Cntrl.h@2:394782101261, 2019-05-16 (annotated)
- Committer:
- kellep15
- Date:
- Thu May 16 15:34:29 2019 +0000
- Revision:
- 2:394782101261
- Parent:
- 1:92f175969d90
rEGLER TUT NICHT
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb2 | 0:05dd1de8cc3f | 1 | #ifndef PID_CNTRL_H_ |
altb2 | 0:05dd1de8cc3f | 2 | #define PID_CNTRL_H_ |
altb2 | 0:05dd1de8cc3f | 3 | |
pmic | 1:92f175969d90 | 4 | // PID Controller Class |
altb2 | 0:05dd1de8cc3f | 5 | class PID_Cntrl |
altb2 | 0:05dd1de8cc3f | 6 | { |
altb2 | 0:05dd1de8cc3f | 7 | public: |
altb2 | 0:05dd1de8cc3f | 8 | |
pmic | 1:92f175969d90 | 9 | PID_Cntrl(float Kp, float Ki, float Kd, float Tf, float Ts, float uMin, float uMax); |
altb2 | 0:05dd1de8cc3f | 10 | |
altb2 | 0:05dd1de8cc3f | 11 | float operator()(float error) { |
kellep15 | 2:394782101261 | 12 | return update(error); |
altb2 | 0:05dd1de8cc3f | 13 | } |
altb2 | 0:05dd1de8cc3f | 14 | |
altb2 | 0:05dd1de8cc3f | 15 | virtual ~PID_Cntrl(); |
altb2 | 0:05dd1de8cc3f | 16 | |
altb2 | 0:05dd1de8cc3f | 17 | void reset(float initValue); |
kellep15 | 2:394782101261 | 18 | float update(float error); |
altb2 | 0:05dd1de8cc3f | 19 | |
altb2 | 0:05dd1de8cc3f | 20 | private: |
altb2 | 0:05dd1de8cc3f | 21 | |
pmic | 1:92f175969d90 | 22 | // controller parameters (member variables) |
kellep15 | 2:394782101261 | 23 | float Kp, Ki, Kd, Tf, Tx, Ts, yMin, yMax; |
kellep15 | 2:394782101261 | 24 | |
pmic | 1:92f175969d90 | 25 | |
pmic | 1:92f175969d90 | 26 | // storage for signals (member variables) |
kellep15 | 2:394782101261 | 27 | float e_old, y_I, y_Dold; |
altb2 | 0:05dd1de8cc3f | 28 | }; |
altb2 | 0:05dd1de8cc3f | 29 | |
pmic | 1:92f175969d90 | 30 | #endif |
pmic | 1:92f175969d90 | 31 |