Evaluation of LFP Battery SOC Estimation Using Auxiliary Particle Filter

: State of charge (SOC) estimation of lithium batteries is one of the most important unresolved problems in the ﬁeld of electric vehicles. Due to the changeable working environment and numerous interference sources on vehicles, it is more di ﬃ cult to estimate the SOC of batteries. Particle ﬁlter is not restricted by the Gaussian distribution of process noise and observation noise, so it is more suitable for the application of SOC estimation. Three main works are completed in this paper by taken LFP (lithium iron phosphate) battery as the research object. Firstly, the ﬁrst-order equivalent circuit model is adapted in order to reduce the computational complexity of the algorithm. The accuracy of the model is improved by identifying the parameters of the models under di ﬀ erent SOC and minimum quadratic ﬁtting of the identiﬁcation results. The simulation on MATLAB / Simulink shows that the average voltage error between the model simulation and test data was less than 24.3 mV. Secondly, the standard particle ﬁlter algorithm based on SIR (sequential importance resampling) is combined with the battery model on the MATLAB platform, and the estimating formula in recursive form is deduced. The test data show that the error of the standard particle ﬁlter algorithm is less than 4% and RMSE (root mean square error) is 0.0254. Thirdly, in order to improve estimation accuracy, the auxiliary particle ﬁlter algorithm is developed by redesigning the importance density function. The comparative experimental results of the same condition show that the maximum error can be reduced to less than 3.5% and RMSE is decreased to 0.0163, which shows that the auxiliary particle ﬁlter algorithm has higher estimation accuracy.


Introduction
Lithium batteries have been widely used in electric vehicles due to their high energy density, high power density, high efficiency, and long lifespan [1]. Overcharge/discharge should be strictly avoided in the use of lithium batteries. Otherwise, the battery service life will be significantly reduced [2,3]. Thus, accurate estimation of battery state of charge (SOC) becomes an important issue in lithium battery applications.
According to the research literature on SOC estimation algorithms, the algorithm can be classified into four types: Coulomb counting method, intrinsic parameter direct measurement method, computer intelligence method, and model-based method.
The coulomb counting method is the simplest and most widely used method. However, as the counting time increases, the estimation error is accumulated. Therefore, the coulomb counting method requires additional error correction. Chen [4], Liu [5], Kutluay [6] and others have proposed many correction methods for the coulomb counting method. This paper is organized as follows. In Section 2, an equivalent circuit model is used and its parameters are identified with typical discharge test data on different SOC value. In Section 3, the battery model is discretized and standardized, and the algorithm flow and steps of battery SOC estimation using standard particle filter algorithm are given. In Section 4, the performance of SOC estimation algorithm based on standard particle filter is tested by experiments. In Section 5, the auxiliary particle filter algorithm which improves the importance density function is proposed and deduced, and the algorithm flow and implementation steps are given. In Section 6, the performance of the auxiliary particle filter algorithm is tested and compared with that of the standard particle filter algorithm.

Battery Model and Parameter Identification
The battery sample used is a 3.22 V/2.3 Ah lithium iron phosphate battery (as shown in Figure 1), and a uC-ZS08 battery testing system is used as the battery testing experimental equipment with an accuracy of 0.1% (as shown in Figure 2).
Energies 2019, 12, x FOR PEER REVIEW 3 of 13 estimation using standard particle filter algorithm are given. In Section 4, the performance of SOC estimation algorithm based on standard particle filter is tested by experiments. In Section 5, the auxiliary particle filter algorithm which improves the importance density function is proposed and deduced, and the algorithm flow and implementation steps are given. In Section 6, the performance of the auxiliary particle filter algorithm is tested and compared with that of the standard particle filter algorithm.

Battery Model and Parameter Identification
The battery sample used is a 3.22 V/2.3 Ah lithium iron phosphate battery (as shown in Figure  1), and a uC-ZS08 battery testing system is used as the battery testing experimental equipment with an accuracy of 0.1% (as shown in Figure 2).  The first-order Thévenin equivalent circuit model is applied, which has lower complexity and takes the relationship between electromotive force of battery and SOC into account. In this model, the dynamic performance of the battery, such as rebound voltage characteristics, can be accurately simulated in the process of battery charging and discharging. A schematic diagram of the battery model is shown in Figure 3. Energies 2019, 12, x FOR PEER REVIEW 3 of 13 estimation using standard particle filter algorithm are given. In Section 4, the performance of SOC estimation algorithm based on standard particle filter is tested by experiments. In Section 5, the auxiliary particle filter algorithm which improves the importance density function is proposed and deduced, and the algorithm flow and implementation steps are given. In Section 6, the performance of the auxiliary particle filter algorithm is tested and compared with that of the standard particle filter algorithm.

