1. Introduction
In response to the issues of the energy crisis and environmental pollution, Electric Vehicles (EVs) are described as one of the most significant developments in the transport industry. The difficulties of the manufacturing technology and the assembly implementation of the battery seem to restrain the development of EVs. The battery as the main power source directly affects vehicle performance. The Battery Management System (BMS) is a significant issue to the battery utilization in the vehicle. The main functions of BMS include improvement of the effectiveness of the battery utilization, prevention of over-charging and over-discharging, prolonging the battery life and monitoring of the battery status. The high effectiveness of the BMS in EVs will mainly depend on accurate information exchange between the modules. The basic function of the monitor module in BMS is to capture and monitor the status of the battery and includes the state of charge (SoC), state of power (SoP), and state of health (SoH) [
1]. The SoC of the battery is a crucial element to decide the battery operating condition. In terms of practical applications, the SoC is also the key factor to ensure the implementation of each module function in the BMS [
2].
The use of different types of batteries in EVs started from the lead-acid battery and quickly progressed to nickel-metal hydride (NiMH) battery and eventually to lithium-ion and ternary lithium battery [
3]. The working trend of the cell and battery pack in EVs is a dynamic and non-linear change, specifically in the lithium-based battery applications [
4]. The value of SoC is not directly measurable. The SoC is affected by serval factors such as the battery terminal voltage, current and temperature. Moreover, measurements of voltage, current, etc. often occur with inevitable noises that lead to errors. The issues of accurate estimation of SoC are being continuously discussed and improved [
5].
The commonly used estimation methods of SoC mainly are based on Open Circuit Voltage (OCV) measurement, the coulomb counting method (Ah method), the method of Electrochemical Impedance Spectroscopy (EIS), the method based on neural network, the Kalman Filter (KF) based methods, etc. [
6]. The OCV-based estimation, Ah method and EIS could be described as direct measurement methods. Taking into account the practicality, the advantage of direct measurement methods is its easy implementation and low cost. However, the values of OCV and the current are obtained through an open-loop estimator. The hysteresis phenomena and the sensor drift will lead to inevitable and cumulative errors, which will significantly impact the operation of the BMS and the use of battery itself [
2]. The estimation approach of the neural network is a data-driven method. The main purpose of the data-driven method is to simulate the nonlinear and dynamic characteristics of the battery. This method requires large Random Access Memory (RAM) storage to train the system for the learning process of the neural network [
7]. Other machine learning methods such as the fuzzy logic, support vector machine and genetic algorithm have been extensively researched for battery SoC estimation [
8,
9,
10,
11]. The machine learning method improves the intelligence of the system but the results are difficult to interpret and hence is not convenient in real practice. The need for appropriate storage requirement appears in the look-up table method of the SoC estimation. The look-up table sourced from the relationship curve of SoC-OCV is inadvisable for online application. A regular recalibration is required to update the table information [
12].
Another significant approach of SoC estimation is the model-based method, which is robust and is based on a close-loop-feedback system. The standard KF method is a well-known approach to estimate the internal state of a dynamic linear system [
13]. To precisely describe the nonlinear working state of the battery, several KF relevant approaches have been used to obtain SoC estimation [
14]. The extended KF (EKF) method mathematically transforms the standard (linear matrix) KF to fit a nonlinear system. Besides, several EKF-based methods, such as lazy EKF and robust EKF, are proposed to estimate the SoC of the battery and in different scenarios for vehicle onboard battery and microgrid energy storage units [
15,
16]. The Dual EKF (DEKF) adopted in [
17,
18] to estimate the SoC of the battery and the parameter of the model shows faster convergence in shorter calculation time. The unscented KF (UKF) transforms the nonlinear models by linear interpolation. Sun et al. [
19] discussed an adaptive UKF (AUKF) algorithm for SoC estimation which shows higher accuracy than the EKF-based estimator. The main issue of the UKF based methods is using the Unscented Transform to deal with the nonlinear transfer of the mean and covariance. Compared to the EKF, the UKF method approximates the probability density distribution of the nonlinear function instead of the nonlinear function approximation. Therefore, the UKF methods are more accurate [
20,
21,
22]. However, the UKF-based estimator seems more applicable to the situation where the system is less nonlinear. The iterative update of the covariance in the UKF-based algorithm is prone to negative definite matrix in a highly nonlinear system. In addition to the methods related to KF, other model-based methods are reported in literature. For example, the Luenberger observer and sliding mode observer showed an accurate SoC estimation but is very complex [
23].
The main objective of this paper is to design an appropriate KF-based method for SoC estimation with considerable accuracy and simplicity. The battery SoC estimation is the parameter identification based on the battery model. In this paper we employ a novel composite battery model based on the electrochemical models [
24]. The offline identification of parameters is first done using experimental data. With these offline parameters, a battery model is subsequently built using MATLAB simulation. This model will include the effects of temperature, charge/discharge rate, direct current resistance, etc. Using this battery model, we implement the iEKF algorithm to estimate the SoC in MATLAB Simulink. The iEKF method combines the OCV, Ah and EKF methods: the OCV-SoC function in our work provide an initial value; Ah counting module online identifies the parameters of the battery model; the errors in the OCV and Ah estimation are corrected by the EKF algorithm. Under both static and dynamic operating conditions, it is shown that the iEKF algorithm results in better accuracy of the SoC estimation than other EKF based methods. The development of a composite battery model is another novelty of this paper.
2. The Battery Model
The State of Charge (SoC) is used to identify the remaining capacity status of the battery. The value of SoC cannot be directly measured but obtained by analyzing external characteristics. Different battery manufactures in the market have a different definition of the SoC. Equation (1) gives a numerical definition of SoC.
where the
CQ is the remaining capacity, and the
CI is the rated capacity when the battery is discharged with a constant current
I.
The process of using the model-based method to estimate SoC could be considered as the dynamic identification for the parameters representing the characteristics of the battery. The choice of the models will determine the mathematical relationship of the different parameters. The equations of the state in the algorithms will also vary from the different model selections.
Figure 1 shows a logical structure of the battery model build-up.
The modeling steps are described as follows:
Selecting the battery model (A novel composite electrochemical model).
Determining the different parameters to be identified based on the selected model.
Performing a series of characteristics tests on the battery.
Linear fitting of the experimental data (offline identification).
Building the model in MATLAB.
Obtaining the equation of state.
Developing the online estimation algorithm (iEKF).
Inputting the current, temperature and SoC (simulations in static and dynamic conditions).
As shown in
Figure 1, the battery model is constructed in two sections: offline parameter identification in section I and online parameter identification in section II. Steps 1 to 6 are the preparation steps for the battery model establishment. They will seriously influence the accuracy of the online estimation based on the iEKF algorithm in step 7. The series of experiments in step 3 refers to four different battery tests (see
Section 3.1 and
Section 3.4). The experiments reflect the external characteristics of the battery and relate to the factors affecting the SoC estimation. The main factors affecting the battery capacity are the charge/discharge rate, temperature, the charge/discharge cycle (battery aging) and self-discharge of the battery [
25]. Taking these factors into account, SoC (
QtI) definition is amended as [
26,
27].
where
t is the charge/discharge duration time,
Qti is the total quantity of electric charge/discharge during the period
t,
I is the current over a time interval 0 to
t and
η is the efficiency coefficient which includes both the charge/discharge rate (
ηi) and the temperature influence coefficient (
ηT).
The Composite Battery Model
For the composite battery model, the SoC is considered as a state variable x in the system,
is the number of the state vector. The output
yk is the voltage of the battery model. The composite model is built based on three different electrochemical models as follows [
28,
29]:
Unnewehr universal model:
Nernst model:
where
E0 is the OCV when the battery is fully charged and
R is the internal resistance which will change with different charge/discharge status and SoC,
ik is the instantaneous current at time
k (negative when the battery is charging and positive when discharging).
K1 to
K4 are the matching parameters to be identified through battery experiments. The state equation based on the composite battery model is described as follows:
While the output equation is
where
K0 is the OCV of the fully charged battery and has the same physical meaning as
E0. However,
E0 in Equations (3)–(5) is the actual measured value while
K0 is obtained by the identification based on OCV-SoC experimental data (see in
Section 3.4). Equations (3)–(5) are combined in Equation (7). The electrochemical models of Equations (3)–(5) reflect the relationship between the terminal voltage and the SoC (
).
R is the internal resistance (Ohmic resistance) and changes with the charging/discharging state of the battery (
).
from Equation (3) and
from Equation (4) reflect the polarization resistances of the battery.
and
from Equation (5) represent the influence of the internal temperature and material activity during the electrochemical reaction of the battery, respectively.
The SoC estimation is not directly considered in most of the papers discussing the battery models. On the other hand, the accuracy of the battery model significantly affects the estimation of the SoC of the battery [
30]. Justifying accurate battery models mainly depends on the dynamic tracking of the battery terminal voltage and the identification of parameters. Many bench tests are used to verify the accuracy of the battery models, such as HPPC test, pulsed charge/discharge cycles and dynamic stress test [
31,
32]. At the same time, the experimental data used to verify the battery model is also applied to design the SoC estimators.
In terms of the electrochemical model, various chemical reactions are carefully considered. They include the reaction occurring at the anode and cathode of the battery and the electrolyte ion transfer process. Equations (3)–(5) are simplified electrochemical models based on empirical modeling method and have the advantages of simple expression and computational efficiency. However, there are some drawbacks when using models in Equations (3)–(5) alone or their correction models such as the new Electrochemical Polarization (EP) model [
22,
32]. Compared to the equivalent circuit models (ECMs) [
33,
34], the composite model described in our work shows sufficient accuracy and short execution time. The composite battery model in this paper uses the calculation results of Equation (7) to replace the direct measurement of OCV, which is known to be difficult [
35] but still used in other electrochemical models and ECMs. The advantage of linear parameters in our model reduces the difficulty of parameter identification. With less complexity, our composite battery model minimizes the number of the parameters to be identified while fully considering the influencing factors by combing
K1 to
K4.
3. The Experiments and Offline Parameter Identification
The mathematical parameters (
,
,
R,
K0,
K1,
K2,
K3,
K4) of the composite battery model shown in Equations (6) and (7) require a validation. The initial identification of the parameters is an offline and static estimation, obtained by polynomial curve fitting of the experimental data (see
Figure 2,
Figure 3,
Figure 4,
Figure 5,
Figure 6,
Figure 7 and
Figure 8). The charge/discharge rate factor
was obtained by the charge and discharge test. Similarly, the temperature influence coefficient
was obtained from temperature characteristic test. The other parameters (
R,
K0,
K1,
K2,
K3,
K4) were obtained through a Hybrid Pulse Power Characterization (HPPC) test and OCV-SoC test [
36]. All the tests were conducted on a LiFePO
4 battery (single cell) with 206 Ah rated capacity and 3.2 V rated voltage.
3.1. Charge and Discharge Rate Test
The main purpose of this test is determining the influence from different charging/discharging rates on the actual capacity of the battery. According to the definition of SoC shown in Equation (2), the difference between the rated capacity and the measured capacity is caused by the variable parameter of . The determination of is based on the experimental data to establish a linear fit relationship.
Five groups of different rates (0.2 C, 0.5 C, 1 C, 2 C and 3 C) with a constant current at room temperature (25 °C) were conducted in charging and discharging tests, respectively. There was a 1 h resting time before starting the discharging test after the charging test was completed.
Table 1 and
Table 2 show a specific data point of both capacity and energy retention for charging and discharging tests, respectively. The curves of the capacity retention rate for the charge and discharge rate tests for the LiFePO
4 battery are shown in
Figure 2 and
Figure 3, respectively. From
Figure 2 and
Figure 3, it is clear that the actual capacity of the battery will decrease as the charge/discharge rate increases.
3.2. Temperature Characteristics Test
Similar to the charge/discharge rate, the battery shows nonlinear behavior with ambient temperature changes. The working temperature of the lithium-based battery pack in actual situations is not a constant. Therefore, a temperature coefficient () has to be introduced to represent the impact of temperature on the SoC estimation.
The test involved using the 1 C rate to discharge a fully charged battery under different (constant) temperature conditions (
).
Table 3 shows a specific data point in both the capacity and energy retention rates at specific temperatures. The change curves of capacity retention rate for the LiFePO
4 battery at different temperature are shown in
Figure 4.
The increase in temperature reduces the overpotential, which will cause an increase in the activity of the chemicals inside the battery. Thus, the discharge capacity of the battery increases at (constant) higher temperature conditions. The experimental results shown in
Figure 4 are consistent with the theoretical analysis—the capacity of the LiFePO
4 battery decreases with the decreasing temperature [
37].
3.3. Hybrid Pulse Power Characterization (HPPC) Test
The HPPC test is one of the most common approaches to offline parameter identification. This paper adopts the HPPC from Freedom CAR Battery Test Manual (published in 2003) to initially identify the parameters of direct current resistance (DCR) [
36]. The DCR, which includes both Ohmic resistance and the polarization resistance, is dynamic. The HPPC test is used to obtain DCR parameters as a function of SoC from the voltage response values. The series of pulse experiments of HPPC is to reliably establish cell voltage response time constants during “discharge”, “rest” and “regen” regions. The standard process of HPPC test is described in
Figure 5, where C
1/1 is 1C charge/discharge rate.
The HPPC test includes nine single repeated sequences (
Figure 5c). Each sequence is separated by 10% SoC or depth of discharge (DOD) with constant current discharge segments from 90% to 10% (
Figure 5b). One HPPC profile includes 10 s discharge, 40 s rest and 10 s charge (
Figure 5a). There is one hour resting time between each sequence (
Figure 5b). It should be noted that the spikes shown in
Figure 5b,c are basically the HPPC profile of
Figure 5a. This test uses 4 C discharge and 3 C charge. The data collection interval of the HPPC test is 0.2 s. The HPPC experimental results are shown in
Table 4 and include the voltage and the DCR. V
before and V
after are the measured voltage values before and after charging/discharge test, respectively. DCR values are rounded to two decimal places.
3.4. OCV-SoC Test
The open-circuit voltage (OCV) test is significant and necessary for the estimation of
K0. The operating characteristics of the battery show that a proportional relationship exists between OCV and SoC. The OCV is roughly regarded as a linearized function of SoC in a simplified system [
38]. For example, the OCV rises with the increase in SoC. The current SoC of the battery can be calculated through a model relationship between OCV and SoC. The experimental steps used to obtain an approximate OCV value are shown in
Figure 6.
3.5. Offline Parameter Identification
The data shown in the various tests described in
Section 3.1,
Section 3.2,
Section 3.3 and
Section 3.4 was obtained by real experimental bench based on LiFePO
4 battery (206 Ah, 3.2 V). A convincing offline parameters identification was required to achieve a reliable mathematical battery model for the simulation of KF. Eight parameters (
,
,
R,
K0,
K1,
K2,
K3,
K4) were identified by the approach of linear fitting and recursive least squares (RLS) in MATLAB. The experimental data was input into MATLAB in the form of different sets of data points. In terms of
, relationship between the actual capacity and the charge/discharge rate were quantified by linear fitting functions in MATLAB. A second-order polynomial linear fitting equation for
was obtained by the use of the polyfit function:
where
i represents the charging-discharging current in A. Similarly, the polynomial curve of the temperature coefficient (
) was obtained by MATLAB polyfit function, as follows:
where
T is the actual temperature of the battery.
The rest of parameters (
K0,
R,
K1,
K2,
K3,
K4) were obtained by the method of RLS.
Figure 7 shows that the vales of parameters begin to converge after 1500 iterations. The values of the parameters were as follows:
R = 0.0048,
K1 = −0.000268,
K2 = 0.1495,
K3 = 0.111 and
K4 = −0.01955. The value of
K0 was 3.191 and is not shown in the figure. The accuracy in the estimation of parameters was high, of the order of ±0.3%. The mathematical model based on linear fitting from real experimental data is therefore reliable for SoC estimation using iEKF.
4. The SoC Estimation Based on an Improved EKF Algorithm
The crucial objective of addressing the filtering problem is filtering any noise from the observed noisy signal. Taking specific situations into account such as signal processing, target tracking and control system, the solution for filtering problem can be generally transformed into a statistical estimation of the system status. Based on the theory of time domain state space, the KF algorithm achieves an estimation of the state of the system by recursive iteration.
4.1. Analysis of the KF and EKF Algorithm
The standard KF is mainly used in a linear dynamic system to estimate the unknown variable which cannot be directly measured. The optimal estimation is the core of the KF algorithm, which is based on the prediction estimation and algorithmic amendment. The processing objects of the KF algorithm include the real system and the system model [
39]. The real system includes the measurable input
uk, the real output
yk and the unmeasurable state
xk. The system model includes the same input
uk, the known state
xk and the output
yx based on the specific battery model. The optimal estimation is obtained through a comparison between the
yk and
yx to amend the prediction estimation. The state variable
xk of the system model is closer to the real value of
yk. The state-space system model of the discrete-time standard KF is expressed as follows:
where
k is the discrete time point,
xk,
uk and
yk are the state variables of the input and the output of the system, respectively.
wk is the process noise variable which is used to describe the superimposed noise and error during state transition.
vk is the measurement noise variable which is used to describe the generated noise and error when the input is measured.
Ak,
Bk,
Ck and
Dk are the equation matching coefficients reflecting the dynamic characteristics of the system.
Figure 8 shows the state-space model of the discrete simple KF.
Two different estimates of the state variable xk and the mean square error of estimation Pk are made at each sampling interval. For example, the first-time predictive estimate of is obtained by the iterative recursion using the state equations based on . The predictive estimates of and are completed before the yk measurement. The calculation of the optimal estimates of and start after the measurement of yk is processed. To obtain the optimal estimation of and , the predictive estimates of and will be amended after the calculation of yk.
The processing steps of standard KF algorithm are as follows:
Initial value of
and
:
Predictive estimate of the
and
:
KF gain
Lk (weighting coefficient matrix)
Optimal estimate of the
and
:
where
Dw and
Dv in Equations (14) and (15) are the covariance of the process noise
wk and the measurement noise
vk, respectively.
The standard KF algorithm shows the advanced estimation of the linear dynamic system. In terms of the nonlinear dynamic system such as the battery pack of EVs, the EKF algorithm linearly transforms the nonlinear system through an extended state-space model, then uses the iterative calculation of the standard EK algorithm to obtain the optimal estimation [
40]. The state-space system model of the EKF is expressed as:
where
and
are the state transfer function and the measurement function of the nonlinear system, respectively. The nonlinear discrete-time state-space model of the EKF algorithm is shown in
Figure 9.
Compared to the standard KF algorithm, the state-space model of EKF algorithm is different. However, the algorithm implementation is similar to the standard KF, which mainly includes the initialization, the predictive estimate and the optimal estimate. The
in predictive estimate of standard KF is replaced by
, while
substitutes
in the optimal estimate. The calculation process of EKF is shown in
Figure 10.
4.2. The SoC Estimation Model Corrected by EKF Based on Composite Model
The complexity of the SoC estimation increases because of the internal nonlinearization of the battery and the significant impact of external conditions. In addition, the working process of the battery for EVs involves large current changes and a single and regular approach hardly achieves an online accurate SoC estimation.
Taking the estimate accuracy and the calculation cost into consideration, an iEKF algorithm is proposed in this paper. The iEKF algorithm combines the OCV method, Ah method and the EKF algorithm. Based on the actual experimental battery data and the initial/offline parameter extraction using MATLAB, the algorithm implementation of the iEKF is shown in
Figure 11.
The main function of OCV method is to provide a relatively accurate initial estimation of the SoC. OCV-SoC curve obtained from the OCV-SoC test (see
Section 3.4) is used to provide an initialized SoC estimation for Ah method and EKF algorithm. A piecewise function is used in this paper for curve fitting the experimental data in OCV-SoC test. The mathematical expression of OCV-SoC relation is as follows (
x is the measured OCV):
The Ah method quantifies the external influence factors which mainly refer to the charging/discharging rate and the temperature. The principle of Ah method is shown in (20).
where
i is positive when discharging, but negative when charging. The coefficient of charging/discharging rate (
ηi) and temperature (
ηT) are obtained by Equations (8a), (8b) and (9), respectively.
In terms of the implementation of EKF algorithm, the composite model described in Equations (3)–(5) is adopted in this paper. The state-space model of EKF algorithm based on the composite battery model uses Equation (6) as the state equation and the Equation (7) as the output equation. The EKF is expected to show a strong algorithm correction ability [
41,
42]. The problem of inaccurate initialized estimation of OCV method and the current accumulated error in Ah method will be addressed by using EKF.
The implementation of EKF algorithm in this paper is as follows:
Ak−1 and
Ck are defined in Step 2 by using Equations (6), (7) and (10). The SoC
0 is calculated based on the remaining charge (after charging/discharging) in the previous state and the OCV in the current state.
,
Dw and
Dv relate to the performance of the battery and the data collection system. In order to update the status of the system, the sampling frequency is set in the Simulink equal to 2.5 times the bandwidth of the sampled signal as per the “Nyquist-Shannon sampling” criterion [
43].