Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: Nucleo_spi 2015_denziben_i2c_S2 Nucleo_Motor Nucleo_Motor
Fork of PID by
PID.h@3:34f4f22b18e7, 2015-08-18 (annotated)
- Committer:
- kikoaac
- Date:
- Tue Aug 18 04:45:10 2015 +0000
- Revision:
- 3:34f4f22b18e7
- Parent:
- 2:14176355508a
- Child:
- 4:a3c85727f0f6
- Child:
- 5:3519920d064d
PID
;
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| aberk | 0:6e12a3e5af19 | 1 | |
| aberk | 0:6e12a3e5af19 | 2 | #ifndef PID_H |
| aberk | 0:6e12a3e5af19 | 3 | #define PID_H |
| aberk | 0:6e12a3e5af19 | 4 | |
| aberk | 0:6e12a3e5af19 | 5 | #include "mbed.h" |
| kikoaac | 1:aac6180820a4 | 6 | class PID |
| kikoaac | 1:aac6180820a4 | 7 | { |
| kikoaac | 1:aac6180820a4 | 8 | public: |
| kikoaac | 1:aac6180820a4 | 9 | |
| kikoaac | 1:aac6180820a4 | 10 | PID(float tauKc, float tauKi, float tauKd); |
| aberk | 0:6e12a3e5af19 | 11 | |
| kikoaac | 2:14176355508a | 12 | double s_dErrIntg ,dErr_prev; |
| kikoaac | 2:14176355508a | 13 | void Start(); |
| kikoaac | 3:34f4f22b18e7 | 14 | void Reset(); |
| kikoaac | 1:aac6180820a4 | 15 | void setInterval(double inter); |
| kikoaac | 1:aac6180820a4 | 16 | //Getters. |
| kikoaac | 1:aac6180820a4 | 17 | void stop(); |
| kikoaac | 1:aac6180820a4 | 18 | double dTarget; double dPoint; |
| kikoaac | 1:aac6180820a4 | 19 | // PI制御ゲイン |
| kikoaac | 1:aac6180820a4 | 20 | double GAIN_P ;//1.5 // 比例ゲイン |
| kikoaac | 1:aac6180820a4 | 21 | double GAIN_I ;//2.8 // 積分ゲイン |
| kikoaac | 1:aac6180820a4 | 22 | double GAIN_D ;//0.2 |
| kikoaac | 1:aac6180820a4 | 23 | double data; |
| kikoaac | 1:aac6180820a4 | 24 | private: |
| kikoaac | 1:aac6180820a4 | 25 | Timer timer; |
| kikoaac | 1:aac6180820a4 | 26 | Ticker T; |
| kikoaac | 1:aac6180820a4 | 27 | float interval; |
| kikoaac | 2:14176355508a | 28 | void PIDctrl(); |
| kikoaac | 1:aac6180820a4 | 29 | |
| aberk | 0:6e12a3e5af19 | 30 | }; |
| aberk | 0:6e12a3e5af19 | 31 | |
| kikoaac | 1:aac6180820a4 | 32 | #endif |
