Ultimate Gain method

Dependents:   2016_slave_MD_rorikon 2016_slave_MD_rorikon WRS_mechanamu_test

Committer:
sgrsn
Date:
Mon Aug 15 04:52:28 2016 +0000
Revision:
1:6939c241c6dc
Parent:
0:35a0b92fe34e
Child:
2:405224725072
ok

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 Timer timer;
sgrsn 0:35a0b92fe34e 15 float integral;
sgrsn 0:35a0b92fe34e 16 float prev_hensa;
sgrsn 0:35a0b92fe34e 17 float nowtime;
sgrsn 0:35a0b92fe34e 18 float prev_time;
sgrsn 0:35a0b92fe34e 19
sgrsn 0:35a0b92fe34e 20 float Ku;
sgrsn 0:35a0b92fe34e 21 float Pu;
sgrsn 0:35a0b92fe34e 22
sgrsn 0:35a0b92fe34e 23 float Kp;
sgrsn 0:35a0b92fe34e 24 float Ti;
sgrsn 0:35a0b92fe34e 25 float Td;
sgrsn 0:35a0b92fe34e 26 float Ki;
sgrsn 0:35a0b92fe34e 27 float Kd;
sgrsn 0:35a0b92fe34e 28 };
sgrsn 0:35a0b92fe34e 29
sgrsn 0:35a0b92fe34e 30 #endif