Browse Source

CDM测试

LAPTOP-EG88H5BE\86151 3 years ago
parent
commit
f6315ea9e0

+ 3 - 2
inc/EmbeddedCoder_inc/BCUDisp.h

@@ -142,8 +142,9 @@ extern uint16_T test_efkSocMin;
 extern uint16_T test_efkSocMax;
 extern real_T test_UpMin;
 extern real_T test_UpMax;
-extern int16_T test_curr;
-extern uint16_T test_U;
+extern int16_T test_curr[10];
+extern uint16_T test_U1[10];
+extern uint16_T test_U2[10];
 
 
 

+ 3 - 2
src/EmbeddedCoder_src/BCUDisp.c

@@ -144,6 +144,7 @@ real_T test_UpMin;
 real_T test_UpMax;
 uint16_T test_ekfSoc;
 uint16_T test_ekfSoc0;
-int16_T test_curr;
-uint16_T test_U;
+int16_T test_curr[10] ={255};
+uint16_T test_U1[10]={5000};
+uint16_T test_U2[10]={5000};
 

+ 30 - 13
src/EmbeddedCoder_src/CDM.c

@@ -25,7 +25,8 @@ void CDM(void)
     static uint8_T ihd_st_workStat_Delay;
 	static int16_T sfmd_I_curr_Delay;
 	static uint8_T Cnt;
-	
+	static uint8_T TestCnt[28];
+	uint8_T TestCntmax;
     //
     if(ihd_st_workStat_Delay == 2 && ihd_st_workStat != 2)
     {
@@ -47,8 +48,8 @@ void CDM(void)
 			deltaES[i] = 0;
             deltaRS[i] = 0;
 			Cnt = 0;
-			test_curr =0;
-			test_U=5000;
+			TestCnt[i]= 0;
+			TestCntmax=0;
         }
     }
     //
@@ -68,8 +69,8 @@ void CDM(void)
             arf[i] = cmdn_V_cellUDelt[i] - (deltaE[i] + cdmn_I_curr * deltaR[i]);
             deltaE[i] = deltaE[i] + K[0] * arf[i];
             deltaR[i] = deltaR[i] + K[1] * arf[i];
-            P[0][i] = ((1 -K[0])* P[0][i] -P[2][i] * K[0] * cdmn_I_curr) /Lambda;
-            P[1][i] = ((1 -K[0])* P[1][i] -P[3][i] * K[0] * cdmn_I_curr) /Lambda;
+            P[0][i] = ((1 -K[0])* P[0][i] -P[2][i] *  K[0] * cdmn_I_curr) /Lambda;
+            P[1][i] = ((1 -K[0])* P[1][i] -P[3][i] *  K[0] * cdmn_I_curr) /Lambda;
             P[2][i] = (-K[1] *P[0][i] +P[2][i] * (1 - K[1] * cdmn_I_curr))/Lambda;
             P[3][i] = (-K[1] *P[1][i] +P[3][i] * (1 - K[1] * cdmn_I_curr))/Lambda;
 			
@@ -80,13 +81,36 @@ void CDM(void)
 	    }
         //
 		Cnt = Cnt + 1;
-
+        TestCntmax=0;
         for (i = 0;i < cmnc_num_cellUNum;i++)
         {   
             deltaES[i] = deltaES[i] + deltaE[i];
 			deltaRS[i] = deltaRS[i] + deltaR[i];
+			 if(deltaR[i] > 0.005)
+			{
+                 TestCnt[i] = (TestCnt[i]+1) >200 ?200:(TestCnt[i]+1);
+		    }
+			if(TestCntmax < TestCnt[i])
+			{
+              TestCntmax = TestCnt[i];
+			}
+        }
+        if(TestCntmax < 5)
+        {
+		    for(i=0;i<9;i++)
+		  	{
+               test_curr[i]=test_curr[i+1];
+			   test_U1[i]=test_U1[i+1];
+			   test_U2[i]=test_U2[i+1];
+		  	}
+		       test_curr[9]=sfmd_I_curr;
+			   test_U1[9]=sfmd_V_cellUMax;
+			   test_U2[9]=sfmd_V_cellUMin;
         }
 
+
+
+		
 		if (Cnt >= 10)
 		{
              for (i = 0;i < cmnc_num_cellUNum;i++)
@@ -96,13 +120,6 @@ void CDM(void)
 			     deltaES[i] = 0;
                  deltaRS[i] = 0;
 
-				 if(deltaR[i] > 5000 &&test_U==5000)
-				 {
-                    test_curr = ihd_I_curr;
-                    test_U =ihv_V_cellU[i];
-				 }
-
-				
              }
 		     Cnt = 0;
 		}

+ 6 - 5
src/EmbeddedCoder_src/SOC.c

@@ -636,7 +636,7 @@ void SOC(void)
         //
         if (fulFlg)
         {
-            socd_pct_bcuSoc = socc_pct_battSocUp;
+            socd_pct_bcuSoc = 1000;
         }
         else
         {
@@ -674,8 +674,8 @@ void SOC(void)
 
 
     //===================================================================
-    //------------------EEsave
-    //==================================================================
+    //------------------EEsave-------------------------------------------
+    //================================================================================================
 
     if ((int16_T)(socd_pct_battSoc - socd_pct_battSoc_save) > 10 || (int16_T)(socd_pct_battSoc - socd_pct_battSoc_save) < -10 || (int16_T)(socd_pct_bcuSoc - socd_pct_bcuSoc_save) > 10 || (int16_T)(socd_pct_bcuSoc - socd_pct_bcuSoc_save) < -10 )
     {
@@ -691,8 +691,9 @@ void SOC(void)
 	
     FirstRun_SOC = false;
 }
-
-//-------------------------------------------------------------------------
+//===================================================================================================================
+//----------------------------function-------------------------------------------------------------------------------
+//===================================================================================================================
 real_T docvmath(real_T soc)
 {
     real_T docv;