# State of Charge Estimation for Lithium-Ion Battery via MILS Algorithm Based on Ensemble Kalman Filter

Authors: Quanchun Yan; Kangkang Yuan; Wen Gu; Chenlong Li; Guoqiang Sun; Yanan Liu
Journal: International Journal of Photoenergy
 (2021)

---

## Abstract

Accurate state of charge (SOC) is great significant for lithium-ion battery to maximize its performance and prevent it from overcharging or overdischarging. This paper presents an ensemble Kalman filter- (EnKF-) based SOC estimation algorithm for lithium-ion battery. Firstly, the lithium-ion battery is modeled by the first-order RC equivalent circuit, and the multi-innovation least square (MILS) algorithm is used to perform online parameter identification of the model parameters. Then, the ensemble Kalman filter (EnKF) is introduced to estimate the state of charge. Finally, two typical experiments including constant current discharge experiment and cycling dynamic stress test are applied to evaluate the performance of the joint algorithm of MILS and EnKF. The experimental results show that the joint algorithm-based ensemble Kalman filter can achieve fast tracking and higher estimation accuracy for lithium-ion battery SOC.


---

## Body

## 1. Introduction

Nowadays, the rapid development of electric vehicles, renewable energy power output, and user-side energy storage system has brought a heavy demand for the energy storage batteries as a key link. Compared with traditional lead-acid and nickel-cadmium battery, etc., lithium-ion battery features high energy density, high power density, low self-discharge rate, and long cycling life [1–3]. With the continuous cost reduction, lithium-ion battery core has been most widely used for battery energy storage. The state of charge (SOC) reflects the current remaining capacity of the battery. However, SOC estimation accuracy of lithium-ion batteries might be limited due to the nonlinear operating, aging, and the working environment effects. Therefore, it is very necessary to improve the estimation accuracy of SOC of lithium-ion batteries through further research [4, 5].The model-based SOC estimation method is the most applicable method for SOC estimation. It starts with parameter identification of the lithium-ion battery model and continues with the proper filter for SOC estimation. Parameter identification is the foundation of SOC estimation, and its accuracy will affect the final estimation. [6] employ the offline least squares algorithm for lithium-ion battery parameter identification, which is simple, feasible, and entails less calculation. However, it is not applicable as online parameter update cannot be possible. [7, 8] choose recursive least squares algorithm for the identification of the equivalent circuit parameters of lithium-ion batteries, which succeeds in online parameter update. But with the problems brought by data saturation and noises unsolved, estimation cannot be unbiased. In this regard, [9] compensate the error caused by noise and use the deviation compensation least squares method for online lithium-ion battery parameter identification, which makes unbiased estimation possible if the noise type can be decided.Proper filter matters in the model-based SOC estimation as it affects the estimation accuracy directly. Standard Kalman filter is applied for SOC in [10] based on the Thevenin Equivalent Circuit of the lithium-ion battery. However, as the lithium-ion battery is a nonlinear system, the error is big. [11] introduce the concept of linearization of nonlinear models, which linearizes the model of the lithium-ion battery state, and realize SOC estimation through extended Kalman filter. Linearization errors are inevitable in this regard. [12, 13] introduce unscented Kalman filter for SOC estimation which uses unscented transform to obtain the prediction mean of the state and the covariance. Because the covariance is not necessarily positive semidefinite, the estimation results may be unstable.In view of the problems in the abovementioned lithium-ion battery estimation methods, a first-order RC equivalent circuit model of lithium-ion batteries is established in this paper, and the multi-innovation least square (MILS) algorithm is used for parameter identification while SOC estimation is based on ensemble Kalman filter (EnKF). These approaches have made it possible for online estimation of SOC and parameter identification. This paper investigates the rate of convergence and accuracy of combined estimation method for SOC estimation of lithium-ion batteries under both the constant current discharge experiment and dynamic stress test (DST).


## 2. Parameter Identification of Lithium-Ion Batteries

### 2.1. Equivalent Circuit Model of Lithium-Ion Batteries

