Browse Source

【V3.0.0.11】 1.故障诊断采用模型算法方式,2.修改了故障数组的bug,3.Uart修改框架,4.bms升级状态反馈

CHENJIE-PC\QiXiang_CHENJIE 3 years ago
parent
commit
c3337316d9
4 changed files with 24 additions and 17 deletions
  1. 1 1
      inc/AppConfig.h
  2. 0 7
      inc/AppSignal.h
  3. 11 4
      src/AppTaskTcp.c
  4. 12 5
      src/EmbeddedCoder_src/SPM.c

+ 1 - 1
inc/AppConfig.h

@@ -13,7 +13,7 @@
 #define DATA_MODULE_TYPE            (1)                 //1表示NB模块,2表示4G cat1
 #define EOLSTATE                    (1)                 //1表示下线检测跳过,使用默认值,0表示使用下线检测
 #define DEFAULT_SN                  "RRRRRR0000000003" //默认上传的SN编码
-#define	APPSWVERSION		        0x0300000A          //数据模块软件版本号
+#define	APPSWVERSION		        0x0300000B          //数据模块软件版本号
 
 #define TCP_ADD                     "iotp.fast-fun.cn"  //数据上传的地址
 #define TCP_PORT					8712                //数据上传的端口

+ 0 - 7
inc/AppSignal.h

@@ -102,10 +102,3 @@ extern AppDataBody AppDataInfo;
 extern AppAlgorithmData   BcuDataInfo;
 extern AppSocketConnectionContext socContext;  //网络连接状态
 extern process_app 		    gProcess_app;
-
-
-//BCU
-extern UINT16 socd_pct_battSoc;
-extern UINT16 socd_pct_ahSoc;
-extern UINT16 socd_pct_estSoc;
-extern UINT16 socd_pct_ekfSoc;

+ 11 - 4
src/AppTaskTcp.c

@@ -540,14 +540,21 @@ static void TcpDataInfoAssembleSend()
             }
         }
     }
-    if(send_counter%60==0)
+    if(send_counter%10==0)
     {
         DebugMsgtoTcpType DebugMsgInfo;
         UINT16 BufferLen = 0;
         UINT8 rbuf[1000];
-		sprintf((char *)rbuf,"%x,%d,%d,%d,%d,%d,%d,%d,,%d,%d,%d,%d,%d,%d,%d",
-        battProtectState,AppDataInfo.RelayControl,chargerConnectState,PowerVoltage,socd_pct_battSoc,socd_pct_ahSoc,socd_pct_estSoc,socd_pct_ekfSoc,
-        AppDataInfo.RentalType,AppDataInfo.ExpiryTimeArray[0],AppDataInfo.ExpiryTimeArray[1],AppDataInfo.ExpiryTimeArray[2],AppDataInfo.ExpiryTimeArray[3],AppDataInfo.ExpiryTimeArray[4],AppDataInfo.ExpiryTimeArray[5]);
+		sprintf((char *)rbuf,   "%x,%d,%d,%d,,\
+                                %d,%d,%d,%d,,\
+                                %d,%d,%d,%d,%d,,\
+                                %d,%d,%d,%d,%d,%d,%d,,\
+                                %d,%d",
+        battProtectState,AppDataInfo.RelayControl,chargerConnectState,PowerVoltage,
+        tmsd_st_heatAct,sfmd_num_fltNum,sfmd_st_fltAct,sfmd_st_fltLevel,
+        socd_pct_ahSoc,socd_pct_ekfSoc,socd_pct_estSoc,socd_pct_battSoc,socd_pct_bcuSoc,
+        sohd_Q_chrgEo,sohd_flg_chrgEndEo,cand_Nr_cellNr,cand_Q_cellCap,cand_V_chrgStartStat,cand_Q_reqCp,cand_Q_totalCp,
+        AppDataInfo.ExpiryTimeArray[1],AppDataInfo.ExpiryTimeArray[2]);
 		BufferLen = strlen(rbuf);
         SendBuffer = malloc(BufferLen+sizeof(DebugMsgInfo));
         memcpy(SendBuffer+sizeof(DebugMsgInfo)-1, rbuf,BufferLen);

+ 12 - 5
src/EmbeddedCoder_src/SPM.c

@@ -17,18 +17,25 @@ void SPM(void)
 
   static uint16_T spmd_Nr_cellNr;
 
-  
+  uint8_T Feq = 15;
   if (FirstRun_SPM)
   {
       spmd_Nr_cellNr =0;
+      cand_Nr_cellNr = 1;
   }
   spmd_Nr_cellNr = spmd_Nr_cellNr + 1;
-  if (spmd_Nr_cellNr >= cmnc_num_cellUNum * 10)
+  if(spmd_Nr_cellNr>=60000U)
   {
-     spmd_Nr_cellNr = 0;
+    spmd_Nr_cellNr = 0;
+  }
+  if(spmd_Nr_cellNr%(Feq*10)==0)
+  {
+    cand_Nr_cellNr++;
+  }
+  if (cand_Nr_cellNr >= cmnc_num_cellUNum)
+  {
+     cand_Nr_cellNr = 1;
   }
-  cand_Nr_cellNr = (uint16_T)(spmd_Nr_cellNr * 0.1) +1;
-  
   SOH();
   BLC();
   if (!ihd_flg_urtRecFlt)