Lithium ferro phosphate battery state of charge estimation using particle filter

Received Jun 25, 2020 Revised Mar 26, 2021 Accepted Apr 9, 2021 Lithium ferro phosphate (LiFePO4) has a promising battery technology with high charging/discharging behaviours make it suitable for electric vehicles (EVs) application. Battery state of charge (SOC) is a vital indicator in the battery management system (BMS) that monitors the charging and discharging operation of a battery pack. This paper proposes an electric circuit model for LiFePO4 battery by using particle filter (PF) method to determine the SOC estimation of batteries precisely. The LiFePO4 battery modelling is carried out using MATLAB software. Constant discharge test (CDT) is performed to measure the usable capacity of the battery and pulse discharge test (PDT) is used to determine the battery model parameters. Three parallel RC battery models have been chosen for this study to achieve high accuracy. The proposed PF implements recursive bayesian filter by Monte Carlo sampling which is robust for non-linear and/or non-Gaussian distributions. The accuracy of the developed electrical battery model is compared with experimental data for verification purpose. Then, the performance of the model is compared with experimental data and extended Kalman filter (EKF) method for validation purposed. A superior battery SOC estimator with higher accuracy compared to EKF method has been obtained.


INTRODUCTION
Burning of fossil fuels causes environmental problem such as global warming, acid rain and urban population [1]- [3]. By energy conversion, the resource of energy such as fossil fuel (coal, oil and natural gases) and nuclear can be extended to many years from getting totally exhausted [4], and this challenge can be tackled by the deployment of emission control systems. The transformation of energy technology, for example, electric vehicle (EV) and hybrid electric vehicle (HEV) are one of the efforts for improvement of traffic and healthier environment. Batteries technologies are the best choice and popular renewable energy than kinetic energy in flywheels, high capacity capacitors and high pressure compressed air [5] in term of higher efficiency, safe and recyclable. LiFePO 4 battery is popular in EV applications for storage of energy which can deliver higher capacity over longer time since it is environment-friendly to the users [6], [7]. Therefore, an accurate battery model is crucial to simulate the charging and discharging characteristic and detailed analysis. Furthermore, battery management system (BMS) can estimate all parameters accurately such as state of charge (SOC) and runtime in order to optimize the performance of battery. SOC is defined as the percentage of the remaining capacity that is present inside of battery [8]. SOC cannot be measured directly in a battery and there are several methods to determine the SOC of battery. Particle filter (PF) is one of the methods that has been used for estimation of SOC with an improved degree of accuracy. PF is an iterative implementation of the Monte Carlo based on statistical signal processing application [9]- [11]. Figure 1 shows the basic idea of PF, as introduced by Gordon [11]- [13], which shows relationship between posterior probability density function (PDF) and the number of samples which is particles [14], [15]. PF method gained popularity in the mid-1990s due to technology development and this method was used for nonlinear state estimation. The researcher's development in PF over recent years with successfully applications such as model of statistics, learning of machine, processing of signal, econometrics, computer graphics, automation, communications, and others [16]- [18].

Figure 1. Basic idea of PF
In [19], the paper proposed PF method to estimate the state of vector with three degree of freedom (DOF) industrial robot by the measurement of fusion obtained from sensor. PF is more convenient for highly nonlinear systems and non-Gaussian noise system where EKF method doest not work well on these systems. Besides, marker-less tracking is technology broadly used in robot control method. The paper [20] introduces a marker-less human-robot interface using PF and Kalman filter (KF) methods. It was used for dual robot to track the human movement by a sensor. KF and PF are broadly used in robotics and control systems to integrate the robot orientation and position.
A new kinematic calibration method based on the extended Kalman filter (EKF) and PF algorithm is presented in [21] to improve the robot position. The priori value is being provided by EKF algorithm and PF algorithm was used to successfully calibrate the parameter of robotic kinematic. In [22], the authors present a method for SOC estimation of LiFePO 4 batteries at dynamic current and temperatures using PF, whereas Thevenin model is proposed in this paper [23] to modelling of NMC cell for different aging levels and operating states. The double particle filter (D-PF) and double adaptive particle filter (D-APF) are developed for online parameters and SOC estimation of lithium-ion batteries to reduce computational cost and improve the accuracy of the SOC estimation [24].
In this paper, PF is applied to the electrical circuit model of LiFePO 4 cell to estimate the lithium cell SOC. The research methodology and procedure to estimate the SOC by the PF method are discussed in detail in Section 2. Then, the method is verified by comparison and analysis of simulation results with experimental data of dynamic behaviors of lithium cell in Section 3. In this section, the performance of the model is not only compared with real experimental data but also to the same electrical circuit model using the EKF method for validation purposes. Finally, the conclusion is presented in Section 4.

