Browse Source

1.增加峰值电压参数,2.优化充电数据获取

qingfeng 3 years ago
parent
commit
ae0bb5bef6

+ 1 - 0
LIB/MIDDLE/CellStateEstimation/Common/BatParam.py

@@ -81,6 +81,7 @@ class BatParam:
             self.CellTempNums=4
             self.FullChrgSoc=98
             self.PeakSoc=60.5
+            self.PeakCellVolt=[3.357,3.358,3.359,3.36,3.361]
             self.PackCrntDec=1
             self.LookTab_SOC = [0.00, 	2.40, 	6.38, 	10.37, 	14.35, 	18.33, 	22.32, 	26.30, 	30.28, 	35.26, 	40.24, 	45.22, 	50.20, 	54.19, 	58.17, 	60.16, 	65.14, 	70.12, 	75.10, 	80.08, 	84.06, 	88.05, 	92.03, 	96.02, 	100.00]
             self.LookTab_OCV = [2.7151,	3.0298,	3.1935,	3.2009,	3.2167,	3.2393,	3.2561,	3.2703,	3.2843,	3.2871,	3.2874,	3.2868,	3.2896,	3.2917,	3.2967,	3.3128,	3.3283,	3.3286,	3.3287,	3.3288,	3.3289,	3.3296,	3.3302,	3.3314,	3.3429]

+ 10 - 14
LIB/MIDDLE/CellStateEstimation/SOH/V1_0_0/CBMSBatSoh.py

@@ -535,13 +535,8 @@ class BatSoh:
                 pass
 
             #获取DVDQ算法所需数据——开始.............................................................................................................
-            if i==3 and self.packcrnt[1]<=-1 and self.packcrnt[2]<=-1 and self.packcrnt[3]<=-1:
-                self._celltemp_weight(i)
-                chrg_start.append(i)
-                tempweightlist2.append(self.tempweight)
-                charging=1
-            elif self.packcrnt[i-1]>-1 and self.packcrnt[i]<=-1 and self.packcrnt[i+1]<=-1 and self.packcrnt[i+2]<=-1:     #判断充电开始
-                if self.bms_soc[i]<45:
+            if charging==0:
+                if self.packcrnt[i]<=-1 and self.packcrnt[i+1]<=-1 and self.packcrnt[i+2]<=-1 and self.bms_soc[i]<45:     #充电开始
                     self._celltemp_weight(i)
                     charging=1
                     if len(chrg_start)>len(chrg_end):
@@ -552,10 +547,8 @@ class BatSoh:
                         tempweightlist2.append(self.tempweight)
                 else:
                     pass
-            else:
-                pass
 
-            if charging==1: #充电中
+            else: #充电中
                 if (self.bmstime[i+1]-self.bmstime[i]).total_seconds()>180:  #如果充电过程中时间间隔>180s,则舍弃该次充电
                     chrg_start.remove(chrg_start[-1])
                     tempweightlist2.remove(tempweightlist2[-1])
@@ -570,7 +563,7 @@ class BatSoh:
                         continue
                     else:
                         pass
-                elif self.packcrnt[i+1]>-0.1 and self.packcrnt[i+2]>-0.1 and self.packcrnt[i+3]>-0.1:   #判断充电结束
+                elif self.packcrnt[i+1]>-0.1 and self.packcrnt[i+2]>-0.1:   #判断充电结束
                     charging=0
                     if len(chrg_start)>len(chrg_end):
                         chrg_start.remove(chrg_start[-1])
@@ -591,9 +584,12 @@ class BatSoh:
                             tempweightlist2.remove(tempweightlist2[-1])
                             continue
                     else:
-                        continue   
-            else:
-                pass
+                        continue  
+                else:
+                    continue 
+        
+        print(chrg_start)
+        print(chrg_end)
         
         #开始计算SOH.............................................................................................................................................
         if standingpoint_sp or chrg_end:       

+ 7 - 12
LIB/MIDDLE/CellStateEstimation/Uniform/V1_0_0/CBMSBatUniform.py

@@ -280,11 +280,8 @@ class BatUniform:
                 pass   
 
             #获取DVDQ算法所需数据——开始............................................................................................................
-            if i==3 and self.packcrnt[1]<=-1 and self.packcrnt[2]<=-1 and self.packcrnt[3]<=-1:
-                chrg_start.append(i)
-                charging=1
-            elif self.packcrnt[i-1]>-1 and self.packcrnt[i]<=-1 and self.packcrnt[i+1]<=-1 and self.packcrnt[i+2]<=-1:     #判断充电开始
-                if self.bms_soc[i]<45:
+            if charging==0: #判断充电开始
+                if self.packcrnt[i]<=-1 and self.packcrnt[i+1]<=-1 and self.packcrnt[i+2]<=-1 and self.bms_soc[i]<45:     #充电开始
                     charging=1
                     if len(chrg_start)>len(chrg_end):
                         chrg_start[-1]=i
@@ -292,10 +289,8 @@ class BatUniform:
                         chrg_start.append(i)
                 else:
                     pass
-            else:
-                pass
 
-            if charging==1: #充电中
+            else: #充电中
                 if (self.bmstime[i+1]-self.bmstime[i]).total_seconds()>180:  #如果充电过程中时间间隔>180s,则舍弃该次充电
                     chrg_start.remove(chrg_start[-1])
                     charging=0
@@ -308,7 +303,7 @@ class BatUniform:
                         continue
                     else:
                         pass
-                elif self.packcrnt[i+1]>-0.1 and self.packcrnt[i+2]>-0.1 and self.packcrnt[i+3]>-0.1:   #判断充电结束
+                elif self.packcrnt[i+1]>-0.1 and self.packcrnt[i+2]>-0.1:   #判断充电结束
                     charging=0
                     if len(chrg_start)>len(chrg_end):
                         if self.bms_soc[i]>90:
@@ -328,9 +323,9 @@ class BatUniform:
                             chrg_start.remove(chrg_start[-1])
                             continue
                     else:
-                        continue   
-            else:
-                pass
+                        continue
+                else:
+                    continue   
 
         if chrg_end:    #DVDQ方法计算soc差
             peaksoc_list=[]