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:
- 55:e9ca699bec57
- Parent:
- 51:640198055ed6
- Child:
- 59:7fdf1168c5c3
--- a/TVDCTRL.h Mon Jan 08 05:29:14 2018 +0000 +++ b/TVDCTRL.h Mon Jan 08 10:06:12 2018 +0000 @@ -52,21 +52,21 @@ const int ERRCOUNTER_DECISION = 100; //エラーカウンタ閾値 //DACは12bit仕様だが一旦16bitに統一してから12bitに変換する -const int DACOUTPUT_MIN =(int)(0xFFFF/5.0 * 0.3); //MCの最低入力電圧 -const int DACOUTPUT_MAX =(int)(0xFFFF/5.0 * 4.7); //MCの最大入力電圧 +const int DACOUTPUT_MIN =(int)(0xFFFF/5.0 * 0.3 + 0.5); //MCの最低入力電圧 +const int DACOUTPUT_MAX =(int)(0xFFFF/5.0 * 4.7 + 0.5); //MCの最大入力電圧 const int DACOUTPUT_VALID_RANGE =DACOUTPUT_MAX - DACOUTPUT_MIN; //実質有効電圧範囲 -const int ZERO_TORQUE_VOLTAGE_NEUTRAL =(int)(0xFFFF/5.0 * 2.5); //0トルク時電圧(ニュートラル位置) -const int ZERO_TORQUE_VOLTAGE_P =(int)(0xFFFF/5.0 * 2.74); //0トルク時電圧(力行側) -const int ZERO_TORQUE_VOLTAGE_REG =(int)(0xFFFF/5.0 * 2.26); //0トルク時電圧(回生側) +const int ZERO_TORQUE_VOLTAGE_NEUTRAL =(int)(0xFFFF/5.0 * 2.5 + 0.5); //0トルク時電圧(ニュートラル位置) +const int ZERO_TORQUE_VOLTAGE_P =(int)(0xFFFF/5.0 * 2.74 + 0.5); //0トルク時電圧(力行側) +const int ZERO_TORQUE_VOLTAGE_REG =(int)(0xFFFF/5.0 * 2.26 + 0.5); //0トルク時電圧(回生側) -const int LINEAR_REGION_TORQUE_POWER =(int)(2.5 / LSB_MOTOR_TORQUE); //制御信号一定でトルクがrpmに対して非線形となる領域の境界値(トルク値:力行) -const int LINEAR_REGION_VOLTAGE_POWER =(int)(0xFFFF/5.0 * 3.25); //制御信号一定でトルクがrpmに対して非線形となる領域の境界値(出力電圧値:力行) -const int MAX_REVOLUTION_TORQUE_POWER =(int)(13.5 / LSB_MOTOR_TORQUE); //最高回転数における最大出力トルク +const int LINEAR_REGION_TORQUE_POWER =(int)(2.5 / LSB_MOTOR_TORQUE + 0.5); //制御信号一定でトルクがrpmに対して非線形となる領域の境界値(トルク値:力行) +const int LINEAR_REGION_VOLTAGE_POWER =(int)(0xFFFF/5.0 * 3.25 + 0.5); //制御信号一定でトルクがrpmに対して非線形となる領域の境界値(出力電圧値:力行) +const int MAX_REVOLUTION_TORQUE_POWER =(int)(13.5 / LSB_MOTOR_TORQUE + 0.5); //最高回転数における最大出力トルク -const int LINEAR_REGION_TORQUE_REGENERATIVE =(int)(-1.7 / LSB_MOTOR_TORQUE); //制御信号一定でトルクがrpmに対して非線形となる領域の境界値(トルク値:回生) -const int LINEAR_REGION_VOLTAGE_REGENERATIVE =(int)(0xFFFF/5.0 * 1.28); //制御信号一定でトルクがrpmに対して非線形となる領域の境界値(出力電圧値:回生) -const int MAX_REVOLUTION_TORQUE_REGENERATIVE =(int)(-5.7 / LSB_MOTOR_TORQUE); //最高回転数における最大出力トルク +const int LINEAR_REGION_TORQUE_REGENERATIVE =(int)(-1.7 / LSB_MOTOR_TORQUE + 0.5); //制御信号一定でトルクがrpmに対して非線形となる領域の境界値(トルク値:回生) +const int LINEAR_REGION_VOLTAGE_REGENERATIVE =(int)(0xFFFF/5.0 * 1.28 + 0.5); //制御信号一定でトルクがrpmに対して非線形となる領域の境界値(出力電圧値:回生) +const int MAX_REVOLUTION_TORQUE_REGENERATIVE =(int)(-5.7 / LSB_MOTOR_TORQUE + 0.5); //最高回転数における最大出力トルク //++++++++++++++++++++++++++++++ //モータトルク演算は右モータ特性を採用 //++++++++++++++++++++++++++++++