Comparison of the SOC Estimation Method for Lithium Battery Based on Simulink

SOC (State Of Charge, SOC) represents the state of charge of a battery and is one of the important indicators to measure the energy usage of the battery. In the field of automotive energy, accurate battery SOC estimation is of great significance for improving the range, service life, and safety of electric vehicles. It is an important part of battery management and energy management. The current SOC estimation methods are diverse, and the ampere-hour integration method has the advantages of high accuracy and simple implementation. The EKF (Extended Kalman Filter) algorithm provides solutions for nonlinear problems such as SOC estimation of batteries. Therefore, these two methods are the preferred choice for some vehicle manufacturers and BMS enterprises. This study selects a first-order RC equivalent circuit model for parameter identification, builds a circuit model on Simulink, and compares and verifies the error of the AH integration method and EKF algorithm.


Introduction
Lithium batteries, as a kind of clean power energy, have no pollution, strong reliability, small size, and other characteristics; thus, it has very broad application prospects.With the continuous development of the electric vehicle industry, as one of the main batteries of electric vehicles, the status estimation of lithium-ion batteries has been one of the research hotspots in the field of electric vehicles [1][2] .The estimated SOC of lithium batteries is one of the key technologies of electric vehicles, which is of great significance to the design and optimization of battery management systems.At present, the SOC estimation method has been widely used.The following are several common SOC estimation methods: the open-circuit voltage method, which has the advantages of high accuracy and light load calculation.However, it is sensitive to the change of temperature, and long use will lead to the change of circuit parameters, affecting the estimation accuracy [3] ; the real-time power is calculated by measuring the current integration method to estimate the SOC of the battery [4] ; the current integration method is simple and easy to implement, but the accuracy is affected by many factors such as sampling period, measurement error and temperature [5] ; the Kalman filter method, where the known battery parameters can be used to update the battery status estimate, and the correlation between battery parameters and noise is taken into account, which has the advantages of eliminating noise and more accurate estimation [6] ; however, this method requires more computing resources and system parameters, which is not conducive to the real-time performance of the system [7] ; the neural network method, where the neural network model can the real-time collected battery data to learn and classify, so as to realize real-time estimation of battery SOC [8] ; the internal resistance method, which is extremely sensitive to the change of temperature, and is easily affected by the temperature, thus affecting the estimation results [9] .In this study, the two most widely used estimation methods were selected: AH integral and EKF algorithm.By establishing a simulation model on Simulink, the accuracy of the two estimation methods and the theoretical research are verified.

Lithium battery equivalent model establishment
According to the analysis of the characteristics of lithium-ion batteries and considering the accuracy and complexity of the model, because the first-order RC circuit is suitable for modeling different types of batteries, it can also comprehensively represent the various characteristics and behaviors of the battery.In conclusion, the first-order RC circuit model was finally selected as the equivalent circuit model for lithium-ion batteries, as shown in Figure 1.
In the above equation: η is the charging efficiency; SOC 0 is the initial charge state of the battery; τ is the time constant; and C max is the total battery capacity.Formula (1) (2) is discretized to obtain formula (5) (6):

Identification of the circuit model parameters
Parameter identification is a common method for finding parameters that may be related to the performance of battery SOC estimation.This process requires collecting some data, conducting systematic modeling, and then using a parameter identification algorithm to calculate the optimal parameter values.Battery model parameters usually include internal resistance, open circuit voltage, polarized resistance and polarized capacitance.
The HPPC (Hybrid Pulse Power Characterization) experiment is a standardized experimental procedure for the development and performance evaluation of battery management systems.It is often used in electric vehicles, hybrid electric vehicles, and fuel cell vehicles to assess battery performance and reliability.The basic principle of the HPPC experiment is to apply a set of current pulses under different battery SOC (State of Charge) to the charge and discharge process within the corresponding voltage range.The performance and capacity are evaluated by analyzing the voltage response, current response, and other parameters.
Identification parameters including R 0 , R 1, and C 1 at a temperature of 25℃. 1) In the normal temperature environment of temperature 25, the full charged lithium battery is let stand for 2 h.
2) The battery power is reduced by 0.5 C current by 10% and is stood for 1 h.
3) HPPC experiment is conducted on the battery, rested for 10 s, and then discharged with 1 C current for 10 s, rested again for 40 s, then charged with 1 C current for 10ds, and finally rested for 30 s.The current data is shown in Figure 1, recording the voltage experiment data of the battery end in this process [10] .
4) Steps 2) and 3) are repeated, and the experimental data is measured when the SOC is 0.1~0.9(interval 0.1).
In this paper, the identification toolbox in Matlab is used for parameter identification, and the measured experimental data is input,the battery discharge current data are shown in Figure Figure 2.After the identification, the voltage curve of the battery end is shown in Figure 3, and the curve fitting effect is ideal.In Figure 3, the dotted line is the measured end voltage curve, and the solid line is the voltage curve of the battery end obtained after parameter identification, which achieves a good identification effect.

