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:
- 28:47e9531a3a9d
- Parent:
- 26:331e77bb479b
- Child:
- 30:c596a0f5d685
--- a/TVDCTRL.h Sat Jul 01 08:45:37 2017 +0000 +++ b/TVDCTRL.h Mon Jul 03 12:03:34 2017 +0000 @@ -24,13 +24,14 @@ BRAKE }; -const int MAX_MOTOR_TORQUE_POWER = 0xFFFF; //LSB : 45/65535 = 0.686655[mNm] -const int MAX_MOTOR_TORQUE_REGENERATIVE = (int)(MAX_MOTOR_TORQUE_POWER / 45.0 * (-15.0)); //LSB : 45/65535 = 0.686655[mNm] -const int MAX_OUTPUT_TORQUE_POWER = (int)(MAX_MOTOR_TORQUE_POWER * 1.0); //出力最大値 -const int MAX_OUTPUT_TORQUE_REGENERATIVE = (int)(MAX_MOTOR_TORQUE_REGENERATIVE * 1.0); //出力最大値 -const int MAX_DISTRIBUTION_TORQUE = (int)(0xFFFF/45.0 * 15.0); //出力MAX時 +const double LSB_MOTOR_TORQUE = 0.015; //Motor torque LSB(15[mNm]) +const int MAX_MOTOR_TORQUE_POWER = (int)(45.0 / LSB_MOTOR_TORQUE); //Motor max torque:45.0[Nm](digital value:3000) +const int MAX_MOTOR_TORQUE_REGENERATIVE = (int)(-15.0 / LSB_MOTOR_TORQUE); //Motor max torque:-15.0[Nm](digital value:1000) +const int MAX_OUTPUT_TORQUE_POWER = (int)(MAX_MOTOR_TORQUE_POWER * 1.0); //出力最大値 +const int MAX_OUTPUT_TORQUE_REGENERATIVE = (int)(MAX_MOTOR_TORQUE_REGENERATIVE * 1.0); //出力最大値 +const int MAX_DISTRIBUTION_TORQUE = (int)(15.0 / LSB_MOTOR_TORQUE); //出力MAX時 (digital value:1000) -const int MIN_INNERWHEEL_MOTOR_TORQUE = (int)(0xFFFF/45.0 * 2.0); //内輪側モーターの最低トルク(MITSUBA社MC仕様対策) +const int MIN_INNERWHEEL_MOTOR_TORQUE = (int)(2.0 / LSB_MOTOR_TORQUE); //内輪側モーターの最低トルク(MITSUBA社MC仕様対策) const int APS_MIN_POSITION =(int)(0xFFFF/3.3 * 1.0); //"正常時"最小入力電圧 const int APS_MAX_POSITION =(int)(0xFFFF/3.3 * 2.0); //"正常時"最大入力電圧 @@ -76,11 +77,14 @@ void initTVD(void); void driveTVD(int TVDmode, bool isRedyToDrive); -int getPulseCounter(SelectMotor rl); +int getPulseCounter(Select rl); float getVelocity(void); int getCurrentSensor(int sensor); int getRawSensor(int sensor); void getCurrentErrCount(struct errCounter_t *ptr); int calcRequestTorque(void); +int getMotorTorque(Select rl); +int isBrakeOn(void); +int getRPS(Select rl, bool switchWheel=false); #endif \ No newline at end of file