Browse Source

内短路优化,增加电信类型

qingfeng 2 years ago
parent
commit
3a46476ad1

+ 2 - 0
LIB/FRONTEND/CellStateEstimation/BatDiag/deploy.py

@@ -70,6 +70,8 @@ def diag_cal():
             elif df_sn.loc[i, 'imei'][3:9] == 'CLL128':    
                 celltype=100 # 重卡
                 factory = "金茂换电"
+            elif df_sn.loc[i, 'imei'][5:9] == 'L420':
+                celltype=101    #20ah磷酸铁锂电芯
             else:
                 logger.info("pid-{} celltype-{} SN: {} SKIP!".format(os.getpid(), "未知", sn))
                 continue

+ 2 - 0
LIB/FRONTEND/CellStateEstimation/BatSafetyAlarm/deploy.py

@@ -77,6 +77,8 @@ def diag_cal(df_sn, df_bms_ram, df_alarm_ram, log_name):
             elif df_sn.loc[i, 'imei'][3:9] == 'CLL128':    
                 celltype=100 # 重卡
                 factory = "金茂换电"
+            elif df_sn.loc[i, 'imei'][5:9] == 'L420':
+                celltype=101    #20ah磷酸铁锂电芯
             else:
                 logger.info("pid-{} celltype-{} SN: {} SKIP!".format(os.getpid(), "未知", sn))
                 continue

+ 2 - 0
LIB/FRONTEND/CellStateEstimation/BatSafetyWarning/deploy_saftywarning.py

@@ -94,6 +94,8 @@ def saftywarning_cal():
             elif df_sn.loc[i, 'imei'][3:9] == 'CLL128':    
                 celltype=100 # 重卡
                 factory = "金茂换电"
+            elif df_sn.loc[i, 'imei'][5:9] == 'L420':
+                celltype=101    #20ah磷酸铁锂电芯
             else:
                 logger.info("pid-{} celltype-{} SN: {} SKIP!".format(os.getpid(), "未知", sn))
                 continue

+ 2 - 0
LIB/FRONTEND/CellStateEstimation/SOH/deploy.py

@@ -95,6 +95,8 @@ if __name__ == "__main__":
                 celltype=100 # 重卡
             elif df_sn.loc[i, 'imei'][3:5] == 'CL' and df_sn.loc[i, 'imei'][5:9] == 'N750': 
                 celltype=4 #CATL 50ah三元电芯
+            elif df_sn.loc[i, 'imei'][5:9] == 'L420':
+                celltype=101    #20ah磷酸铁锂电芯
             else:
                 logger.info("pid-{} celltype-{} SN: {} SKIP!".format(os.getpid(), "未知", sn))
                 continue

+ 2 - 0
LIB/FRONTEND/SaftyCenter/CellValueDiag/deploy.py

@@ -52,6 +52,8 @@ def fun():
                 celltype=3 #力信 50ah三元电芯
             elif df_sn.loc[i, 'imei'][3:5] == 'CL' and df_sn.loc[i, 'imei'][5:9] == 'N750': 
                 celltype=4 #CATL 50ah三元电芯
+            elif df_sn.loc[i, 'imei'][5:9] == 'L420':
+                celltype=101    #20ah磷酸铁锂电芯
             else:
                 logger.info("pid-{} celltype-{} SN: {} SKIP!".format(os.getpid(), "未知", sn))
                 continue

+ 2 - 0
LIB/FRONTEND/SaftyCenter/Liplated/deploy.py

@@ -57,6 +57,8 @@ def cell_platd_sorvol_test(df_sn):
                 celltype=100 # 重卡
             elif df_sn.loc[i, 'imei'][3:5] == 'CL' and df_sn.loc[i, 'imei'][5:9] == 'N750': 
                 celltype=4 #CATL 50ah三元电芯
+            elif df_sn.loc[i, 'imei'][5:9] == 'L420':
+                celltype=101    #20ah磷酸铁锂电芯
             else:
                 logger.info("pid-{} celltype-{} SN: {} SKIP!".format(os.getpid(), "未知", sn))
                 continue

+ 2 - 0
LIB/FRONTEND/SaftyCenter/LowSocAlarm/deploy.py

@@ -120,6 +120,8 @@ if __name__ == "__main__":
                     celltype=100 # 重卡
                 elif df_sn.loc[i, 'imei'][3:5] == 'CL' and df_sn.loc[i, 'imei'][5:9] == 'N750': 
                     celltype=4 #CATL 50ah三元电芯
