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@1:aac6180820a4, 2015-06-19 (annotated)
- Committer:
- kikoaac
- Date:
- Fri Jun 19 06:36:10 2015 +0000
- Revision:
- 1:aac6180820a4
- Parent:
- 0:6e12a3e5af19
- Child:
- 2:14176355508a
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 | 1:aac6180820a4 | 12 | void PIDctrl(void); |
| kikoaac | 1:aac6180820a4 | 13 | void start(); |
| kikoaac | 1:aac6180820a4 | 14 | void setInterval(double inter); |
| kikoaac | 1:aac6180820a4 | 15 | //Getters. |
| kikoaac | 1:aac6180820a4 | 16 | void stop(); |
| kikoaac | 1:aac6180820a4 | 17 | double dTarget; double dPoint; |
| kikoaac | 1:aac6180820a4 | 18 | // PI制御ゲイン |
| kikoaac | 1:aac6180820a4 | 19 | double GAIN_P ;//1.5 // 比例ゲイン |
| kikoaac | 1:aac6180820a4 | 20 | double GAIN_I ;//2.8 // 積分ゲイン |
| kikoaac | 1:aac6180820a4 | 21 | double GAIN_D ;//0.2 |
| kikoaac | 1:aac6180820a4 | 22 | double data; |
| kikoaac | 1:aac6180820a4 | 23 | private: |
| kikoaac | 1:aac6180820a4 | 24 | Timer timer; |
| kikoaac | 1:aac6180820a4 | 25 | Ticker T; |
| kikoaac | 1:aac6180820a4 | 26 | float interval; |
| kikoaac | 1:aac6180820a4 | 27 | |
| aberk | 0:6e12a3e5af19 | 28 | }; |
| aberk | 0:6e12a3e5af19 | 29 | |
| kikoaac | 1:aac6180820a4 | 30 | #endif |
