Răsfoiți Sursa

36V/48V通过参数兼容

Ye Jin 5 luni în urmă
părinte
comite
19f76a9568

+ 1 - 1
User project/1.FrameLayer/Source/TimeTask_Event.c

@@ -467,7 +467,7 @@ void  Event_200ms(void)
     /* Upper Computer Info Update */
     Can_voMC_Run_200ms();
     
-    if ((switch_flg.SysFault_Flag == TRUE) && (MC_WorkMode > 0))
+    if (switch_flg.SysFault_Flag == TRUE)
     {
         SendData(ID_MC_BC, MODE_REPORT, 0x1104, (uint8_t *)&MC_ErrorCode.Code);
     }

+ 47 - 47
User project/2.MotorDrive/Source/alarm.c

@@ -552,39 +552,39 @@ void alm_voDetecTBS(const ALM_IN *in, const ALM_DETECTBS_COF *coef)
             alm_stDecCt.ulOvrVltLvl3 = 0;
         }
 
-        /* Over voltage level 2 */
-        if (in->uwVdcPu > coef->ulOvrVltLvl2ValPu) // 44V
-        {
-            alm_stDecCt.ulOvrVltLvl2++;
-            if (alm_stDecCt.ulOvrVltLvl2 >= coef->ulOvrVltLvl2ValCt) // 10ms
-            {
-                alm_stDecCt.ulOvrVltLvl2 = coef->ulOvrVltLvl2ValCt;
-                // alm_unAction.bit.ThrPhsShrt = 1;
-                alm_unCode.bit.OvrVlt = 1;
-                alm_unAction.bit.PWMOff = 1;
-            }
-        }
-        else
-        {
-            alm_stDecCt.ulOvrVltLvl2 = 0;
-        }
-
-        /* Over voltage level 1 */
-        if (in->uwVdcPu > coef->ulOvrVltLvl1ValPu) // 43V
-        {
-            alm_stDecCt.ulOvrVltLvl1++;
-            if (alm_stDecCt.ulOvrVltLvl1 >= coef->ulOvrVltLvl1ValCt) // 2s
-            {
-                alm_stDecCt.ulOvrVltLvl1 = coef->ulOvrVltLvl1ValCt;
-                // alm_unAction.bit.ThrPhsShrt = 1;
-                alm_unCode.bit.OvrVlt = 1;
-                alm_unAction.bit.PWMOff = 1;
-            }
-        }
-        else
-        {
-            alm_stDecCt.ulOvrVltLvl1 = 0;
-        }
+//        /* Over voltage level 2 */
+//        if (in->uwVdcPu > coef->ulOvrVltLvl2ValPu) // 44V
+//        {
+//            alm_stDecCt.ulOvrVltLvl2++;
+//            if (alm_stDecCt.ulOvrVltLvl2 >= coef->ulOvrVltLvl2ValCt) // 10ms
+//            {
+//                alm_stDecCt.ulOvrVltLvl2 = coef->ulOvrVltLvl2ValCt;
+//                // alm_unAction.bit.ThrPhsShrt = 1;
+//                alm_unCode.bit.OvrVlt = 1;
+//                alm_unAction.bit.PWMOff = 1;
+//            }
+//        }
+//        else
+//        {
+//            alm_stDecCt.ulOvrVltLvl2 = 0;
+//        }
+//
+//        /* Over voltage level 1 */
+//        if (in->uwVdcPu > coef->ulOvrVltLvl1ValPu) // 43V
+//        {
+//            alm_stDecCt.ulOvrVltLvl1++;
+//            if (alm_stDecCt.ulOvrVltLvl1 >= coef->ulOvrVltLvl1ValCt) // 2s
+//            {
+//                alm_stDecCt.ulOvrVltLvl1 = coef->ulOvrVltLvl1ValCt;
+//                // alm_unAction.bit.ThrPhsShrt = 1;
+//                alm_unCode.bit.OvrVlt = 1;
+//                alm_unAction.bit.PWMOff = 1;
+//            }
+//        }
+//        else
+//        {
+//            alm_stDecCt.ulOvrVltLvl1 = 0;
+//        }
         /*=======================================================================
         Under voltage
         =======================================================================*/
@@ -605,20 +605,20 @@ void alm_voDetecTBS(const ALM_IN *in, const ALM_DETECTBS_COF *coef)
         }
 
         //      /* Under voltage level 1 */