The first-order RC equivalent circuit model of lithium-ion battery (Figure1) can accurately reflect the transition process from the charging to discharging of the battery, which entails high accuracy and low computational complexity [14, 15]. In Figure 1, R1 represents the ohmic resistance, R2 is the polarization resistance, and C is the polarization capacitance. R1, R2, and C are to be identified. i refers to the working current of the lithium-ion battery, and its direction is shown in Figure 1. VCt means the polarization capacitance voltage, VOCt indicates the terminal voltage, and Et is the electromotive force.Figure 1
The first-order RC circuit model.According to Kirchhoff’s laws, the following equation can be obtained from Figure1:
(1)Et=itR1+VCt+VOCt,it=CdVCtdt+VCtR2.


### 2.2. State Equation for Lithium-Ion Battery

The abovementioned electrical relation for lithium-ion battery presents a continuous-time model, and a discrete model of the battery system is obtained through discretizing the time model. In this way, online parameter identification based on the discrete model is possible.Through Laplace transform of the electrical relation for the lithium-ion battery, the transfer function can be obtained.(2)Gs=UsIs=R1+R2CR2s+1,where
(3)Us=Es−VOCs.Transform Equation (2) using the impulse-invariant method, and we have the discrete transfer function as follows:
(4)UzIz=a2+a3z−11−a1z−1.With Equation (4), the system’s difference equation can be written as follows:
(5)Uk=a1Uk−1+a2Ik+a3Ik−1,where
(6)a1=e−T/CR2,a2=1+CR1C,a3=−R1e−T/CR2,and T is the sampling period of the discrete system.Based on the difference equation, the ARX model of the lithium-ion battery can be expressed as follows:(7)yk=hTkθ,hk=Uk−1,Ik,Ik−1T,θ=a1,a2,a3T.The ARX model applies to online parameter identification for lithium-ion batteries. The output is identified asyk=Uk, the input is Ik, and the parameters to be identified are a1, a2, and a3. Following the step to solve a1, a2, a3, R1, R2, and C can be decided according to Equation (6).The SOC reference value applied in this paper is obtained using the Ampere-Hour method. With the Kirchhoff’s laws, we combine the first-order RC circuit model and the SOC Ampere-Hour model and present the state space model for the lithium-ion battery as follows:(8)SOCkVC,k=100e−T/R2CSOCk−1VC,k−1+−TQ0R21−e−T/R2Cik−1,VOC,k=ESOCk−0,1SOCkVC,k−R1ik,where ESOCk represents the electromotive force to the SOC value at time k. The E-SOC curve can also be drawn out through experiments with Q0 as the capacity of the Li-ion battery.


### 2.3. MILS Algorithm-Based Parameter Identification of Lithium-Ion Battery

Based on the traditional recursive least squares algorithm, the multi-innovation least square (MILS) algorithm expands the scalar innovation into vector innovation and uses information matrices in the place of data vectors, which fully applies the limited measurement data. Moreover, the influence of noise on the identification accuracy is also taken into consideration, and the parameters of the system are identified through online iteration, which enhances the innovation use efficiency as well as the convergence speed and identification accuracy [16, 17].Supposing that there exists an autoregressive exogenous model (ARX):(9)Azyk=Bzuk+vk,where yk is the output, uk is the input, vk is the zero-mean, Gaussian white noise, and A(z) and B(z) represent the delay operators, so
(10)Az=1+a1z−1+a2z−2+⋯+anaz−na,Bz=b0+b1z−1+b2z−2+⋯+bnbz−nb.Takeθ as the parameter vector of the mode:
(11)θ=−a1,−a2,⋯,−ana,b0,b1,⋯,bnb.The system innovation is(12)ek=yk−φTkθ^k−1,where φT represents the data vector.Then, we expand the scalar innovation to vector innovation:(13)Ep,k=yk−φTkθ^k−1yk−1−φTk−1θ^k−1⋮yk−p+1−φTk−p+1θ^k−1∈ℝp,so the MILS algorithm model can be presented as
(14)Yp,k=ϕTp,kθk−1+Ep,k,where p is the innovation length and ϕT refers to the information matrix.Through derivation, the recursive process of the identification algorithm can be detailed as follows:Update the parameters(15)θ^k=θ^k−1+LkYp,k−ϕTp,kθ^k−1.Update the gain matrix(16)Lk=Pk−1ϕp,kIp+ϕTp,kPk−1ϕp,k−1.Update the covariance matrix(17)Pk=Pk−1−LkϕTp,kPk−1.To start the algorithm, the initial values ofθ^k and Pk need to be set.


