![](/media/cache/group/default_image.jpg.50x50_q85.jpg)
加減速走行時の次マーカ検出前のブレーキングシステムを導入。各速度域におけるブレーキのタイミングとPDパラメータの調整を入念に行うこと。また、LCDの表示事項はストップゴールの表示は必要性を感じなかったため、走行交差点数のパラメータ表示に変更した。
Dependencies: mbed AQM0802 CRotaryEncoder TB6612FNG
Diff: main.cpp
- Revision:
- 21:97cc65e61580
- Parent:
- 20:3b35311f4576
- Child:
- 22:b40f7d0c0f12
--- a/main.cpp Tue Nov 19 11:12:26 2019 +0000 +++ b/main.cpp Wed Nov 20 04:41:18 2019 +0000 @@ -7,7 +7,7 @@ //☆★☆★各種パラメータ調整箇所☆★☆★☆★ #define DEFAULT_SPEED 300 //1走目の基本速度[mm/sec] -#define DEFAULT_SPEED1 600 +#define DEFAULT_SPEED1 800 #define DEFAULT_SPEED2 900 #define STOP_DISTANCE 200000 //停止距離200000[um]⇒20[cm] #define TURN_POWER 0.6 //コースアウト時の旋回力 @@ -338,23 +338,22 @@ /////各モータの目標速度の設定 if(Sw==0){ + Target_Speed_A=Medium_Speed; + Target_Speed_B=Medium_Speed; + Motor_A_Diff[1]=Motor_A_Diff[0]; Motor_B_Diff[1]=Motor_B_Diff[0]; - -// Target_Speed_A=Medium_Speed; -// Target_Speed_B=Medium_Speed; - + Motor_A_Diff[0]=(Target_Speed_A-Speed_A); Motor_B_Diff[0]=(Target_Speed_B-Speed_B); } else { + Target_Speed_A1=High_Speed; + Target_Speed_B1=High_Speed; Motor_A_Diff[1]=Motor_A_Diff[0]; Motor_B_Diff[1]=Motor_B_Diff[0]; - -// Target_Speed_A1=High_Speed; -// Target_Speed_B1=High_Speed; - + Motor_A_Diff[0]=(Target_Speed_A1-Speed_A); Motor_B_Diff[0]=(Target_Speed_B1-Speed_B); } @@ -480,8 +479,8 @@ wait(2); Stop_Distance=0; Machine_Status&=0x7F;//ストップ状態解除 - Target_Speed_A=Medium_Speed; - Target_Speed_B=Medium_Speed; + //Target_Speed_A=Medium_Speed; + //Target_Speed_B=Medium_Speed; }else{//機体走行中であったとき