Deyauo 5 месяцев назад
Родитель
Сommit
b0f07015b6

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

@@ -447,6 +447,7 @@ void event_voAssCmd(void)
             /* 力矩中轴助力模式判断 */
             if(cp_stBikeRunInfoPara.uwBikeGear > 0)
             {   
+#if 0 //正常模式
                 if((cp_stBikeRunInfoPara.uwBikeGear == 0x22)||(bikethrottle_stBikeThrottleOut.uwThrottlePercent > 250))
                 {
                     /* 力矩中轴速度模式 */
@@ -457,6 +458,9 @@ void event_voAssCmd(void)
                     /* 力矩中轴力矩助力模式 */
                     event_enMode = TorqAss;
                 }
+#else //仪表挡位控制转速
+                event_enMode = SpdAss;
+#endif
             }
             else 
             {

+ 32 - 5
3.BasicFunction/Source/CadAssist.c

@@ -874,6 +874,7 @@ void ass_voAssistCmdDeal(void)
     /** Record Last assist mode */
     ass_stCadAssParaPro.uwAssitModeLast = ass_stCadAssParaPro.uwAssitMode;
     
+#if 0
     /** Cart Comand */
     if(ass_stCadAssParaIn.uwGearSt == 0x22)
     {
@@ -892,8 +893,8 @@ void ass_voAssistCmdDeal(void)
          }
          else
          {
-        tmp_slAssistSpdCmd = (SLONG)ass_stCadAssCoef.swKmhToMSpdPu*(SLONG)ass_stCadAssCoef.uwCartMaxBikeSpeed  >> 4;    
-    }
+            tmp_slAssistSpdCmd = (SLONG)ass_stCadAssCoef.swKmhToMSpdPu*(SLONG)ass_stCadAssCoef.uwCartMaxBikeSpeed  >> 4;
+         }
     }
     else if((ass_stCadAssParaIn.uwGearSt > 0)&&(ass_stCadAssParaIn.uwGearSt <= 5))
     {
@@ -901,7 +902,7 @@ void ass_voAssistCmdDeal(void)
         if(ass_stCadAssParaIn.uwThrottlePercent > 250)
         {
             ass_stCadAssParaPro.uwAssitMode = 7;
-        #if(THROTTLEGEAR !=0)
+        #if(THROTTLEGEAR != 0)
                 if(ass_stCadAssParaIn.uwGearSt == 1)
                     {
                         ass_MaxSpeed.MaxBikeSpeed =   ass_MaxSpeed.uwGearOne;
@@ -950,7 +951,7 @@ void ass_voAssistCmdDeal(void)
             {
                 #if(INTELLIGENCADGEAR_EN!=0) 
                 tmp_slAssistCadSpdCmd = (SLONG)ass_voCadCmdDeal();  //Q14
-#endif
+                #endif
                 /** Assist command,gear 1 to 5 */
                 if(ass_stCadAssParaIn.uwGearSt == 1)
                 {
@@ -1085,7 +1086,33 @@ void ass_voAssistCmdDeal(void)
         ass_stCadAssParaPro.uwAssitMode = 0;
         tmp_slAssistSpdCmd = 0;                 /**< Q15 */
     }
-    
+#else //仪表挡位控制转速
+    if((ass_stCadAssParaIn.uwGearSt >= 0x01) && (ass_stCadAssParaIn.uwGearSt <= 0x05) )
+    {
+        ass_stCadAssParaPro.uwAssitMode = 6;
+        if(ass_stCadAssParaIn.uwGearSt == 0x01)
+            MC_MotorSPD_rpm_Percent = 20;
+        else if(ass_stCadAssParaIn.uwGearSt == 0x02)
+            MC_MotorSPD_rpm_Percent = 40;
+        else if(ass_stCadAssParaIn.uwGearSt == 0x03)
+            MC_MotorSPD_rpm_Percent = 60;
+        else
+            MC_MotorSPD_rpm_Percent = 100;
+        tmp_slAssistSpdCmd = (SLONG)ass_stCadAssCoef.swKmhToMSpdPu*(SLONG)ass_stCadAssCoef.uwThrottleMaxBikeSpeed >> 4;
+        tmp_slAssistSpdCmd= ((SLONG)MC_MotorSPD_rpm_Percent * tmp_slAssistSpdCmd) / 100;
+
+        if(MC_MotorSPD_rpm_Percent <= 2)
+        {
+            tmp_slAssistSpdCmd = 0;
+            ass_stCadAssParaPro.uwAssitMode = 0;
+        }
+    }
+    else
+    {
+        ass_stCadAssParaPro.uwAssitMode = 0;
+        tmp_slAssistSpdCmd = 0;                 /**< Q15 */
+    }
+#endif
     /** Stop Assist when Bike Brake */
     if((BikeBrake_blGetstate() == TRUE) ||(BMS_RunInfo.Status.Status_Bit.Charge!=0))
     {

+ 2 - 2
4.BasicHardwSoftwLayer/2.BasicSoftwLayer/Include/syspar.h

@@ -43,7 +43,7 @@ Update Time
 
 #define IPM_VOLTAGE_36V         0x0
 #define IPM_VOLTAGE_48V         0x1
-#define IPM_VOLTAGE_SEL         IPM_VOLTAGE_36V
+#define IPM_VOLTAGE_SEL         IPM_VOLTAGE_48V
 
 #define BIKE_TYPE_R219          0x0
 #define BIKE_TYPE_R168          0x01
@@ -126,7 +126,7 @@ Update Time
  指拨档位
    不同档位,指拨的最大速度有区分。1档-48%,2档-60%,3档-72%,4档-84%,5档-100%,
 *=======================================================================*/
-#define     THROTTLEGEAR              0
+#define     THROTTLEGEAR              1
 /*======================================================================*
  踏频 档位限速
    不同档位,踏频的最大速度有区分。1档-48%,2档-60%,3档-72%,4档-84%,5档-100%,

+ 3 - 3
4.BasicHardwSoftwLayer/2.BasicSoftwLayer/Include/user.h

@@ -43,7 +43,7 @@ Update Time
 *=======================================================================*/
 #define CADENCE_ASSIST 1
 #define TORQUE_ASSIST  2
-#define ASSIST_MODE    TORQUE_ASSIST
+#define ASSIST_MODE    CADENCE_ASSIST
 /*======================================================================*
    Motor Number Selection
 *=======================================================================*/
@@ -83,9 +83,9 @@ Update Time
 #elif (IPM_POWER_SEL == IPM_POWER_350W_9G)
 #define MOTOR_ID_SEL   MOTOR_LUNGU_WELLING_HAL_POLE8_350W_958Ratio
 #elif ((IPM_POWER_SEL == IPM_POWER_250W_6G)||(IPM_POWER_SEL == IPM_POWER_350W_6G))
-#define MOTOR_ID_SEL  MOTOR_PEGASI_NEW
+#define MOTOR_ID_SEL  MOTOR_PEGASI_PLUS_NEW
 #else
-#define MOTOR_ID_SEL MOTOR_PEGASI_NEW
+#define MOTOR_ID_SEL MOTOR_PEGASI_PLUS_NEW
 #endif
 
 /*======================================================================*

+ 1 - 1
mspm0g3507.syscfg

@@ -331,8 +331,8 @@ PWM1.crossTriggerEn                     = true;
 PWM1.crossTriggerAuthority              = "Secondary";
 PWM1.secondaryCrossTriggerSource        = "InputTrigger_1";
 PWM1.interruptPriority                  = "0";
-PWM1.dbRiseDelayTimerCount              = 108;
 PWM1.dbFallDelayTimerCount              = 108;
+PWM1.dbRiseDelayTimerCount              = 72;
 PWM1.peripheral.$assign                 = "TIMA0";
 PWM1.peripheral.ccp0Pin.$assign         = "PB14";
 PWM1.peripheral.ccp1Pin.$assign         = "PA7";