|
@@ -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;
|
|
|
}
|