Ultimate Gain method

Dependents:   2016_slave_MD_rorikon 2016_slave_MD_rorikon WRS_mechanamu_test

Committer:
sgrsn
Date:
Wed Nov 14 02:20:07 2018 +0000
Revision:
5:6949e401a9ad
Parent:
4:3ca1603fbcda
...

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sgrsn 0:35a0b92fe34e 1 #ifndef PID_H
sgrsn 0:35a0b92fe34e 2 #define PID_H
sgrsn 0:35a0b92fe34e 3 #include "mbed.h"
sgrsn 0:35a0b92fe34e 4
sgrsn 0:35a0b92fe34e 5 class PID
sgrsn 0:35a0b92fe34e 6 {
sgrsn 0:35a0b92fe34e 7 public:
sgrsn 0:35a0b92fe34e 8 PID(Timer *T);
sgrsn 5:6949e401a9ad 9 float controlPID(float target, float nowrpm);
sgrsn 4:3ca1603fbcda 10 float PI_lateD(float target, float nowrpm);
sgrsn 5:6949e401a9ad 11 float controlP(float target, float nowrpm, float new_Kp);
sgrsn 5:6949e401a9ad 12 float controlPI(float target, float nowrpm);
sgrsn 5:6949e401a9ad 13 void setParameter(float new_Kp, float new_Ki, float new_Kd);
sgrsn 5:6949e401a9ad 14 void setParameter(float new_Ku, float new_Pu);
sgrsn 5:6949e401a9ad 15 void setParameterPI(float new_Ku, float new_Pu);
sgrsn 0:35a0b92fe34e 16 void reset();
sgrsn 2:405224725072 17
sgrsn 2:405224725072 18 float Ku;
sgrsn 2:405224725072 19 float Pu;
sgrsn 2:405224725072 20 float Kp;
sgrsn 2:405224725072 21 float Ti;
sgrsn 2:405224725072 22 float Td;
sgrsn 2:405224725072 23 float Ki;
sgrsn 2:405224725072 24 float Kd;
sgrsn 0:35a0b92fe34e 25
sgrsn 2:405224725072 26 private:
sgrsn 5:6949e401a9ad 27 Timer *timer;
sgrsn 0:35a0b92fe34e 28 float integral;
sgrsn 0:35a0b92fe34e 29 float prev_hensa;
sgrsn 0:35a0b92fe34e 30 float nowtime;
sgrsn 0:35a0b92fe34e 31 float prev_time;
sgrsn 4:3ca1603fbcda 32 float lateD;
sgrsn 0:35a0b92fe34e 33 };
sgrsn 0:35a0b92fe34e 34
sgrsn 0:35a0b92fe34e 35 #endif