NHK2017Ateamかにろぼ
Dependencies: 2017NHKpin_config mbed FEP HMC6352 MotorDriverController PID QEI omni
\ ̄\ / ̄/ /l \ \ / / lヽ | ヽ ヽ | | / / | \ ` ‐ヽ ヽ ● ● / / ‐ / \ __ l | ||___|| / l __ / \ \ / \/ /\| 人__人 |/\ //\| |/\\ //\| |/\\ / . \_____/ \ ┏┓ ┏━┓┏┓ ┏┓ ┏┓┏┓ ┏┓ ┏┓┗┛ ┏┓ ┗┓┃┗┛ ┏┛┗━┓ ┃┃┃┃ ┃┃┏━┛┗┓┏┓┏┛┗━┓┃┃┏┓┏┓┏━━━┓ ┗┓┏━┛ ┃┃┗┛ ┃┃┗━┓┏┛┗┛┗┓┏┓┃┗┛┗┛┃┃┗━━━┛ ┏┛┃┏━┓┃┗━━┓┃┃┏━┛┗┓ ┏┛┃┃┃ ┃┃ ┃┏┛┗━┛┗━━┓┃┃┃┃┏┓┏┛ ┗━┛┃┃ ┃┃┏┓ ┃┃┏━━┓┏━━┛┃┃┃┃┗┛┃ ┏┛┃ ┃┃┃┗━━┓ ┗┛┗━━┛┗━━━┛┗┛┗━━┛ ┗━┛ ┗┛┗━━━┛
bot/PIDcontroller/PID_controller.h@6:590c9622ecf1, 2017-08-24 (annotated)
- Committer:
- UCHITAKE
- Date:
- Thu Aug 24 08:16:21 2017 +0000
- Revision:
- 6:590c9622ecf1
- Child:
- 18:41f7dd1a5ed1
Just worked !!!!!!!!
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
UCHITAKE | 6:590c9622ecf1 | 1 | /** |
UCHITAKE | 6:590c9622ecf1 | 2 | * @file PID_controller.h |
UCHITAKE | 6:590c9622ecf1 | 3 | * @brief コンパスセンサを使ったPIDコントローラ |
UCHITAKE | 6:590c9622ecf1 | 4 | */ |
UCHITAKE | 6:590c9622ecf1 | 5 | #ifndef PID_CONTROLLER_H |
UCHITAKE | 6:590c9622ecf1 | 6 | #define PID_CONTROLLER_H |
UCHITAKE | 6:590c9622ecf1 | 7 | |
UCHITAKE | 6:590c9622ecf1 | 8 | #include "mbed.h" |
UCHITAKE | 6:590c9622ecf1 | 9 | #include "pin_config.h" |
UCHITAKE | 6:590c9622ecf1 | 10 | |
UCHITAKE | 6:590c9622ecf1 | 11 | #include "PID.h" |
UCHITAKE | 6:590c9622ecf1 | 12 | #include "HMC6352.h" |
UCHITAKE | 6:590c9622ecf1 | 13 | |
UCHITAKE | 6:590c9622ecf1 | 14 | #define M_PI 3.141592653589793 |
UCHITAKE | 6:590c9622ecf1 | 15 | #define KC 1.0 |
UCHITAKE | 6:590c9622ecf1 | 16 | #define TI 0.0 |
UCHITAKE | 6:590c9622ecf1 | 17 | #define TD 0.0 |
UCHITAKE | 6:590c9622ecf1 | 18 | #define INTERVAL 1.0 |
UCHITAKE | 6:590c9622ecf1 | 19 | /** |
UCHITAKE | 6:590c9622ecf1 | 20 | * @brief コンパスセンサを使ったPIDコントローラ |
UCHITAKE | 6:590c9622ecf1 | 21 | */ |
UCHITAKE | 6:590c9622ecf1 | 22 | class PIDC : public PID, HMC6352, Ticker |
UCHITAKE | 6:590c9622ecf1 | 23 | { |
UCHITAKE | 6:590c9622ecf1 | 24 | public : |
UCHITAKE | 6:590c9622ecf1 | 25 | /** |
UCHITAKE | 6:590c9622ecf1 | 26 | * @brief コンストラクタ,タイマ割り込みでの計算開始 |
UCHITAKE | 6:590c9622ecf1 | 27 | */ |
UCHITAKE | 6:590c9622ecf1 | 28 | PIDC(); |
UCHITAKE | 6:590c9622ecf1 | 29 | |
UCHITAKE | 6:590c9622ecf1 | 30 | void confirm(); |
UCHITAKE | 6:590c9622ecf1 | 31 | float getCo(); |
UCHITAKE | 6:590c9622ecf1 | 32 | private : |
UCHITAKE | 6:590c9622ecf1 | 33 | |
UCHITAKE | 6:590c9622ecf1 | 34 | void updateOutput(); |
UCHITAKE | 6:590c9622ecf1 | 35 | |
UCHITAKE | 6:590c9622ecf1 | 36 | int rawDegree; |
UCHITAKE | 6:590c9622ecf1 | 37 | int offSetDegree; |
UCHITAKE | 6:590c9622ecf1 | 38 | int turnOverNumber; |
UCHITAKE | 6:590c9622ecf1 | 39 | int beforeDegree; |
UCHITAKE | 6:590c9622ecf1 | 40 | |
UCHITAKE | 6:590c9622ecf1 | 41 | protected : |
UCHITAKE | 6:590c9622ecf1 | 42 | float co; |
UCHITAKE | 6:590c9622ecf1 | 43 | float processValue; |
UCHITAKE | 6:590c9622ecf1 | 44 | int initDegree; |
UCHITAKE | 6:590c9622ecf1 | 45 | }; |
UCHITAKE | 6:590c9622ecf1 | 46 | |
UCHITAKE | 6:590c9622ecf1 | 47 | #endif//PID_CONTROLLER_H |