-        if (in->uwVdcCompPu < coef->ulUndrVltLvl1ValPu) // 190V
-        {
-            alm_stDecCt.ulUndrVltLvl1++;
-            if (alm_stDecCt.ulUndrVltLvl1 >= coef->ulUndrVltLvl1ValCt) // 2s
-            {
-                alm_stDecCt.ulUndrVltLvl1 = coef->ulUndrVltLvl1ValCt;
-                alm_unAction.bit.PWMOff = 1;
-                alm_unCode.bit.UndrVlt = 1;
-            }
-        }
-        else
-        {
-            alm_stDecCt.ulUndrVltLvl1 = 0;
-        }
+//        if (in->uwVdcCompPu < coef->ulUndrVltLvl1ValPu) // 190V
+//        {
+//            alm_stDecCt.ulUndrVltLvl1++;
+//            if (alm_stDecCt.ulUndrVltLvl1 >= coef->ulUndrVltLvl1ValCt) // 2s
+//            {
+//                alm_stDecCt.ulUndrVltLvl1 = coef->ulUndrVltLvl1ValCt;
+//                alm_unAction.bit.PWMOff = 1;
+//                alm_unCode.bit.UndrVlt = 1;
+//            }
+//        }
+//        else
+//        {
+//            alm_stDecCt.ulUndrVltLvl1 = 0;
+//        }
         alm_pvt_blTbsFirstFlg = TRUE;
     }
     else

+ 25 - 7
User project/3.BasicFunction/Source/canAppl.c

@@ -64,6 +64,8 @@ static UWORD uwRemainDistanceCal;
 UWORD  ulPowerOnUsedTime = 0;
 BOOL AngleTest = FALSE;
 
+static SLONG slBMSMaxVol = 42000;
+static SLONG slBMSMinVol = 32000;
 void Can_voUpdateMC_UpcInfo(void)
 {
     MC_UpcInfo.stMotorInfo.uwPolePairs = cp_stMotorPara.swMotrPolePairs;
@@ -217,6 +219,22 @@ void Can_voUpdateMC_UpcInfo(void)
     OBC_SetCustomPara.DeltDiameter =  (SBYTE)ass_stParaCong.swDeltPerimeter;
     OBC_SetCustomPara.AssistMod =  (UBYTE)ass_stParaSet.uwAsssistSelectNum;
     OBC_SetCustomPara.AutoPowerOffTime =  (UBYTE)ass_stParaCong.uwAutoPowerOffTime;
+    
+    if(cp_stMotorPara.swRUdcV == 360)
+    {
+        slBMSMaxVol = 42000;
+        slBMSMinVol = 32000;
+    }
+    else if(cp_stMotorPara.swRUdcV == 480)
+    {
+        slBMSMaxVol = 54600;
+        slBMSMinVol = 41600;
+    }
+    else
+    {
+        slBMSMaxVol = 42000;
+        slBMSMinVol = 32000;
+    }
 }
 
 static UWORD SizeMCUP;
@@ -869,13 +887,13 @@ void Can_RemainTrip_Cal(void)
     }
 }
 
-#if ((MOTOR_ID_SEL == MOTOR_WELLING_CITY_36V) || (MOTOR_ID_SEL == MOTOR_WELLING_MTB_36V))
-static SLONG slBMSMaxVol = 42000;
-static SLONG slBMSMinVol = 32000;
-#elif ((MOTOR_ID_SEL == MOTOR_WELLING_CITY_48V) || (MOTOR_ID_SEL == MOTOR_WELLING_MTB_48V))
-static SLONG slBMSMaxVol = 54600;
-static SLONG slBMSMinVol = 41600;
-#endif
+//#if ((MOTOR_ID_SEL == MOTOR_WELLING_CITY_36V) || (MOTOR_ID_SEL == MOTOR_WELLING_MTB_36V))
+//static SLONG slBMSMaxVol = 42000;
+//static SLONG slBMSMinVol = 32000;
+//#elif ((MOTOR_ID_SEL == MOTOR_WELLING_CITY_48V) || (MOTOR_ID_SEL == MOTOR_WELLING_MTB_48V))
+//static SLONG slBMSMaxVol = 54600;
+//static SLONG slBMSMinVol = 41600;
+//#endif
 static SWORD SOC_Cnt, SOC_Value, SOC_MIN;
 static ULONG Voltage_Sum;
 static BOOL  blSOCfirstSet = FALSE;

+ 2 - 2
User project/4.BasicHardwSoftwLayer/2.BasicSoftwLayer/Include/user.h

@@ -182,8 +182,8 @@ Update Time
 #define M_MAGNETIC_MATERIAL Ferrite // unit:Null
 #define M_FLUX_WB           7336    // 5056    // unit: 0.001mWb, Flux linkage
 #define M_ID_MAX_AP         0       //-25      // unit: 0.01A, Max d axis current
-#define M_ID_MIN_AP         -300    // unit: 0.01A, Min d axis current
-#define M_IS_PEAK_MAX_AP    4000    // unit: 0.01A, Max phase current(below base speed)
+#define M_ID_MIN_AP         -600    // unit: 0.01A, Min d axis current
+#define M_IS_PEAK_MAX_AP    3200    // unit: 0.01A, Max phase current(below base speed)
 #define M_POWER_MAX_WT      600     // unit: W, Max power
 #define M_R_SPD_RPM         5000    // unit: r/min, rate spd
 #define M_R_PWR_WT          250     // unit: W, rate power