|
@@ -594,6 +594,7 @@ static void AssitCuvApplPerVolt(void) /* parasoft-suppress METRICS-28 "本项目
|
|
|
ass_stCalCoef.uwStartupGain = ass_stParaSet.uwStartupCoef ; //零速启动助力比计算
|
|
|
ass_stCalCoef.uwStartupCruiseGain = ass_stParaSet.uwStartupCruiseCoef ; //带速启动助力比计算
|
|
|
|
|
|
+ swPreCurrentPu = (SWORD)(((SLONG)swPreCurrentPu * 990 )>>10);
|
|
|
/* Assist FSM Control */
|
|
|
switch (Ass_FSM)
|
|
|
{
|
|
@@ -608,7 +609,7 @@ static void AssitCuvApplPerVolt(void) /* parasoft-suppress METRICS-28 "本项目
|
|
|
swPreCurrentPu = 0;
|
|
|
}
|
|
|
|
|
|
- if((ass_stCalCoef.swAss2SpdCNT > 3000) || ((ass_stCalIn.uwcadance < StopCad) && (ass_stCalIn.uwtorquePer <= ass_stCalCoef.uwAssStopThreshold))) //踏频小于0.1 hz
|
|
|
+ if((ass_stCalCoef.swAss2SpdCNT > 3000) || (ass_stCalIn.uwcadance == 0) || ((ass_stCalIn.uwcadance < StopCad) && (ass_stCalIn.uwtorquePer <= ass_stCalCoef.uwAssStopThreshold))) //踏频小于0.1 hz
|
|
|
{
|
|
|
Ass_FSM = StopAssit;
|
|
|
ass_stCalCoef.swAss2SpdCNT = 0;
|
|
@@ -741,7 +742,7 @@ static void AssitCuvApplPerVolt(void) /* parasoft-suppress METRICS-28 "本项目
|
|
|
|
|
|
|
|
|
/* Switch to ReduceCurrent FSM */
|
|
|
- if(((ass_stCalIn.uwcadance < StopCad) && (ass_stCalIn.uwtorquePer <= ass_stCalCoef.uwAssStopThreshold)) || (ass_stCalIn.uwGearSt == 0) || (BikeBrake_blGetstate() == TRUE) || (bikegearsensor_blBikeGetState() == TRUE))
|
|
|
+ if(((ass_stCalIn.uwcadance < StopCad) && (ass_stCalIn.uwtorquePer <= ass_stCalCoef.uwAssStopThreshold)) || (ass_stCalIn.uwcadance == 0) || (ass_stCalIn.uwGearSt == 0) || (BikeBrake_blGetstate() == TRUE) || (bikegearsensor_blBikeGetState() == TRUE))
|
|
|
{
|
|
|
/* When CandanceFreq=0 or BikeGear=0*/
|
|
|
ass_stCalCoef.swAss2SpdCNT = 0;
|
|
@@ -831,7 +832,7 @@ static void AssitCuvApplPerVolt(void) /* parasoft-suppress METRICS-28 "本项目
|
|
|
}
|
|
|
|
|
|
/* Switch to ReduceCurrent FSM */
|
|
|
- if(((ass_stCalIn.uwcadance < StopCad) && (ass_stCalIn.uwtorquePer <= ass_stCalCoef.uwAssStopThreshold)) || (ass_stCalIn.uwGearSt == 0) || (BikeBrake_blGetstate() == TRUE) || (bikegearsensor_blBikeGetState() == TRUE))
|
|
|
+ if(((ass_stCalIn.uwcadance < StopCad) && (ass_stCalIn.uwtorquePer <= ass_stCalCoef.uwAssStopThreshold)) || (ass_stCalIn.uwcadance == 0) || (ass_stCalIn.uwGearSt == 0) || (BikeBrake_blGetstate() == TRUE) || (bikegearsensor_blBikeGetState() == TRUE))
|
|
|
{
|
|
|
/* When CandanceFreq=0 or BikeGear=0*/
|
|
|
ass_stCalOut.blTorqPIFlg = FALSE;
|
|
@@ -1002,14 +1003,14 @@ static void AssitCuvApplPerVolt(void) /* parasoft-suppress METRICS-28 "本项目
|
|
|
}
|
|
|
ass_stCalOut.swTorRefTarget = ass_stCalOut.swTorAss2CurrentTemp + ass_stCalOut.swCadAss2CurrentTemp;
|
|
|
ass_stCalOut.swTorRefEnd = ass_stCalOut.swTorRefTarget;
|
|
|
-// if(swPreCurrentPu < ass_CalOut.swTorRefEnd)
|
|
|
-// {
|
|
|
+ if(swPreCurrentPu < ass_stCalOut.swTorRefEnd)
|
|
|
+ {
|
|
|
ass_stCalOut.swTorAssistCurrentTemp = ass_stCalIn.swDirection *ass_stCalOut.swTorRefEnd;
|
|
|
-// }
|
|
|
-// else
|
|
|
-// {
|
|
|
-// ass_CalOut.swTorAssistCurrentTemp = (ULONG)ass_CalIn.swDirection * swPreCurrentPu;
|
|
|
-// }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ ass_stCalOut.swTorAssistCurrentTemp = (ULONG)ass_stCalIn.swDirection * swPreCurrentPu;
|
|
|
+ }
|
|
|
|
|
|
break;
|
|
|
|