Battery Model and Parameter Identification
The battery sample used is a 3.22 V/2.3 Ah lithium iron phosphate battery (as shown in Figure  1), and a uC-ZS08 battery testing system is used as the battery testing experimental equipment with an accuracy of 0.1% (as shown in Figure 2).  The first-order Thévenin equivalent circuit model is applied, which has lower complexity and takes the relationship between electromotive force of battery and SOC into account. In this model, the dynamic performance of the battery, such as rebound voltage characteristics, can be accurately simulated in the process of battery charging and discharging. A schematic diagram of the battery model is shown in Figure 3. The first-order Thévenin equivalent circuit model is applied, which has lower complexity and takes the relationship between electromotive force of battery and SOC into account. In this model, the dynamic performance of the battery, such as rebound voltage characteristics, can be accurately simulated in the process of battery charging and discharging. A schematic diagram of the battery model is shown in Figure 3.
In Figure 1, V OCV (SOC) represents the open circuit voltage of the battery which is equal to the electromotive force in numerical value, and it has a fixed mapping relationship with battery SOC at a certain temperature. This mapping relationship can be obtained by the charge/discharge test of the battery and expressed by V OCV = f (SOC). The influence of ambient temperature is not discussed in this paper. For the sample batteries in this paper, the relationship we measured can be expressed as Equation (1).  Figure 2. Test equipment uC-ZS08.
The first-order Thévenin equivalent circuit model is applied, which has lower complexity and takes the relationship between electromotive force of battery and SOC into account. In this model, the dynamic performance of the battery, such as rebound voltage characteristics, can be accurately simulated in the process of battery charging and discharging. A schematic diagram of the battery model is shown in Figure 3.
where SOC 0 is the initial SOC value of battery. Q N is the battery rated capacity. R b and R Ω are polarized and ohmic internal resistance of the battery respectively, while V b and V Ω are their voltages. C b is battery polarized capacitance. η is the coulomb efficiency, which can be obtained by the battery charge/discharge test. H < 1 (when battery is discharging) η = 1 (when battery is charging). I and V out are the working current and the terminal voltage of the battery separately, which can be measured directly by sensors in real time.
The state and output equations can be deduced from Equation (2). Meanwhile, we set r = [r 1 , r 2 ] T and v as the process noise and measurement noise.
The parameters in the battery model cannot be directly obtained by theoretical derivation analysis. The data of the output voltage value with the input current are tested by applying different current excitation to the test battery in various initial SOC. This data is used to identify the parameters in the battery model.
For a typical discharge cycle as shown in Figure 4, the terminal voltage of the battery V out will suddenly drop instantaneously at the beginning of the discharge current, which is the time of 60 s. This sudden voltage drop is caused by the ohmic internal resistance in the battery model. It can be identified by the ratio of the falling voltage difference to the discharge current. The calculation expression is At the end of discharge, the time of 120 s, the internal electron-chemical reaction of the battery does not stop, which causes a rebound voltage phase after the discharge stops. The rebound voltage phase can be divided into the abrupt phase (A-B) and the gradual phase (B-C). The reason for the abrupt phase is the same as the instantaneous voltage drop at the beginning of discharging, which is caused by the ohmic internal resistance in the battery model. The gradual phase of the rebound voltage curve is caused by the polarized internal resistance R b and the polarized internal capacitance C b . The curve of the rebound voltage phase can be approximated by Equation (6), This sudden voltage drop is caused by the ohmic internal resistance in the battery model. It can be identified by the ratio of the falling voltage difference to the discharge current. The calculation expression is At the end of discharge, the time of 120 s, the internal electron-chemical reaction of the battery does not stop, which causes a rebound voltage phase after the discharge stops. The rebound voltage phase can be divided into the abrupt phase (A-B) and the gradual phase (B-C). The reason for the abrupt phase is the same as the instantaneous voltage drop at the beginning of discharging, which is caused by the ohmic internal resistance in the battery model. The gradual phase of the rebound voltage curve is caused by the polarized internal resistance Rb and the polarized internal capacitance Cb. The curve of the rebound voltage phase can be approximated by Equation (6), Theoretically, the value of the polarized resistance Rb and the polarized capacitance Cb in the battery model will change along with different SOC. The identification results of the experimental data also verify this point. The identification results of Rb and Cb under different SOC are shown in Table 1.  Theoretically, the value of the polarized resistance R b and the polarized capacitance C b in the battery model will change along with different SOC. The identification results of the experimental data also verify this point. The identification results of R b and C b under different SOC are shown in Table 1. The battery parameters of other SOC states are obtained by using the quadratic polynomial difference. The result is shown in Figure 5 and the equations are as follows The battery parameters of other SOC states are obtained by using the quadratic polynomial difference. The result is shown in Figure 5 and the equations are as follows 6  After the model parameter identification is completed, according to Equation (3) and the identification result, the battery Simulink model can be established in MATLAB/Simulink as shown in Figure 6. In order to verify the accuracy of the battery model and parameter identification, the battery model of Figure 6 is applied with a user-defined operating cycle as shown in Figure 7. The charge/discharge current switches frequently in this operating cycle. At the same time, the same operating cycle was applied to the sample battery test equipment uC-ZS08. The battery terminal voltage data can be obtained from both model simulation and battery test, and the comparison is shown in Figure 8. The voltage error between them is shown in Figure 9. After the model parameter identification is completed, according to Equation (3) and the identification result, the battery Simulink model can be established in MATLAB/Simulink as shown in Figure 6.
The battery parameters of other SOC states are obtained by using the quadratic polynomial difference. The result is shown in Figure 5 and the equations are as follows After the model parameter identification is completed, according to Equation (3) and the identification result, the battery Simulink model can be established in MATLAB/Simulink as shown in Figure 6. In order to verify the accuracy of the battery model and parameter identification, the battery model of Figure 6 is applied with a user-defined operating cycle as shown in Figure 7. The charge/discharge current switches frequently in this operating cycle. At the same time, the same operating cycle was applied to the sample battery test equipment uC-ZS08. The battery terminal voltage data can be obtained from both model simulation and battery test, and the comparison is shown in Figure 8. The voltage error between them is shown in Figure 9. In order to verify the accuracy of the battery model and parameter identification, the battery model of Figure 6 is applied with a user-defined operating cycle as shown in Figure 7. The charge/discharge current switches frequently in this operating cycle. At the same time, the same operating cycle was applied to the sample battery test equipment uC-ZS08. The battery terminal voltage data can be obtained from both model simulation and battery test, and the comparison is shown in Figure 8. The voltage error between them is shown in Figure 9.    In Figure 9, the maximum error of the terminal voltage and the experimental terminal voltage is less than 60 mV and the average error is 24.1 mV. The model and parameters identification are proved to be accurate.

