Control Library by altb
Dependents: My_Libraries IndNav_QK3_T265
Diff: PID_Cntrl.h
- Revision:
- 0:d49418189c5c
- Child:
- 1:1010530120ce
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/PID_Cntrl.h Mon Mar 04 11:03:08 2019 +0000 @@ -0,0 +1,29 @@ +class PID_Cntrl +{ +public: + + PID_Cntrl(float P, float I, float D, float tau_f, float Ts, float uMin, float uMax); + + float operator()(float error) { + return doStep((double)error); + } + + virtual ~PID_Cntrl(); + + void reset(float initValue); + float doStep(double error); + void set_limits(double ,double ); + float get_ulimit(void); + +private: + + double Iold; + double eold,yold,del; + double uMax; + double uMin; + double Ts; + double P,I,D; + double p, Ka; + void setCoefficients(float P, float I, float D, float tau_f, float Ts); + +}; \ No newline at end of file