SOC Estimation for Electric Vehicle Battery Using Kalman Filtering

With the growing shortage of petroleum energy and the intensification of air pollution, the development of energy-saving and environmentally friendly electric vehicles has become the main trend in the automotive industry. As the power source and energy carrier of electric vehicles, the battery’s own manufacturing process and group application technology have become key factors in promoting the commercialization of electric vehicles. Therefore, in order to ensure that the electric vehicle battery can work safely and effectively, electric vehicles must be equipped with a specific battery management system (BMS) to control and manage the state of the power battery pack. The state of charge (SOC) estimation has always been the core of the battery management system. It is the main parameter reflecting the battery operating state and provides a judgment basis for the vehicle control strategy. In this paper, I take the lithium iron phosphate (LiFePO₄) polymer power battery as the research object and use the Kalman filter correction algorithm to estimate the SOC of the power battery pack online.

I first introduce the development status of electric vehicles and the performance requirements of vehicle power batteries. Starting from the electrochemical characteristics of lithium iron phosphate batteries, I analyze the various internal and external factors affecting battery SOC and the difficulties of online estimation. Starting from the definition of SOC, by comparing several commonly used SOC estimation methods and combining with the application environment of electric vehicle battery, I propose the Kalman filter correction algorithm. This algorithm gives full play to the advantages of the open circuit voltage method, the ampere-hour counting method, and the extended Kalman filtering method, thus greatly improving the estimation accuracy and real-time performance of SOC. According to the discharge experiment data, the system establishes the charge-discharge rate SOC model, temperature SOC model, open circuit voltage SOC model, and extended Kalman filtering composite model related to the algorithm.

Then on this basis, I build the power battery pack SOC estimation system from both software and hardware perspectives. The system is composed of data sampling, algorithm execution, communication management, protection control, information storage, and data display modules. It completes the online detection of battery voltage, charge-discharge current, and temperature, the execution of the Kalman filter correction algorithm, microcontroller SPI and serial port communication, LCD online display, battery state diagnosis, and protection functions, thus achieving real-time online accurate estimation of the remaining power of the electric vehicle battery pack in a real sense.

1. Introduction

With the development of productivity and the increase in social demand, automobiles are no longer simply regarded as traditional means of transportation, but are gradually becoming an important part of social life for most people. The popularity of automobiles and manufacturing technology can reflect the current level of modernization of a country. At the same time, the continuous rise in global car ownership has caused human society to face many challenges such as energy shortage, climate warming, and air quality degradation. These aspects have indirectly promoted the development of automotive technology. Many researchers are constantly working on ways to reduce fuel consumption and develop new clean energy vehicles. Therefore, more and more people realize that electric vehicles are an important way to reduce environmental pollution and realize the concept of green vehicles.

Electric vehicles are mainly divided into three categories: pure electric vehicles (EV), hybrid electric vehicles (HEV), and fuel cell electric vehicles (FCEV). Pure electric vehicles obtain all their power from on-board energy storage devices to drive the motor. Hybrid electric vehicles have both electric drive and traditional internal combustion engine drive systems. Fuel cell electric vehicles use fuel cell engines as their power system. From an overall perspective, electric vehicles are superior to conventional fuel vehicles in terms of energy type, emission control, energy efficiency, and noise pollution. Therefore, electric vehicles have become the main trend in the research and development of green vehicles worldwide.

However, electric vehicles also have their own shortcomings. First, the driving range of electric vehicles is short and the on-board capacity is small. The low energy density of batteries is the biggest problem in the development of electric vehicles. Second, the manufacturing cost of electric vehicles is relatively high, generally 2 to 5 times that of fuel vehicles of the same class. Third, electric vehicles must be equipped with corresponding infrastructure and solve the problem of hydrogen sources. These factors all limit the development of electric vehicles.

The performance parameters of power batteries include energy density, power density, energy utilization efficiency, charge-discharge efficiency, self-discharge rate, and cycle life. So far, the power batteries commonly used in electric vehicles include lead-acid batteries, nickel-cadmium batteries, nickel-metal hydride batteries, and lithium-ion batteries. Table 1 provides a detailed comparison of the performance parameters of these batteries.

Type Specific Energy (Wh/kg) Energy Density (Wh/L) Specific Power (W/kg) Monthly Self-discharge Rate Cycle Life Memory Effect
Lead-acid 30–45 60–90 200–300 <5% 400–600 None
Ni-Cd 40–60 80–110 150–350 15%–30% 600–1200 Large
Ni-MH 60–70 130–170 150–300 25%–35% 600–1200 Small
Li-ion 90–130 140–200 250–450 2%–5% 800–1200 None

As an important part of the battery system, the battery management system plays a role in optimizing battery performance and extending battery service life. In the following years, BMS research will still focus on data acquisition, SOC estimation, safety management, and control functions. Data acquisition mainly enhances the anti-interference ability of the system, especially the sampling module, and improves the sampling speed and measurement accuracy of sensors. SOC estimation has always been the core part of BMS. How to grasp the changing rules of battery internal state and the influence of external factors on battery capacity, establish a reasonable and effective battery model and SOC algorithm, realize online SOC estimation and reduce estimation errors, will still be the main research direction in the future.

Accurate SOC estimation is the most basic and important aspect of the battery management system. SOC refers to the current stored power of the battery. In pure electric vehicles and hybrid electric vehicles, the power battery operates under very complex and harsh conditions, especially during start-up and acceleration, where there is high-current discharge with dramatic current fluctuations. Therefore, SOC is a nonlinearly changing state quantity during battery charging and discharging, which brings great difficulty to battery remaining power estimation. General SOC estimation strategies cannot meet the requirements of electric vehicles. Under this premise, I apply the Kalman filter theory to the SOC estimation of power batteries.