The SOC Estimation Algorithm of the Standard Particle Filter
The basic idea of PF is to use discrete random sample points to approximate the probability density function of system state variables. The minimum variance estimate is obtained by replacing    In Figure 9, the maximum error of the terminal voltage and the experimental terminal voltage is less than 60 mV and the average error is 24.1 mV. The model and parameters identification are proved to be accurate.

The SOC Estimation Algorithm of the Standard Particle Filter
The basic idea of PF is to use discrete random sample points to approximate the probability density function of system state variables. The minimum variance estimate is obtained by replacing In Figure 9, the maximum error of the terminal voltage and the experimental terminal voltage is less than 60 mV and the average error is 24.1 mV. The model and parameters identification are proved to be accurate.

The SOC Estimation Algorithm of the Standard Particle Filter
The basic idea of PF is to use discrete random sample points to approximate the probability density function of system state variables. The minimum variance estimate is obtained by replacing the integral operation with the mean of the samples. It is no longer limited to the theoretical framework of Kalman filter and has a good solution to the state estimation of nonlinear and non-Gaussian distribution.
According to Equations (3) and (4), the state equations and output equation of the battery can be rewritten in the following form after discretion, where ∆t is sampling time.
The state variable is set at x k = [ SOC(k) V b (k) ] T and the output variable is y k = V out (k). and standardize Equations (3) and (4) as follows: According to the theory of the standard particle filter algorithm combined with the established battery model, the combination of the particle filter and the battery model for estimating the SOC is shown in following summary of standard particle filter operation.
The particles x 1 k , x 2 k , . . . , x M k at the current moment is predicted according to the state equation using the particles x 1 k−1 , x 2 k−1 , . . . , x M k−1 at the previous moment.
Step 3: Set the particle weights involved in the estimation iteration.
Update and normalize the weight of each particle and calculate the weight of the ith particle by the equation as following Step 4: Normalize the particles weight to w i k , Step 5: Perform a resampling algorithm.
The principle of resampling algorithm is to discard the particles with smaller weights and copy the particles with larger weights. The copying times is determined by the weight of the particle. Firstly, generate M numbers λ i (i = 1, 2, . . . ., M) between [0, 1] randomly. Then, the weight values of the particles are sequentially added until the sum of the weights is greater than λ i . If the following formula is satisfied then set Step 6: Estimation state updatex

