Ruprecht Altenburger
/
mirror_actuator_preston
corrections altb2
Lib_Cntrl/PID_Cntrl.h
- Committer:
- ernstpre
- Date:
- 2021-08-05
- Revision:
- 1:25a2b47ca291
- Parent:
- 0:d2e117716219
File content as of revision 1:25a2b47ca291:
#ifndef PID_CNTRL_H_ #define PID_CNTRL_H_ class PID_Cntrl { public: PID_Cntrl(float P, float I, float D, float tau_f, float Ts, float uMin, float uMax); PID_Cntrl() {}; float operator()(float e) { return update(e); } virtual ~PID_Cntrl(); void reset(float initValue); void setCoefficients(float P, float I, float D, float tau_f, float Ts, float uMin, float uMax); float update(float e); float saturate(float); private: float P, I, D, tau_f, Ts, uMin, uMax; float Ppart, Ipart, Dpart, e_old; }; #endif