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 TVDctrller2017_brdRev1_ver6 by
Diff: TVDCTRL.h
- Revision:
- 18:b7c362c8f0fd
- Parent:
- 16:7afd623ef48a
- Child:
- 19:571a4d00b89c
--- a/TVDCTRL.h Tue Aug 09 20:59:59 2016 +0000 +++ b/TVDCTRL.h Wed Aug 10 11:21:47 2016 +0000 @@ -17,6 +17,7 @@ ,19661 }; +//エラーカウンタ型 struct errCounter_t { int apsUnderVolt; //aps電圧不足 int apsExceedVolt; //aps電圧超過 @@ -28,14 +29,14 @@ int brakeOverRide; //accel-brake同時踏み }; -#define ratioLPF 0.2679f //CutOff:5Hz -#define ratioLPF_V 0.061f //CutOff:1Hz(sampling:10ms) +#define ratioLPF 0.2679f //各センサLPF:CutOff:5Hz +#define ratioLPF_V 0.061f //車速LPF:CutOff:1Hz(sampling:10ms) #define M_PI 3.1415f //[-] #define TVD_GEAR_RATIO 10.0f //[-] #define TIRE_DIAMETER 0.533f //[m] #define WHEEL_BASE 1.760f //[m] +#define TREAD 1.3f //[m] #define STABIRITY_FACTOR 0.01f //[-] -#define TREAD 1.3f //[m] enum { APS_PRIMARY=0, @@ -49,11 +50,11 @@ }; const int MAX_MOTOR_TORQUE = 0xFFFF; //LSB : 45/65535 = 0.686655[mNm] -const int MAX_OUTPUT_TORQUE = (int)(MAX_MOTOR_TORQUE * 0.7); //出力最大値 -const int MAX_DISTRIBUTION_TORQUE = (int)(0xFFFF/45.0 * 5.0); +const int MAX_OUTPUT_TORQUE = (int)(MAX_MOTOR_TORQUE * 0.7);//出力最大値 +const int MAX_DISTRIBUTION_TORQUE = (int)(0xFFFF/45.0 * 25.0); const float MAX_STEER_ANGLE = (float)(M_PI/180.0 * 25.0); //[-] -const int MIN_INNERWHEEL_TORQUE = (int)(0xFFFF/45.0 * 2.0); //内輪の最低トルク(MITSUBA社MC仕様対策) +const int MIN_INNERWHEEL_MOTOR_TORQUE = (int)(0xFFFF/45.0 * 2.0); //内輪側モーターの最低トルク(MITSUBA社MC仕様対策) const int APS_MIN_POSITION =(int)(0xFFFF/3.3 * 1.0); //"正常時"最小入力電圧 const int APS_MAX_POSITION =(int)(0xFFFF/3.3 * 2.0); //"正常時"最大入力電圧 @@ -72,14 +73,15 @@ //DACは12bit仕様だが一旦16bitに統一してから12bitに変換する const int DACOUTPUT_MIN =(int)(0xFFFF/3.3 * 0.49); //MCの最低入力電圧 -const int DACOUTPUT_MAX =(int)(0xFFFF/3.3 * 2.5); //MCの最大入力電圧 +const int DACOUTPUT_MAX =(int)(0xFFFF/3.3 * 2.0); //MCの最大入力電圧 const int DACOUTPUT_VALID_RANGE =DACOUTPUT_MAX - DACOUTPUT_MIN; //実質有効電圧範囲 const int LINEAR_REGION_TORQUE =(int)(MAX_MOTOR_TORQUE/45.0 * 2.5); //トルクに回転数が影響しない領域の境界値(トルク値) const int LINEAR_REGION_VOLTAGE =(int)(0xFFFF/3.3 * 1.0); //トルクに回転数が影響しない領域の境界値(出力電圧値) const int MAX_REVOLUTION_TORQUE =(int)(MAX_MOTOR_TORQUE/45.0 * 13.5); //最高回転数における最大出力トルク -const int MAX_PULSE_TIME =5000; //12000rpmが最高回転数 +const int MIN_PULSE_TIME =5000; //12000rpm時(最高回転数)のパルス時間(最小値) +const int MAX_PULSE_TIME =150000; //最大パルス時間(about:4.02km/h) void initTVD(void); void driveTVD(void);