tengfei.qi@fast-fun.com.cn преди 2 години
родител
ревизия
27166813f3
променени са 6 файла, в които са добавени 30 реда и са изтрити 16 реда
  1. 1 0
      inc/EmbeddedCoder_inc/BCUDisp.h
  2. 4 4
      src/AppTaskTcp.c
  3. 2 0
      src/EmbeddedCoder_src/BCUDisp.c
  4. 3 4
      src/EmbeddedCoder_src/ISC.c
  5. 19 7
      src/EmbeddedCoder_src/PIM.c
  6. 1 1
      src/EmbeddedCoder_src/SOC.c

+ 1 - 0
inc/EmbeddedCoder_inc/BCUDisp.h

@@ -177,6 +177,7 @@ extern uint16_T  pimv_R_cellOhm[cmnc_num_cellUNumMax];
 extern uint16_T  pimd_pct_battSoc;
 extern uint16_T  pimv_pct_cellSoc[cmnc_num_cellUNumMax];
 extern boolean_T pimv_flg_inval[cmnc_num_cellUNumMax];
+extern boolean_T  pimd_flg_inval; 
 
 extern uint16_T test_cellCap[cmnc_num_cellUNumMax];
 extern real_T test_U1;

+ 4 - 4
src/AppTaskTcp.c

@@ -580,14 +580,14 @@ static void TcpDataInfoAssembleSend()
         static UINT8 Debugcounter = 0;
         sprintf((char *)rbuf, "B-%d,%d,%d,%d,%d,,\
                                 %d,%d,%d,%d,%d,%d,,\
-                                %d,%d,%d,%d,%d,%d,,\
-                                %d,%d,%d,%d,,\
+                                %d,%d,%d,%d,%d,%d,%d,,\
+                                %d,%d,%d,%d,%d,,\
                                 %d,%d,%d,%d,%d,%d,%d,,\
                                 %d,%d,%d,,",
                 socd_pct_ahSoc, socd_pct_ekfSoc, socd_pct_battSoc, socd_pct_bcuSoc,pimd_pct_battSoc,
                 sfmd_I_curr, sfmd_V_cellUMax, sfmd_V_cellUMin, sfmv_V_cellU[0], sfmv_V_cellU[1], sfmv_V_cellU[2],
-                cand_idx_cellNr, cand_Q_cellCap, ihd_tm_parkTime, sohd_Q_chrgEo, iscv_Q_remainCpEi[cand_idx_cellNr - 1], iscd_tm_totalEi,
-                pimd_V_ocv, pimd_R_ohm, pimd_R_polar, pimd_F_polar,
+                cand_idx_cellNr, appv_V_cellU[cand_idx_cellNr - 1],cand_Q_cellCap, ihd_tm_parkTime, sohd_Q_chrgEo, iscv_Q_remainCpEi[cand_idx_cellNr - 1], iscd_tm_totalEi,
+                pimd_V_ocv, pimd_R_ohm, pimd_R_polar, pimd_F_polar,pimd_flg_inval,
                 pimv_V_cellOcv[0], pimv_V_cellOcv[1], pimv_V_cellOcv[2], pimv_R_cellOhm[0], pimv_R_cellOhm[1], pimv_R_cellOhm[2],pimv_R_cellOhm[sfmd_idx_cellUMin],
                 iscd_flg_flt[0], iscd_flg_flt[1], iscd_flg_flt[2]);
         if (Debugcounter % 5 == 0)

+ 2 - 0
src/EmbeddedCoder_src/BCUDisp.c

@@ -175,6 +175,8 @@ uint16_T   pimv_R_cellOhm[cmnc_num_cellUNumMax];
 uint16_T   pimd_pct_battSoc;
 uint16_T   pimv_pct_cellSoc[cmnc_num_cellUNumMax];
 boolean_T  pimv_flg_inval[cmnc_num_cellUNumMax];
+boolean_T  pimd_flg_inval; 
+	
 
 uint16_T test_cellCap[cmnc_num_cellUNumMax];
 real_T test_U1;

+ 3 - 4
src/EmbeddedCoder_src/ISC.c

@@ -104,17 +104,16 @@ void ISC(void)
 		
     }
    
-	
-    
+
     //=====================================================================
     //================放电过程中诊断=================================== 2A
     //=====================================================================
-    if(!socd_flg_cellSocDisable)
+    if(!pimd_flg_inval)
     {
         TimeCtn = TimeCtn + 1;
         for (i = 0; i < cmnc_num_cellUNum;i++)
         {
-            iscn_Q_cellAh[i] = (uint16_T)((uint32_T)(socv_pct_cellSoc[i] * sohv_Q_cellCap[i])/1000);
+            iscn_Q_cellAh[i] = (uint16_T)((uint32_T)(pimv_pct_cellSoc[i] * sohv_Q_cellCap[i])/1000);
         }
         if (TimeCtn == 60)
         {

+ 19 - 7
src/EmbeddedCoder_src/PIM.c

@@ -197,22 +197,34 @@ void PIM(void)
     //全部单体参数---------------------
     for(i = 0;i < cmnc_num_cellUNum;i++)
     {
+        pimv_V_cellOcv[i]   = pimd_V_ocv + cdmv_V_deltOCV[i];
+        pimv_R_cellOhm[i]   = pimd_R_ohm + cdmv_R_deltOhm[i];
+        pimv_pct_cellSoc[i] = look1_u16tu16(pimv_V_cellOcv[i], cmnm_V_ocv, cmnm_pct_soc, 13);
         if((!pimn_flg_inval && !cdmv_flg_inval[i]))
-        {
-            pimv_flg_inval[i]   = 0;
-            pimv_V_cellOcv[i]   = pimd_V_ocv + cdmv_V_deltOCV[i];
-            pimv_R_cellOhm[i]   = pimd_R_ohm + cdmv_R_deltOhm[i];
-            pimv_pct_cellSoc[i] = look1_u16tu16(pimv_V_cellOcv[i], cmnm_V_ocv, cmnm_pct_soc, 13);
+        {   
 			if (pimv_V_cellOcv[i] > 4400 || pimv_V_cellOcv[i] < 1000 || pimv_R_cellOhm[i] < 1000 || pimv_R_cellOhm[i] > 10000)
 			{ 
-			    pimv_flg_inval[i]   = 1;
+				pimd_flg_inval = 1;
+			}
+			else
+			{
+			    pimv_flg_inval[i]  = 0;
 			}
         }
         else
         {
-            pimv_flg_inval[i]   = 1;
+            pimv_flg_inval[i] = 1;
         }
     }
+	pimd_flg_inval = 0;
+	for(i = 0;i < cmnc_num_cellUNum;i++)
+	{
+       if(pimv_flg_inval[i] == 1)
+       {
+           pimd_flg_inval = 1;
+		   break;
+       }
+	}
     // 整包SOC
     socMin = 1000;
     socMax = 0;

+ 1 - 1
src/EmbeddedCoder_src/SOC.c

@@ -447,7 +447,7 @@ void SOC(void)
         overFlg = false;
         fulFlg = false;
         fulCntl = 0;
-		if (!pimv_flg_inval[sfmd_idx_cellUMin] && 0)
+		if (!pimv_flg_inval[sfmd_idx_cellUMin])
 		{
 		    socn_V_disChrgCCV = look1_i16tu16(sfmd_I_curr,socm_I_disChrgCor,socm_V_disChrgCor,3) + (uint16_T)(sfmd_I_curr * (pimv_R_cellOhm[sfmd_idx_cellUMin]) * 0.001 * 0.1);
 		}