Browse Source

【V3.1.247.65_clcDtc】修改了BMS故障诊断与加热常开故障诊断,并清除存储故障码

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
1238a6aa2d
5 changed files with 30 additions and 21 deletions
  1. 2 2
      inc/AppConfig.h
  2. 9 0
      inc/AppSignal.h
  3. 2 2
      src/AppTaskTcp.c
  4. 15 16
      src/EmbeddedCoder_src/BCU.c
  5. 2 1
      src/EmbeddedCoder_src/SFM.c

+ 2 - 2
inc/AppConfig.h

@@ -2,7 +2,7 @@
  * @Author       : ChenJie
  * @Date         : 2021-10-14 09:27:15
  * @LastEditors  : ChenJie
- * @LastEditTime : 2021-12-29 12:17:50
+ * @LastEditTime : 2021-12-29 16:57:38
  * @Description  : App Config H file 配置文件,可以针对不同参数进行更改
  * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\inc\AppConfig.h
  */
@@ -16,7 +16,7 @@
 #define DEFAULT_SN "RLTEST00000000001" //默认上传的SN编码
 
 #define APPSWRELEASE 0          //软件测试版本标志位,0-测试,1-发布
-#define APPSWVERSION 0x0301F841 //数据模块软件版本号
+#define APPSWVERSION 0x0301F741 //数据模块软件版本号
 
 #define RELAYCONFIG 1              //继电器配置
 #define TCP_ADD "iotp.fast-fun.cn" //数据上传的地址

+ 9 - 0
inc/AppSignal.h

