.
Fork of Cntrlol_Lib by
Diff: PID_Cntrl.h
- Revision:
- 0:e2a7d7f91e49
- Child:
- 1:bf62e74fbcf3
diff -r 000000000000 -r e2a7d7f91e49 PID_Cntrl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PID_Cntrl.h Fri Sep 28 08:34:20 2018 +0000 @@ -0,0 +1,25 @@ +class PI_Cntrl +{ +public: + + PI_Cntrl(float P, float I, float D, float tau_f, float Ts, float uMax, float uMin); + + float operator()(float error) { + return doStep((double)error); + } + + virtual ~PID_Cntrl(); + + void reset(float initValue); + float doStep(double error); + +private: + + double Iold; + double uk,yk; + double uMax; + double uMin; + double Ts; + void setCoefficients(float D, float tau_f, float Ts); + +}; \ No newline at end of file