## 2.1. Equivalent Circuit Model of Lithium-Ion Batteries

The first-order RC equivalent circuit model of lithium-ion battery (Figure1) can accurately reflect the transition process from the charging to discharging of the battery, which entails high accuracy and low computational complexity [14, 15]. In Figure 1, R1 represents the ohmic resistance, R2 is the polarization resistance, and C is the polarization capacitance. R1, R2, and C are to be identified. i refers to the working current of the lithium-ion battery, and its direction is shown in Figure 1. VCt means the polarization capacitance voltage, VOCt indicates the terminal voltage, and Et is the electromotive force.Figure 1
The first-order RC circuit model.According to Kirchhoff’s laws, the following equation can be obtained from Figure1:
(1)Et=itR1+VCt+VOCt,it=CdVCtdt+VCtR2.


## 2.2. State Equation for Lithium-Ion Battery

The abovementioned electrical relation for lithium-ion battery presents a continuous-time model, and a discrete model of the battery system is obtained through discretizing the time model. In this way, online parameter identification based on the discrete model is possible.Through Laplace transform of the electrical relation for the lithium-ion battery, the transfer function can be obtained.(2)Gs=UsIs=R1+R2CR2s+1,where
(3)Us=Es−VOCs.Transform Equation (2) using the impulse-invariant method, and we have the discrete transfer function as follows:
(4)UzIz=a2+a3z−11−a1z−1.With Equation (4), the system’s difference equation can be written as follows:
(5)Uk=a1Uk−1+a2Ik+a3Ik−1,where
(6)a1=e−T/CR2,a2=1+CR1C,a3=−R1e−T/CR2,and T is the sampling period of the discrete system.Based on the difference equation, the ARX model of the lithium-ion battery can be expressed as follows:(7)yk=hTkθ,hk=Uk−1,Ik,Ik−1T,θ=a1,a2,a3T.The ARX model applies to online parameter identification for lithium-ion batteries. The output is identified asyk=Uk, the input is Ik, and the parameters to be identified are a1, a2, and a3. Following the step to solve a1, a2, a3, R1, R2, and C can be decided according to Equation (6).The SOC reference value applied in this paper is obtained using the Ampere-Hour method. With the Kirchhoff’s laws, we combine the first-order RC circuit model and the SOC Ampere-Hour model and present the state space model for the lithium-ion battery as follows:(8)SOCkVC,k=100e−T/R2CSOCk−1VC,k−1+−TQ0R21−e−T/R2Cik−1,VOC,k=ESOCk−0,1SOCkVC,k−R1ik,where ESOCk represents the electromotive force to the SOC value at time k. The E-SOC curve can also be drawn out through experiments with Q0 as the capacity of the Li-ion battery.


## 2.3. MILS Algorithm-Based Parameter Identification of Lithium-Ion Battery

Based on the traditional recursive least squares algorithm, the multi-innovation least square (MILS) algorithm expands the scalar innovation into vector innovation and uses information matrices in the place of data vectors, which fully applies the limited measurement data. Moreover, the influence of noise on the identification accuracy is also taken into consideration, and the parameters of the system are identified through online iteration, which enhances the innovation use efficiency as well as the convergence speed and identification accuracy [16, 17].Supposing that there exists an autoregressive exogenous model (ARX):(9)Azyk=Bzuk+vk,where yk is the output, uk is the input, vk is the zero-mean, Gaussian white noise, and A(z) and B(z) represent the delay operators, so
(10)Az=1+a1z−1+a2z−2+⋯+anaz−na,Bz=b0+b1z−1+b2z−2+⋯+bnbz−nb.Takeθ as the parameter vector of the mode:
(11)θ=−a1,−a2,⋯,−ana,b0,b1,⋯,bnb.The system innovation is(12)ek=yk−φTkθ^k−1,where φT represents the data vector.Then, we expand the scalar innovation to vector innovation:(13)Ep,k=yk−φTkθ^k−1yk−1−φTk−1θ^k−1⋮yk−p+1−φTk−p+1θ^k−1∈ℝp,so the MILS algorithm model can be presented as
(14)Yp,k=ϕTp,kθk−1+Ep,k,where p is the innovation length and ϕT refers to the information matrix.Through derivation, the recursive process of the identification algorithm can be detailed as follows:Update the parameters(15)θ^k=θ^k−1+LkYp,k−ϕTp,kθ^k−1.Update the gain matrix(16)Lk=Pk−1ϕp,kIp+ϕTp,kPk−1ϕp,k−1.Update the covariance matrix(17)Pk=Pk−1−LkϕTp,kPk−1.To start the algorithm, the initial values ofθ^k and Pk need to be set.


