naoki tanabe / petbottle_Loading

Dependents:  

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers petbottleLoading.h Source File

petbottleLoading.h

00001 #ifndef PETBOTTLE_LOADING_H
00002 #define PETBOTTLE_LOADING_H
00003 #include "ikarashiMDC.h"
00004 #include "PID.h"
00005 #include "QEI.h"
00006 #include"pin_config.h"
00007 
00008 #define loadingKP 30.0
00009 #define loadingKI 0.0
00010 #define loadingKD 0.0
00011 #define RATE 0.01
00012 
00013 
00014 /**
00015  * 装填・発射機構用クラス
00016  */
00017 class petbottleLoading
00018 {
00019 public:
00020     /**
00021     * デフォルトコンストラクタ
00022     */
00023     petbottleLoading();
00024 
00025     /**
00026      *
00027      * @0:最初の位置
00028      * @1:発射機構1まで移動モード
00029      * @2:発射機構2まで移動モード
00030      * @3:装填して原点に戻りボトルを落とすモード
00031      */
00032     void petbottlemode(int loadingmode);
00033 
00034     /**
00035      *装填機構状態表示
00036      * @0 : 装填中~~
00037      * @1 : 装填完了!
00038      */
00039     int state();
00040     
00041     int LoadingEncoder();
00042 
00043 
00044 private:
00045     /*装填機構*/
00046     void loadingasenble();
00047     ikarashiMDC* petbottledrop;
00048     ikarashiMDC* petbotleslider;
00049     ikarashiMDC* petbottleIn;
00050     Serial RS485;
00051     DigitalOut RS485control;
00052 
00053     double petbottledropPwm, petbotlesliderPwm, petbottleInPwm;
00054     PID loadingPid;
00055     QEI loadingencoder;
00056     InterruptIn limitSW1_,limitSW2_,limitSW3_;
00057     int limitSW1,limitSW2,limitSW3;
00058     bool limitSwFlag[3],limitSwFlag2[3], limitStatus[3];
00059     int nowPals, loadingDistance, pullDistanceOfset;
00060     double Output_PID;
00061     int loadingmode;
00062     bool sw5flag;
00063     
00064     /*受信系*/
00065     bool receiveSuccessed;
00066 //    Serial debug;
00067     Timer pt;
00068     float pdt;
00069 
00070 
00071 };
00072 
00073 
00074 
00075 #endif