@@ -1,3 +1,12 @@
+/*
+ * @Author       : ChenJie
+ * @Date         : 2021-12-28 19:25:29
+ * @Version      : V3.0
+ * @LastEditors  : ChenJie
+ * @LastEditTime : 2021-12-29 16:52:03
+ * @Description  : file content
+ * @FilePath     : \PLAT\project\ec616_0h00\apps\qx_app\inc\AppSignal.h
+ */
 /*
  * @Author       : ChenJie
  * @Date         : 2021-10-14 09:27:15

+ 2 - 2
src/AppTaskTcp.c

@@ -590,9 +590,9 @@ static void TcpDataInfoAssembleSend()
                 pimv_V_cellOcv[0], pimv_V_cellOcv[1], pimv_V_cellOcv[2], pimv_R_cellOhm[0], pimv_R_cellOhm[1], pimv_R_cellOhm[2]);
         if (Debugcounter % 5 == 0)
         {
-            sprintf((char *)rbuf + strlen(rbuf), ",A-%x,%d,%d,%x,%x,,%d,%d,,%x",
+            sprintf((char *)rbuf + strlen(rbuf), ",A-%x,%d,%d,%x,%x,,%d,%d,,%x,%d",
                     battProtectState, AppDataInfo.RelayControl, chargerConnectState, BMSupdatestatus, PadInterrupt,
-                    AppDataInfo.ExpiryTimeArray[1], AppDataInfo.ExpiryTimeArray[2], UnSleepFlag);
+                    AppDataInfo.ExpiryTimeArray[1], AppDataInfo.ExpiryTimeArray[2], UnSleepFlag, sfmd_flg_heatCirOpenFltEo);
         }
         Debugcounter++;
         if (Debugcounter > 100)

+ 15 - 16
src/EmbeddedCoder_src/BCU.c

@@ -1,6 +1,5 @@
 
 #include "BCU.h"
-
 static StaticTask_t gProcess_Bcu_Task_t;
 static UINT8 gProcess_Bcu_TaskStack[PROC_BCU_TASK_STACK_SIZE];
 static osThreadId_t BcuTaskId = NULL;
@@ -92,7 +91,7 @@ void BCU(void)
                     }
                     // printf("time:%d\n",ihd_tm_parkTime);
                     //
-		
+
                     //数据获取
                     ihd_st_reSet = SysResetFlag;
                     ihd_I_curr = (int16_T)(-(battI - 10000));
@@ -113,26 +112,26 @@ void BCU(void)
                     ihd_flg_urtRecFlt = UartErrorFlag;
                     ihd_flg_urtRecFlg = UartRecvFlag;
                     ihd_st_chrgConnect = chargerConnectState;
-                    ihd_flg_cellULowFlt = ((battWarningState)&0x01) == 1;
-                    ihd_flg_battULowFlt = ((battWarningState >> 1) & 0x01) == 1;
-                    ihd_flg_cellUOverFlt = ((battWarningState >> 2) & 0x01) == 1;
-                    ihd_flg_battUOverFlt = ((battWarningState >> 3) & 0x01) == 1;
-                    ihd_flg_disChrgCurrOverFlt = ((battWarningState >> 4) & 0x01) == 1;
-                    ihd_flg_chrgCurrOverFlt = ((battWarningState >> 5) & 0x01) == 1;
-                    ihd_flg_disChrgModTOverFlt = ((battWarningState >> 6) & 0x01) == 1;
-                    ihd_flg_chrgModTOverFlt = ((battWarningState >> 7) & 0x01) == 1;
-                    ihd_flg_chrgMosTOverFlt = ((battWarningState >> 11) & 0x01) == 1;
+                    ihd_flg_cellULowFlt = (getbit(battProtectState, 8)) == 1;
+                    ihd_flg_battULowFlt = (getbit(battProtectState, 9)) == 1;
+                    ihd_flg_cellUOverFlt = (getbit(battProtectState, 24)) == 1;
+                    ihd_flg_battUOverFlt = (getbit(battProtectState, 25)) == 1;
+                    ihd_flg_disChrgCurrOverFlt = (getbit(battProtectState, 1)) == 1;
+                    ihd_flg_chrgCurrOverFlt = (getbit(battProtectState, 2)) == 1;
+                    ihd_flg_disChrgModTOverFlt = (getbit(battProtectState, 20)) == 1;
+                    ihd_flg_chrgModTOverFlt = (getbit(battProtectState, 16)) == 1;
+                    ihd_flg_chrgMosTOverFlt = (getbit(battProtectState, 18)) == 1;
                     ihd_flg_disChrgMosClosFlt = ((battWarningState >> 18) & 0x01) == 1;
                     ihd_flg_chrgMosClosFlt = ((battWarningState >> 19) & 0x01) == 1;
-                    ihd_flg_disChrgModTLowFlt = ((battWarningState >> 22) & 0x01) == 1;
-                    ihd_flg_chrgModTLowFlt = ((battWarningState >> 23) & 0x01) == 1;
+                    ihd_flg_disChrgModTLowFlt = (getbit(battProtectState, 21)) == 1;
+                    ihd_flg_chrgModTLowFlt = (getbit(battProtectState, 17)) == 1;
                     ihd_flg_currOpenFlt = 0;
                     ihd_st_heatForceControl = HeatForceControl;
                     ihd_st_chrgMosControl = ChargeForbiddenControl == 0;
                     ihd_st_disChrgMosControl = DisChargeForbiddenControl == 0;
                     ihd_st_relayControl = RelayForbiddenControl == 0;
-					ihd_st_heatStat = battHeatEnableState;
-                    // ihd_flg_DTCClear = 1;   //////clear
+                    ihd_st_heatStat = battHeatEnableState;
+                    ihd_flg_DTCClear = 1; //////clear
                     //调用算法
                     SFM();
                     TMS();
@@ -174,7 +173,7 @@ void BCU(void)
                 if (TimeCounter % 10 == 0)
                 {
                     ihd_tm_parkTime++;
-                    //printf("time:%d\n",ihd_tm_parkTime);
+                    // printf("time:%d\n",ihd_tm_parkTime);
                 }
                 if (TimeCounter % 1000 == 0)
                 {

+ 2 - 1
src/EmbeddedCoder_src/SFM.c

@@ -930,7 +930,8 @@ void SFM(void)
 
     // 33 加热回路常开故障
     Enable2 = JudgeTimeSystem(1, tmsd_st_heatAct == 1, &DiagTime.N33, 600);
-    sfmd_flg_heatCirOpenFltEo = (((int16_T)(heatT2Arr[9] - heatT2Arr[0]) < 5 && (int16_T)(heatT1Arr[9] - heatT1Arr[0]) < 5) && Enable2) || sfmd_flg_heatCirOpenFltEo || sfmd_flg_heatCirOpenFltEi;
+    Enable2 = (DiagTime.N33 == 600);
+    sfmd_flg_heatCirOpenFltEo = (((int16_T)(heatT2Arr[9] - heatT2Arr[0]) < 5 && (int16_T)(heatT1Arr[9] - heatT1Arr[0]) < 5) && (modTMaxArr[9] < modTMaxArr[0] + 4) && Enable2) || sfmd_flg_heatCirOpenFltEo || sfmd_flg_heatCirOpenFltEi;
 
     //================================================================================================================================================================
     //================================================================================================================================================================