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.
Fork of petbottle_Loading by
petbottleLoading.h@0:890f901f4898, 2018-10-04 (annotated)
- Committer:
- tanabe2000
- Date:
- Thu Oct 04 11:43:22 2018 +0000
- Revision:
- 0:890f901f4898
- Child:
- 1:6cdfc10c7b1d
?????????
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| tanabe2000 | 0:890f901f4898 | 1 | #ifndef PETBOTTLE_LOADING_H |
| tanabe2000 | 0:890f901f4898 | 2 | #define PETBOTTLE_LOADING_H |
| tanabe2000 | 0:890f901f4898 | 3 | #include "ikarashiMDC.h" |
| tanabe2000 | 0:890f901f4898 | 4 | #include "PID.h" |
| tanabe2000 | 0:890f901f4898 | 5 | #include "QEI.h" |
| tanabe2000 | 0:890f901f4898 | 6 | #include"pin_config.h" |
| tanabe2000 | 0:890f901f4898 | 7 | |
| tanabe2000 | 0:890f901f4898 | 8 | #define loadingKP 8.0 |
| tanabe2000 | 0:890f901f4898 | 9 | #define loadingKI 0 |
| tanabe2000 | 0:890f901f4898 | 10 | #define loadingKD 0.0000001 |
| tanabe2000 | 0:890f901f4898 | 11 | #define RATE 0.01 |
| tanabe2000 | 0:890f901f4898 | 12 | |
| tanabe2000 | 0:890f901f4898 | 13 | |
| tanabe2000 | 0:890f901f4898 | 14 | /** |
| tanabe2000 | 0:890f901f4898 | 15 | * 装填・発射機構用クラス |
| tanabe2000 | 0:890f901f4898 | 16 | */ |
| tanabe2000 | 0:890f901f4898 | 17 | class petbottleLoading |
| tanabe2000 | 0:890f901f4898 | 18 | { |
| tanabe2000 | 0:890f901f4898 | 19 | public: |
| tanabe2000 | 0:890f901f4898 | 20 | /** |
| tanabe2000 | 0:890f901f4898 | 21 | * デフォルトコンストラクタ |
| tanabe2000 | 0:890f901f4898 | 22 | */ |
| tanabe2000 | 0:890f901f4898 | 23 | petbottleLoading(); |
| tanabe2000 | 0:890f901f4898 | 24 | |
| tanabe2000 | 0:890f901f4898 | 25 | /** |
| tanabe2000 | 0:890f901f4898 | 26 | * |
| tanabe2000 | 0:890f901f4898 | 27 | * @0:最初の位置 |
| tanabe2000 | 0:890f901f4898 | 28 | * @1:発射機構1まで移動モード |
| tanabe2000 | 0:890f901f4898 | 29 | * @2:発射機構2まで移動モード |
| tanabe2000 | 0:890f901f4898 | 30 | * @3:装填して原点に戻りボトルを落とすモード |
| tanabe2000 | 0:890f901f4898 | 31 | */ |
| tanabe2000 | 0:890f901f4898 | 32 | void petbottlemode(int loadingmode); |
| tanabe2000 | 0:890f901f4898 | 33 | |
| tanabe2000 | 0:890f901f4898 | 34 | /** |
| tanabe2000 | 0:890f901f4898 | 35 | *装填機構状態表示 |
| tanabe2000 | 0:890f901f4898 | 36 | * @0 : 装填中~~ |
| tanabe2000 | 0:890f901f4898 | 37 | * @1 : 装填完了! |
| tanabe2000 | 0:890f901f4898 | 38 | */ |
| tanabe2000 | 0:890f901f4898 | 39 | int state(); |
| tanabe2000 | 0:890f901f4898 | 40 | |
| tanabe2000 | 0:890f901f4898 | 41 | int LoadingEncoder(); |
| tanabe2000 | 0:890f901f4898 | 42 | |
| tanabe2000 | 0:890f901f4898 | 43 | |
| tanabe2000 | 0:890f901f4898 | 44 | private: |
| tanabe2000 | 0:890f901f4898 | 45 | /*装填機構*/ |
| tanabe2000 | 0:890f901f4898 | 46 | void loadingasenble(); |
| tanabe2000 | 0:890f901f4898 | 47 | ikarashiMDC* petbottledrop; |
| tanabe2000 | 0:890f901f4898 | 48 | ikarashiMDC* petbotleslider; |
| tanabe2000 | 0:890f901f4898 | 49 | ikarashiMDC* petbottleIn; |
| tanabe2000 | 0:890f901f4898 | 50 | Serial RS485; |
| tanabe2000 | 0:890f901f4898 | 51 | DigitalOut RS485control; |
| tanabe2000 | 0:890f901f4898 | 52 | |
| tanabe2000 | 0:890f901f4898 | 53 | double petbottledropPwm, petbotlesliderPwm, petbottleInPwm; |
| tanabe2000 | 0:890f901f4898 | 54 | PID loadingPid; |
| tanabe2000 | 0:890f901f4898 | 55 | QEI loadingencoder; |
| tanabe2000 | 0:890f901f4898 | 56 | InterruptIn limitSW1_,limitSW2_,limitSW3_; |
| tanabe2000 | 0:890f901f4898 | 57 | int limitSW1,limitSW2,limitSW3; |
| tanabe2000 | 0:890f901f4898 | 58 | bool limitSwFlag[3],limitSwFlag2[3], limitStatus[3]; |
| tanabe2000 | 0:890f901f4898 | 59 | int nowPals, loadingDistance, pullDistanceOfset; |
| tanabe2000 | 0:890f901f4898 | 60 | double Output_PID; |
| tanabe2000 | 0:890f901f4898 | 61 | int loadingmode; |
| tanabe2000 | 0:890f901f4898 | 62 | bool sw5flag; |
| tanabe2000 | 0:890f901f4898 | 63 | |
| tanabe2000 | 0:890f901f4898 | 64 | /*受信系*/ |
| tanabe2000 | 0:890f901f4898 | 65 | bool receiveSuccessed; |
| tanabe2000 | 0:890f901f4898 | 66 | Serial debug; |
| tanabe2000 | 0:890f901f4898 | 67 | Timer pt; |
| tanabe2000 | 0:890f901f4898 | 68 | float pdt; |
| tanabe2000 | 0:890f901f4898 | 69 | |
| tanabe2000 | 0:890f901f4898 | 70 | |
| tanabe2000 | 0:890f901f4898 | 71 | }; |
| tanabe2000 | 0:890f901f4898 | 72 | |
| tanabe2000 | 0:890f901f4898 | 73 | |
| tanabe2000 | 0:890f901f4898 | 74 | |
| tanabe2000 | 0:890f901f4898 | 75 | #endif |
