.
Fork of Cntrlol_Lib by
PID_Cntrl.h@8:32445aab4589, 2018-10-26 (annotated)
- Committer:
- altb
- Date:
- Fri Oct 26 12:40:51 2018 +0000
- Revision:
- 8:32445aab4589
- Parent:
- 3:27b75e7dd54a
corrected bugs
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb | 1:bf62e74fbcf3 | 1 | class PID_Cntrl |
altb | 0:e2a7d7f91e49 | 2 | { |
altb | 0:e2a7d7f91e49 | 3 | public: |
altb | 0:e2a7d7f91e49 | 4 | |
altb | 2:1f8ddc46c578 | 5 | PID_Cntrl(float P, float I, float D, float tau_f, float Ts, float uMin, float uMax); |
altb | 0:e2a7d7f91e49 | 6 | |
altb | 0:e2a7d7f91e49 | 7 | float operator()(float error) { |
altb | 0:e2a7d7f91e49 | 8 | return doStep((double)error); |
altb | 0:e2a7d7f91e49 | 9 | } |
altb | 0:e2a7d7f91e49 | 10 | |
altb | 0:e2a7d7f91e49 | 11 | virtual ~PID_Cntrl(); |
altb | 0:e2a7d7f91e49 | 12 | |
altb | 0:e2a7d7f91e49 | 13 | void reset(float initValue); |
altb | 0:e2a7d7f91e49 | 14 | float doStep(double error); |
altb | 3:27b75e7dd54a | 15 | void set_limits(double ,double ); |
altb | 3:27b75e7dd54a | 16 | float get_ulimit(void); |
altb | 3:27b75e7dd54a | 17 | |
altb | 0:e2a7d7f91e49 | 18 | private: |
altb | 0:e2a7d7f91e49 | 19 | |
altb | 0:e2a7d7f91e49 | 20 | double Iold; |
altb | 1:bf62e74fbcf3 | 21 | double eold,yold,del; |
altb | 0:e2a7d7f91e49 | 22 | double uMax; |
altb | 0:e2a7d7f91e49 | 23 | double uMin; |
altb | 0:e2a7d7f91e49 | 24 | double Ts; |
altb | 1:bf62e74fbcf3 | 25 | double P,I,D; |
altb | 2:1f8ddc46c578 | 26 | double p, Ka; |
altb | 1:bf62e74fbcf3 | 27 | void setCoefficients(float P, float I, float D, float tau_f, float Ts); |
altb | 0:e2a7d7f91e49 | 28 | |
altb | 0:e2a7d7f91e49 | 29 | }; |