The Kalman filter theory was proposed by R.E. Kalman in 1960 and is an intelligent optimization algorithm for estimating time-varying state quantities of dynamic systems. This algorithm can linearize the nonlinear state-space model of the battery. While performing recursive filtering, it uses the information provided by the observed data to continuously correct the state estimation results, reducing state estimation errors and providing the corresponding dynamic error range. Based on this characteristic, electric vehicles can use battery energy more effectively without worrying too much about overcharge and overdischarge. The Kalman filter method has strong correction ability for SOC estimation values and can be used for electric vehicle batteries operating under intense charge-discharge current fluctuations.

2. Lithium Battery Characteristics and SOC Definition

Generally, the performance of lithium-ion power batteries is mainly determined by the cathode and anode materials. Lithium-ion batteries with LiFePO₄ as the cathode material have the characteristics of high energy density, low cost, and good safety performance, making them the primary choice for electric vehicle battery. In recent years, the successful development and application of lithium iron phosphate batteries is a major breakthrough in the global battery industry.

The internal active material of a lithium-ion battery works based on the principle that Li⁺ can be reversibly combined during the intercalation reaction. The reaction itself is a partial ordering process. The reaction device enables Li⁺ to reversibly move out of and insert into the host material without causing significant changes in the host structure. LiFePO₄ belongs to the orthorhombic system (Pmnb), having a regular olivine crystal structure. The stable physical and chemical structure of the LiFePO₄ molecule gives the lithium iron phosphate battery the advantages of high energy and high safety.

The lithium iron phosphate polymer battery is a rechargeable secondary high-energy battery that utilizes the characteristics of Li⁺ intercalation and deintercalation in the positive and negative electrode materials. The charging and discharging reaction mechanism is as follows:

Charging:

$$ \mathrm{LiFePO_4} – x\mathrm{Li^+} – x\mathrm{e^-} \rightarrow x\mathrm{FePO_4} + (1-x)\mathrm{LiFePO_4} \tag{1} $$

Discharging:

$$ \mathrm{FePO_4} + x\mathrm{Li^+} + x\mathrm{e^-} \rightarrow x\mathrm{LiFePO_4} + (1-x)\mathrm{FePO_4} \tag{2} $$

During charging, Li⁺ deintercalates from the positive electrode of the battery and embeds into the negative electrode through the internal electrolyte, making the negative electrode in a lithium-rich state and the positive electrode in a lithium-poor state. At the same time, electrons compensate for the charge and transfer to the graphite carbon in the negative electrode through the external circuit, thereby ensuring the balance between charges. The discharge process is exactly the opposite. Under normal charging and discharging conditions, Li⁺ embeds and deintercalates between the layered carbon negative electrode and the oxide positive electrode, which generally only causes changes in the interlayer spacing of the materials and does not destroy the crystal structure.

From the perspective of battery use, the performance parameters of lithium iron phosphate polymer batteries mainly include: battery capacity, battery voltage, internal resistance, charge-discharge rate, discharge power, self-recovery effect, discharge depth, and cycle life.

2.1 SOC Definition

Simply put, the state of charge SOC refers to the current stored power of the battery, that is, the remaining power. It is the main parameter reflecting the battery state. Usually, SOC is numerically defined as the ratio of the remaining battery power to the battery capacity under certain discharge conditions:

$$ SOC = 1 – \frac{Q_I}{Q_n} = 1 – \frac{Q_i}{Q_c} = \frac{Q_c – Q_i}{Q_c} \tag{3} $$

where Qn is the nominal capacity; Qc is the standard remaining capacity of the battery; Qi is the standard used capacity, numerically equal to the difference between the nominal capacity and the standard remaining capacity; QI is the actual used capacity, referring to the power discharged from a fully charged battery at the actual working temperature and discharge rate. η is the battery efficiency coefficient, used to quantify the influence of various factors on battery SOC. By introducing the battery efficiency coefficient η, the actual used capacity QI can be converted into the standard used capacity Qi, which facilitates the calculation of SOC.

In addition, we define SOC=100% as the state of charge when the battery terminal voltage rises to the charging cut-off voltage by trickle charging at room temperature of 25°C, and SOC=0 refers to the state of charge when the battery terminal voltage drops to the discharge cut-off voltage during actual discharge.

The above SOC definitions are all based on the single battery as the research object. However, electric vehicles use battery packs, so the definition of SOC needs to be modified accordingly. A single battery is the most basic unit of a battery pack. In order to facilitate installation, transportation, and use, several single batteries are usually connected in series to form a battery module. A battery pack is obtained by connecting multiple battery modules in series, parallel, or mixed modes. Due to the differences between single batteries, from single battery to battery module to battery pack, the power performance has obvious attenuation. Therefore, in order to ensure the safe and effective operation of the battery pack, according to the “barrel theory” principle, I take the minimum SOC value of all single batteries in the battery pack as the SOC value of the entire battery pack.

2.2 Factors Affecting SOC

In electric vehicles, the battery pack exhibits a high degree of nonlinearity, and SOC is affected by many factors such as discharge rate, battery temperature, self-discharge rate, and cycle life, which brings great difficulty to the accurate estimation of SOC.

(1) Discharge rate: Under the condition that other influencing factors remain unchanged, the battery discharge capacity decreases with the increase of discharge rate. This is because the depth of action of the internal active material of the battery along the electrode thickness direction is limited. When discharging at high current, the greater the discharge rate, the shallower the depth of action and the lower the utilization rate, so the battery capacity is smaller, and vice versa.