## 3. Principle of EnKF-Based SOC Estimation

In ensemble Kalman filter (EnKF), the Monte Carlo method is used to generate the initial set of samples of the state variables where the estimation of all the samples is carried out through the state transition function in view of the state space. Then, we calculate the average of the sample set after state transition and obtain the current state estimation result [18–20]. Supposing that there exists a discrete nonlinear system, the EnKF process can be represented as follows:
(18)xk=fxk−1+wk−1,zk=hxk+vk,where xk is the state vector, zk is the measurement vector, f⋅ represents the state transition function, h⋅ indicates the measurement function, wk refers to the process noise, and vk is the measurement noise.(1) InitializationGenerate the ensemble of the initial SOCs of the systemx0ii=1q using the Monte Carlo method where q is the size of the SOC samples in the set, and the initial state and initial covariance are as follows:
(19)x^0=1q∑i=1qx0i,P0=1q−1∑i=1qx0i−x^0x0i−x∧0T.(2) State predictionAt stepk−1 of the system, the set of SOC samples will be xk−1ii=1q, and the set of state variable prediction will be xk∣k−1ii=1q, which satisfy the following equation:
(20)xk∣k−1i=fxk−1i+wk−1,so the one-step ahead prediction is
(21)x^k∣k−1=1q∑i=1qxk∣k−1i,and the one-step ahead prediction covariance will be
(22)Pk∣k−1=1q−1∑i=1qxk∣k−1−x^k∣k−1xk∣k−1−x∧k∣k−1T.(3) State correctionAccording to the measurement function of the system, the one-step ahead prediction can be obtained.(23)zk∣k−1i=hxk∣k−1i,which can be rewritten as
(24)z^k∣k−1=1q∑i=1qzk∣k−1i,so the cross-covariance of the state error of the system and the measurement error can be represented as
(25)Pk∣k−1xz=1q−1∑i=1qxk∣k−1i−x^k∣k−1zk∣k−1i−z∧k∣k−1T,while the system measurement covariance is
(26)Pk∣k−1zz=1q−1∑i=1qzk∣k−1i−z^k∣k−1zk∣k−1i−z∧k∣k−1T.The Kalman gain matrix is obtained by combing Equation (25) and Equation (26).
(27)Kk=Pk∣k−1xzPk∣k−1zz−1.Therefore, the estimated value of Kalman filter for the SOC sample will be(28)xk∣ki=xk∣k−1i+Kkzk+vk−zk∣k−1i,and we obtain the estimated value of the SOC and the covariance at k.
(29)x^k=1q∑i=1qxk∣ki,(30)Pk=1q−1∑i=1qxk∣ki−x^kxk∣ki−x∧kT.Thus, the SOC estimation for Li-ion batteries atk is concluded.The integrated strategy of MILS algorithm and EnKF algorithm for SOC estimation is mapped in Figure2.Figure 2
Integration strategy of MILS and EnKF.The terminal voltageUk and working current ik data of lithium battery during charging and discharging are tested through experiments, where k is time. In the MILS section, Uk and ik are read at time k. The MILS algorithm is used to calculate the parameter identification results of R1, R2, and C in the first-order RC equivalent circuit model of lithium battery at the current moment. The lithium battery state space model is updated according to the current R1, R2, and C, namely, Equation (8). In the EnKF section, according to the initial SOC value at time k, the initial state set is obtained through Monte Carlo sampling. The predicted value of each element in the state set is calculated by the state space model, and the predicted value of the state set is obtained. The current Kalman filter gain Kk is calculated by the state space model, and the predicted value of the state quantity is modified to obtain the current state estimation result. The above two steps are cycled until all times are traversed to obtain the SOC estimation results of the full-time period.


## 4. Experimental Verification

