[Battery Test] Processing OCV(4) - Compensate for Steady State Resistance

2021. 1. 23. 16:50[Battery is my Life]

code

# Compensate for steady state resistance
from scipy.interpolate import interp1d

# 0.5 soc 구간 charge ocv & discharge ocv difference 구하기 위한 interpolation 
# kind = 'linear'
chg_interp= interp1d(chgZ,chgV,fill_value='extrapolate')
dischg_interp = interp1d(disZ,disV,fill_value='extrapolate')

# 0.5 soc 구간 charge ocv & discharge ocv difference (blending factor) 구하기   
deltaV50 = chg_interp(0.5) - dischg_interp(0.5)

# soc < 0.5 구간 charge ocv에 blending factor 적용 
below_index = np.where(chgZ < 0.5)
chgV_modified = chgV[below_index] - chgZ[below_index]*deltaV50
chgZ_modified = chgZ[below_index]

# soc > 0.5 구간 discharge ocv에 blending factor 적용
upper_index = np.where(disZ > 0.5)
disV_modified = np.flipud(disV[upper_index]+ (1-disZ[upper_index])*deltaV50)
disZ_modified = np.flipud(disZ[upper_index])

# 두 구간 합치기
tot_OCV = np.concatenate([chgV_modified,disV_modified])
tot_Z = np.concatenate([chgZ_modified,disZ_modified])

# 전반적인 OCV vs SOC relationship 구하기 위한 interpolation
# kind = 'linear'
Z_OCV_fn =  interp1d(tot_Z,tot_OCV,fill_value='extrapolate')

 

[Code Analysis]

np.where

np.where(chgZ < 0.5)
# ==> returns chgZ array에 0.5 이하인 것들의 index값 반환

 

np.flipud

np.flipud(disZ[upper_index])
# ==> returns disZ array에 soc가 0.5보다 큰 element들의 order를 (flip) 바꿔준다

 

interp1d

Z_OCV_fn = interp1d(tot_Z,tot_OCV,fill_value='extrapolate')
# ==> returns tot_Z(X) 와 tot_OCV(Y)의 관계를 함수로 반환
# Z_OCV_fn(0.5) 는 soc = 0.5 일때의 OCV를 반환

# interp1d(tot_Z,tot_OCV,kind=) default : kind='linear'
# kind 종류 : linear, nearest, cubic, quadratic, etc 다양하다
# 여기서는 linear로 잡아주고 실험함

# fill_value = 'extrapolate' 
# 간혹 범위에서 벗어난 값들이 있는데 'extrapolate' 으로 설정하면 알아서 계산해준다

 

np.concatenate

np.concatenate([chgV_modified,disV_modified])
# ==> returns 두 array 합치기

 

[Visualization]

before processing

  • (xlabel 이 soc를 의미한다고 가정)

 

  • high soc 끝점 : charge OCV > discharge OCV
    • charge OCV가 25$^\circ$C calibration 전에 100% SOC에 도달할 수도 있다

 

  • low soc 끝점 : charge OCV > discharge OCV
    • discharge OCV가 25$^\circ$C calibration 전에 0% SOC에 도달할 수도 있다

 

  • 전반적인 OCV vs SOC relationship (soc = 0.5 기준)
    • 0.5 이상 : discharge OCV curve 로 보겠다
    • 0.5 이하 : charge OCV curve 로 보겠다

 

High SOC Low SOC
blue : charge / red : discharge
blue : charge / red : discharge

 

processing

  • at high soc : discharge OCV가 주 성분 (초록선 - discharge ocv trend와 가까워진다)
  • at low soc : charge OCV가 주 성분 (초록선 - charge ocv trend와 가까워진다)
  • 초록선 - charge OCV 와 discharge OCV 사이에 들어온다

 

blue : charge / red : discharge / green : modified

 

[Conclusion]

  • soc = 0.5 기준으로 두 구간으로 나눈다
    • at high soc : discharge OCV 성분만 가져온다
    • at low soc : charge OCV 성분만 가져온다
    • 이 둘을 BLEND 시킨다
728x90