The Estimation and Verification of the Standard Particle Filter SOC
The standard particle filter algorithm was simulated and tested under the charge/discharge cycle shown in Figure 7. Initial SOC value of the battery can be obtained by measuring the open circuit voltage after fully charging the test battery and resting for one day, and then substituting the open circuit voltage into Equation (1). In the process of charge/discharge test, the test equipment records the actual charge/discharge current in real time, and obtains the real SOC of the battery by Coulomb counting.
The SOC estimation model of the standard particle filter algorithm is established in MATLAB. The charge/discharge current and the measured voltage are imported into the estimation model. The comparison between the estimation SOC and the real SOC is shown in Figure 10. When using the standard particle filter algorithm to estimate the SOC, the SOC estimation error as a function of time is shown in Figure 11. As can be seen from Figures 10 and 11, the maximum error of the standard particle filter SOC estimation is less than 4%. The overall mean square error of this test is 0.0254. then set Step 6: Estimation state update

The Estimation and Verification of the Standard Particle Filter SOC
The standard particle filter algorithm was simulated and tested under the charge/discharge cycle shown in Figure 7. Initial SOC value of the battery can be obtained by measuring the open circuit voltage after fully charging the test battery and resting for one day, and then substituting the open circuit voltage into Equation (1). In the process of charge/discharge test, the test equipment records the actual charge/discharge current in real time, and obtains the real SOC of the battery by Coulomb counting.
The SOC estimation model of the standard particle filter algorithm is established in MATLAB. The charge/discharge current and the measured voltage are imported into the estimation model. The comparison between the estimation SOC and the real SOC is shown in Figure 10. When using the standard particle filter algorithm to estimate the SOC, the SOC estimation error as a function of time is shown in Figure 11. As can be seen from Figures 10 and 11, the maximum error of the standard particle filter SOC estimation is less than 4%. The overall mean square error of this test is 0.0254.   Figure 10. Comparison of SOC between PF estimation and test.

Auxiliary Particle Filter on Improved Importance Density Function
Step 6: Estimation state update

The Estimation and Verification of the Standard Particle Filter SOC
The standard particle filter algorithm was simulated and tested under the charge/discharge cycle shown in Figure 7. Initial SOC value of the battery can be obtained by measuring the open circuit voltage after fully charging the test battery and resting for one day, and then substituting the open circuit voltage into Equation (1). In the process of charge/discharge test, the test equipment records the actual charge/discharge current in real time, and obtains the real SOC of the battery by Coulomb counting.
The SOC estimation model of the standard particle filter algorithm is established in MATLAB. The charge/discharge current and the measured voltage are imported into the estimation model. The comparison between the estimation SOC and the real SOC is shown in Figure 10. When using the standard particle filter algorithm to estimate the SOC, the SOC estimation error as a function of time is shown in Figure 11. As can be seen from Figures 10 and 11, the maximum error of the standard particle filter SOC estimation is less than 4%. The overall mean square error of this test is 0.0254.