+                elif df_sn.loc[i, 'imei'][5:9] == 'L420':
+                    celltype=101    #20ah磷酸铁锂电芯
                 # else:
                 #     logger.info("pid-{} celltype-{} SN: {} SKIP!".format(os.getpid(), "未知", sn))
                 #     continue

+ 2 - 0
LIB/FRONTEND/SaftyCenter/Sorest/deploy.py

@@ -56,6 +56,8 @@ def cell_sor_test(df_sn):
                 celltype=100 # 重卡
             elif df_sn.loc[i, 'imei'][3:5] == 'CL' and df_sn.loc[i, 'imei'][5:9] == 'N750': 
                 celltype=4 #CATL 50ah三元电芯
+            elif df_sn.loc[i, 'imei'][5:9] == 'L420':
+                celltype=101    #20ah磷酸铁锂电芯
             else:
                 logger.info("pid-{} celltype-{} SN: {} SKIP!".format(os.getpid(), "未知", sn))
                 continue

+ 44 - 44
LIB/MIDDLE/CellStateEstimation/BatSafetyWarning/V1_0_1/CBMSBatInterShort.py

@@ -214,9 +214,9 @@ class BatInterShort():
     #充电delt_volt获取.................................................................................
     def _deltvolt(self,chrg_start,chrg_end,voltmax_index):
         if self.celltype<50:
-            volt_list=[4.16, 4.18, 4.2]
+            volt_list=[4.10, 4.12, 4.14]
         else:
-            volt_list=[3.47, 3.49, 3.51]
+            volt_list=[3.50, 3.52, 3.54]
         deltvolt_list=[]
         packcrnt_mean_list=[]
         temp_mean_list=[]
@@ -602,58 +602,58 @@ class BatInterShort():
                     cellvolt_now=self._cellvolt_get(i)
                     if min(celltemp_now)>0 and max(cellvolt_now)<4:
                         charging=2
-                    if charging==2 and min(cellvolt_now)>3 and 4.1<max(cellvolt_now)<4.14:
+                    if charging==2 and min(cellvolt_now)>3 and 4.06<max(cellvolt_now)<4.12:
                         charging=1
                         chrg_start=i
                     else:
                         pass
 
             else: #充电中
-                cellvolt_now=self._cellvolt_get(i)
+                cellvolt_now=self._cellvolt_get(i-1)
                 #计算漏电流......................................................................
-                if max(cellvolt_now)>4.2 and self.packcrnt[i]>-0.1 and self.packcrnt[i+1]>-0.1:   #电压>93%对应的电压
-                    if i-chrg_start>10:
-                        chrg_end=i
-                        charging=0
+                if max(cellvolt_now)>4.1 and self.packcrnt[i]>-0.1 and self.packcrnt[i+1]>-0.1:   #电压>93%对应的电压
+                    # if (self.bmstime[i] - self.bmstime[chrg_start]).total_seconds()>300:
+                    chrg_end=i
+                    charging=0
 
