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.
Dependencies: mbed AQM0802 CRotaryEncoder TB6612FNG
tuning.h
00001 /************************************ 00002 個人で設定する調整パラメータ 00003 00004 ************************************/ 00005 00006 ////////機体速度関連 00007 #define LOW_SPEED 750 //標準速度[mm/sec] 00008 #define MEDIUM_SPEED 850 //2走目の中間速度[mm/sec] 00009 #define HIGH_SPEED 1150 //2走目の高速速度[mm/sec] 00010 #define STOP_DISTANCE 200000 //停止距離200000[um]⇒20[cm] 00011 #define TURN_POWER 0.4f //コースアウト時の旋回力 00012 00013 00014 ///////マーカ判定関連 00015 #define DEFAULT_GRAY 0.25f //フォトリフレクタデジタル入力の閾値 00016 //シリアル通信でSensor_Digital値を確認し調整する。 00017 #define MARKER_WIDTH 8000 //マーカ幅[um](ビニルテープ幅19000[um]以内) 00018 //コースの傷によってマーカ誤検知する場合は値を大きくする。 00019 #define CROSS_JUDGE 4 //ラインセンサいくつ以上白線検知で交差点認識するか設定。 00020 00021 00022 //////ブレーキングシステム調整 00023 #define HIGH_SPEED_SECTION 1.35f //最高速度の左右回転差の上限倍率 00024 #define MEDIUM_SPEED_SECTION 1.65f //中間速度の左右回転差の上限倍率 00025 #define LOW_SPEED_SECTION 2.00f //最低速度の左右回転差の上限倍率 00026 #define HL_BREAK_DISANCE 200000 //高速度で次のカーブが低速カーブのときのブレーキング距離[um] 00027 #define HM_BREAK_DISANCE 150000 //高速度で次のカーブが中間速度カーブのときのブレーキング距離[um] 00028 #define ML_BREAK_DISANCE 100000 //中間速度で次のカーブが低速カーブのときのブレーキング距離[um] 00029 00030 00031 00032 //////各種PD調整 00033 //モータ速度のゲイン関連(むやみに調整しない) 00034 #define M_KP 0.002f //P(比例)制御成分 00035 #define M_KD 0.001f //D(微分)制御成分 00036 00037 //フォトリフレクタのゲイン(外側に行くにつれ値を何倍させたいか調整する。) 00038 #define S_K1 1.0f //float演算させる値には必ずfを付ける 00039 #define S_K2 2.0f //2倍 00040 #define S_K3 4.0f //3倍 00041 00042 00043 //ラインセンサ各種制御成分 00044 //P成分 00045 #define S_KP_LOW 2.0f //低速P成分 00046 #define S_KP_MEDIUM 1.5f //中速P成分 00047 #define S_KP_HIGH 1.0f //高速P成分 00048 00049 #define S_KP_DEFAULT_HIGH 1.5f //3走目P成分 00050 00051 //D成分 00052 #define S_KD_LOW 6.0f //低速D成分 00053 #define S_KD_MEDIUM 3.0f //中速D成分 00054 #define S_KD_HIGH 2.0f //高速D成分 00055 00056 #define S_KD_DEFAULT_HIGH 1.0f //3走目D成分 00057 //////////☆★☆★☆★☆★☆★//////////////
Generated on Thu Jul 14 2022 21:31:15 by
1.7.2