State of charge estimation by using extended Kalman filter based on improved open circuit voltage model

Received Apr 18, 2019 Revised Feb 19, 2020 Accepted Mar 20, 2020 This paper focuses on the state of charge estimation (SOC) for battery Li-ion. By modeling a battery based on the equivalent circuit model, the extended Kalman filter approach can be applied to estimate the battery SOC. An electrical battery model is developed in Matlab, Where the structure of the model is detailed by equations and blocks. The battery model has been validated from the experiment results. The comparison shows a good agreement in predicting the voltage, SOC estimation and the model performs better in SOC estimation.


INTRODUCTION
The rechargeable batteries become widely spread nowadays due to availability in markets in different sizes, as well as can be used for industrial applications or people needs. Another factor contributes to its spread is the environmental issue and the low-cost of this energy. However, theirs long life cycle and high density of its energy make it dominate in many applications, such as power grid, electrical vehicle, which have been integrated as an energy storage system [1]. In recent years, the rechargeable battery improved by using developed technologies such as limit gas emission and enhanced in mass and energy density. It is well known that the battery converts the chemical energy to electrical energy during discharge and the opposite during the charging process, due to this reason, modeling the battery becomes a necessity to control and safeguard the systems.
Modeling the battery can give important pieces of information about its internal state. The internal state represented by the remaining energy inside the battery, which is signified by the state of charge (SOC). The main objective of modeling is to monitoring the internal parameters of the battery, among them the voltage, current, and SOC [2,3]. Therefore, an accurate battery model is vital to forecast the battery characteristics and can avoid the overcharge or the over-discharge. In literature, there are a lot of studies on battery modeling. Some of them focus on electrochemical modeling [4,5] and other about equivalent circuit models or combined models [6,7]. Since the equivalent circuit models have been based on electrical components to suit chemical behavior it is applied widely for simulation. Thevenin and second-order battery model are popularly used for modeling the battery, but before selecting the battery model, it is necessary to Matlab/Simulink is a powerful tool for simulation; it provides a lot of blocks and tools such as functions blocks, and also strong libraries, as SimPowerSystems library. However, the model is built based on the electrical equations and developed in Simulink in order to give accurate simulation results. The paper is investigated on the equivalent circuit model build in Matlab/Simulink. The second-order Thevenin battery model was designed and the parameters of the battery model determination from experimental data. Moreover, a proposed model can be easily linked to other circuit blocks for comparison between real estimation and simulated data. Then, an extended Kalman filter algorithm (EKF) [8][9][10] was developed to enhance SOC estimation. Therefore, the coulomb counting method [11][12][13] has been used as a reference for SOC estimation. The paper is organized as follows: Section two introduces the proposed model and detailed by equations and blocks. Test bench and parameters extraction represented in section three, followed by outline the EKF approach in section four. The results of simulation are summarized in section five. Finally, the paper concludes.

PROPOSED BATTERY MODEL
The commonly used equivalent circuit for describing the battery model is Thevenin, which is representing the model by electrical components. It consists of an ideal battery voltage source (OCV), a series resistance (Rs), and a parallel capacitance (C) and an over-voltage resistance (R). The Thevenin model also named the first-order model, second-order model or third-order model depending on the number of the branch (RC) consist. The RCs branches are used to describe the behavior or transient response of terminal voltage. Figure 1 shows the selected equivalent circuit model. This second-order Thevenin model is built in Simulink and standard tests were done into the battery to determine its parameters.

SOC calculation
State of charge is the famous parameter reflect the quantity of energy remain in the battery. It can be affected by some conditions as the temperature and the history of the cell. When the cell is fully charged the SOC take the value of 100% or 1, in opposite, when it is fully empty or discharged get the value 0. Numerous methods assume to determinate the SOC as the coulomb counting. It is the simplest approach based directly to the definition of SOC, the precision of this method depending on the initial value of SOC and require recalibration each cycle of charge/discharge, mathematically expressed in [14]: Where the SOC 0 is the initial value, C bat is the nominal capacity given by the manufacture. By converting the (1) to Simulink model for simulation purpose, Figure 2 shows the structure of SOC calculation.

OCV calculation
Open circuit voltage is the equilibrium voltage. It is an important parameter to be identified which is the linked directly to the SOC. The relationship OCV-SOC can be represented with polynomial equation. However, a mathematical function can be establishing that relationship as shown in Figure 3.  Figure 4 shows the structure of the RC branches, the value of R_1 , C_1, R_2 and C_2 are tabulated in look-up table due to their relationships with SOC. The model determines the best value for parameters by using interpolation-extrapolation method.

Voltage of RCs branches calculation
The branches RCs are corresponding to the transient response of battery terminal voltage. In order to build a subsystem responsible to represent the RC parallel network, in Figure 1 appear the voltage V 1 and V 2 , which are corresponding to transient voltages 1 and 2, their equations can be expressed as: Thus, the blocks used to realize the simulation of these equations can be arranged as illustrated in Figure 5, where the first and the second RC network are V 1 and V 2 respectively.