Auxiliary Particle Filter on Improved Importance Density Function
The principle of auxiliary particle filter (APF) is to make full use of particles with high predictive likelihood from the previous moment to the current moment. In this way, sample particles can be generated. Comparing the sample particles generated by the standard particle filter, the auxiliary particle filter can obtain a more satisfactory effect when the likelihood function of the sampled particle is narrower or is at the tail of the prior probability distribution.
Introduce an auxiliary variable m to represent the order number of particles at time (k−1). By using the Bayes Theorem, the joint probability density function p(x k , m|y 1:k ) is expressed as p(x k , m|y 1:k ) ∝ p(y k |x k )p(x k , m|y 1:k−1 )= p(y k |x k )p(x k |m, y 1:k−1 )p(m|y 1: Generate the importance probability density function q(x k , m|x 0:k−1 , where µ m k is the character related with x k predicted by {x q(x k , m|y 1:k ) = q(x k |m, y 1:k )q(m|y 1:k ) then q(m|y 1: The operation of the APF SOC estimation is summarized in the following summary of auxiliary particle filter operation.
Step 1: Initialization • Setx 0 ,σ 0 , M, Q and R as in the summary of standard particle filter operation before in Section 3.
Step 2: For i = 1:M, calculate µ m i k = E(x k |x m i k−1 ) or generate µ m k from p(x k |x m k−1 ) Step 3: Calculate the particles weight by Equation (22) q(m|y 1:k ) = p(y k |µ m k )w m k−1 Step 4: Normalize the weights as in Step 4 in the summary of standard particle filter operation before in Section 3.
Step 5: Perform a resampling algorithm as in Step 5 in the summary of standard particle filter operation below, and record the order number of the resampling particles to m i . Then new particles are set for the time of (k−1), Step 6: State prediction as in Step 2 in the summary of standard particle filter operation before in Section 3 and get the particles of current time Step 7: Calculate the particles weight by Equation (20), and normalize them.
Calculate the mean of the particles and update the state estimationx k ,

The SOC Estimation Based on the Auxiliary Particle Filter
After establishing the SOC estimation model of APF algorithm in MATLAB, the same test data are also imported into the estimation model as in the verification of PF in Section 4. The estimation results of the comparison between APF and PF are shown in Figures 12 and 13.
Step 8: Estimation state update. Calculate the mean of the particles and update the state estimation ˆk x , (25)

The SOC Estimation based on the Auxiliary Particle Filter
After establishing the SOC estimation model of APF algorithm in MATLAB, the same test data are also imported into the estimation model as in the verification of PF in Section 4. The estimation results of the comparison between APF and PF are shown in Figures 12 and 13.  As shown in Figure 12, the SOC estimation result is closer to the true value of the SOC when using the APF. It can be seen from Figure 13 that the estimated error fluctuation range of PF is within 0.04, and the maximum estimation error of APF is less than 3.5% and the overall root mean square error (RMSE) of errors decreased from 0.0254 to 0.0163. The SOC estimation fluctuation of APF is also smaller than the estimated fluctuation of PF, so the performance of APF is better than PF in the battery SOC estimation.

Conclusion
Step 8: Estimation state update. Calculate the mean of the particles and update the state estimation ˆk x , (25)

The SOC Estimation based on the Auxiliary Particle Filter
After establishing the SOC estimation model of APF algorithm in MATLAB, the same test data are also imported into the estimation model as in the verification of PF in Section 4. The estimation results of the comparison between APF and PF are shown in Figures 12 and 13.  As shown in Figure 12, the SOC estimation result is closer to the true value of the SOC when using the APF. It can be seen from Figure 13 that the estimated error fluctuation range of PF is within 0.04, and the maximum estimation error of APF is less than 3.5% and the overall root mean square error (RMSE) of errors decreased from 0.0254 to 0.0163. The SOC estimation fluctuation of APF is also smaller than the estimated fluctuation of PF, so the performance of APF is better than PF in the battery SOC estimation. As shown in Figure 12, the SOC estimation result is closer to the true value of the SOC when using the APF. It can be seen from Figure 13 that the estimated error fluctuation range of PF is within 0.04, and the maximum estimation error of APF is less than 3.5% and the overall root mean square error (RMSE) of errors decreased from 0.0254 to 0.0163. The SOC estimation fluctuation of APF is also smaller than the estimated fluctuation of PF, so the performance of APF is better than PF in the battery SOC estimation.

Conclusions
The particle filter algorithm breaks through the limitation that the process noise and observed noise of the Kalman filter used in Gaussian distribution, which is suitable for the SOC estimation problem of the battery.
The particle filter algorithm was selected as the main algorithm for estimating SOC, and we studied and compared the problem of adaptability and accuracy of PF and APF algorithms based on the model we established and the variable we selected. In addition, a more detail algorithm implementation was discussed in this paper.
Firstly, the Thévenin battery model was established considering the changes of the internal resistance and the capacitance with different SOC, and the particle filter algorithm was combined to complete the simulation analysis of the battery SOC. At the same time, as a comparison, this paper shows how to improve the importance density function of the standard particle filter algorithm. The APF of the importance density function was combined with the battery model to perform SOC estimation under the recursive action of the algorithm. Finally, the two estimation algorithms of PF and APF were compared comprehensively. Although the SOC estimation error of the APF algorithm was only 0.5% less than that of PF, RMSE of the APF algorithm was much better than the PF algorithm, which was reduced by 0.9%.