(2) Battery temperature: The power and active material utilization rate of the battery will increase with the rise of battery temperature. This is mainly caused by the temperature performance change of the electrolyte. When the battery temperature rises, the viscosity of the electrolyte decreases and the activity increases, leading to the enhancement of ion diffusion movement ability, ultimately improving the utilization rate of active materials and increasing the actual available capacity of the battery.

(3) Cycle life: After a period of use, the standard total dischargeable capacity of the lithium battery will change to a certain extent. At first, the capacity will increase somewhat, then remain roughly unchanged for a period, and then gradually decrease.

(4) Self-discharge rate: Self-discharge, also called charge retention ability, refers to the storage capacity retention ability of the battery in an open-circuit state under certain environmental conditions. Under the action of self-discharge, the SOC value will decrease with the increase of storage time.

3. Review of Common SOC Estimation Methods

The discharge of power batteries in electric vehicles is a very complex electrochemical reaction process. Factors such as discharge rate, ambient temperature, internal resistance, and self-discharge rate will all affect the estimation and judgment of battery SOC values. At the same time, these factors will change with the increase of cycle life, which accordingly increases the difficulty of battery modeling and SOC algorithm estimation.

At present, the main SOC estimation methods for power batteries at home and abroad include the discharge test method, open circuit voltage method, ampere-hour counting method, internal resistance measurement method, load voltage method, and neural network method. The following table summarizes these methods.

Method Advantages Disadvantages Applicability
Discharge test Most reliable, suitable for all batteries Time-consuming, requires interruption Laboratory only
Open circuit voltage Simple, accurate at end of discharge Long rest time needed, not dynamic Stationary state
Ampere-hour counting Simple, widely used Cumulative error, needs initial SOC Online with compensation
Internal resistance Good accuracy at later stage Complex, susceptible to interference Combined with other methods
Load voltage Real-time estimation Affected by current variation Rarely used alone
Neural network Suitable for nonlinear systems Needs large training data Emerging technology

Compared with common electronic consumer products, electric vehicles have higher requirements for the performance parameters of power batteries. The battery pack often works under high current and severe current fluctuation discharge conditions. At the same time, the influence of temperature on battery capacity also increases relatively. This puts forward more stringent requirements for the SOC estimation algorithm:

(1) The SOC estimation result should have high accuracy. In order to improve the energy utilization rate of power batteries and provide accurate cruising information, the maximum SOC estimation error should generally be controlled within 10%.

(2) SOC must be estimated online in real time. The vehicle control strategy of electric vehicles is adjusted at any time according to the current SOC value of the power battery pack.

(3) The current accumulation error should be reduced. Long-term cumulative errors will make the SOC estimation error larger and larger, reaching the maximum at the later stage of charging and discharging. Therefore, the ampere-hour counting method cannot be used alone in the battery management system of electric vehicles.

(4) The algorithm should be able to correct the inaccurate initial SOC value in real time. When the electric vehicle stops, the power battery pack is in an offline state, and it is difficult to accurately calculate the battery state of charge under the influence of self-discharge.

Given the above requirements, traditional SOC estimation methods cannot achieve online real-time accurate estimation of the SOC of electric vehicle battery packs. After comprehensive consideration of various factors, I decide to apply the Kalman filter theory to the estimation algorithm, and combine it with the open circuit voltage method and the ampere-hour counting method to estimate SOC, which basically meets the requirements of electric vehicles for SOC algorithms.

4. Kalman Filter and Battery Models

4.1 Standard Kalman Filter

In 1960, Kalman used the time-domain state-space theory to create the Kalman filter method, and successively proposed a Kalman filter algorithm that is easy to implement recursively on computers. The standard Kalman filter algorithm is mainly applied to linear dynamic systems. The system state-space model is as follows:

State equation:

$$ x_{k+1} = A_k x_k + B_k u_k + w_k \tag{4} $$

Output equation:

$$ y_k = C_k x_k + D_k u_k + v_k \tag{5} $$

where xk, uk, yk are the system state variable, input, and output respectively; wk is the process noise variable, used to describe the additive noise and error in the state transition process; vk is the observation noise variable, used to describe the noise and error generated during the measurement of system input. Ak, Bk, Ck, Dk are equation matching coefficients used to reflect the dynamic characteristics of the system. Here, we assume that both the process noise wk and the observation noise vk are Gaussian white noise with zero mean.

The standard Kalman filter performs two different estimations of the state variable xk and the mean square estimation error Pk at each sampling interval. The specific operation steps are as follows:

(1) Initialization of state variable x₀⁺ and mean square estimation error P₀⁺:

$$ x_0^+ = E[x_0] \tag{6} $$
$$ P_0^+ = E[(x_0 – x_0^+)(x_0 – x_0^+)^T] \tag{7} $$

(2) Prediction estimation of state variable xk⁻ and mean square estimation error Pk⁻:

$$ x_k^- = A_{k-1} x_{k-1}^+ + B_{k-1} u_{k-1} \tag{8} $$
$$ P_k^- = A_{k-1} P_{k-1}^+ A_{k-1}^T + D_w \tag{9} $$

(3) Kalman gain Lk calculation:

$$ L_k = P_k^- C_k^T (C_k P_k^- C_k^T + D_v)^{-1} \tag{10} $$

(4) Optimal estimation of state variable xk⁺ and mean square estimation error Pk⁺:

$$ x_k^+ = x_k^- + L_k (Y_k – y_k) \tag{11} $$
$$ P_k^+ = (1 – L_k C_k) P_k^- \tag{12} $$