Vs calculation
It is necessary to mention that the series resistance represent the difference between the drop value of voltage after pulse discharge, and it also shows different values when transferring between charge and discharge operations. The value of the voltage across it can be calculated as e (4), the structure block in Simulink is illustrated in Figure 6.

BATTERY TESTS
As it is illustrated in Figure 8, the schematic blocks show the experiment test bench structure. The bench consists of a LifeP04 battery, which has a nominal voltage of 3.2 and a capacity of 10Ah. The battery is discharged by electronic load and the data transferred to the host computer using Arduino mega with Matlab/Simulink in a room at 25°C.

Series resistance
The series resistance Rs can be identified from experimental data as illustrated in Figure 9. The internal resistance can be calculated in the drop voltage between U1 and U2 during relaxation period (I=0A) by using (6). The obtained values tabulated in look-up table as shown in Figure 7.

Calculation of R1, R2, C1 and C2
The values of R 1 , R 2 , C 1 and C 2 are determined from the transient voltage between U2 and U3. The least square method algorithm through curve fitting Matlab tool has been used to compute each parameter of RCs branch network. The obtained values are tabulated in look-up table as mentioned in Figure 4. The equation used to determine these values is denoted as:

OCV relationship
The open circuit voltage is the terminal voltage of the battery after pulse discharge applied where the voltage reaches the equilibrium state. The values of OCV linked to SOC. The relationship between them is represented by polynomial function as shown in Figure 10. It is constructed by different experimental points fitted with polynomial function. The fitted polynomial function is defined as: where z denote the state of charge (SOC) and the parameters to are tabulated in Table 1:

EXTENDED KALMAN FILTER APPROACH
The Kalman filter is the most technology known on tracking systems, used also for the estimation, there exists for linear systems and has adopted for nonlinear systems under the name extended Kalman filter (EKF) [15][16][17][18][19], which is utilising for prediction into dynamic fields, for example: tracking, navigation, and also in global position. So recently has used in battery field. The Kalman filter consists of mathematical recursive equations, which allows the repetition of the calculi each step, the output of the system depend directly to the previous input, so the state vector relies on the present output to its input. Because of the battery behaviour and its dynamic. It can be considered as a nonlinear system for this part, due to the voltage and current sensors from another part. In this system, the output is the voltage, and the input is the current, also an observer is designed to calculate and evaluate the state each sampling time. The observer is designed to track each parameter; every parameter is representing into the system by a specific state variable. The system is based on the equations of the first order RC equivalent model, which cited in battery model chapter. The EKF technique is applied to suit the behaviour of the battery and extract the parameters each iterations. By supposing the state variables for the battery are: (9) with T is the transpose matrix.
To provide a background, it is necessary to briefly describe the extended Kalman filter. For the state vector has been used a nonlinear continuous equation, and for the observation vector used a nonlinear discrete equation. The input is chosen as u(t)=IL and the output is y(t)=Vt, the equations of the system and its observer become [20]: The terms w and v are random distributions Gaussian representing the error caused by the sensors and measurements. In the previous functions f (x,u) and g (x,u) linearization is needed, so each sampling step is carried by the Jacobin function as follow [21]: The EKF algorithm follows the steps: a. Prediction: b. Measurement update where Q and R are the variances of the noise v(k) and w(k) respectively, and I is the identity matrix, ̂ is the update state estimated from the previous one.

SIMULATION RESULTS
In order to validate the proposed model, the simulation results of continuous discharge and pulse discharge tests are used to compare with the corresponding experiment results. Therefore, the structure of the schematic made for simulation is shown in Figure 11. The EKF is integrated to estimate the SOC. Figure 11. Schematic blocks of EKF SOC estimation By using the experimental data, such as current and voltage, where the input is the current-time vector and the voltage-time as an output of the model. As shown in Figure 12, the voltage curve of simulation and experiment results are well tracked. The RMS error of voltage is 25mv, which is 2% to the terminal voltage of the battery. This shows good agreement between the model and experiment, so the model can perform accurately. Similarly, the error of estimation the voltage is shown in Figure 13. The improved battery model is suitable for SOC estimation, the hybrid pulse power test was implemented to figure out the accuracy of this model. The parameters of the battery are updated via look-up table and extrapolation, Figure 14 presents the comparison of real data with model simulation data. The figure shows a good match between real and simulation in SOC. As shown in Figure 15, the simulated SOC match the real SOC while the discharge current applied. The EKF SOC estimator instantly diminishes the error, while error decreases below 3% in continuous discharge. In our case, while the correction takes a few milliseconds. Figure 14. Estimation of SOC of pulse discharge test Figure 15. Estimation of SOC of pulse discharge test

CONCLUSION
This paper has been proposed as an accurate battery model to characterize the dynamic behavior of battery based on Matlab/Simulink. The EKF algorithm is applied to optimally estimate the SOC of the cell, the battery model has been based on the second-order Thevenin model, where has been implemented and explained in details. This model has been developed and the accuracy has been proven with experimental results. It is applicable for other battery models, while it is simple and not involves complex computation, as well as, the response of EKF algorithm in order of a few seconds.