Tobias Vögeli
/
GRT_VC_PIDT1
pr7
PID_Cntrl.h@0:05dd1de8cc3f, 2019-05-03 (annotated)
- Committer:
- altb2
- Date:
- Fri May 03 09:37:27 2019 +0000
- Revision:
- 0:05dd1de8cc3f
- Child:
- 1:92f175969d90
Final Template Version for Lab #7
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 | |
altb2 | 0:05dd1de8cc3f | 4 | // PID Controller Class (Template) |
altb2 | 0:05dd1de8cc3f | 5 | class PID_Cntrl |
altb2 | 0:05dd1de8cc3f | 6 | { |
altb2 | 0:05dd1de8cc3f | 7 | public: |
altb2 | 0:05dd1de8cc3f | 8 | |
altb2 | 0:05dd1de8cc3f | 9 | PID_Cntrl(float P, float I, float D, float tau_f, float Ts, float uMin, float uMax); |
altb2 | 0:05dd1de8cc3f | 10 | |
altb2 | 0:05dd1de8cc3f | 11 | float operator()(float error) { |
altb2 | 0:05dd1de8cc3f | 12 | return update((double)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); |
altb2 | 0:05dd1de8cc3f | 18 | float update(double error); |
altb2 | 0:05dd1de8cc3f | 19 | |
altb2 | 0:05dd1de8cc3f | 20 | private: |
altb2 | 0:05dd1de8cc3f | 21 | |
altb2 | 0:05dd1de8cc3f | 22 | // here some local variables are defined |
altb2 | 0:05dd1de8cc3f | 23 | }; |
altb2 | 0:05dd1de8cc3f | 24 | |
altb2 | 0:05dd1de8cc3f | 25 | #endif |