2nd Library
Diff: PI_Cntrl.h
- Revision:
- 0:a201a6cd4c0c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PI_Cntrl.h Thu Mar 07 07:03:56 2019 +0000 @@ -0,0 +1,29 @@ +class PI_Cntrl +{ +public: + + PI_Cntrl(float Kp, float Tn, float Ts); + PI_Cntrl(float Kp, float Tn, float Ts, float uMax); + PI_Cntrl(float Kp, float Tn, float Ts, float uMax, float uMin); + + float operator()(float error) { + return doStep((double)error); + } + + virtual ~PI_Cntrl(); + + void reset(float initValue); + float doStep(double error); + +private: + + double b0; + double b1; + double b2; + double s; + double uMax; + double uMin; + + void setCoefficients(float Kp, float Tn, float Ts); + +};