|
@@ -39,6 +39,8 @@ class SafetyWarning:
|
|
|
cellshortfault=0
|
|
|
volt_rate=[]
|
|
|
R2_list=[]
|
|
|
+ voltsigmafault_list=[]
|
|
|
+ uniformfault_list=[]
|
|
|
|
|
|
if not self.df_short.empty:
|
|
|
short_current=self.df_short['short_current']
|
|
@@ -79,7 +81,7 @@ class SafetyWarning:
|
|
|
cellvolt_rank=cellvolt_rank.str.replace("[", '')
|
|
|
cellvolt_rank=cellvolt_rank.str.replace("]", '')
|
|
|
|
|
|
- # plt.figure()
|
|
|
+ plt.figure()
|
|
|
for i in range(self.param.CellVoltNums):
|
|
|
#漏电流故障判断...........................................................................
|
|
|
if not self.df_short.empty:
|
|
@@ -113,21 +115,22 @@ class SafetyWarning:
|
|
|
R2_list.append(R2)
|
|
|
|
|
|
volt_rate.append(a1)
|
|
|
- # plt.plot(xtime1,y1,label=a1)
|
|
|
- # plt.scatter( xtime1,VoltChange[volt_column[i]],marker='o')
|
|
|
- # plt.legend(loc='best')
|
|
|
- # plt.title('单体电压'+str(i+1))
|
|
|
- # plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
|
|
|
- # plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
|
|
|
+ plt.plot(xtime1,y1,label=a1)
|
|
|
+ plt.scatter( xtime1,VoltChange[volt_column[i]],marker='o')
|
|
|
+ plt.legend(loc='best')
|
|
|
+ plt.title('单体电压'+str(i+1))
|
|
|
+ plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
|
|
|
+ plt.rcParams['axes.unicode_minus']=False #用来正常显示负号
|
|
|
# plt.show()
|
|
|
|
|
|
- if volt3sigma_sum>len(self.OutLineVol_Rate)/2:
|
|
|
+ if volt3sigma_sum>len(volt3sigma)/2:
|
|
|
voltsigmafault=1
|
|
|
else:
|
|
|
voltsigmafault=0
|
|
|
else:
|
|
|
volt_rate.append(0)
|
|
|
R2_list.append(0)
|
|
|
+ voltsigmafault_list.append(voltsigmafault)
|
|
|
|
|
|
#电芯SOC排名判断.............................................................................
|
|
|
if not self.df_uniform.empty:
|
|
@@ -139,9 +142,10 @@ class SafetyWarning:
|
|
|
uniformfault=0
|
|
|
else:
|
|
|
uniformfault=0
|
|
|
+ uniformfault_list.append(uniformfault)
|
|
|
|
|
|
#漏电流热失控预警确认........................................................
|
|
|
- if cellshortfault==1 and (uniformfault==1 or voltsigmafault==1):
|
|
|
+ if cellshortfault==1:
|
|
|
faultcode=110
|
|
|
faultlv=4
|
|
|
faultinfo='电芯{}发生热失控安全预警'.format(i+1)
|
|
@@ -162,7 +166,7 @@ class SafetyWarning:
|
|
|
else:
|
|
|
cellsoh_3sigma=[0]*self.param.CellVoltNums
|
|
|
for i in range(len(volt_rate)):
|
|
|
- if volt_rate[i]<self.param.TrwVoltRate and volt_rate_3sigma[i]<-3 and abs(cellsoh_3sigma[i])<2.5:
|
|
|
+ if volt_rate[i]<self.param.TrwVoltRate and volt_rate_3sigma[i]<-3 and abs(cellsoh_3sigma[i])<2.5 and (uniformfault_list[i]==1 or voltsigmafault_list[i]==1):
|
|
|
faultcode=110
|
|
|
faultlv=4
|
|
|
faultinfo='电芯{}发生热失控安全预警'.format(i+1)
|
|
@@ -171,6 +175,6 @@ class SafetyWarning:
|
|
|
else:
|
|
|
pass
|
|
|
|
|
|
- # plt.show()
|
|
|
+ plt.show()
|
|
|
|
|
|
return df_res
|