|
@@ -202,8 +202,7 @@ class BatInterShort():
|
|
|
|
|
|
#三元电池的内短路电流计算...........................................................................................................................................................
|
|
|
def _ncm_intershort(self):
|
|
|
- column_name=['time_st', 'time_sp', 'sn', 'method','short_current','baltime']
|
|
|
- df_res=pd.DataFrame(columns=column_name)
|
|
|
+ df_res=pd.DataFrame(columns=['time_st', 'time_sp', 'sn', 'method','short_current','baltime'])
|
|
|
df_ram_last=self.df_last
|
|
|
df_ram_last1=self.df_last1
|
|
|
df_ram_last3=self.df_last3
|
|
@@ -217,31 +216,35 @@ class BatInterShort():
|
|
|
capacity=self.param.Capacity*batsoh/100
|
|
|
|
|
|
#参数初始化
|
|
|
- if self.df_last.empty:
|
|
|
+ if df_ram_last.empty:
|
|
|
firsttime=1
|
|
|
dict_bal={}
|
|
|
else:
|
|
|
- deltsoc_last=self.df_last.loc[0,'deltsoc']
|
|
|
- cellsoc_last=self.df_last.loc[0,'cellsoc']
|
|
|
- time_last=self.df_last.loc[0,'time']
|
|
|
+ deltsoc_last=df_ram_last.loc[0,'deltsoc']
|
|
|
+ cellsoc_last=df_ram_last.loc[0,'cellsoc']
|
|
|
+ time_last=df_ram_last.loc[0,'time']
|
|
|
firsttime=0
|
|
|
dict_bal={}
|
|
|
- if self.df_last1.empty:
|
|
|
+ if df_ram_last1.empty:
|
|
|
firsttime1=1
|
|
|
dict_bal1={}
|
|
|
else:
|
|
|
- deltsoc_last1=self.df_last1.loc[0,'deltsoc1']
|
|
|
- time_last1=self.df_last1.loc[0,'time1']
|
|
|
+ deltsoc_last1=df_ram_last1.loc[0,'deltsoc1']
|
|
|
+ time_last1=df_ram_last1.loc[0,'time1']
|
|
|
firsttime1=0
|
|
|
dict_bal1={}
|
|
|
- if self.df_last3.empty:
|
|
|
+ if df_ram_last3.empty:
|
|
|
standingtime=0
|
|
|
standingtime1=0
|
|
|
else:
|
|
|
- standingtime=self.df_last3.loc[0,'standingtime']
|
|
|
- standingtime1=self.df_last3.loc[0,'standingtime1']
|
|
|
- firsttime1=0
|
|
|
+ standingtime=df_ram_last3.loc[0,'standingtime']
|
|
|
+ standingtime1=df_ram_last3.loc[0,'standingtime1']
|
|
|
dict_bal1={}
|
|
|
+ if abs(self.packcrnt[0])<0.01 and standingtime>1 and standingtime1>1:
|
|
|
+ standingtime=standingtime+(self.bmstime[0]-df_ram_last3.loc[0,'time3']).total_seconds()
|
|
|
+ standingtime1=standingtime1+(self.bmstime[0]-df_ram_last3.loc[0,'time3']).total_seconds()
|
|
|
+ else:
|
|
|
+ pass
|
|
|
|
|
|
for i in range(1,len(self.df_bms)-1):
|
|
|
|
|
@@ -380,7 +383,7 @@ class BatInterShort():
|
|
|
pass
|
|
|
|
|
|
#更新RAM的standingtime
|
|
|
- df_ram_last3.loc[0]=[self.sn,standingtime,standingtime1]
|
|
|
+ df_ram_last3.loc[0]=[self.sn,self.bmstime[len(self.bmstime)-1],standingtime,standingtime1]
|
|
|
|
|
|
#返回计算结果
|
|
|
if df_res.empty:
|
|
@@ -406,40 +409,45 @@ class BatInterShort():
|
|
|
batsoh=self.df_soh.loc[len(self.df_soh)-1,'soh']
|
|
|
capacity=self.param.Capacity*batsoh/100
|
|
|
#参数初始化
|
|
|
- if self.df_last.empty:
|
|
|
+ if df_ram_last.empty:
|
|
|
firsttime=1
|
|
|
dict_bal={}
|
|
|
else:
|
|
|
- deltsoc_last=self.df_last.loc[0,'deltsoc']
|
|
|
- cellsoc_last=self.df_last.loc[0,'cellsoc']
|
|
|
- time_last=self.df_last.loc[0,'time']
|
|
|
+ deltsoc_last=df_ram_last.loc[0,'deltsoc']
|
|
|
+ cellsoc_last=df_ram_last.loc[0,'cellsoc']
|
|
|
+ time_last=df_ram_last.loc[0,'time']
|
|
|
firsttime=0
|
|
|
dict_bal={}
|
|
|
- if self.df_last1.empty:
|
|
|
+ if df_ram_last1.empty:
|
|
|
firsttime1=1
|
|
|
dict_bal1={}
|
|
|
else:
|
|
|
- deltsoc_last1=self.df_last1.loc[0,'deltsoc1']
|
|
|
- time_last1=self.df_last1.loc[0,'time1']
|
|
|
+ deltsoc_last1=df_ram_last1.loc[0,'deltsoc1']
|
|
|
+ time_last1=df_ram_last1.loc[0,'time1']
|
|
|
firsttime1=0
|
|
|
dict_bal1={}
|
|
|
- if self.df_last2.empty:
|
|
|
+ if df_ram_last2.empty:
|
|
|
firsttime2=1
|
|
|
charging=0
|
|
|
dict_bal2={}
|
|
|
else:
|
|
|
- deltAs_last2=self.df_last2.loc[0,'deltAs2']
|
|
|
- time_last2=self.df_last2.loc[0,'time2']
|
|
|
+ deltAs_last2=df_ram_last2.loc[0,'deltAs2']
|
|
|
+ time_last2=df_ram_last2.loc[0,'time2']
|
|
|
firsttime2=0
|
|
|
charging=0
|
|
|
dict_bal2={}
|
|
|
- if self.df_last3.empty:
|
|
|
+ if df_ram_last3.empty:
|
|
|
standingtime=0
|
|
|
standingtime1=0
|
|
|
else:
|
|
|
- standingtime=self.df_last3.loc[0,'standingtime']
|
|
|
- standingtime1=self.df_last3.loc[0,'standingtime1']
|
|
|
+ standingtime=df_ram_last3.loc[0,'standingtime']
|
|
|
+ standingtime1=df_ram_last3.loc[0,'standingtime1']
|
|
|
dict_bal1={}
|
|
|
+ if abs(self.packcrnt[0])<0.01 and standingtime>1 and standingtime1>1:
|
|
|
+ standingtime=standingtime+(self.bmstime[0]-df_ram_last3.loc[0,'time3']).total_seconds()
|
|
|
+ standingtime1=standingtime1+(self.bmstime[0]-df_ram_last3.loc[0,'time3']).total_seconds()
|
|
|
+ else:
|
|
|
+ pass
|
|
|
|
|
|
for i in range(1,len(self.df_bms)-1):
|
|
|
|
|
@@ -657,7 +665,7 @@ class BatInterShort():
|
|
|
|
|
|
|
|
|
#更新RAM
|
|
|
- df_ram_last3.loc[0]=[self.sn,standingtime,standingtime1]
|
|
|
+ df_ram_last3.loc[0]=[self.sn,self.bmstime[len(self.bmstime)-1],standingtime,standingtime1]
|
|
|
|
|
|
#返回结果
|
|
|
if df_res.empty:
|