where Lk represents the Kalman gain, which is also called the signal-to-noise ratio balance factor. Under high signal-to-noise ratio conditions, the larger the value of the Kalman gain, the faster the filtering convergence speed.

4.2 Extended Kalman Filter

For linear dynamic systems, the standard Kalman filter is undoubtedly the best state estimation method. However, the power battery pack of an electric vehicle is itself a nonlinear dynamic system. The battery state of charge and the charge-discharge rate, battery working voltage, and ambient temperature also have a nonlinear relationship. Therefore, the extended Kalman filter method should be used to realize online SOC estimation of the battery pack.

Compared with the standard Kalman filter, the extended Kalman filter linearizes the nonlinear power battery system through the system state-space model, and then uses the iterative process of the standard Kalman filter algorithm to perform optimal estimation of state variables. The system state-space model is as follows:

State equation:

$$ x_{k+1} = f(x_k, u_k) + w_k \tag{13} $$

Output equation:

$$ y_k = g(x_k, u_k) + v_k \tag{14} $$

where f(xk, uk) and g(xk, uk) correspond to the nonlinear state transition function and the nonlinear measurement function, respectively. Except for the different state-space models selected, the extended Kalman filter and the standard Kalman filter are essentially similar. Both are composed of initialization, prediction estimation, and optimal estimation. The extended Kalman filter uses the nonlinear model to estimate the state variable.

4.3 Battery Model Selection

From the perspective of system state variables, nonlinear state transition function f(xk, uk) and nonlinear measurement function g(xk, uk), the battery models used in the extended Kalman filter can be divided into the following categories.

The composite model is a combination of three battery models: the Shepherd model, the Unnewehr universal model, and the Nernst model. The composite model expression is:

State equation:

$$ x_{k+1} = x_k – \frac{\eta_i}{\eta_T} \frac{\Delta t}{Q_n} i_k \tag{15} $$

Output equation:

$$ y_k = K_0 – \frac{K_1}{x_k} – K_2 x_k + K_3 \ln(x_k) + K_4 \ln(1 – x_k) – R i_k \tag{16} $$

The simplified model treats the open circuit voltage as a function of SOC and the current as a function of the internal resistance:

State equation:

$$ x_{k+1} = x_k – \frac{\eta_i}{\eta_T} \frac{\Delta t}{Q_n} i_k \tag{17} $$

Output equation:

$$ y_k = OCV(x_k) – R i_k \tag{18} $$

The model with hysteresis effect considers the difference between the terminal voltage and the open circuit voltage after the battery transitions from the working state to the static state. The polarization effect correction model takes into account the nonlinear continuous change of battery terminal voltage when the charge-discharge current changes.

From the comparison of the four Kalman filter models, it can be seen that although the composite model and the simplified model are not as good as the hysteresis effect model and the polarization effect correction model in terms of estimation accuracy, their computational complexity is small and the operation is very simple, making them easy to implement in a microcontroller system. In addition, the difference between the composite model and the simplified model is mainly reflected in the form of the output equation. The composite model calculates the value through the expression K₀ – K₁/xk – K₂xk + K₃ln(xk) + K₄ln(1-xk) to replace the process of directly measuring the open circuit voltage in the simplified model, fundamentally solving the problem of difficult judgment of the open circuit voltage state and making the SOC estimation value more accurate. In view of the above considerations, I decide to adopt the battery composite model as the state-space model of the extended Kalman filter algorithm.

5. Kalman Filter Correction Algorithm

In the battery management system, SOC is an extremely important parameter. It provides the necessary judgment basis for the electric vehicle control strategy and estimates the cruising range of the vehicle in real time according to the current battery operating state. Accurate SOC values can not only greatly improve the working efficiency of the battery pack, but also effectively protect battery performance and extend the service life of the battery pack. However, the nonlinearity inside the battery pack and the influence of external factors correspondingly increase the complexity of SOC estimation algorithm design.

Based on reading a large number of domestic and foreign references and analyzing battery discharge experimental data, according to the special requirements of electric vehicles for SOC estimation algorithms, I propose the Kalman filter correction algorithm. This algorithm organically combines the extended Kalman filter algorithm, the ampere-hour counting method, and the open circuit voltage method. According to the different states of the battery, the appropriate method is selected for SOC estimation.

The ampere-hour counting method is based on the traditional current accumulation method, using the charge-discharge rate SOC model and the temperature SOC model to quantify the external influencing factors, so that the SOC estimation accuracy has been greatly improved. The principle of the ampere-hour counting method can be described by the equation:

$$ SOC_{k+1} = SOC_k + \frac{1}{Q_n} \frac{\eta_i}{\eta_T} \int_{k}^{k+1} i \, dt \tag{19} $$

where SOCk represents the remaining battery power of the battery pack at time k. i is positive during discharge and negative during charging. The charge-discharge rate coefficient ηi and the temperature influence coefficient ηT can be calculated using the following equations respectively:

$$ \eta_i = \frac{14967}{14967 – 4.3859 i + 1.150918 i^2} \tag{20} $$

$$ \eta_T = 1 + 0.00363 T – 0.00035 T^2 + 0.000013 T^3 – 0.00000036 T^4 \tag{21} $$

In equation (20), i represents the charge-discharge current in amperes. In equation (21), T represents the battery temperature in degrees Celsius. The open circuit voltage method provides a relatively accurate initial SOC value for the ampere-hour counting method and the extended Kalman filter method. Here, I use a piecewise function method to fit the curve equation of the open circuit voltage experimental data, obtaining the following relationship expression between SOC and OCV, where x is the measured open circuit voltage value in mV:

$$ x > 3335, \quad SOC = 1 \tag{22} $$

$$ 3327 \leq x \leq 3335, \quad SOC = \frac{1}{14512} (1 – \sqrt{8.47457105 \times 10^7 – 505671948}) \tag{23} $$

$$ 3297 < x < 3327, \quad SOC = \frac{1}{14512} (1 – \sqrt{0.26997 \times 10^7 – 20174026}) \tag{24} $$

$$ 3283 \leq x \leq 3297, \quad SOC = \frac{1}{14512} (1 – \sqrt{7.2721221273 \times 10^7 – 350478219}) \tag{25} $$

$$ 3179 < x < 3283, \quad SOC = \frac{1}{14512} (1 – \sqrt{0.2562017 \times 10^6 – 12.519419}) \tag{26} $$

$$ 2828 \leq x \leq 3179, \quad SOC = \frac{1}{14512} (1 – \sqrt{0.00735 \times 10^5 – 33.40059513}) \tag{27} $$

$$ x < 2828, \quad SOC = 0 \tag{28} $$

The extended Kalman filter has a strong algorithm correction ability and can improve the estimation results of the open circuit voltage method and the ampere-hour counting method, thereby solving the problems of inaccurate initial SOC value of the open circuit voltage method and current cumulative error of the ampere-hour counting method.

The specific algorithm process of the extended Kalman filter is as follows:

(1) Model selection:

$$ x_{k+1} = x_k – \frac{\eta_i}{\eta_T} \frac{\Delta t}{Q_n} i_k \tag{29} $$
$$ y_k = K_0 – \frac{K_1}{x_k} – K_2 x_k + K_3 \ln(x_k) + K_4 \ln(1 – x_k) – R i_k \tag{30} $$

(2) System parameter determination: By comparing equations (4), (5) with (29), (30), the system parameters Ak-1 and Ck can be determined:

$$ A_{k-1} = \frac{\partial f(x_{k-1}, u_{k-1})}{\partial x_{k-1}} \bigg|_{x_{k-1} = x_{k-1}^+} = 1 \tag{31} $$
$$ C_k = \frac{\partial y_k}{\partial x_k} \bigg|_{x_k = x_k^-} = \frac{K_1}{x_k^2} – K_2 + \frac{K_3}{x_k} – \frac{K_4}{1-x_k} \tag{32} $$

(3) Algorithm state initialization:

$$ x_0^+ = SOC_0, \quad P_0^+ = var(x_0) \tag{33} $$

(4) Extended Kalman filter iterative calculation:

$$ x_k^- = x_{k-1}^+ – \frac{\eta_i}{\eta_T} \frac{\Delta t}{Q_n} i_{k-1} \tag{34} $$
$$ y_k = K_0 – \frac{K_1}{x_k^-} – K_2 x_k^- + K_3 \ln(x_k^-) + K_4 \ln(1 – x_k^-) – R i_k \tag{35} $$
$$ P_k^- = A_{k-1} P_{k-1}^+ A_{k-1}^T + D_w \tag{36} $$
$$ L_k = \frac{P_k^- C_k^T}{C_k P_k^- C_k^T + D_v} \tag{37} $$
$$ x_k^+ = x_k^- + L_k (Y_k – y_k) \tag{38} $$
$$ P_k^+ = (1 – L_k C_k) P_k^- \tag{39} $$

The initial state value SOC₀ can be calculated based on the previous battery charge-discharge remaining capacity and the current open circuit voltage value. The initial mean square estimation error P₀⁺, process noise error Dw, and observation noise error Dv are closely related to the battery type performance and data acquisition system, while the data sampling period is generally determined by the charge-discharge rate and battery operating conditions.

The Kalman filter correction algorithm makes full use of the respective advantages of the three algorithms by organically combining the open circuit voltage method, the ampere-hour counting method, and the extended Kalman filter method. The algorithm first uses the open circuit voltage method to provide a relatively accurate initial SOC value for the battery pack, and then alternately uses the ampere-hour counting method and the extended Kalman filter method in a cycle. By using the extended Kalman filter to correct the estimated values of the open circuit voltage method and the ampere-hour counting method, this not only ensures the accuracy and feasibility of online battery SOC estimation, but also greatly reduces the overall cost of the battery management system, making the final SOC estimation value more effective and reliable.

6. Hardware System Design

In practical applications, the battery SOC value is difficult to measure directly with conventional tools and instruments. Generally, we can only estimate the current battery SOC value indirectly by building accurate battery mathematical models and performance estimation algorithms, using the battery data measured by the system (single battery voltage, battery pack total voltage, charge-discharge current, and battery surface temperature). Here, I perform improved processing on this estimation method, replacing the ambient temperature with the battery surface temperature, making the temperature SOC model more accurate during application.

The design goal of this system is to achieve online real-time accurate estimation of SOC for the lithium iron phosphate power battery pack. This requires that in addition to ensuring a certain accuracy of the SOC estimation results, the system must also complete signal acquisition, data transmission, algorithm implementation, data display, and control protection within a very short time, truly reflecting the accuracy and real-time performance of the battery SOC estimation system.

The power battery pack used in my experiment is composed of four lithium iron phosphate single batteries in series, each with a rated voltage of 3.2V, and a total battery pack voltage of 12.8V. In the SOC estimation system, the battery signals to be measured mainly include single battery voltage, battery pack total voltage, charge-discharge current, and battery surface temperature, totaling 7 data quantities. The signal sampling period is set to 1 second, and the Kalman filter correction algorithm period and data display update period are both 5 seconds.

