Ultimate Gain method
Dependents: 2016_slave_MD_rorikon 2016_slave_MD_rorikon WRS_mechanamu_test
PID.h@2:405224725072, 2016-08-17 (annotated)
- Committer:
- sgrsn
- Date:
- Wed Aug 17 05:33:56 2016 +0000
- Revision:
- 2:405224725072
- Parent:
- 1:6939c241c6dc
- Child:
- 4:3ca1603fbcda
chng about public and private.
;
Who changed what in which revision?
User | Revision | Line number | New 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 | 2:405224725072 | 13 | |
sgrsn | 2:405224725072 | 14 | float Ku; |
sgrsn | 2:405224725072 | 15 | float Pu; |
sgrsn | 2:405224725072 | 16 | float Kp; |
sgrsn | 2:405224725072 | 17 | float Ti; |
sgrsn | 2:405224725072 | 18 | float Td; |
sgrsn | 2:405224725072 | 19 | float Ki; |
sgrsn | 2:405224725072 | 20 | float Kd; |
sgrsn | 0:35a0b92fe34e | 21 | |
sgrsn | 2:405224725072 | 22 | private: |
sgrsn | 0:35a0b92fe34e | 23 | Timer timer; |
sgrsn | 0:35a0b92fe34e | 24 | float integral; |
sgrsn | 0:35a0b92fe34e | 25 | float prev_hensa; |
sgrsn | 0:35a0b92fe34e | 26 | float nowtime; |
sgrsn | 0:35a0b92fe34e | 27 | float prev_time; |
sgrsn | 0:35a0b92fe34e | 28 | |
sgrsn | 0:35a0b92fe34e | 29 | }; |
sgrsn | 0:35a0b92fe34e | 30 | |
sgrsn | 0:35a0b92fe34e | 31 | #endif |