1. Introduction
The LiFePO4 battery has advantages such as good safety, long service life, and high power density, and so on [
1,
2], which is widely used in electric vehicles and energy storage systems. To prevent battery failures such as overcharging and over-discharging, it is necessary to monitor the battery operating status in real time, especially its state of charge (SOC).
The methods of accurate SOC estimation can generally be categorized into the following types: open-circuit voltage, ampere-hour integral-based estimation method, data-driven-based estimation method, and filtering algorithms based on equivalent circuit models [
3,
4,
5]. There is a monotonic one-to-one correspondence between the open-circuit voltage and the SOC value of the battery. The corresponding table of open-circuit voltage and SOC can be established, and the SOC value can be determined by looking up the table [
6]. However, this method requires a long time after the battery is charged and discharged before measuring the open-circuit voltage. Reference [
7] proposed a fast open-circuit voltage prediction method. The battery only needs to be placed within 15 min to accurately predict the open-circuit voltage. However, the calculation process is complex, and the requirements for the processor are high. The ampere-hour integral method tracks the SOC by the change in the current integral value. The measurement error will accumulate in the integral, resulting in a large error of SOC. Reference [
8] analyzed the error sources of the ampere-hour analysis method and proposed a method to reduce the cumulative error of time and the proportional error of the SOC. However, it is more dependent on the current accuracy, and the accuracy of the current sensor is higher.
If the data-driven algorithm is trained properly, it can predict the SOC of any type of battery without knowing its inherent characteristics in advance. Reference [
9] proposed a method of predicting SOC via artificial neural network machine learning. The root-mean-squared error (RMSE) of the LiFePO4 battery used in this paper is 0.33% during the test cycle. The author of Reference [
10] proposed a recurrent neural network (RNN) with long short-term memory (LSTM) to accurately estimate the SOC of lithium-ion batteries, and it can achieve high accuracy at temperatures from 10 °C to 25 °C. Reference [
11] used the support vector machine (SVM) method to estimate the SOC of the battery from the experimental data set, which has high accuracy. In the method of machine learning or deep learning, a data-driven algorithm collects terminal voltage, working current, temperature, and other data in the work of the battery, and it uses neural network and machine learning to train a large amount of data to obtain the current SOC value. This method needs to collect a large amount of data for calculation, which requires a powerful processor and is sensitive to the type of battery. If the internal parameters of the battery change, the data-driven model cannot follow the internal changes well, resulting in a larger SOC estimation error.
The filtering algorithms based on equivalent circuit models mainly use derivative algorithms of Kalman filtering (KF) and particle filtering algorithms for SOC estimation [
12,
13,
14,
15,
16,
17]. As the most popular model-based method, the KF-based algorithm has enhanced robustness to measurement and process noise and has a high estimation accuracy [
18]. Based on the extended Kalman filter (EKF) algorithm, an adaptive dual EKF algorithm is proposed in Ref. [
12]; the EKF algorithm is used to improve the nonlinear battery model for SOC estimation in Refs. [
17,
19] for the LiFePO4 battery. A strong tracking volume EKF algorithm (STEKF) is proposed in Ref. [
20] to provide accurate SOC prediction and a faster computing time. A multi-rate strong tracking EKF algorithm (MRSTEKF) is proposed by introducing multi-rate control strategy and enhancement technology in Ref. [
21], and the SOC tracking stability and estimation accuracy is improved from 55.34% and 49.51% with STEKF to 52.66% and 33.88% with MRSTEKF, respectively. An online adaptive EKF algorithm based on the Davidson model is used to estimate SOC [
22], and the SOC estimation error can be reduced to 2%. The sigma points Kalman filter (SPKF) is another nonlinear system filtering algorithm that can be used to estimate SOC, which uses numerical approximations instead of analytical approximations of EKF. A joint battery model and SOC estimation algorithm based on SPKF is proposed in Ref. [
23], which has the same computational complexity as EKF but has higher accuracy. In Ref. [
24], a combination of the volumetric Kalman filtering algorithm and the forgetting factor recursive least squares (FFRLS) algorithm is used to estimate SOC, and the maximum estimation error of SOC under high-rate pulses is reduced to be less than 1%. On the other hand, the method of approximating a probability density function based on a particle filter is used to estimate the SOC. In Ref. [
25], a volumetric particle filter for accurate SOC estimation is proposed. In Ref. [
26], dual-scale, dual-particle, and dual-scale adaptive particle filters for SOC estimation are proposed. However, compared with SOC estimation algorithms based on the Kalman filter, the SOC estimation algorithms based on the particle filter have a larger computational burden [
27]. In Ref. [
28], an analytical mathematical formulation of storage and its SOC is presented. In Ref. [
29], a power allocation strategy based on cluster switching to relieve the stated problem in two levels is proposed, which is used to eliminate the imbalanced SOC and decrease battery energy loss. To address the power allocation challenges, a novel optimized state-of-charge (SOC) feedback-based energy management strategy in Ref. [
30] is proposed for HESS in IPS to restrain the DC bus voltage fluctuation in this paper.
In this paper, a FFRLS-AEKF joint estimation algorithm based on time-varying parameter model is proposed, which considers the characteristics that the FFRLS algorithm can update the battery parameters in real time and the AEKF algorithm can correct the initial value error of SOC and follows the parameters of the battery. Firstly, the working principle of FFRLS for battery parameter identification is analyzed. Secondly, the second-order equivalent circuit state discretization equation based on the AEKF algorithm is established, and the steps of the battery SOC estimation method based on AEKF are discussed. Thirdly, a joint SOC estimation method based on FFRLS-AEKF is proposed. Fourthly, the SOC estimation performance of three methods as EKF, AEKF, and FFRLS-AEKF is compared by experiments. The experimental results show that the FFRLS-AEKF algorithm can have a higher SOC estimation and faster accuracy convergence speed. Finally, the thesis is summarized.
3. SOC Estimation Method Based on AEKF
3.1. Adaptive Extended Kalman Filter State Equation
The Kalman filter algorithm applies to linear systems. If it is used in a nonlinear system, the Taylor expansion formula needs to be used to locally approximate the nonlinear state equation as a linear equation. The method used for nonlinear systems is called the extended Kalman filter algorithm. Nonlinear systems can be represented by Formula (12):
where
xk is the state variable,
yk is the observation variable,
f(
xk,
uk) is the nonlinear state function,
g(
xk,
uk) is the nonlinear observation function, and
wk and
vk are gaussian white noise with zero means and covariances of
Qk and
Rk, respectively. The EKF algorithm takes advantage of the local linearity property of nonlinear functions by locally linearizing both nonlinear functions. As described in the previous section,
this is the optimal estimated value of the state variable at
k time. By performing a first-order Taylor expansion of the nonlinear state function
f(
xk,
uk) around
, Equation (13) can be obtained as follows:
In Equation (13), ignoring the high-order term
and letting
, Equation (2) can be simplified as follows:
Expanding the nonlinear observation function
g(
xk,
uk) around the prior state estimate
at
k time by a first-order Taylor series, Equation (15) can be obtained as follows:
Ignoring higher-order terms in
and setting
, Equation (14) can be simplified as follows:
If both the nonlinear state equation and the observation equation are linear, then Equation (11) can be rewritten as follows:
Here, matrices
Fk and
Gk can be obtained by calculating the Jacobian matrices of
f and
g. If the state variable
x is
n-dimensional, i.e.,
x = [
x1,
x2, …,
xn]
T, then the solution for matrices
Fk and
Gk is as follows.
The EKF algorithm requires advanced calibration of the covariance matrices for observation noise and process noise, which is often calculated by experience, and the covariance matrices Qk and Rk are fixed values. However, in high-rate conditions of lithium iron phosphate batteries, the noise often changes due to the internal chemical reaction and resulting temperature variation and is no longer a fixed value. To improve the accuracy of SOC estimation, the AEKF algorithm is introduced. Based on the EKF algorithm, the AEKF adds the Sage–Husa adaptive filtering algorithm, enabling the observation noise covariance matrix and the process noise covariance matrix in the EKF algorithm to be adaptively updated, thus improving the accuracy of the SOC estimation. The steps of the AEKF algorithm are listed as follows:
Step 1. Initialization
Set , , , , when k = 0, where is the initial estimate of the state variables, y0 is the initial observation value, P0 is the initial value of the error covariance matrix, and Q0 and R0 are the initial values of the process covariance matrix and observation noise covariance matrix, respectively.
Step 3. Prediction of error covariance
Step 4. Calculate the Kalman gain
Step 6. Update the noise covariance matrix
In Equations (24) and (25),
ek is called the innovation matrix, and
d is the estimated residual value expressed using the adaptive window factor in the windowing function, which is used to calculate the observation dimension
M. According to the principle of the windowing function, if
M is small, the computational burden of the adaptive algorithm is reduced, but the accuracy of the algorithm is lower. Conversely, if
M is large, the accuracy of the algorithm is significantly improved, but the computational burden is too high, which is not suitable for recursive estimation algorithms. Therefore,
M needs to be adjusted according to the convergence time, as shown in Equation (26).
In Equation (26),
η is the window convergence rate, which has a range of 0 <
η < 1. After calculating
M, the noise covariance matrix can be updated as shown in Equations (27) and (28):
Step 7. Estimation of error covariance.
Subsequently, repeat step 2~step 7 for recursive estimation to obtain the optimal estimate of the state variables.
3.2. Discretization of State Space Equation
Taking the operating current
IL as the input variable, battery SOC, battery electrochemical polarization voltage
Up1, and concentration difference polarization voltage
Up2 as state variables, and
UOC as the observation variable, Equation (30) can be obtained by combining Equations (8) and (9):
Equations (30) and (31) are the continuous state equation and continuous observation equation, respectively. Here, UOC[SOC(t)] is the open-circuit voltage at time t obtained using the OCV-SOC relation function.
Setting the Coulomb efficiency
η to be 1 and defining the sampling period as
T, Equations (30) and (31) are discretized as follows:
The vector composed of SOC(k), Up1(k), and Up2(k) in the above equation is the state vector xk of the system at k time in Equation (11), while UL(k) is the observation vector yk of the system at k time. Equation (32) is a linear equation, while the nonlinearity of the battery system state space equation is reflected in the UOC[SOC(k)] part of Equation (33). Therefore, the Kalman filtering algorithm for SOC estimation is carried out using both EKF and AEKF, and the results are compared with the coulomb counting method for SOC estimation.
3.3. SOC Estimation Process for LiFePO4 Battery
Step 1. Data input. Input the test data of the LiFePO4 battery, including the working current sampling data IL(k), terminal voltage UL(k), battery capacity of 13 Ah, parameter model identification results, and sampling period T = 0.1 s.
Step 2. Algorithm initialization. Initialize the battery state vector x0 = [SOC(0), 0, 0], estimation error covariance matrix , process noise covariance matrix , and observation noise covariance matrix R0 = 0.05.
Step 3. Calculate the prior estimate of the state variable and the predicted covariance matrix. Firstly, according to Equation (10), calculate the state transition matrix and the system input matrix using the model parameters at time k. Secondly, substitute the state vector xk = [SOC(k), Up1(k), Up2(k)] and the operating current I(k) at k time into Equation (20) to calculate the prior estimate value of the state variable. Finally, calculate the predicted error covariance matrix Pk+1/k according to Equation (21).
Step 4. Calculating the Kalman gain matrix. Firstly, the nonlinear observation equation is linearized based on Equation (8), and the Jacobian matrix
Gk of the observation equation is calculated, as given in equation (33). Secondly, the Jacobian matrix
Gk, the predicted error covariance matrix
Pk+1/k, and the observation noise matrix
Rk are substituted into Equation (22) to calculate the Kalman gain matrix
Kk.
Step 5. Calculating the optimal estimated value of the state vector and updating the error covariance matrix. Based on Equation (34), the observation value, i.e., the estimated value UL(k) of the battery terminal voltage at k time, is calculated. Then, Equation (23) is used to calculate the optimal estimated value of the state vector, where SOC(k + 1) is the SOC value estimated by AEKF at (k + 1) time. Finally, Equation (13) is used to update the error covariance matrix Pk+1/k.
Step 6. Updating the noise covariance matrix. The process noise covariance matrix Qk and the observation noise covariance matrix R(k) are calculated based on Equations (24) and (25). Steps 2 to 6 are repeated recursively to estimate the SOC value at each moment.
3.4. Comparison and Analysis of SOC Estimation Results between EKF and AEKF Algorithms
To compare and analyze the performance of EKF and AEKF algorithms for SOC estimation of lithium iron phosphate batteries, a comparative study is conducted on SOC estimation based on the second-order equivalent circuit parameter model. Through battery charge–discharge testing, the corresponding relationship between battery OCV and SOC can be obtained through fitting. A 13 Ah-rated capacity and 3.2 V-rated voltage LiFePO4 battery is selected for HPPC testing to obtain its SOC and OCV data. The testing procedure involved discharging at 1 C for 10 s, resting for 40 s, and then charging at 0.75 C for 10 s. After resting for 45 min for every 10% drop in SOC, the OCV is measured, followed by another cycle of testing until the SOC of the battery reached 0.06, which is considered as the end of the discharge. Under the global discharge, the battery terminal voltage
UL, the output current
IL, and the real values of SOC are shown in
Figure 2 and
Figure 3, respectively.
Figure 4 and
Figure 5, respectively, show the SOC estimation results and estimation errors under the EKF and AEKF algorithms. From
Figure 4 and
Figure 5, it can be seen that compared with the EKF algorithm, the AEKF algorithm can converge to the vicinity of the true value more quickly. The convergence time of the EKF algorithm and the AEKF algorithm is 532.8 s and 124.5 s, respectively. The SOC estimation accuracy of the AEKF algorithm is higher than that of the EKF algorithm. Experimental results show that the AEKF algorithm has a better SOC estimation convergence speed and accuracy.
The specific statistical characteristics of SOC estimation errors under EKF and AEKF algorithms are shown in
Table 1 (absolute error, AE; relative error, RE; mean absolute error, MAE; mean relative error, MRE), and the relevant features are calculated based on the converged results. From
Table 1, it can be seen that the SOC estimation accuracy of the AEKF algorithm is better than that of the EKF algorithm, with a maximum absolute error (MaxAE) of 11.9% and a maximum relative error (MaxRE) of 152.6%, which occurs at the end of discharge. And the MAE of the SOC estimation is 8.8%, and the MRE of the SOC estimation is 25.4% with the AEKF algorithm, which is lower than that with the EKF. It can also be seen from
Table 1 that the errors of both EKF and AEKF algorithms gradually increase. Therefore, the adaptive noise covariance matrix updating method of the AEKF algorithm can reduce SOC estimation errors. However, the SOC estimation precision is still large, which cannot meet the actual use needs of the battery energy management system. And, further optimization of the SOC estimation algorithm is needed.
4. SOC Estimation Method Based on FFRLS-AFKF
The FFRLS-AEKF joint estimation algorithm uses the SOC value estimated using the AEKF algorithm to replace the estimated value of the ampere-hour integration method in the FFRLS algorithm to improve the battery equivalent circuit parameters identification accuracy. The identified model parameters are substituted into the AEKF algorithm to recursively estimate the SOC and improve the accuracy of the AEKF algorithm. Then, the estimated SOC value is fed back to FFRLS, and through positive feedback, the SOC estimation accuracy is finally improved. The specific calculation process is shown in
Figure 6.
Step 1. Initialize the FFRLS algorithm and the AEKF algorithm, where SOC(0) is obtained by the open-circuit voltage method.
Step 2. Obtain the model parameters at k time through the FFRLS algorithm, substitute them into the AEKF algorithm, construct the corresponding transfer matrix and input matrix, and obtain the SOC at (k + 1) time.
Step 3. Substitute the SOC at (k + 1) time into the OCV-SOC relationship formula, and then use the FFRLS algorithm to obtain the model parameters at (k + 1) time.
Step 4. Update the transfer matrix and input matrix in the AEKF algorithm to obtain the SOC of the next time step; repeat steps 2 to step 4 and recursively obtain the SOC at each time step. The specific calculation process is shown in the diagram.
5. Experimental Results
The experimental parameters setting is the same as in
Section 3.2. The structure of the battery pack used in the experiment is first parallel and then series. The batteries used are all new, and the working temperature is 25 °C. According to the method in
Section 2.3, the battery parameters
R0,
Rp1,
Cp1,
Rp2, and
Cp2 can be identified at 25 °C, and the identification results are in
Table 2. Four single cells form a parallel unit, and ten parallel units, a total of forty battery cells form a series battery pack. The parallel unit is composed of ten parallel units, and a total of forty battery cells are composed of series battery packs. The model of the battery is IFP9380, the rated capacity is 15 Ah, the nominal voltage is 3.2 V, the operating voltage range is 2.0–3.65 V, and the maximum discharge current is 2.00 A. The main control chip of the switching circuit selects STM32F103VB8T6 battery voltage measurement using the battery management chip LTC6811. The measurement error is less than 1 mV, and the sampling frequency is greater than 3 kHz. The sampling of the circuit current uses a shunt, and the sampling error is less than 0.1%. The experimental platform is shown in
Figure 7.
Figure 8 and
Figure 9 show the SOC estimation results and errors using the AEKF and FFRLS-AEKF algorithms, respectively. From
Figure 6 and
Figure 7, it can be seen that the estimation results with the FFRLS-AEKF algorithm are closer to the true values, and the SOC estimation errors with the FFRLS-AEKF algorithm are smaller than with the AEKF algorithm. The estimation errors of the AEKF and FFRLS-AEKF algorithms are shown in
Table 3. It can be seen from
Table 3 that the maximum absolute error of the joint estimation algorithm is 4.97%, and the error is controlled within 5%. As the battery operating time increases, the SOC estimation accuracy continuously converges to the vicinity of the true value, with the average absolute error decreasing to 2.5%. The experimental results show that the FFRLS-AEKF joint estimation algorithm has good convergence performance and high estimation accuracy, verifying that the proposed method is correct and feasible. Therefore, the SOC estimation performances with EKF, AEKF, and FFRLS-AEKF are shown in
Table 4.
6. Conclusions
The working principle of FFRLS for battery parameter identification is analyzed. The second-order equivalent circuit state discretization equation based on the AEKF algorithm is established, and the steps of the battery SOC estimation method based on AEKF are discussed and simulated. The simulation results show that it has the disadvantages of low steady-state accuracy and slow convergence rate. To improve SOC estimation precision, combining the advantages of high precision and adaptability of FFRLS and AEKF, a joint SOC estimation method based on FFRLS-AEKF is proposed and experimented with. The experimental results show that the FFRLS-AEKF algorithm can have higher SOC estimation and faster accuracy convergence speed, verifying that the proposed method is correct and feasible.
In the actual use of the battery pack, it is often necessary to combine the battery cells in series and parallel to provide sufficient capacity and voltage level. However, in the process of series and parallel grouping of the battery pack, there will be problems such as more complex model parameters and difficult data sampling. Therefore, the next step in this research field needs to consider the influence of physical parameters such as the small number of sampling points, incomplete sampling data, and contact resistance on the accuracy of the battery model. The establishment of a perfect equivalent model of the battery pack is the focus of the next step in this research.