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.cpp
- Revision:
- 4:d7778cde0aff
- Parent:
- 3:821e2f07a260
- Child:
- 5:a5462959b3ab
--- a/TVDCTRL.cpp Sun Jul 24 08:02:18 2016 +0000 +++ b/TVDCTRL.cpp Sun Jul 24 08:23:56 2016 +0000 @@ -211,7 +211,7 @@ //Do not use "printf" in interrupt!!! static int preTime=0; int currentTime = RightPulseTimer.read_us(); - + gRightPulseTime = currentTime - preTime; if(gRightPulseTime < 40) //25000rpm上限より早い場合 @@ -334,7 +334,7 @@ } else { pulseTime = getPulseTime(rl); rpm = (int)((1.0/pulseTime) * 1000000.0 * 60.0); //pulseTime:[ms] - + if(rpm < 3000) { //3000rpm未満は回転数による出力制限がない領域 outputVoltage = interpolateLinear(torque, MAX_MOTOR_TORQUE); //outputVoltage = (int)((DACOUTPUT_MAX-LINEAR_REGION_VOLTAGE)/(MAX_MOTOR_TORQUE-LINEAR_REGION_TORQUE) * torque) + LINEAR_REGION_VOLTAGE; @@ -355,7 +355,7 @@ //outputVoltage = (int)((float)(DACOUTPUT_MAX-LINEAR_REGION_VOLTAGE)/(MAX_REVOLUTION_TORQUE-LINEAR_REGION_TORQUE) * torque) + LINEAR_REGION_VOLTAGE; } } else { - outputVoltage = 0; //回転上限のため出力停止 + //outputVoltage = 0; //回転上限のため出力停止 } } @@ -400,10 +400,10 @@ distributionTor = distributeTorque(getVelocity(), MAX_STEER_ANGLE / M_PI * getSteerAngle()); //トルク分配量計算 distributionTor /= 2.0f; - + //デバッグ終わったらこの行は消すこと!!!!! distributionTor=0; - + if(requestTorque + distributionTor > MAX_OUTPUT_TORQUE) //片モーター上限時最大値にクリップ torqueHigh = MAX_OUTPUT_TORQUE; else