Hello

Committer:
ChengHan
Date:
Thu Nov 22 01:07:08 2018 +0000
Revision:
0:004c04a30fce
Hello

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ChengHan 0:004c04a30fce 1 #ifndef PID_H
ChengHan 0:004c04a30fce 2 #define PID_H
ChengHan 0:004c04a30fce 3
ChengHan 0:004c04a30fce 4 #include "mbed.h"
ChengHan 0:004c04a30fce 5
ChengHan 0:004c04a30fce 6 class PID{
ChengHan 0:004c04a30fce 7 public:
ChengHan 0:004c04a30fce 8
ChengHan 0:004c04a30fce 9 PID(float setKp, float setKi, float setKd, float setSampletime);
ChengHan 0:004c04a30fce 10 void SetOutputLimits(float setoutputLimits_H, float setoutputLimits_L);
ChengHan 0:004c04a30fce 11 void SetInputLimits(float setinputLimits_H, float setinputLimits_L);
ChengHan 0:004c04a30fce 12 void Compute(float setreference, float setfeedbackvalue);
ChengHan 0:004c04a30fce 13 void PID::EnableAntiWindUp(float Ka_);
ChengHan 0:004c04a30fce 14
ChengHan 0:004c04a30fce 15 float Kp;
ChengHan 0:004c04a30fce 16 float Ki;
ChengHan 0:004c04a30fce 17 float Kd;
ChengHan 0:004c04a30fce 18 float Ka;
ChengHan 0:004c04a30fce 19
ChengHan 0:004c04a30fce 20 float error[3];
ChengHan 0:004c04a30fce 21 float output;
ChengHan 0:004c04a30fce 22 float reference;
ChengHan 0:004c04a30fce 23
ChengHan 0:004c04a30fce 24
ChengHan 0:004c04a30fce 25
ChengHan 0:004c04a30fce 26
ChengHan 0:004c04a30fce 27 float sampletime;
ChengHan 0:004c04a30fce 28
ChengHan 0:004c04a30fce 29
ChengHan 0:004c04a30fce 30
ChengHan 0:004c04a30fce 31 private:
ChengHan 0:004c04a30fce 32
ChengHan 0:004c04a30fce 33 bool Outputlimit_bool;
ChengHan 0:004c04a30fce 34 bool Inputlimit_bool;
ChengHan 0:004c04a30fce 35 bool AntiWindUp_bool;
ChengHan 0:004c04a30fce 36
ChengHan 0:004c04a30fce 37 float outputLimits_H;
ChengHan 0:004c04a30fce 38 float outputLimits_L;
ChengHan 0:004c04a30fce 39 float inputLimits_H;
ChengHan 0:004c04a30fce 40 float inputLimits_L;
ChengHan 0:004c04a30fce 41
ChengHan 0:004c04a30fce 42 float feedbackvalue;
ChengHan 0:004c04a30fce 43 // Ticker PID_timer;
ChengHan 0:004c04a30fce 44
ChengHan 0:004c04a30fce 45 };
ChengHan 0:004c04a30fce 46
ChengHan 0:004c04a30fce 47 #endif /* PID_H*/