[Battery Test] Processing OCV(3) - Compute $R_0$ estimates

2021. 1. 18. 21:05[Battery is my Life]

Code

# df1 : discharge
# df3 : charge

# Compute R0 estimates
# assume R0 changes linearly from 0 soc to 100 soc 

# Step index = 2 (slow discharge)
slow_dischg_index = df1[df1['Step_Index']==2].index.tolist()
slow_dichg_first_index = slow_dischg_index[0]
slow_dichg_last_index = slow_dischg_index[-1]

# Step index = 2 (slow charge)
slow_chg_index = df3[df3['Step_Index']==2].index.tolist()
slow_chg_first_index = slow_chg_index[0]
slow_chg_last_index = slow_chg_index[-1]

# starting instant voltage change (step 1 에서 step 2 로 바뀌는 순간!)
IR1Da = df1.loc[slow_dichg_first_index-1,'Voltage(V)'] - df1.loc[slow_dichg_first_index,'Voltage(V)'] # beginning of dischg step 
IR1Ca = df3.loc[slow_chg_first_index,'Voltage(V)']-df3.loc[slow_chg_first_index-1,'Voltage(V)'] # beginning of chg step

# final instant voltage change (step 2 에서 step 3 로 바뀌는 순간!)
IR2Da = df1.loc[slow_dichg_last_index+1,'Voltage(V)'] - df1.loc[slow_dichg_last_index,'Voltage(V)'] # end of dischg step
IR2Ca = df3.loc[slow_chg_last_index,'Voltage(V)']-df3.loc[slow_chg_first_index+1,'Voltage(V)'] # end of chg step

# min (limiting effect)
IR1D = min(IR1Da,2*IR2Ca)
IR2D = min(IR2Da,2*IR1Ca)
IR1C = min(IR1Ca,2*IR2Da)
IR2C = min(IR2Ca,2*IR1Da)

# Adjusting voltage curves

# discharge part

length_of_slow_dischg_index = len(slow_dischg_index)
blend = np.array([i for i in range(length_of_slow_dischg_index)])/(length_of_slow_dischg_index-1)

# resistance 의 변화가 linear하다고 가정!
IRblend = IR1D + (IR2D-IR1D) * blend

# OCV (discharge) + 저항 성분
disV = np.array(df1.loc[slow_dischg_index,'Voltage(V)']) + IRblend

# soc 계산
disZ = 1 - (np.array(df1.loc[slow_dischg_index,'Discharge_Capacity(Ah)'])/Q25)

# soc가 1에서 시작하게끔 만들어주는 과정
disZ = disZ + (1-disZ[0])

# charge part 

length_of_slow_chg_index = len(slow_chg_index)
blend = np.array([i for i in range(length_of_slow_chg_index)])/(length_of_slow_chg_index-1)

# resistance 의 변화가 linear하다고 가정!
IRblend = IR1C + (IR2C-IR1C) * blend

# OCV (charge) - 저항 성분
chgV = np.array(df3.loc[slow_chg_index,'Voltage(V)']) - IRblend

# soc 계산
chgZ = (np.array(df3.loc[slow_chg_index,'Charge_Capacity(Ah)'])/Q25)

# soc가 0에서 시작하게끔 만들어주는 과정
chgZ = chgZ - chgZ[0]

[Visualization]

  • before data processing
    • 우리가 원하는 형태는 하나의 SOC 값에 하나의 OCV 값
    • test 결과 charge / discharge 에 따라 OCV값이 다르다 (그림의 xlabel은 data index값, soc가 아님)

  • data processing
    • 저항(Series Resistance)이 영향을 주었을 것이다
    • OCV에 따라 저항 값이 다르다
    • (실제는 그렇지 않지만) 저항값이 linear하게 변한다고 가정!
    • 저항값을 빼줘서 charge / discharge OCV의 간격을 좁히자!
      blue : charge / red : discharge

[Conclusion]

  • charge / discharge 간 간격을 줄였지만 여전히 2 개의 그래프로 나타난다
  • 다음 세션에서 interpolation을 활용해 해결하는 과정을 다루겠다
728x90