Browse Source

加热策略修改:工作模式=0时 不开启(非充电阶段)

LAPTOP-EG88H5BE\86151 2 years ago
parent
commit
8d0a000d01

+ 3 - 0
inc/EmbeddedCoder_inc/BCUCal.h

@@ -110,3 +110,6 @@ extern const uint16_T cmm_I_ChrgCurr[18];
 extern const uint16_T tmsc_T_openThr;     /* 热管理开启温度; */
 extern const uint16_T tmsc_T_closeMinThr; /* 热管理关闭温度(最低模组); */
 extern const uint16_T tmsc_T_closeMaxThr; /* 热管理开启温度(最高模组); */
+extern const uint16_T tmsc_pct_socOpen;/* 热管理开启SOC阈值(非充电)*/
+extern const uint16_T tmsc_pct_socClos;/* 热管理推出SOC阈值(非充电)*/
+

+ 2 - 1
inc/EmbeddedCoder_inc/BCUDisp.h

@@ -67,7 +67,8 @@ extern uint8_T   ihd_st_heatForceControl;
 extern uint8_T   ihd_st_EOLState;
 extern boolean_T ihd_flg_urtRecFlg;
 extern uint8_T   ihd_st_reSet;
-extern uint8_T ihd_st_heatStat;
+extern uint8_T   ihd_st_heatStat;
+extern uint8_T   ihd_st_wakeUpStat; 
 
 extern int16_T   sfmd_I_curr;                              /*处理后整包电流 */
 extern uint16_T  sfmd_T_modTMax;                          /*处理后模组温度最小 */

+ 1 - 2
inc/EmbeddedCoder_inc/TMS.h

@@ -2,6 +2,5 @@
 #include "BCUCal.h"
 #include "BCUDisp.h"
 #include "AppSignal.h"
-extern boolean_T FirstRun_TMS;
 extern void TMS_Init(void);
-extern void TMS(void);
+extern void TMS(void);

+ 1 - 0
src/AppTaskMain.c

@@ -202,6 +202,7 @@ static void MainTask(void *arg)
 #ifdef DEBUGLOG
                 UINT8 WakeUpFlg = 0;
                 WakeUpFlg = ((SleepTimerEnd) << 3) | ((TCPWorkState == 1) << 2) | ((PadInterrupt_clrCounter >= 1) << 1) | (otherTempAvg > (50 + 40));
+				ihd_st_wakeUpStat = WakeUpFlg;
                 Debug_printf("WORK:%d,%d,%d,%d\n", PadInterrupt_clrCounter, PadInterrupt, UartInterruptcount, WakeUpFlg);
 #endif
                 PROC_MAIN_STATE_SWITCH(PROCESS_STATE_IDLE);

+ 3 - 0
src/EmbeddedCoder_src/BCUCal.c

