Ultimate Gain method

Dependents:   2016_slave_MD_rorikon 2016_slave_MD_rorikon WRS_mechanamu_test

Committer:
sgrsn
Date:
Sat Aug 06 05:31:34 2016 +0000
Revision:
0:35a0b92fe34e
Child:
1:6939c241c6dc
Ultimate Gain method

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 0:35a0b92fe34e 9 float control(float target, float nowrpm);
sgrsn 0:35a0b92fe34e 10 float control_P(float target, float nowrpm, float new_Kp);
sgrsn 0:35a0b92fe34e 11 void set_parameter(float new_Ku, float new_Pu);
sgrsn 0:35a0b92fe34e 12 void reset();
sgrsn 0:35a0b92fe34e 13
sgrsn 0:35a0b92fe34e 14 private:
sgrsn 0:35a0b92fe34e 15 Timer timer;
sgrsn 0:35a0b92fe34e 16 float integral;
sgrsn 0:35a0b92fe34e 17 float prev_hensa;
sgrsn 0:35a0b92fe34e 18 float nowtime;
sgrsn 0:35a0b92fe34e 19 float prev_time;
sgrsn 0:35a0b92fe34e 20
sgrsn 0:35a0b92fe34e 21 float Ku;
sgrsn 0:35a0b92fe34e 22 float Pu;
sgrsn 0:35a0b92fe34e 23
sgrsn 0:35a0b92fe34e 24 float Kp;
sgrsn 0:35a0b92fe34e 25 float Ti;
sgrsn 0:35a0b92fe34e 26 float Td;
sgrsn 0:35a0b92fe34e 27 float Ki;
sgrsn 0:35a0b92fe34e 28 float Kd;
sgrsn 0:35a0b92fe34e 29 };
sgrsn 0:35a0b92fe34e 30
sgrsn 0:35a0b92fe34e 31 #endif