RESEARCH METHOD
The 3.2V of 18Ah LiFePO 4 lithium cell is used for the battery modelling in this research and the detailed specifications of the battery are shown in Table 1 [26]. The work process is shown in Figure 2. Pulse discharge test (PDT) and random test are performed to investigate the LiFePO 4 battery dynamic characteristics in this research. The measurement of voltage and current from the test is collected and stored in data acquisition system (DAQ) model NI9219. Next, the PF is developed for battery model and experimental data was obtained from the battery test will to simulate and analyse the PF performance by MATLAB simulation tool.   Figure 3 shows experimental assembly for test procedure. A 120V programmable electronic load device model IT8514C from ITECH with specification of 240 A and 1200 W, is used to act as constant current load in order to discharge the LiFePO 4 battery; and a DC power supply model EA-PSI 8200-70R from Elektro-Automatik, capable of delivering 70A load with rating of 200 V and 5000 W, is used to charge the LiFePO 4 battery. The ambient temperature of the battery test was monitored by environment chamber which is JH-KE. The experimental results obtained from the battery test are collect and stored by National Instrument DAQ model NI9219. NI9219 is interfaced with LabVIEW software to gather the data from battery test. The experimental data was saved and stored in excel file to easily simulate and analyses the process using MATLAB software.

Experimental result
Two tests were performed on the LiFePO 4 battery to determine the performance of PF, which is PDT and random test. Figure 4 and Figure 5 represent the experimental measurement of current and voltage. PDT is conducted, which consists of a sequence of constant discharge current and rest duration as illustrated in Figure 3. The battery is discharged by 9A load current with a period time of 26980 seconds and six cycles of pulses for PDT. The battery's charge and discharge are shown in Figure 4, which is called a random test. The duration for the random test is 10320 seconds with 12 cycles of charging/discharging pulses.  The usable capacity is the extracted energy from the battery which presumes a battery is discharged from same charge state until the equal end-of-discharge voltage [26]. The usable capacity is determined from experimental result of constant discharge test (CDT) which is performed to measure the battery's capacity in a specified state. Figure 7 shows the experimental result for 9A CDT test and the equation of usable capacity expressed as (1) where the equation gets from the curve fitting tool by MATLAB software. The usable capacity (CN), can be expressed as: important parameter in nonlinear relations where the value of OCV is directly dependent on the value of SOC [29], [30]. OCV for a certain SOC can be identified based on PDT when the battery is at rest condition until it reaches a new equilibrium state shown in Figure 8 [31]. A fifth-order polynomial equation can be formulated by using curve fitting tool in MATLAB to represent the OCV-SOC relationship as expressed in (3). Thus, the parameters can be determined by transient voltage response for discharge and rest, as illustrated in Figure 9, where the terminal voltage of the battery is derived as (4). Finally, the battery parameters that have been extracted from (4) are tabulated in Table 2.

Particle filter (PF) algorithm
PF algorithm is applied in this research to achieve high accuracy of the OCV estimation. This value is used to determine SOC by utilizing SOC-OCV relationship curve as shown in Figure 7. The relation between SOC and OCV varies based on the type of battery and it is usually given by the manufacturer. The Recursive Bayesian estimation and importance sampling (IS), which is the general methods or technique for estimate properties of a particular distribution are used in PF algorithm as basic framework.
In this research, Monte Carlo is implemented based on IS to remove the particle from the posterior probability density (PDF) and weights of each particle. After that, the particles are filtered and updated according to their pdf and weight. The OCV estimation can be computed based on pdf and weight of the updated particles. PF is not restricted by the assumption of linear model and Gaussian noise at the same time compared Kalman filter (KF) algorithm. As a result, PF become a popular method to solve the nonlinear and non-Gaussian state estimation problem [22]. The PF algorithm is explained in detailed in this section [32]. (a) Initialization k= 0.
Generate initial particles within minimum voltage and maximum voltage with a uniform probability. Suppose the number of particles is N, the variance of measurement noise is and the variance of process noise is . These particles are denoted by X 0 i (i = 1,2, . . , N) for SOC. (b) Prediction.
Generate N particle , last sampled particle X k−1 i and get output estimation Y k i according to (5) and (6): Where, (c) Evaluate importance weight Calculate the maximum q i of the particles X k i according to the measurement y k represented as (6): Normalized the importance weight as follow q i = q i / ∑ q j N j=1 (d) Resampling Generate a set of posterior particles X k i based on their weights q i by multinomial resampling method, i=1, 2, …, N (e) Output The state variables (OCV) after completion of the algorithm are obtained by X k = ∑ q i N i X k i . Take X k i into OCV-SOC curve to obtain SOC V,k