I adopt a modular design concept and divide the entire hardware system into the following seven parts: data acquisition circuit, data processing unit (MCU), LCD display unit, data storage unit, communication expansion interface, host computer monitoring unit, and battery protection circuit. The modules are closely combined and interconnected, as shown in the system framework.

The data processing unit MCU is the core control component of the entire system. The main functions include data sampling control, digital signal preprocessing, Kalman filter correction algorithm implementation, host computer serial port communication, battery protection circuit control, and other peripheral module management.

The functions required by this system mainly include the following aspects:

– Measurement and display of each single battery terminal voltage and battery pack total voltage

– Measurement and display of battery pack charge-discharge current

– Measurement and display of battery pack surface temperature

– Online real-time estimation and display of battery pack SOC value

– Battery pack state diagnosis and charge-discharge protection control

– Storage and retrieval of battery information

– Calculation and display of battery pack charge-discharge time

The data processing unit function is mainly completed by the microcontroller MC9S08AW32 from Freescale Semiconductor. During the entire lithium battery pack SOC estimation process, the microcontroller MC9S08AW32 needs to complete the following tasks:

(1) Control the analog switch HCF4051 and A/D converter chip Max1174 to collect battery analog signals in real time, and process and analyze the sampled digital signals to obtain the corresponding voltage, current, and temperature values.

(2) According to the current charge-discharge stage of the battery pack, use the appropriate SOC estimation method, compare the SOC estimation result with the battery pack voltage, current, and temperature values, realize the analysis and diagnosis of the battery pack state, ensure that the battery pack is in a normal working state, and control the LCD module to display relevant battery information.

(3) Transmit the battery current working voltage, charge-discharge current, battery surface temperature and other data to the host computer in real time through the serial communication interface module SCI, and receive the battery digital signals of the lower acquisition circuit through the SPI communication interface.

(4) Save the remaining battery pack power value after each experiment, provide a reference basis for the initial SOC value when using the battery next time, and update the battery cycle life number at the same time.

The data acquisition circuit mainly collects signals such as the total battery pack voltage, each single battery voltage, charge-discharge current, and battery surface temperature in real time. The LTS 6-NP Hall sensor is used for current measurement, which converts the current signal into a voltage signal. The LM35 temperature sensor converts the temperature signal into a voltage signal. The Max1174 performs analog-to-digital conversion on the voltage, current, and temperature signals that have been processed by the front end.

For the battery protection circuit, the microcontroller MC9S08AW32 controls the NMOS transistor STP75NF75 to cut off the battery pack charge-discharge circuit when the battery operating state exceeds the safe area, thereby achieving the purpose of protecting the battery. The communication interface unit is mainly composed of serial port communication and SPI communication. The serial port communication is used for real-time battery sampling data transmission between MC9S08AW32 and the host PC, while the SPI communication expands the data sampling capability of MC9S08AW32.

In the data storage module, I use the low-power E²PROM chip 24C08 to record the final SOC value and battery cycle life number of the battery pack from the previous charge-discharge process. The display module uses a 128×64 graphic dot matrix liquid crystal display to show battery information such as the SOC estimation algorithm running state, battery pack working time, battery pack total voltage, charge-discharge current, battery surface temperature, and current battery pack SOC value.

7. Software System Design

The system software design mainly refers to programming the microcontroller MC9S08AW32 on the basis of hardware design. Through the program method, it controls each hardware circuit and finally realizes the online accurate estimation of the battery pack SOC. At the same time, I use Matlab software to process the battery data received by the PC to achieve the functions of algorithm verification and model optimization. The system software part is written in C language in a modular manner, which not only increases the readability and portability of the program, but also facilitates online debugging and upgrading of system software functions.

The program writing and debugging of the microcontroller MC9S08AW32 are completed under the CodeWarrior development software interface. CodeWarrior is a software tool developed by Metrowerks specifically for all Freescale MCU and DSP embedded application development. It is a dedicated software development platform recommended by Freescale to users. The integrated environment of the software includes editors, source code browsers, search engines, construction systems, debuggers, project managers, and other functional modules.

The Kalman filter correction algorithm in the software is implemented by consulting data tables to simplify complex formulas. The variables that need to be calculated by consulting tables mainly include the remaining variable initial value SOC₀, the charge-discharge rate coefficient ηi, the temperature influence coefficient ηT, Ck, and yk.

In the SOC₀ table lookup calculation, the input is the battery open circuit voltage OCV (mV): 2828≤OCV≤3335, with a total of 508 points (accuracy 1mV). In order to save microcontroller storage space, the table output value SOC₀’ is the SOC₀ magnified by 10⁴ times, converting 4-byte float data into 2-byte int data.

The ηi table lookup input is the battery charge-discharge current i (A): 0≤i≤15, with a total of 301 points (accuracy 50mA), and the table output result ηi‘ is magnified by 10⁴ times, stored as int type. The ηT table lookup input is the battery surface temperature T (°C): -20≤T≤50, with a total of 71 points (accuracy 1°C), and the table output result ηT‘ is also magnified by 10⁴ times, stored as int type.

Ck is the Kalman filter algorithm coefficient. The table lookup input is the current battery remaining SOC: 0.0001≤SOC≤0.9999, with a total of 5000 points (accuracy 0.02%). The table output result Ck‘ is magnified by 10⁵ times, stored as long type. yk is the Kalman filter output estimated voltage. The table lookup input is SOC: 0.001≤SOC≤0.999 (accuracy 0.1%), with a total of 1000 points, and the table output yk (mV) is stored in the microcontroller as int type.

The Matlab 6.5 software accomplishes the following functions in this system:

(1) Estimate the parameters of the extended Kalman filter composite model. The output equation of this model is given by equation (30). The parameters to be estimated are K₀, R, K₁, K₂, K₃, K₄. By defining vector Y=[y₁, y₂, …, yN]ᵀ and matrix H=[h₁, h₂, …, hN]ᵀ with column vectors hj=[1, ij, 1/xj, xj, ln(xj), ln(1-xj)]ᵀ, the model output equation is equivalent to Y=Hθ, and the parameter vector θ can be obtained as θ=(HᵀH)⁻¹HᵀY. Table 2 lists the final estimated values of the model parameters.

Parameter K₀ R K₁ K₂ K₃ K₄
Value 3.391 0.0048 -0.000268 0.1495 0.111 -0.01955

(2) Derive the second-order polynomial fitting curve equation for the charge-discharge rate coefficient ηi, the fourth-order polynomial fitting curve equation for the temperature influence coefficient ηT, and the open circuit voltage SOC relationship expression.

(3) After the charge-discharge experiment, use the known charge-discharge data to calculate the real SOC values of the battery pack at each moment, and compare them with the SOC estimated values of the Kalman filter correction algorithm, thereby achieving the purpose of algorithm performance evaluation and algorithm model correction.

8. Experimental Results and Analysis

On the basis of mastering the system hardware design and software algorithm requirements, I built a power battery pack SOC online estimation platform. On this experimental hardware platform, by simulating various electric vehicle driving conditions, the model parameters and algorithm performance are tested and optimized. The test object of this platform is a four-cell series lithium battery pack. If the number of single batteries in the battery pack is large, the SPI interface can be used to connect the data acquisition expansion circuit to achieve data transmission, thereby improving the SOC estimation capability of the system.

The battery selected for this experiment is the lithium iron phosphate polymer power battery produced by Wanxiang Electric Vehicle Co., Ltd. Table 3 lists the specific parameters of the single battery.

Model Dimension Rated Voltage Rated Capacity Internal Resistance Discharge Cut-off Voltage Charge Protection Voltage Rated Discharge Current Operating Temperature Cycle Life
WX11I3215 230×140×7.8 mm 3.2V ≥15Ah ≤2.1mΩ 2.8V 3.8V 15A -10–45°C 800 cycles

When performing the discharge experiment, the battery pack directly supplies power to the electronic load IT8513B. By using the programmability of the constant current mode of IT8513B, the vehicle cycle conditions are simulated in real time, thus verifying the accuracy and reliability of the SOC estimation algorithm to a certain extent. The maximum discharge current of the battery pack is 15A. The current update period of IT8513B is 1 second. When the single battery terminal voltage drops to the discharge cut-off voltage, the battery pack discharge experiment ends.

Considering the battery characteristics and the experimental environment, I selected three different driving test conditions: HWFET, UDDS, and FUDS to verify the SOC estimation performance of the Kalman filter correction algorithm for the power battery pack as widely as possible.

8.1 HWFET Test Condition

The HWFET cycle condition has a total length of 766 seconds. It is a transient test cycle with relatively high overall power output requirements and fewer braking states. The HWFET cycle experiment test object is a fully charged battery pack. Before the discharge experiment begins, the measured individual battery voltages are 3.442V, 3.444V, 3.410V, and 3.388V respectively. Using the open circuit voltage method, the entire battery pack SOC₀ is calculated to be 1. The entire discharge experiment lasted 4293 seconds, completing 6 HWFET cycles. After the experiment, the battery pack SOC is 0. During the experiment, the maximum output power of the battery pack is 195W.

8.2 UDDS Test Condition

The urban dynamometer driving schedule UDDS has a single cycle period of 1367 seconds. Since the electronic load IT8513B can only provide up to 1000 constant current input steps, the UDDS condition must be reduced, resulting in a modified UDDS test condition with a total length of 955 seconds. The battery pack that was not fully charged was used as the test object for this UDDS cycle experiment. Before the discharge experiment, the open circuit voltage of each single battery was measured as: 3.292V, 3.291V, 3.291V, 3.290V, corresponding to SOC values of 65.8%, 63.7%, 63.7%, and 61.6% respectively. The E²PROM SOC value is 68.8%, so the battery pack open circuit voltage SOC₀ equals 65.2%. The entire discharge experiment lasted 4980 seconds, divided into 5 cycles. After the experiment, the battery pack SOC is 0. The maximum output power of the battery pack is 192.9W.

8.3 FUDS Test Condition

The federal urban driving schedule FUDS has a condition length of 1372 seconds. In this experiment, the FUDS condition was modified by intercepting 998 seconds and converting all charging current data into discharge current data. Before the experiment, the open circuit voltage of each single battery was measured as: 3.297V, 3.296V, 3.296V, 3.295V, corresponding to SOC values of 74.8%, 73.2%, 73.2%, and 71.5% respectively. The E²PROM SOC value is 69.1%, so the battery pack open circuit voltage SOC₀ equals 70.3%. The entire discharge experiment lasted 4255 seconds, completing 4 FUDS cycles. The battery pack maximum output power is 194.7W, and the battery pack SOC is 21.7% at the end of the experiment.

Table 4 summarizes the performance of the Kalman filter correction algorithm under the three test conditions.

Test Condition Duration (s) Initial SOC Final SOC Maximum Output Power (W) Maximum SOC Error Average SOC Error
HWFET 4293 100% 0% 195.0 4.04% 1.74%
UDDS 4980 65.2% 0% 192.9 7.80% 3.11%
FUDS 4255 70.3% 21.7% 194.7 – –