### 4.1. Experimental Platform

The experimental platform in this paper constitutes the test equipment, thermostat, computer, and the data collection and processing system. The voltage detection error is within the range of ±0.1%, the charge/discharge current detection error is ±0.1%, and the accuracy of temperature measurement is about ±1°C, whereas the data sampling frequency is set at 1 Hz. All the experiments in this paper are carried out at constant temperature, e.g., 25°C, to ensure the consistency of the tests.The battery selected in this paper is LiFePO4 battery with a rated terminal voltage of 3.5 V and a rated capacity of 20 Ah. Real-time monitoring and data collection of the battery are performed on the experimental platform. This paper investigates the feasibility of EnKF for SOC estimation of lithium-ion batteries under both the constant current discharge experiment and dynamic stress test (DST).Experiment 1 (constant current discharge experiment): take a fully charged (SOC value at 100%) LiFePO4 battery, let it rest for 2 hours, and then discharge the battery at a constant current of 10 A. The experiment concludes when the terminal voltage drops to the cut-off voltage of 2.5 V. The current waveform is shown in Figure 3(a).Figure 3
(a) Current waveform in experiment 1. (b) Current waveform in experiment 2. (c) Voltage waveform in experiment 1. (d) Voltage waveform in experiment 2.
(a)(b)(c)(d)Experiment 2 (cycling dynamic stress test): take a fully charged LiFePO4 battery (SOC value at 100%), let it rest for 2 hours, and perform a cycling dynamic stress test (DST) according to the Electric Vehicle Battery Test Procedures Manual [21]. When the terminal voltage drops to the cut-off voltage (2.5 V), the experiment ends, and the current waveform is shown in Figure 3(b).


### 4.2. Parameter Identification Test

This paper first validates the parameter identification method based on the MILS algorithm for lithium-ion batteries. Considering that the parameters of lithium-ion batteries cannot be captured directly, we compare the corresponding terminal voltage of lithium-ion batteries obtained based on the parameter identification results with the measured terminal voltage of lithium-ion batteries, and prove the accuracy of the parameter identification results through the terminal voltage errors mapped in Figure4.Figure 4
(a) Terminal voltage error in experiment 1. (b) Terminal voltage error in experiment 2.
(a)(b)Figure4 shows that the terminal voltage error remains below 50 mV when the parameter identification results are stable under the two conditions, which indicates a high accuracy with the average error is within 2%.


### 4.3. Speed and Accuracy Test

In order to verify the tracking performance of the integrated algorithm on the actual SOC value, SOC estimation experiments are carried out with the initial SOC value featuring a certain deviation from the actual value and the initial covariance matrix as the unit matrix. The integrated algorithm is launched with the initial value, and the comparison of the SOC estimation results is shown in Figure5.Figure 5
(a) Comparison of SOC estimation in experiment 1. (b) Comparison of SOC estimation in experiment 2.
(a)(b)It can be seen from Figure5 that under the two operating conditions, it takes the UKF algorithm 300 cross-sections to return to the true value whereas only 50 are needed for the EnKF algorithm, up to 80% from the UKF algorithm, indicating an improved tracking performance on SOC. Simulation results in the constant current discharge experiment demonstrate that the average error of the SOC estimated value by the UKF algorithm is 1.6966% while the average error remains basically within 1% for 1000 SOC estimations with the EnKF algorithm. The error distribution is mapped in Figure 6(a). Under DST conditions, simulation results present the average error of SOC estimated value with UKF algorithm at 2.0229% whereas the average error remains basically within 1.5% for 1000 SOC estimations with EnKF algorithm. The error distribution is mapped in Figure 6(b).Figure 6
(a) Error distribution of experiment 1. (b) Error distribution of experiment 2.
(a)(b)


## 4.1. Experimental Platform