-                        #计算漏电流值...................................................................
-                        if firsttime2==1:
-                            firsttime2=0
-                            voltmax_index=list(cellvolt_now).index(max(cellvolt_now))+1
-                            # cellvolt_max=(self.df_bms['单体电压'+str(voltmax_index)][chrg_start:chrg_end])/1000
-                            
-                            deltvolt_last2,packcrnt_mean_last,temp_mean_last=self._deltvolt(chrg_start,chrg_end,voltmax_index)  #获取deltAs
-                            
-                            time_last2=self.bmstime[chrg_end]
-                            df_ram_chrgvolt.loc[0]=[self.sn,time_last2,list(map(list,deltvolt_last2)),packcrnt_mean_last,temp_mean_last]    #更新RAM信息
-                        else:
-                            dict_baltime2={}
-                            time_now2=self.bmstime[chrg_end]
-                            voltmax_index=list(cellvolt_now).index(max(cellvolt_now))+1
-                            # cellvolt_max=(self.df_bms['单体电压'+str(voltmax_index)][chrg_start:chrg_end])/1000
-                            
-                            deltvolt_now2,packcrnt_mean_now,temp_mean_now=self._deltvolt(chrg_start,chrg_end,voltmax_index)
-                            leak_current2=[]
-                            for j in range(min(len(deltvolt_now2),len(deltvolt_last2))):
-                                if abs(packcrnt_mean_now[j]-packcrnt_mean_last[j])<10 and (abs(temp_mean_now[j]-temp_mean_last[j])<10 or (temp_mean_now[j]>20 and temp_mean_last[j]>20)) and (time_now2-time_last2).total_seconds()<14*24*3600:
-                                    list_sub2=(deltvolt_now2[j]-deltvolt_last2[j])*1000
-                                    list_sub2=np.round(list_sub2,1)
-                                    leak_current2.append(list(list_sub2))
-                                else:
-                                    break
-                            if len(leak_current2)>0:
-                                df_res.loc[len(df_res)]=[time_last2,time_now2,self.sn,4,str(leak_current2),str(dict_baltime2)]  #计算结果存入Dataframe
-                            time_last2=time_now2
-                            deltvolt_last2=deltvolt_now2
-                            packcrnt_mean_last=packcrnt_mean_now
-                            temp_mean_last=temp_mean_now
-                            dict_bal2={}
-                            df_ram_chrgvolt.loc[0]=[self.sn,time_last2,list(map(list,deltvolt_last2)),packcrnt_mean_last,temp_mean_last]    #更新RAM信息
-                    
+                    #计算漏电流值...................................................................
+                    if firsttime2==1:
+                        firsttime2=0
+                        voltmax_index=list(cellvolt_now).index(max(cellvolt_now))+1
+                        # cellvolt_max=(self.df_bms['单体电压'+str(voltmax_index)][chrg_start:chrg_end])/1000
+                        
+                        deltvolt_last2,packcrnt_mean_last,temp_mean_last=self._deltvolt(chrg_start,chrg_end,voltmax_index)  #获取deltAs
+                        
+                        time_last2=self.bmstime[chrg_end]
+                        df_ram_chrgvolt.loc[0]=[self.sn,time_last2,list(map(list,deltvolt_last2)),packcrnt_mean_last,temp_mean_last]    #更新RAM信息
                     else:
-                        charging=0
+                        dict_baltime2={}
+                        time_now2=self.bmstime[chrg_end]
+                        voltmax_index=list(cellvolt_now).index(max(cellvolt_now))+1
+                        # cellvolt_max=(self.df_bms['单体电压'+str(voltmax_index)][chrg_start:chrg_end])/1000
+                        
+                        deltvolt_now2,packcrnt_mean_now,temp_mean_now=self._deltvolt(chrg_start,chrg_end,voltmax_index)
+                        leak_current2=[]
+                        for j in range(min(len(deltvolt_now2),len(deltvolt_last2))):
+                            if abs(packcrnt_mean_now[j]-packcrnt_mean_last[j])<10 and (abs(temp_mean_now[j]-temp_mean_last[j])<10 or (temp_mean_now[j]>20 and temp_mean_last[j]>20)) and (time_now2-time_last2).total_seconds()<14*24*3600:
+                                list_sub2=(deltvolt_now2[j]-deltvolt_last2[j])*1000
+                                list_sub2=np.round(list_sub2,1)
+                                leak_current2.append(list(list_sub2))
+                            else:
+                                break
+                        if len(leak_current2)>0:
+                            df_res.loc[len(df_res)]=[time_last2,time_now2,self.sn,4,str(leak_current2),str(dict_baltime2)]  #计算结果存入Dataframe
+                        time_last2=time_now2
+                        deltvolt_last2=deltvolt_now2
+                        packcrnt_mean_last=packcrnt_mean_now
+                        temp_mean_last=temp_mean_now
+                        dict_bal2={}
+                        df_ram_chrgvolt.loc[0]=[self.sn,time_last2,list(map(list,deltvolt_last2)),packcrnt_mean_last,temp_mean_last]    #更新RAM信息
+                    
+                    # else:
+                    #     charging=0
                 
-                elif self.packcrnt[i]>-0.1 and self.packcrnt[i-1]>-0.1: #(self.packcrnt[i]<-eval(self.pack_param['capacity'])/2 and self.packcrnt[i-1]<-eval(self.pack_param['capacity'])/2):  #如果充电过程中时间间隔>180s,则舍弃该次充电
+                elif self.packcrnt[i]>-0.1 and self.packcrnt[i+1]>-0.1: #(self.packcrnt[i]<-eval(self.pack_param['capacity'])/2 and self.packcrnt[i-1]<-eval(self.pack_param['capacity'])/2):  #如果充电过程中时间间隔>180s,则舍弃该次充电
                     charging=0
                 elif i==len(self.df_bms)-2:  #数据中断后仍在充电,将前段充电数据写入RAM
                     df_ram_lfp=self.df_bms.iloc[chrg_start:]