@@ -115,3 +115,6 @@ const uint16_T cmm_I_ChrgCurr[18] = {0, 100, 100, 100, 100, 50,
 const uint16_T tmsc_T_openThr = 45U;     /* 热管理开启温度; */
 const uint16_T tmsc_T_closeMinThr = 50U; /* 热管理关闭温度(最低模组); */
 const uint16_T tmsc_T_closeMaxThr = 70U; /* 热管理开启温度(最高模组); */
+const uint16_T tmsc_pct_socOpen = 100;/* 热管理开启SOC阈值(非充电)*/
+const uint16_T tmsc_pct_socClos = 50;/* 热管理退出SOC阈值(非充电)*/
+

+ 1 - 0
src/EmbeddedCoder_src/BCUDisp.c

@@ -67,6 +67,7 @@ uint8_T   ihd_st_EOLState;
 boolean_T ihd_flg_urtRecFlg;
 uint8_T   ihd_st_reSet;
 uint8_T ihd_st_heatStat;
+uint8_T ihd_st_wakeUpStat;
 
 int16_T   sfmd_I_curr;                              /*处理后整包电流 */
 uint16_T  sfmd_T_modTMax;                          /*处理后模组温度最小 */

+ 10 - 46
src/EmbeddedCoder_src/TMS.c

@@ -1,29 +1,19 @@
-/*
- * @Author       : ChenJie
- * @Date         : 2021-11-08 10:44:13
- * @Version      : V3.0
- * @LastEditors  : ChenJie
- * @LastEditTime : 2021-11-08 14:34:38
- * @Description  : file content
- * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\src\EmbeddedCoder_src\TMS.c
- */
 
 #include "TMS.h"
 
-boolean_T FirstRun_TMS;
 void TMS_Init(void)
 {
-    FirstRun_TMS = true;
+    tmsd_flg_firstRun = true;
 }
 
 void TMS(void)
 {
-    static uint8_T TminLowNr;
-    static uint8_T TminOverNr;
-    static uint8_T TmaxOverNr;
+    static uint16_T TminLowNr;
+    static uint16_T TminOverNr;
+    static uint16_T TmaxOverNr;
 
     //初始值
-    if (FirstRun_TMS)
+    if (tmsd_flg_firstRun)
     {
         tmsd_st_heatAct = 0;
         TminLowNr = 0;
@@ -31,49 +21,23 @@ void TMS(void)
         TmaxOverNr = 0;
     }
 
-    //
-    if (sfmd_T_modTMin < tmsc_T_openThr)
-    {
-        TminLowNr = (TminLowNr + 1) > 200 ? 200 : (TminLowNr + 1);
-    }
-    else
-    {
-        TminLowNr = 0;
-    }
-    //
-    if (sfmd_T_modTMin >= tmsc_T_closeMinThr)
-    {
-        TminOverNr = (TminOverNr + 1) > 200 ? 200 : (TminOverNr + 1);
-    }
-    else
-    {
-        TminOverNr = 0;
-    }
-    //
-    if (sfmd_T_modTMax >= tmsc_T_closeMaxThr)
-    {
-        TmaxOverNr = (TmaxOverNr + 1) > 200 ? 200 : (TmaxOverNr + 1);
-    }
-    else
-    {
-        TmaxOverNr = 0;
-    }
-
     //================================温度判定 开关热管理状态===============================
     if (tmsd_st_heatAct == 0)
     {
-        if (TminLowNr >= 5 && ((socd_pct_battSoc > 100 && ihd_st_disChrgMosControl == 1) || ihd_st_chrgConnect == 1))
+        if (JudgeTimeSystem(1, sfmd_T_modTMin < tmsc_T_openThr, &TminLowNr,5) && ((socd_pct_battSoc > tmsc_pct_socOpen && ihd_st_disChrgMosControl == 1 && ihd_st_workStat !=0) || ihd_st_chrgConnect == 1))
         {
             tmsd_st_heatAct = 1;
         }
     }
     else
     {
-        if (TmaxOverNr >= 5 || TminOverNr >= 5 || (ihd_st_chrgConnect == 0 && socd_pct_battSoc < 50))
+        if (JudgeTimeSystem(1, sfmd_T_modTMin >= tmsc_T_closeMinThr, &TminOverNr,5) || JudgeTimeSystem(1, sfmd_T_modTMax >= tmsc_T_closeMaxThr, &TmaxOverNr,5) || (ihd_st_chrgConnect == 0 && socd_pct_battSoc < tmsc_pct_socClos))
         {
             tmsd_st_heatAct = 0;
         }
     }
+    //*/
+	//printf("tmsd_st_heatAct:%d,Tmin:%d,Tmax:%d,ihd_st_workStat:%d,SOC:%d\n\n",tmsd_st_heatAct,sfmd_T_modTMin,sfmd_T_modTMax,ihd_st_workStat,socd_pct_battSoc);
  
     /*/因故障关闭热管理
     if (((sfmd_st_fltAct >> 4) & 0x01) == 1)
@@ -92,5 +56,5 @@ void TMS(void)
         tmsd_st_heatAct = 0;
     }
 
-    FirstRun_TMS = false;
+    tmsd_flg_firstRun = false;
 }