The experimental platform in this paper constitutes the test equipment, thermostat, computer, and the data collection and processing system. The voltage detection error is within the range of ±0.1%, the charge/discharge current detection error is ±0.1%, and the accuracy of temperature measurement is about ±1°C, whereas the data sampling frequency is set at 1 Hz. All the experiments in this paper are carried out at constant temperature, e.g., 25°C, to ensure the consistency of the tests.The battery selected in this paper is LiFePO4 battery with a rated terminal voltage of 3.5 V and a rated capacity of 20 Ah. Real-time monitoring and data collection of the battery are performed on the experimental platform. This paper investigates the feasibility of EnKF for SOC estimation of lithium-ion batteries under both the constant current discharge experiment and dynamic stress test (DST).Experiment 1 (constant current discharge experiment): take a fully charged (SOC value at 100%) LiFePO4 battery, let it rest for 2 hours, and then discharge the battery at a constant current of 10 A. The experiment concludes when the terminal voltage drops to the cut-off voltage of 2.5 V. The current waveform is shown in Figure 3(a).Figure 3
(a) Current waveform in experiment 1. (b) Current waveform in experiment 2. (c) Voltage waveform in experiment 1. (d) Voltage waveform in experiment 2.
(a)(b)(c)(d)Experiment 2 (cycling dynamic stress test): take a fully charged LiFePO4 battery (SOC value at 100%), let it rest for 2 hours, and perform a cycling dynamic stress test (DST) according to the Electric Vehicle Battery Test Procedures Manual [21]. When the terminal voltage drops to the cut-off voltage (2.5 V), the experiment ends, and the current waveform is shown in Figure 3(b).


## 4.2. Parameter Identification Test

This paper first validates the parameter identification method based on the MILS algorithm for lithium-ion batteries. Considering that the parameters of lithium-ion batteries cannot be captured directly, we compare the corresponding terminal voltage of lithium-ion batteries obtained based on the parameter identification results with the measured terminal voltage of lithium-ion batteries, and prove the accuracy of the parameter identification results through the terminal voltage errors mapped in Figure4.Figure 4
(a) Terminal voltage error in experiment 1. (b) Terminal voltage error in experiment 2.
(a)(b)Figure4 shows that the terminal voltage error remains below 50 mV when the parameter identification results are stable under the two conditions, which indicates a high accuracy with the average error is within 2%.


## 4.3. Speed and Accuracy Test

In order to verify the tracking performance of the integrated algorithm on the actual SOC value, SOC estimation experiments are carried out with the initial SOC value featuring a certain deviation from the actual value and the initial covariance matrix as the unit matrix. The integrated algorithm is launched with the initial value, and the comparison of the SOC estimation results is shown in Figure5.Figure 5
(a) Comparison of SOC estimation in experiment 1. (b) Comparison of SOC estimation in experiment 2.
(a)(b)It can be seen from Figure5 that under the two operating conditions, it takes the UKF algorithm 300 cross-sections to return to the true value whereas only 50 are needed for the EnKF algorithm, up to 80% from the UKF algorithm, indicating an improved tracking performance on SOC. Simulation results in the constant current discharge experiment demonstrate that the average error of the SOC estimated value by the UKF algorithm is 1.6966% while the average error remains basically within 1% for 1000 SOC estimations with the EnKF algorithm. The error distribution is mapped in Figure 6(a). Under DST conditions, simulation results present the average error of SOC estimated value with UKF algorithm at 2.0229% whereas the average error remains basically within 1.5% for 1000 SOC estimations with EnKF algorithm. The error distribution is mapped in Figure 6(b).Figure 6
(a) Error distribution of experiment 1. (b) Error distribution of experiment 2.
(a)(b)


## 5. Conclusions

In view of the strong nonlinear characteristics of lithium-ion batteries, the EnKF algorithm integrated with online parameter identification is adopted in this paper to estimate the SOC of lithium-ion batteries under the conditions of constant current discharge experiment and cycling dynamic stress test. The verification results are as follows:(1)
For the parameter identification of lithium-ion batteries using MILS algorithm, the identification error is within 2%(2)
For the EnKF algorithm, the Monte Carlo method can capture the SOC distribution characteristics more accurately. In this case that there is an error in the given SOC value, its SOC estimated value can quickly return to the true value, thus ensuring fast and accurate tracking of the SOC(3)
Calculation results under the two operating conditions demonstrate that the accuracy of the SOC estimation using the EnKF algorithm remains high, which provides solid support for the operation strategy of the battery management systemIn the subsequent research, it will be of great significance to combine the healthy state of the battery based on SOC and track the charged state of the lithium-ion battery [22–24].



---

*Source: 8869415-2021-03-04.xml*