|
@@ -229,14 +229,14 @@ void Event_10ms(void)
|
|
|
// Signal_detect();
|
|
|
|
|
|
/* Use upper computer */
|
|
|
-// if(cp_stFlg.RotateDirectionSelect == ForwardRotate)
|
|
|
-// {
|
|
|
-// uart_slSpdRefRpm = ((SLONG)MC_MotorSPD_rpm_Percent*5000)/100;
|
|
|
-// }
|
|
|
-// else if(cp_stFlg.RotateDirectionSelect == BackwardRotate)
|
|
|
-// {
|
|
|
-// uart_slSpdRefRpm = -((SLONG)MC_MotorSPD_rpm_Percent*5000)/100;
|
|
|
-// }
|
|
|
+ if(cp_stFlg.RotateDirectionSelect == ForwardRotate)
|
|
|
+ {
|
|
|
+ uart_slSpdRefRpm = ((SLONG)MC_MotorSPD_rpm_Percent*5000)/100;
|
|
|
+ }
|
|
|
+ else if(cp_stFlg.RotateDirectionSelect == BackwardRotate)
|
|
|
+ {
|
|
|
+ uart_slSpdRefRpm = -((SLONG)MC_MotorSPD_rpm_Percent*5000)/100;
|
|
|
+ }
|
|
|
|
|
|
/* bikespeed closeloop control */
|
|
|
// bikemotorspdref();
|
|
@@ -295,23 +295,23 @@ void Event_200ms(void)
|
|
|
bikespeed_voGetBikeSpeedPwrError(adc_stUpOut.uwU5VPu);
|
|
|
|
|
|
/* Bike faults 200ms detect */
|
|
|
-// if((cp_stFlg.RunModelSelect == MountainBIKE) || (cp_stFlg.RunModelSelect == CityBIKE))
|
|
|
-// {
|
|
|
-// alm_stBikeIn.uwTroqReg = hw_uwADC0[7];
|
|
|
-// alm_stBikeIn.uwTroqPu = torsensor_stTorSensorOut.uwTorquePu;
|
|
|
-// alm_stBikeIn.blBikeSpdOvrFlg = bikespeed_stFreGetOut.blBikeSpeedSensorPwrErrorFlg;
|
|
|
-// alm_stBikeIn.blCadenceFreqOvrFlg = cadence_stFreGetOut.blCadenceSensorErrorFlg;
|
|
|
-// alm_stBikeIn.swMotorSpdDir = ass_CalIn.swDirection;
|
|
|
-// alm_stBikeIn.swMotorSpdPu = scm_stSpdFbkLpf.slY.sw.hi;
|
|
|
-// alm_stBikeIn.uwBikeSpdPu = bikespeed_stFreGetOut.uwFrequencyPu;
|
|
|
-// alm_stBikeIn.uwCadenceFreqPu = cadence_stFreGetOut.uwFrequencyPu;
|
|
|
-// alm_stBikeIn.uwMotorNTCReg = adc_stUpOut.MotorTempReg;
|
|
|
-// alm_stBikeIn.uwPCBNTCReg = adc_stUpOut.PCBTempReg;
|
|
|
-// alm_stBikeIn.uwThrottleReg = adc_stUpOut.uwThrottleReg;
|
|
|
-// alm_stBikeIn.blThrottleExistFlg = FALSE;
|
|
|
-// alm_stBikeIn.blMotorNTCExistFlg = FALSE;
|
|
|
-// alm_voDetec200MS(&alm_stBikeIn, &alm_stDetect200MSCoef);
|
|
|
-// }
|
|
|
+ if((cp_stFlg.RunModelSelect == MountainBIKE) || (cp_stFlg.RunModelSelect == CityBIKE))
|
|
|
+ {
|
|
|
+ alm_stBikeIn.uwTroqReg = torsensor_stTorSensorOut.uwTorqueReg;
|
|
|
+ alm_stBikeIn.uwTroqPu = torsensor_stTorSensorOut.uwTorqueLPFPu;//torsensor_stTorSensorOut.uwTorquePu;
|
|
|
+ alm_stBikeIn.blBikeSpdOvrFlg = bikespeed_stFreGetOut.blBikeSpeedSensorPwrErrorFlg;
|
|
|
+ alm_stBikeIn.blCadenceFreqOvrFlg = cadence_stFreGetOut.blCadenceSensorErrorFlg;
|
|
|
+ alm_stBikeIn.swMotorSpdDir = ass_CalIn.swDirection;
|
|
|
+ alm_stBikeIn.swMotorSpdPu = scm_stSpdFbkLpf.slY.sw.hi;
|
|
|
+ alm_stBikeIn.uwBikeSpdPu = bikespeed_stFreGetOut.uwFrequencyPu;
|
|
|
+ alm_stBikeIn.uwCadenceFreqPu = cadence_stFreGetOut.uwFrequencyPu;
|
|
|
+ alm_stBikeIn.uwMotorNTCReg = adc_stUpOut.MotorTempReg;
|
|
|
+ alm_stBikeIn.uwPCBNTCReg = adc_stUpOut.PCBTempReg;
|
|
|
+ alm_stBikeIn.uwThrottleReg = adc_stUpOut.uwThrottleReg;
|
|
|
+ alm_stBikeIn.blThrottleExistFlg = FALSE;
|
|
|
+ alm_stBikeIn.blMotorNTCExistFlg = FALSE;
|
|
|
+ alm_voDetec200MS(&alm_stBikeIn, &alm_stDetect200MSCoef);
|
|
|
+ }
|
|
|
|
|
|
if (switch_flg.SysFault_Flag == TRUE)
|
|
|
{
|