AH Integration method
The current integration method is a relatively simple and practical method.Through the real-time collection of battery current parameters, the real-time power of the battery is calculated by the current integration method, and the SOC is calculated according to the battery design capacity of the battery.However, this method will have a cumulative error over time, and it cannot be eliminated.According to the equation, the basic SOC value is obtained.The battery pack is regarded as a dynamic continuous system input is the discharge current I, and the output is the SOC of the battery pack.
In Equation (7),where SOC 0 is the initial state of charge; C max is the maximum capacity of the battery; I is the charge-discharge current, which can be obtained by measuring the discharge current and charging current of the battery.The current can be measured using a current sensor or any other current-measuring device.
The current integration method can obtain a more accurate SOC value in some cases.However, when using the current integration method, we should pay attention to some limitations, such as current sensor accuracy and current fluctuation.Also, we cannot predict abnormal SOC change, such as temperature impact, battery aging, etc.Therefore, to obtain more accurate results, more refined SOC estimates are sometimes needed in combination with other methods, such as model-based methods.

EKF algorithm
The Extended Kalman Filter (EKF) is a filtering method that can be used to estimate the state of nonlinear systems, usually using current and voltage to calculate the SOC.Estimating multiple state quantities such as battery charging state and internal electrochemical parameters, correlation with onboard sensor data, and battery model can achieve accurate SOC estimation.
EKF uses a dynamic model to calculate the predicted value for the next state while using the measurements to update the prediction value and calculate the filtered SOC.Nonlinear functions were used to describe the dynamic and measurement models.Formula ( 8) is the equation of state and the observation equation of the EKF algorithm.
where Q k is the covariance matrix of process noise, and R k is the covariance matrix of measurement noise.Combined with the battery model, A k , B k , C k , and D k can be obtained and then put into the EKF algorithm calculation as follows: (1) The state of the system at time k is predicted as in formula ( (2) Preprediction of the state error covariance array at time k as formula (10): (3) Calculate the Kalman gain Kk as in formula (11): (4)Calculate the optimal estimate of the system state at the time point as in formula (12): (5)Update the system state error covariance array at time k such as formula (13): Iteration according to the above recursive equation of EKF enables the optimal estimation of the SOC of the cell in real time.In conclusion, the EKF algorithm is a feasible method for computing the cell SOC.It enables the estimation of the state of nonlinear dynamic systems while being applicable to many different types of battery systems.However, EKF also has some limitations, such as slow computation and sensitivity to initialization parameters and error processing.Therefore, sufficient optimization and validation should be performed in actual use.

Experimental verification
The verification circuit is built on Simulink to compare the error and estimation characteristics of the algorithm.The simulation circuit diagram is shown in Figure 4.According to the experiment, the AH integration method can maintain high accuracy from the initial stage to 90%, with a maximum error of 2.3%.Still, with the accumulation of time, the error gradually increases, and the maximum error at the end of the battery discharge can reach 17%, which is consistent with the theoretical study; the maximum error of the EKF algorithm can reach 20% because the battery parameters cannot be obtained at the initial time of the discharge experiment.Experiments found that continuing to discharge the EKF algorithm after the battery capacity is less than 96% can converge to the true value, even in the battery discharge end, still maintaining high precision.When the battery capacity is below 96%, the maximum error of the EKF algorithm is less than 1%.This study records the initial error of the two algorithms, as shown in Table 1.The two estimation errors are shown in Figure 5, and the estimation comparison results are shown in Figure 6.

Conclusion
By accurately estimating SOC, it is not only crucial to manage the charging and discharging process of automobiles but also to more accurately optimize energy management strategies to improve battery life and vehicle mileage.The current methods for estimating SOC have their own advantages and disadvantages.This study selects two widely used methods and verifies the error characteristics of the two estimation methods by building simulation models on Simulink in order to analyze the advantages and disadvantages.However, in different practical applications, selecting appropriate methods requires comprehensive consideration based on specific circumstances, including factors such as accuracy, computational complexity, and system implementation.It is also possible to consider the combination of multiple estimation algorithms to obtain more accurate estimation results.

Figure 1 .
Figure 1.First-order RC equivalent circuit model In Figure 1, U oc is the open circuit voltage, U L is the battery end voltage, R 0 is the internal ohmic resistance, R 1 and C 1 are the polarized internal resistance and polarized capacitance, respectively, U 1 is the two terminal voltages of capacitor C 1 , and the total current of I L circuit.The battery model equation can be obtained as formula (1) (2) (3) (4):

Figure 2 .
Figure 2. Discharge current Figure 3. At-end voltage identification result 4. Comparative verification of the estimation method