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:
- 5:a5462959b3ab
- Parent:
- 3:821e2f07a260
- Child:
- 6:26fa8c78500e
diff -r d7778cde0aff -r a5462959b3ab TVDCTRL.h --- a/TVDCTRL.h Sun Jul 24 08:23:56 2016 +0000 +++ b/TVDCTRL.h Mon Jul 25 07:12:49 2016 +0000 @@ -41,7 +41,7 @@ }; #define ratioLPF 0.456f //CutOff:10Hz -#define ratioLPF_V 0.456f //CutOff:10Hz(sampling:10ms) +#define ratioLPF_V 0.061f //CutOff:10Hz(sampling:10ms) #define M_PI 3.1415f //[-] #define TVD_GEAR_RATIO 10.0f //[-] #define TIRE_DIAMETER 0.533f //[m] @@ -60,10 +60,10 @@ LEFT_MOTOR }; -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_MOTOR_TORQUE = 0xFFFF; //LSB : 45/65535 = 0.686655[mNm] +const int MAX_OUTPUT_TORQUE = (int)(MAX_MOTOR_TORQUE * 0.7); //出力最大値 const float MAX_DISTRIBUTION_TORQUE = (MAX_OUTPUT_TORQUE*0.8); -const float MAX_STEER_ANGLE = (float)(M_PI/180.0 * 25.0); //[-] +const float MAX_STEER_ANGLE = (float)(M_PI/180.0 * 25.0); //[-] const int APS_MIN_POSITION =(int)(0xFFFF/3.3 * 1.0); //"正常時"最小入力電圧 const int APS_MAX_POSITION =(int)(0xFFFF/3.3 * 2.0); //"正常時"最大入力電圧 @@ -88,12 +88,15 @@ const float FIX_DACOUTFORM =(float)((0xFFF/3.3 * 2.5)/0xFFFF); +const int MAX_PULSE_TIME =5000; //12000rpmが最高回転数 + void loadSensorsLPF(void); int checkSensorPlausibility(void); void initTVD(void); void driveTVD(void); +int getPulseTime(SelectMotor rl); float getVelocity(void); int loadCurrentSensor(int sensor); int loadRawSensor(int sensor);