Through the analysis and comparison of the experimental data using Matlab, the estimation effect of the Kalman filter correction algorithm is very good and fully meets the SOC estimation accuracy requirements for electric vehicle battery packs. From the battery pack SOC change curves, we can see:

(1) Before the discharge experiment begins, the battery pack can obtain a relatively accurate initial remaining power value by using the open circuit voltage method and the SOC value stored in the E²PROM.

(2) In the first 200 seconds of the discharge experiment, the battery pack successfully eliminates the influence of the hysteresis effect on the battery model estimation performance by using the ampere-hour counting method, laying a good state foundation for the effective implementation of the extended Kalman filter algorithm.

(3) At the early stage of the extended Kalman filter algorithm execution, the powerful correction ability of the Kalman filter on the SOC estimation value can be clearly seen. With the progress of the discharge experiment, the difference between the SOC estimation value and the real value becomes smaller and smaller.

(4) The Kalman filter correction algorithm uses the alternating method of the ampere-hour counting method and the extended Kalman filter method, which not only ensures the accuracy of the final SOC estimation value, but also reduces the overall cost of the power battery pack SOC online estimation system.

The technical indicators completed by the system mainly include the following aspects:

(1) Number of single batteries in the battery pack: 4

(2) Maximum SOC estimation error of the battery pack: <10%, average error: <5%

(3) Single battery overcharge and overdischarge protection: overcharge cut-off voltage 3.8V, overdischarge cut-off voltage 2.8V

(4) Battery pack overcurrent protection: maximum discharge current 1C, maximum charge current 0.5C

(5) Temperature protection: maximum operating temperature 45°C, maximum temperature rise 4°C/10 seconds

(6) Data acquisition period 1 second, Kalman filter correction algorithm execution period 5 seconds

9. Conclusion and Outlook

According to the system design requirements of the thesis – SOC accurate estimation of power battery packs based on Kalman filtering, I mainly completed the following work:

(1) I understood the characteristics of lithium iron phosphate polymer power batteries, mastered the battery charge-discharge characteristics and SOC influencing factors in the electric vehicle environment, and compared and analyzed several commonly used battery SOC estimation algorithms, ultimately proposing the Kalman filter correction algorithm that effectively combines the extended Kalman filter method, the ampere-hour counting method, and the open circuit voltage method.

(2) Using the battery data of the discharge test method, I established the charge-discharge rate SOC model, temperature SOC model, open circuit voltage SOC model, and extended Kalman filter dynamic model.

(3) I completed the hardware circuit design and software program writing of the battery SOC online estimation system, realizing the data acquisition of battery pack voltage, current, and temperature, the execution of the Kalman filter correction algorithm, the online display and storage of important battery pack data, the control of the battery pack protection circuit, the host computer data transmission, and the communication of peripheral circuit modules.

(4) By using the vehicle cycle test conditions to verify the performance of the Kalman filter correction algorithm and the power battery pack SOC online estimation system, I further corrected and optimized the algorithm model parameters using the test results. After Matlab analysis and processing, the battery pack SOC estimation error fully meets the design requirements specified by relevant national standards.

The problems to be solved in the system include the following aspects:

(1) In addition to the influence of charge-discharge rate and temperature, the SOC value of the battery pack is also closely related to the self-discharge rate, the battery health state SOH, and the balance between single batteries. In order to obtain a more accurate SOC estimation value, the algorithm must take these factors into account.

(2) The battery pack used in the experiment is only a 12.8V 15Ah battery pack formed by four lithium iron phosphate polymer power batteries in series. In order to better verify the Kalman filter correction algorithm through condition experiments, a power battery pack with larger capacity and more cells should be used.

(3) The electric vehicle is an environment with high noise and high electromagnetic interference. The SOC online estimation system should improve its anti-interference ability during design to improve the reliability and accuracy of the estimation results.

(4) The SOC online estimation system should be designed to operate in a low-power mode, thereby reducing the power loss of the battery pack in this system.

With the improvement of production technology and the optimization of product performance, power batteries will certainly become the main direction of the battery industry in the future. As the core part of the battery management system, SOC estimation is bound to receive more and more attention and research. In view of the current development status, SOC estimation is likely to achieve breakthroughs in the following aspects:

(1) Establish a more reasonable and effective battery model and intelligent SOC estimation algorithm. During battery use, the algorithm should be able to correct the battery model parameters in real time, making the SOC estimation value closer to the real value.

(2) Create a SOC estimation scheme applicable to most battery types. At present, there are many types of power batteries, and SOC estimation algorithms are only effective for a specific type of battery. This leads to great waste of system development time and cost, and is not conducive to the promotion and application of power batteries.

(3) Improve the accuracy and real-time performance of the SOC estimation of power battery packs. To truly achieve this, in addition to having a reasonable and effective battery model and estimation algorithm, it is also necessary to use a dedicated high-speed embedded microprocessor chip as the main control unit of the entire system. Although many internationally renowned IC manufacturers, such as Maxim, TI, and Seiko Electronics, have successively launched their own research and development of battery management chips, their application objects are some small-capacity, low-voltage batteries. Dedicated chips that can be directly applied to vehicle power battery packs are still extremely rare.

In summary, the Kalman filter correction algorithm proposed in this thesis provides an effective solution for the online real-time accurate SOC estimation of electric vehicle battery packs. The algorithm fully achieves the complementary advantages of the open circuit voltage method, the ampere-hour counting method, and the extended Kalman filter method. Through the verification of multiple vehicle cycle conditions, the estimation error of this algorithm is well controlled within the national standard requirements, providing a solid foundation for the further development and application of electric vehicle battery management systems.

Scroll to Top