RESULTS AND DISCUSSION
The experimental result and the estimation of SOC from PF algorithm are presented and discussed in this section. The outcome for this research is presented in two different parts: i) PDT, and ii) random test. The initial SOC( 0 ),error covariance measurement update (P), process noise ( ) and sensor noise ( ) are assumed in (14) to (17). The initial SOC is set to 90% for PF method for analysis.  Figure 10 and Figure 11 show the comparison of the terminal voltage of the of LiFePO 4 battery for 9A PDT test and random test. The red line represents experimental voltage while the blue line represents estimated voltage by PF algorithm. As a result, the terminal voltage for both tests is nearly same between experimental and simulation result. However, noise is observed in simulation result of the PF estimated terminal voltage due to the existence of noise measurement in PF algorithm.

Validation of terminal voltage
The mean absolute error (MAE), mean square error (MSE) and root mean square error (RMSE) are three types of error used for analysis of the performance of the model for terminal voltage of the battery in this research. MAE is the average of the difference between estimated and measured value in the test or model as expressed in (18). MSE is the average squared difference between estimated and measured value in the test or model as defined as (19). While RMSE is defined as the square root of the MSE in (20).
(20) Table 3 shows the error analysis between experimental voltage and PF estimated voltage for both tests. The MAE, MSE and RMSE of terminal voltage in 9A PDT test are 0.0091V, 0.0014V and 0.0373, respectively, which are 0.284%, 0.044% and 1.166% to the nominal voltage of LiFePO 4 battery. Whereas the MAE, MSE and RMSE of voltage in random test are 0.0456V, 0.0184V and 0.1357V respectively which are 1.425%, 0.575% and 4.241% to the nominal voltage of LiFePO 4 battery, respectively. It shows that PF has good performance to determine the terminal voltage during relaxation time even though the noise appear across PF estimated voltage especially during transient; both in PDT and random test. The proposed model by PF proves that PF algorithm can estimate the terminal voltage precisely.

Validation of SOC estimation
The Coulomb counting method is used to measure the discharging current of the LiFePO 4 battery and integrates the discharging current over time with the purpose of estimating Real SOC. The Real SOC from Coulomb counting for PDT of 9A and the random test is illustrated in Figure 12 (a) and Figure 13 (a), respectively. While Figure 12 (b) and Figure 13 (b) show the comparison between Real SOC (red line), EKF estimated SOC (yellow line) and PF estimated SOC (blue line). Both methods are able to track and estimate the battery SOC accurately, especially when the SOC is higher than 20 %. However, when battery SOC is less than 20%, both estimators are departing from real data. RMSE, absolute error, and relative error are used as a tool to validate and compare the performance of PF and EKF with real SOC. The RMSE and error analysis are denoted as (20) to (24).  The absolute error is defined as the difference between the estimated value and the measured value. The relative error is the ratio of absolute error to the measured value. Table 4 tabulates the error analysis of the SOC estimation algorithm for PDT of 9A and random test. For PDT of 9A, the absolute error and percentage error for EKF estimated SOC is 0.0219% and 0.05%, respectively. Whereas the absolute error and percentage error for PF estimated SOC is 0.0184% and 0.04%, respectively. The difference in relative error for the PDT test between PF and EKF is 0.01%. For PDT of 9A, the RMSE for EKF and PF estimated SOC is 4.6153% and 4.9648%, respectively.
For the random test, the absolute error and relative error of SOC estimation by PF are 1.0622% and 2.58%, respectively. In comparison, the absolute error and relative error of SOC estimation by EKF are 1.2099% and 2.94 %, respectively. The difference in relative error for the random test between PF and EKF is 0.36%. For the random test, the RMSE for EKF and PF estimated SOC is 2.3830% and 1.0657%, respectively. The Table 4 shows that the PF method has a lower absolute error and relative error in both tests. For RMSE, EKF is more accurate than PF, leaving it with a small marginal error in PDT while PF is superior to EKF in random tests. Thus, it can be summarised that the performance of PF is comparable to the performance of EKF.  pulse discharge test (PDT) are performed to investigate the characteristics of the LiFePO 4 battery. Then, the performance of the PF-SOC estimation method is assessed by comparing it with experimental data of dynamic behaviors of LiFePO 4 lithium cell. Additionally, the performance of PF and extended Kalman filter (EKF)-SOC estimation is compared by error analysis. From the analysis, the PF is more accurate than EKF due to a robust procedure to undertake inference for non-linear or non-Gaussian models as compared to the EKF. From PDT and random test, it can be concluded that the PF method is accurate to determine the terminal voltage of the battery with an average error of less than 5% even though the noise appears across PF estimated voltage. Absolute error and relative error, which represent as error analysis of SOC for PDT test and the random test, show that the performance of PF-SOC estimation is more accurate and more precise than EKF-SOC estimation of battery. However, slow responses of the filter, particularly over relaxation time and the dynamic characteristics in terms of the open-circuit voltage (OCV)-SOC relationship of the LiFePO4 battery, may restrict the performances of PF as shown in PDT. In general, it can be concluded that the PF performance is on par with EKF and worth applied for battery SOC estimation.