Selaa lähdekoodia

关闭车速限功率计算,采用传动比控速方案。

Deyauo 4 kuukautta sitten
vanhempi
sitoutus
bb18673bc4

+ 5 - 4
1.FrameLayer/Source/TimeTask_Event.c

@@ -104,15 +104,16 @@ void  Event_1ms(void)
     bikebrake_voBikeBrakeDetect();
 
     /* 转把根据车速限制功率 */
-    ThrottlePowerLimitCal((ass_stCadAssParaPro.uwAssitMode == 7), MC_RunInfo.BikeSpeed, ass_ParaCong.uwThrottleMaxSpdKmH * 10,
-                          scm_stMotoPwrInLpf.sY.sw.hi, pwr_stPwrLimOut2.swMotorPwrLimitActualPu, &Throttle_PowerLimit_K);
-
+    #if 0
+    ThrottlePowerLimitCal((ass_stCadAssParaPro.uwAssitMode == 7), MC_RunInfo.BikeSpeed, (ass_ParaCong.uwThrottleMaxSpdKmH - 5) * 10,
+                          scm_stMotoPwrInLpf.slY.sw.hi, pwr_stPwrLimOut2.swMotorPwrLimitActualPu, &Throttle_PowerLimit_K);
+    #endif
     /* 电池电量限电流 */
     AssistCurrentLimitAccordingBMS(MC_RunInfo.SOC);
 
     /* 限制母线电流 */
     AssCurLimAccordIdc(adc_stUpOut.uwIbusAvgLpfPu);
-#if(BIKE_OXFORD_EN==0)cd
+#if(BIKE_OXFORD_EN==0)
     if(power_stPowStateOut.powerstate != POWER_ON_END)
     {
        cp_stBikeRunInfoPara.uwBikeGear = 0;

+ 5 - 5
3.BasicFunction/Source/BikeRatioCal.c

@@ -58,10 +58,10 @@ void BikeRatioCal_Process(UWORD MotorSpeed, UWORD Cadence, UWORD BikeSpeedRpm, U
         //计算结果滤波
         p_Bike_RatioCal->RatioFltSum += ((p_Bike_RatioCal->RatioPer << 10) - p_Bike_RatioCal->RatioFltSum) >> 8;
         p_Bike_RatioCal->RatioFlt = p_Bike_RatioCal->RatioFltSum >> 10;
-        //目标值
-        if((p_Bike_RatioCal->RatioResult + 2) > p_Bike_RatioCal->RatioFlt)
-            p_Bike_RatioCal->RatioResult -= 2;
-        else if((p_Bike_RatioCal->RatioResult + 2) < p_Bike_RatioCal->RatioFlt)
-            p_Bike_RatioCal->RatioResult += 2;
+        //目标值
+        if((p_Bike_RatioCal->RatioResult + 5) > p_Bike_RatioCal->RatioFlt)
+            p_Bike_RatioCal->RatioResult -= 5;
+        else if((p_Bike_RatioCal->RatioResult + 10) < p_Bike_RatioCal->RatioFlt)
+            p_Bike_RatioCal->RatioResult += 10;
     }
 }

+ 6 - 6
3.BasicFunction/Source/CadAssist.c

@@ -941,7 +941,7 @@ void ass_voAssistCmdDeal(void)
             {
                 tmp_slAssistSpdCmd = (SLONG)ass_stCadAssCoef.swKmhToMSpdPu*(SLONG)ass_MaxSpeed.MaxBikeSpeed>> 4;
             }
-            #if 0
+            #if 1
             tmp_slAssistSpdCmd = (tmp_slAssistSpdCmd << 10) / Bike_RatioCalParam.RatioResult; //前后飞轮传动比
             #endif
         #else
@@ -954,7 +954,7 @@ void ass_voAssistCmdDeal(void)
             {
                 tmp_slAssistSpdCmd = (SLONG)ass_stCadAssCoef.swKmhToMSpdPu*(SLONG)ass_stCadAssCoef.uwThrottleMaxBikeSpeed >> 4;
             }
-            #if 0
+            #if 1
             tmp_slAssistSpdCmd = (tmp_slAssistSpdCmd << 10) / Bike_RatioCalParam.RatioResult; //前后飞轮传动比
             #endif
          #endif
@@ -1893,13 +1893,13 @@ void ThrottlePowerLimitCal(BOOL ThrottleModeFlag, UWORD BikeSpeed, UWORD BikeSpe
                 {
                     if(BikeSpeed > (BikeSpeedLimit + 10))
                     {
-                        //if(ThrottlePowerLimit->K_Result > ThrottlePowerLimit->K_DecStep)
-                        //    ThrottlePowerLimit->K_Result -= ThrottlePowerLimit->K_DecStep;
+                        if(ThrottlePowerLimit->K_Result > ThrottlePowerLimit->K_DecStep)
+                            ThrottlePowerLimit->K_Result -= ThrottlePowerLimit->K_DecStep;
                     }
                     else if(BikeSpeed < (BikeSpeedLimit - 10))
                     {
-                        //if(ThrottlePowerLimit->K_Result < 16384)
-                        //    ThrottlePowerLimit->K_Result += ThrottlePowerLimit->K_AccStep;
+                        if(ThrottlePowerLimit->K_Result < 16384)
+                            ThrottlePowerLimit->K_Result += ThrottlePowerLimit->K_AccStep;
                     }
                 }
                 break;

+ 1 - 1
3.BasicFunction/Source/canAppl.c

@@ -1105,7 +1105,7 @@ void Can_GearSt_switch(void)
 {
     cp_stBikeRunInfoPara.uwBikeGearLast = cp_stBikeRunInfoPara.uwBikeGear;
     
-    if (MC_WorkMode == 1) // 配置模式不自动关闭助力
+    if (MC_WorkMode != 0) // 配置模式和调试模式不自动关闭助力
     {
         ulOBC_ComTimeOutCount = cp_ulSystickCnt;
     }