NHK2017Ateamかにろぼ

Dependencies:   2017NHKpin_config mbed FEP HMC6352 MotorDriverController PID QEI omni

classDiagram

    \ ̄\                   / ̄/ 
/l     \  \             /  / lヽ  
| ヽ  ヽ   |           |  /  / | 
\ ` ‐ヽ  ヽ  ●        ●         /  / ‐  / 
  \ __ l  |  ||___|| /  l __ / 
     \  \ /      \/ 
      /\|   人__人  |/\       
    //\|             |/\\     
    //\|             |/\\     
    /     . \_____/         \ 

                               ┏┓        ┏━┓┏┓              
     ┏┓         ┏┓┏┓   ┏┓    ┏┓┗┛     ┏┓ ┗┓┃┗┛              
┏┛┗━┓  ┃┃┃┃    ┃┃┏━┛┗┓┏┓┏┛┗━┓┃┃┏┓┏┓┏━━━┓ 
┗┓┏━┛  ┃┃┗┛    ┃┃┗━┓┏┛┗┛┗┓┏┓┃┗┛┗┛┃┃┗━━━┛    
┏┛┃┏━┓┃┗━━┓┃┃┏━┛┗┓      ┏┛┃┃┃        ┃┃              
┃┏┛┗━┛┗━━┓┃┃┃┃┏┓┏┛      ┗━┛┃┃        ┃┃┏┓          
┃┃┏━━┓┏━━┛┃┃┃┃┗┛┃         ┏┛┃        ┃┃┃┗━━┓    
┗┛┗━━┛┗━━━┛┗┛┗━━┛         ┗━┛        ┗┛┗━━━┛  
Committer:
UCHITAKE
Date:
Wed Aug 23 01:07:20 2017 +0000
Revision:
3:d25e7fb07ed2
Parent:
2:ea151e05033a
add document

Who changed what in which revision?

UserRevisionLine numberNew contents of line
UCHITAKE 3:d25e7fb07ed2 1 /**
UCHITAKE 3:d25e7fb07ed2 2 * @file PID_controller.h
UCHITAKE 3:d25e7fb07ed2 3 * @brief コンパスセンサを使ったPIDコントローラ
UCHITAKE 3:d25e7fb07ed2 4 */
UCHITAKE 2:ea151e05033a 5 #ifndef PID_CONTROLLER_H
UCHITAKE 2:ea151e05033a 6 #define PID_CONTROLLER_H
UCHITAKE 2:ea151e05033a 7
UCHITAKE 2:ea151e05033a 8 #include "mbed.h"
UCHITAKE 2:ea151e05033a 9 #include "pin_config.h"
UCHITAKE 2:ea151e05033a 10
UCHITAKE 2:ea151e05033a 11 #include "PID.h"
UCHITAKE 2:ea151e05033a 12 #include "HMC6352.h"
UCHITAKE 2:ea151e05033a 13
UCHITAKE 2:ea151e05033a 14 #define M_PI 3.141592653589793
UCHITAKE 2:ea151e05033a 15 #define KC 1.0
UCHITAKE 2:ea151e05033a 16 #define TI 0.0
UCHITAKE 2:ea151e05033a 17 #define TD 0.0
UCHITAKE 2:ea151e05033a 18 #define INTERVAL 0.05
UCHITAKE 3:d25e7fb07ed2 19 /**
UCHITAKE 3:d25e7fb07ed2 20 * @brief コンパスセンサを使ったPIDコントローラ
UCHITAKE 3:d25e7fb07ed2 21 */
UCHITAKE 2:ea151e05033a 22 class PIDC : public PID, HMC6352, Ticker
UCHITAKE 2:ea151e05033a 23 {
UCHITAKE 2:ea151e05033a 24 public :
UCHITAKE 3:d25e7fb07ed2 25 /**
UCHITAKE 3:d25e7fb07ed2 26 * @brief コンストラクタ,タイマ割り込みでの計算開始
UCHITAKE 3:d25e7fb07ed2 27 */
UCHITAKE 2:ea151e05033a 28 PIDC();
UCHITAKE 2:ea151e05033a 29
UCHITAKE 2:ea151e05033a 30 private :
UCHITAKE 2:ea151e05033a 31 void updateOutput();
UCHITAKE 2:ea151e05033a 32
UCHITAKE 2:ea151e05033a 33 int rawDegree;
UCHITAKE 2:ea151e05033a 34 int offSetDegree;
UCHITAKE 2:ea151e05033a 35 int turnOverNumber;
UCHITAKE 2:ea151e05033a 36 int beforeDegree;
UCHITAKE 2:ea151e05033a 37
UCHITAKE 2:ea151e05033a 38 protected :
UCHITAKE 2:ea151e05033a 39 float co;
UCHITAKE 2:ea151e05033a 40 float processValue;
UCHITAKE 2:ea151e05033a 41 int initDegree;
UCHITAKE 2:ea151e05033a 42 };
UCHITAKE 2:ea151e05033a 43
UCHITAKE 2:ea151e05033a 44 #endif//PID_CONTROLLER_H