Next Article in Journal
Autonomous Parking Space Detection for Electric Vehicles Based on Improved YOLOV5-OBB Algorithm
Previous Article in Journal
Grid-Sim: Simulating Electric Fleet Charging with Renewable Generation and Battery Storage
Previous Article in Special Issue
Cost-Benefit Analysis of Downstream Applications for Retired Electric Vehicle Batteries
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Research on SOC Estimation Method for Lithium-Ion Batteries Based on Neural Network

School of Mechanical Engineering, Xi’an University of Science and Technology, Xi’an 710054, China
*
Author to whom correspondence should be addressed.
World Electr. Veh. J. 2023, 14(10), 275; https://doi.org/10.3390/wevj14100275
Submission received: 19 August 2023 / Revised: 9 September 2023 / Accepted: 28 September 2023 / Published: 2 October 2023
(This article belongs to the Special Issue Battery Production for Electric Vehicles)

Abstract

:
With the increasingly serious problem of environmental pollution, new energy vehicles have become a hot spot in today’s research. The lithium-ion battery has become the mainstream power battery of new energy vehicles as it has the advantages of long service life, high-rated voltage, low self-discharge rate, etc. The battery management system is the key part that ensures the efficient and safe operation of the vehicle as well as the long life of the power battery. The accurate estimation of the power battery state directly affects the whole vehicle’s performance. As a result, this paper established a lithium-ion battery charge state estimation model based on BP, PSO-BP and LSTM neural networks, which tried to combine the PSO algorithm with the LSTM algorithm. The particle swarm algorithm was utilized to obtain the optimal parameters of the model in the process of repetitive iteration so as to establish the PSO-LSTM prediction model. The superiority of the LSTM neural network model in SOC estimation was demonstrated by comparing the estimation accuracies of BP, PSO-BP and LSTM neural networks. The comparative analysis under constant flow conditions in the laboratory showed that the PSO-LSTM neural network predicts SOC more accurately than BP, PSO-BP and LSTM neural networks. The comparative analysis under DST and US06 operating conditions showed that the PSO-LSTM neural network has a greater prediction accuracy for SOC than the LSTM neural network.

1. Introduction

Since the Industrial Revolution, energy has become an important part of human work and life. For centuries, the energy supply has relied mainly on non-renewable resources such as oil, coal and natural gas. With the continuous exploitation and use of these resources, energy depletion has been a common problem faced by human beings [1]. Therefore, the need to develop energy-saving [2] and new energy vehicles is an international consensus. Lithium-ion batteries have become one of the main power source choices for electric vehicles because of their high energy density, long life and low self-discharge multiplier [3]. The performance of the power battery system is not only related to the energy density of the battery cells but also closely related to the performance of the battery management system [4]. The battery management system is the “brain” of the power battery system, which provides the necessary conditions to ensure the normal operation of the battery module. The indicators of battery management system prediction mainly include SOC, capacity, energy status and power status. Among them, the SOC of the battery is the most critical indicator monitored by the battery management system [5]. This is because accurate SOC estimation is important in preventing overcharge or overdischarge, improving battery energy utilization and guaranteeing the safety and stability of the EV battery system, which provides necessary conditions for the subsequent optimization of the whole vehicle energy distribution.
To estimate the state of the lithium battery, various methods have been proposed by past researchers [6,7,8,9,10,11,12]. The open-circuit voltage method [13] is a method to estimate the SOC value by OCV, based on the functional relationship between the open-circuit voltage and SOC at both ends of the lithium-ion battery. However, because of the polarization effect of lithium-ion batteries, a long standing time is required to obtain the accurate OCV value. Therefore, the open-circuit voltage method can only be applied when the electric vehicle is parked; otherwise, the SOC value cannot be estimated online. The ampere–time integration method is one of the most widely used algorithms for SOC estimation because of its low computational effort and easy implementation [14,15]. Its principle is to calculate the amount of power charged or discharged during the charging and discharging of Li-ion batteries by integrating the current over time and then adding or subtracting it from the initial SOC value to obtain the current SOC estimation value. The ampere–time integration method cannot obtain the initial SOC value, so it is highly dependent on the accuracy of the initial SOC value. If there is a huge error in the initial SOC value, then the final SOC estimation value will also produce a huge error. The Kalman filtering [16,17] is able to balance computational complexity and estimation accuracy, so it is widely used in automotive, energy storage, aviation and navigation. The Kalman filtering algorithm resumes the state-space equations for the system and filters out the process noise and observation noise of the system by circular iterations to finally achieve the optimal estimation in the sense of minimum variance. The drawback of Kalman filtering is that it can only be applied to linear systems and cannot be applied directly to nonlinear systems.
The neural network is a mathematical model that simulates the synaptic connections of the human brain to analyze the system. Neural networks have the abilities of self-adaptation and self-learning. The neural network method simulates the neuronal system of the human brain, processes and remembers the input information through training a large amount of data and obtains a mapping relationship. Therefore, the neural network method has good prediction ability in nonlinear problems [18]. The advantage is that the internal structure of the system does not need to be understood, which is equivalent to treating the system as a “black box”, and the output accuracy of the network is high with sufficient training data [19]. Consequently, the application of neural networks to SOC estimation can circumvent the problems of initial SOC values and the accuracy of the equivalent model for Li-ion batteries. The neural network method generally consists of an input layer, a hidden layer and an output layer [20]. The number of layers and the number of nodes in the hidden layer are related to the prediction accuracy of the neural network model. In general, the more layers, the smaller the error, but too many layers can lead to too much complexity in the whole network and increase the training difficulty. The number of nodes in the hidden layer is related to the complexity of the network and the size of the error in the model output. After a reasonable training with a large amount of data, the number of nodes in the hidden layer is determined using parameters related to the network convergence speed [21]. The ability of the neural network method to deal with nonlinear problems makes it widely used in the SOC estimation of lithium-ion batteries for electric vehicles [22].
In this paper, the 18,650–2200 mA ternary lithium-ion battery was selected as the research object. BP, PSO-BP and LSTM neural network [23] models were established to predict the SOC of lithium-ion batteries. The comparison of the estimation accuracy of the three models shows that the LSTM neural network model has greater estimation accuracy. In addition, the PSO algorithm and the LSTM algorithm were combined to establish the PSO–LSTM prediction model. It was found that the accuracy of PSO-LSTM neural network estimation is superior.
This paper is organized as follows. The working principle of the lithium-ion battery, as well as the modeling and simulation of BP, PSO-BP and LSTM neural network models, is presented in Section 2. Section 3 compares and analyzes the errors of the three neural network models. Section 4 describes the modeling and simulation of the PSO-LSTM neural network model and compares the errors of PSO-LSTM and LSTM regarding SOC estimation. Finally, Section 5 concludes the research work of this paper.

2. Study of SOC Estimation Method

2.1. Lithium-Ion Battery Working Principle

A common lithium-ion battery is mainly composed of positive and negative electrodes, diaphragm and electrolyte [24]. The main function of the cathode is to provide enough positive ions for the redox reaction during the battery charge and discharge. The negative electrode, on the other hand, mainly provides electrons for the battery during charging and discharging, and its material is usually graphite. The function of the diaphragm is to prevent electrons from shuttling back and forth between the positive and negative electrodes but to maintain the free movement of lithium ions. The electrolyte is also a very important part that is mainly responsible for the normal flow of lithium ions between the positive and negative electrodes.
As can be seen in Figure 1, when a lithium-ion battery is in discharge mode, a large number of lithium ions originally embedded in the negative terminal of the battery will move rapidly to the positive terminal. At the same time, to ensure charge balance, electrons will also move from the negative terminal to the positive terminal. The process of lithium ions and electrons moving to the positive terminal at the same time is the so-called discharge process. On the contrary, in the charging mode, the transfer of lithium ions and electrons to the negative electrode represents the charging process of the battery.
The process of battery charging and discharging is shown in Equations (1)–(3).
Positive electrode reaction:
L i Z O 2 L i 1 x Z O 2 + x L i + + x e
Negative reaction:
C + x L i + + x e L i x C
Total reaction equation:
C + L i Z O 2 L i x C + L i 1 x Z O 2
where Z means elements such as iron, nickel and cobalt.
The 18650–2200 mA ternary lithium-ion battery specific parameters are shown in Table 1.

2.2. SOC Estimation Based on BP Algorithm

2.2.1. Model Building

BP neural network (Back Propagation Neural Network), known as error back propagation neural network, mainly consists of an input layer, an implicit layer and an output layer [25,26,27].
The parameters, such as voltage and current of the battery, are selected as the input of the model. The battery SOC value is used as the expected output of the model. The estimation flow of the BP neural network is shown in Figure 2.
The implicit layer is the core of the neural network, in which the number of nodes has not yet existed in scientific evidence. Currently, the most commonly used number is based on empirical formula to determine the number of nodes in the implicit layer.
The process of calculating the number of nodes is shown in Equation (4).
  l = n + a + m
where l means the number of nodes; n means the number of nodes in the output layer; a means the number of nodes in the input layer; m means the integer between 0 and 10.
Experimentally, the best results can be obtained when the number of nodes l is 8.

2.2.2. Model Simulation

MATLAB is used as a platform to establish the BP neural network model. The experimental data collected under constant flow conditions are fed into the input layer of the neural network. After setting the relevant parameters of the neural network, the training starts and continues until the output value of the training result meets the expected value to complete the model training. After the training is completed, the model parameters are determined according to the training results of the neural network, and the estimation accuracy of the neural network model is verified. The test data are input to the neural network model for verification and simulation. Finally, the results of comparing the real and predicted values are analyzed.
Figure 3a shows that the predicted and true values of lithium-ion battery SOC basically maintain the same variation throughout the estimation stage of lithium-ion battery SOC values, which verifies the validity of this model. The true value is derived from the SOC calculation of charge and discharge data in real time. As can be seen from Figure 3b, the estimation error of this model has a large error deviation at the early and late stages of estimation, with the largest estimation error of 4.57%. The error of the overall process is basically within 4%, which can generally meet the requirements for the accuracy of lithium-ion battery SOC estimation.

2.3. SOC Estimation Based on PSO-BP Algorithm

2.3.1. Model Building

Particle swarm optimization is an optimization algorithm proposed based on the behavior of swarm foraging [28]. The traditional BP neural network calculates the gradient by deriving the error function for each layer of neurons and then uses the gradient descent algorithm to optimize the connection weights and biases of the neural network. However, it is easy to fall into local optimal solutions because of the nonlinearity of the overall model. The PSO optimization algorithm, on the other hand, achieves a more powerful global optimization search capability through the random search of each particle in the solution space. The combination of BP neural network and PSO optimization algorithm can improve the fit of BP neural network model to the data and give it greater prediction accuracy.
The core idea of PSO-BP neural network model is to use the connection weights and biases of each layer in the neural network as the position matrix of each particle in the PSO optimization algorithm and to design the fitness function at the same time. By global search, the particle with the smallest global fitness is found to be the global optimal solution, and its position parameters represent the optimal weights and biases of the BP neural network model. The optimization flow chart of PSO-BP is shown in Figure 4.
Assume that the parameter dimension contained in the position of each particle is n. The dimension n of the position parameter of each particle is calculated as in Equation (5).
n = i n p u t c e l l s + 1 × h i d d e n 1 c e l l s + h i d d e n 1 c e l l s × o u t p u t c e l l s + o u t p u t c e l l s
where i n p u t c e l l s means the dimension of neural network input, h i d d e n 1 c e l l s means the number of nodes in the first hidden layer of neural network and o u t p u t c e l l s means the number of nodes in the output of neural network.
Each particle fitness is calculated as follows. Map the n-dimensional vector representing the particle position into the individual connection weights and thresholds of the neural network, and then input one training sample from the input layer of the neural network so as to obtain D at the output layer. Make the difference between it and the training sample label Y, and take the absolute value to obtain the error of one sample. Finally, sum up the errors of all samples to obtain the fitness function value. The calculation is shown in Equation (6).
f = r 2 r 1 | Y r 1 r 2 D r 1 r 2 |
where Y means the desired output of the training data, D means the actual output result, r1 means the number of output layers and r2 means the number of samples.

2.3.2. Model Simulation

The accuracy of the PSO-BP neural network model for estimating the SOC of Li-ion battery is verified with the same experimental test data. The test data are simulated and validated after the training is completed, and the experimental results are shown in Figure 5.
From Figure 5, it can be seen that the maximum estimation error of PSO-BP neural network model is 2.65%, which is generally 2% lower than that of BP neural network model. On the whole, the error of its overall estimation process can be maintained within 3%. Since the PSO-BP neural network model can avoid the error of falling into the local optimum, PSO-BP has better estimation accuracy for the SOC of Li-ion batteries.

2.4. SOC Estimation Based on LSTM Algorithm

2.4.1. Principle of LSTM Algorithm

Recurrent neural network (RNN) is a special kind of neural network structure. RNN has good results in dealing with time series problems. However, there are still problems such as gradient vanishing phenomenon. This is mainly due to the fact that when the time span is too large, the RNN’s learning memory of the initial data will be substantially weakened, resulting in gradient disappearance. After the gradient disappears, the network will not be able to update the parameters by back propagation at that time.
In order to solve the problem of gradient disappearance or explosion of RNN, scholars have proposed a series of improvement algorithms, one of which is the LSTM neural network algorithm [29]. As shown in Figure 6, the biggest difference between LSTM and RNN is the addition of “gate” structure inside LSTM, and LSTM can add or remove certain information through the “gate” structure. The “gate” structure is actually a fully connected layer, which allows all neural units to connect to each other. The “gate” structure is divided into three layers, which are input gate, hidden gate and forgetting gate [30,31,32]. Through these three gating units, LSTM neural networks can solve the gradient disappearance or explosion phenomenon [33,34].
(1)
LSTM forward calculation process
The information-forgetting process in the neuron is determined by the Sigmoid function in the forgetting gate, which can be used to remove invalid information and retain useful information. The output at the moment t − 1 is calculated as shown in Equation (7).
f t = σ W f h t 1 + W f x t + b f
There are two main steps to update the information in the neural unit at the moment t. Firstly, the input gate data i t is calculated according to the Sigmoid function. Secondly, there is the tanh layer to generate a new vector C ˜ t . The new vector C ˜ t is combined with the input gate data i t to update the information of the neuron. i t   and C ˜ t are calculated as Equations (8) and (9).
i t = σ W i h t 1 + W i x t + b i
C ~ 1 = t a n h W C h t 1 + W C x t + b c
During the information update of the neuron at the moment t, the product operation is performed using f t and the information state c t 1 of the neuron at the previous moment to first complete the discarding of useless information. Then, the new valid information i t × c t is summed up to form the current latest information to realize the updating of information. The calculation process is shown in Equation (10).
C t = f t ×   C t 1 + i t × C ~ t
In the principle of the state output value of the memory unit at the current moment t, the state of the memory unit is processed using the Sigmoid function to retain the information to be output. Then, the tanh layer is used to process it. Finally, the two parts of the information are multiplied to obtain the memory unit output value at the current moment t [35].
The calculation process of the LSTM neural network output values at the moment t is shown in Equations (11) and (12).
o t = σ W o h t 1 + W o x t + b o
h t = o t × t a n h o t
where tanh and σ mean activation function; i t , θ t , o t and c t mean input gate, output gate, forgetting gate and neuron states at the moment t; W i , W f , W o   a n d   W c mean weight matrix of each neuron at the moment t; b i ,   b f ,   b o and b c mean bias corresponding to each gate neuron at the moment t.
(2)
LSTM reverse calculation process
The calculation process of the memory cell output value at the moment t is shown in Equation (13).
δ c t = k = 1 K W c k δ k t + g = 1 G W c g δ g ( t + 1 )
The calculation process of the expression for the output gate o at the moment t is shown in Equation (14).
δ o t = f o t c = 1 c h s c t ε c t
The calculation process of the LSTM network state at the moment t is shown in Equation (15).
ε s t = b o t h s c t ε c t + b θ ( t + 1 ) ε s ( t + 1 ) + W c t δ i ( t + 1 ) + W c θ δ θ ( t + 1 ) + W c o δ o t
The calculation process of the derivative of the memory cell weight at the moment t is shown in Equation (16).
δ c t = b i t g o c i ε s t
The calculation process of the derivative of the weight of the forgetting gate f at the moment t is shown in Equation (17).
δ θ t = f o θ t c = 1 C s c t 1 ε s t
The calculation process of the derivative of the weight of input gate i at the moment t is shown in Equation (18).
δ i t = f a i t c = 1 C g a c t ε s l
where f ,   g   a n d   h mean activation function; s c t means memory neural units c at the moment t; ε c t means output of the neuron at the moment t; ε s t means signals from neurons at the moment t.

2.4.2. Model Building

The LSTM neural network model mainly consists of an input layer, an implicit layer and an output layer. The input layer is responsible for receiving input information. The number of nodes in the hidden layer is the most influential parameter on the training result of the whole model. The output layer is responsible for the output result and the inverse normalization of the obtained data.
The structure of LSTM is schematically shown in Figure 7. A large amount of data obtained from the laboratory is imported into the input layer of the neural network. The network starts training after the data is processed by the input layer, and, finally, the parameters of the model are adjusted according to the estimation results of the model. The training will complete when the prediction results of the model meet the requirements.

2.4.3. Model Simulation

The network model was built by writing code in MATLAB, and the experimentally obtained battery-related data were imported into the model. After a lot of training of the model, the parameters of the model were finally determined by measuring the estimation accuracy and operational complexity. Adam was used to complete the model optimization.
The predicted value of the LSTM neural network model is different from the true value to obtain the estimation error of the model. As can be seen from Figure 8a, the predicted value of the battery SOC is always consistent with the true value of SOC in the overall trend of the curve throughout the estimation process, and the error between them is also small. As can be seen from Figure 8b, the maximum error of the prediction result of the LSTM neural network on the SOC of the lithium-ion battery is 1.84%, and the error of the whole process is kept below 2%. In general, the overall estimation accuracy is high.

3. Contrast and Analysis

In order to compare the estimation performance of different models, two indexes—loss value of the model during training and test accuracy—were selected to compare the three neural network models. Lower training loss value represents better fitting ability of the model, while greater test accuracy represents greater generalization ability and prediction performance of the model. As can be seen from Figure 9a, the BP model has the smallest loss value during training, followed by the LSTM neural network model, and the PSO-BP neural network model has the largest one. As can be seen from Figure 9b, the LSTM neural network model has the highest test accuracy among the three network models, while the BP model has the lowest test accuracy, which is because the BP model easily falls into overfitting, while the LSTM neural network has a more extensive inductive bias. The combination of these two points identifies the advantages of the LSTM model.
Three different neural network methods for Li-ion battery SOC estimation are compared. As shown in Figure 10, the LSTM neural network has an error within 2%, and the estimation accuracy is improved by 2.73% over the BP model and 1.5% over PSO-BP. It is smaller than the BP and PSO-BP neural network models throughout the estimation phase, showing the superiority of the LSTM model. Therefore, it can be concluded that the LSTM neural network is a better choice for lithium-ion battery SOC estimation.

4. SOC Estimation Based on PSO-LSTM Algorithm

4.1. Principle of PSO-LSTM Model

Learning rate is the most important hyperparameter of LSTM neural networks, followed by network size, while momentum gradient has little effect on the final results [36]. In order to match the LSTM structure with the data characteristics of lithium-ion batteries, the PSO-LSTM prediction model was constructed. The number of neurons in the hidden layer (ls), the initial learning rate (lr) and the learning rate degradation factor (lrdf) were taken as the optimization objectives. The specific optimization steps of the PSO-LSTM neural network model are as follows:
Step 1: Data processing. The normalization of data processing is the basis of modeling. Different input data have different dimensions, and the difference in values can be very large, which will directly make the model have a big difference in training speed. Therefore, the data must be further normalized. To classify the collected data, the data are first mapped to [−1, 1] using the mapping function, and the normalized experimental data are classified into two datasets, “training” and “testing”.
Step 2: Using PSO to optimize important hyperparameters in LSTM models:
Step 2.1: Parameter initialization. Determine d, e, k, c1, c2, ω and the velocity and position [37].
The d is the particle dimension, e is the size of the population, k is the number of iterations, c1 and c2 are learning factors and ω is the inertia weights.
Step 2.2: Initialize the velocity and position of the population particles, and randomly generate the spatial position x = (ls, lr, lrdf) of each particle of the population.
Step 2.3: Set the mean square error as the target fitness value of the particle swarm, as well as obtain the individual extreme value ( p i j ) and global extreme value ( p g i ) of each particle according to the fitness value of the individual particles.
Step 2.4: Based on Equations (19) and (20), update the positions ( x i j ) and velocities ( v i j ) of the particles in real time, then obtain the fitness values based on the latest positions of the particles. As a result, the individual and global extremes are updated.
v i j ( t + 1 ) = w v i j ( t ) + c 1 r 1 p i j ( t ) x i j ( t ) + c 2 r 2 p g i ( t ) x i j ( t )
x i j ( t + 1 ) = x i j ( t ) + v i j ( t + 1 )
Step 2.5: According to the termination condition, evaluate the optimization result; if the condition is satisfied, the algorithm ends at this point and outputs the final optimization result. Otherwise, it will return to step 2.3.
Step 3: Build the LSTM model, and train the network using the parameters obtained from PSO optimization.
Step 4: After completing the training of the network, evaluate the estimation results of this network using the data from the previously divided test set. Finally, select the root mean square error (RMSE), mean absolute error (MAE) and maximum absolute error (ME) as the performance evaluation metrics.
The calculation process of RMSE, MAE and ME is shown in Equations (21)–(23).
RMSE = 1 T t = 1 T S O C ( t ) S O C ( t ) 2
M A E = 1 T t = 1 T S O C ( t ) S O C ( t )
M E = m a x S O C ( t ) S O C ( t )
where S O C ( t ) means the true value at the moment t, S O C ( t ) means estimated value at the moment t, and T means the estimation of the total number of samples tested.

4.2. Model Building

The optimization process of this model is to use PSO to optimize the key parameters, such as the number of neurons, the learning rate and the maximum number of iterations in the LSTM model, and build the model based on the optimal parameters obtained as the parameters of the LSTM neural network. The overall flow of the simulation is shown in Figure 11.
The specific optimization steps of the PSO-LSTM neural network model are as follows.
Step 1: Collect the relevant battery data of the lithium-ion battery in real time under laboratory conditions. Determine the search space of the particle swarm according to the constraints to complete the initialization.
Step 2: After completing the initialization, solve the fitness value of each data sample. After comparing the target fitness value, distinguish the samples as discoverers, explorers and stragglers according to the difference between the samples and the target value. The one with the smallest difference is the discoverer, and the rest are explorers and stragglers.
Step 3: Update the position of the three individuals in Step 2. If the number of particles in the new position is too many, this particle returns to the last valid position, while the remaining particles recalculate the target fitness value and reassign roles.
Step 4: Confirm whether the convergence requirements are satisfied. If not, jump to step 3, or go directly to step 5.
Step 5: Output the information of the globally optimal particles, and obtain the weights of the optimal neural network as well as the threshold value.

4.3. Model Simulation

In order to verify the effectiveness of the optimization model, the PSO-LSTM neural network model was established in MATLAB. The optimal parameters of the LSTM neural network were optimized according to the particle swarm algorithm, described in the previous section, to meet the expected requirements. The experimental data under the laboratory constant flow condition were selected to verify the estimation performance of the PSO-LSTM model. The estimation results under the constant flow condition are shown in Figure 12.
As can be seen from Figure 12, the overall trend of the SOC prediction value and the real value of the PSO-LSTM model under constant current condition is generally consistent. The error fluctuation in the overall estimation process is much smaller, and the estimation accuracy is significantly improved compared with that of the LSTM model. The maximum estimation error is 1.5%, and the error of the whole estimation process is kept within 1%.
From Figure 13, it can be seen that the optimized model has less volatility during the whole estimation period. Its error curve is under the LSTM model’s. There is no dramatic fluctuation, and the overall estimation error can be controlled around 1%. The improvement of the PSO-LSTM model compared to the LSTM model in terms of accuracy is due to the fact that the PSO algorithm can automatically adjust the hyperparameters of the LSTM model to find the optimal parameters, which avoids the need to manually adjust the parameters. This improves the efficiency of finding the optimal parameters and makes the hyperparameters of the PSO-LSTM model more suitable than those of the LSTM model. As mentioned above, the PSO-LSTM model has greater estimation precision.
In order to further reflect the superiority of the optimization model, the estimation accuracy of this model was compared with the BP, PSO-BP, LSTM and PSO-LSTM neural network models. The magnitude of the values of RSME, MAE and ME was chosen as a measure of the estimation accuracy of these three models.
The comparative error results of the four different neural network models are shown in Figure 14 and Table 2. From Figure 14, it can be seen that the overall estimation error of the PSO-LSTM neural network is significantly smaller than the other three neural networks. Moreover, its stability in the whole estimation process is the best. This shows that the PSO-LSTM estimation model has the optimal estimation accuracy and greater reliability. From Table 2, it can also be found that the RMSE, MAE and ME of PSO-LSTM are smaller than the other three models, which verifies the advantages of the PSO-LSTM estimation model in the SOC estimation of lithium-ion batteries, reflecting its certain application value.

4.4. Analysis of the Results of LSTM and PSO-LSTM for DST Condition

From Figure 15, it can be seen that the LSTM model has good estimation performance in the DST condition. The curves of its predicted and real values keep the same trend as a whole. To be specific, the error gradually becomes smaller from the early stage to the middle stage of the test, then the estimation error gradually increases in the later stage. At the end of the estimation period, the maximum estimation error of the whole prediction period occurs, and the maximum error is 3.60%. Note that the overall can be kept within 2.0%, which basically meets the estimation requirements. However, this model has greater volatility during the whole estimation period. Therefore, there is room for improvement in the stability of model estimation.
As can be seen from Figure 16, the overall estimation value of the PSO-LSTM model under the DST condition has a high estimation accuracy. The trends of the model’s estimation value and real value are basically consistent. Compared with the LSTM model, the optimized model has a relatively stable error during the whole estimation period, without large fluctuations. The estimation error is kept within 1.7%, with a maximum error of 1.92%. It can be seen that the optimized model can still maintain good estimation accuracy under the DST condition. Accordingly, the optimized model has stronger robustness.
From Figure 17, it can be seen that the PSO-LSTM model has higher estimation accuracy than the LSTM model during the whole estimation process. The overall error fluctuation of the PSO-LSTM model is smaller, which indicates that the PSO-LSTM model has better robustness. Therefore, the estimation accuracy and stability of PSO-LSTM are improved compared with the LSTM model under actual working conditions.

4.5. Analysis of the Results of LSTM and PSO-LSTM for US06 Condition

From Figure 18, it can be seen that the estimation value of the LSTM model under the US06 condition is generally consistent with the change value of the real value. The estimation error of the model changes from large to small and then to large in the whole estimation stage, until the estimation error gradually reaches the maximum, which is 4.11%. The overall error during the estimation period is kept within 3%, which meets the estimation requirements on the whole.
Figure 19 shows that the PSO-LSTM model has good estimation accuracy during the whole estimation period, and the estimation error can be controlled within 2.1%. Furthermore, the optimization model has better stability. The overall fluctuation of the error is relatively smooth, without large changes. Therefore, the estimation performance of the optimized model is superior and more applicable.
From Figure 20, it can be seen that the overall error of the LSTM model during the estimation period is 4.1%, and the fluctuation change is very obvious, which indicates that the stability of LSTM in the estimation process still needs to be improved. Compared with the LSTM estimation model, the PSO-LSTM model has good estimation accuracy during the whole estimation period. The estimation error can be controlled within 2.1%. The optimization model also has better stability, and the overall fluctuation of the error is relatively smooth, without large changes. Therefore, the estimation performance of the optimized model is superior and more applicable.

5. Conclusions

In this paper, the SOC estimation model of lithium-ion batteries based on the BP, PSO-BP and LSTM algorithms was established. Through comparison experiments, the results showed that the maximum errors of SOC estimation of BP, PSO-BP and LSTM neural network models were 4.57%, 2.65% and 1.84%, respectively, under the laboratory constant current conditions, which verifies that the LSTM model established in this paper can perform SOC estimation more accurately.
The PSO algorithm was selected to optimize the hyperparameters of the LSTM neural network model, and an optimized PSO-LSTM model was constructed to estimate the SOC of lithium-ion batteries. The experimental results under constant current conditions showed that the maximum estimation error of the PSO-LSTM model was only 1.5% at most, and the overall estimation accuracy was improved by 1% compared with that of the LSTM model. The maximum estimation errors of the PSO-LSTM model were 1.92% and 2.1% for DST and US06 conditions, respectively, which were 1% to 2% less than that of LSTM. The results show that PSO-LSTM has better accuracy and generalization ability throughout the estimation process.
The PSO-LSTM model proposed in this paper estimated and analyzed the SOC of lithium-ion batteries, but only some of the key influencing factors were selected as the input features of the model, and other sub-important factors were not analyzed and discussed, so there is still some room for progress in the extraction of input features. This paper only focuses on the field of lithium-ion battery SOC estimation and does not carry out an in-depth study of intercell equalization and ambient temperature changes. Secondly, the estimation of the SOH of Li-ion batteries is another very important area, and, if the conditions permit, the SOC and SOH of Li-ion batteries can be studied at the same time.

Author Contributions

Conceptualization, C.Z. and X.X.; methodology, C.Z. and X.X.; software, Y.L.; validation, X.X., J.H. and W.S.; formal analysis, X.X.; investigation, C.Z.; resources, C.Z.; data curation, Y.L.; writing—original draft preparation, X.X.; writing—review and editing, C.L., X.X. and J.H.; visualization, C.Z.; supervision, C.Z.; project administration, C.Z.; funding acquisition, C.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the National Natural Science Foundation of China: Research on the Integrated Control Method of the Lateral Stability of Distributed Drive Mining Electric Vehicles (51974229) and the 2021 Youth Innovation Team Construction Scientific Research Program of Shaanxi Provincial Education Department (Project No. 21JP071).

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Wang, W.H.; Fu, R. Stability Analysis of EKF-Based SOC Observer for Lithium-Ion Battery. Energies 2023, 16, 5916. [Google Scholar] [CrossRef]
  2. Wang, C.N.; Yang, F.C.; Vo, N.T.M.; Nguyen, V.T.T. Enhancing Lithium-Ion Battery Manufacturing Efficiency: A Comparative Analysis Using DEA Malmquist and Epsilon-Based Measures. Batteries 2023, 9, 317. [Google Scholar] [CrossRef]
  3. Wang, Y.; Tian, J.; Sun, Z.; Wang, L.; Xu, R.; Li, M.; Chen, Z. A comprehensive review of battery modeling and state estimation approaches for advanced battery management systems. Renew. Sustain. Energy Rev. 2020, 131, 110015. [Google Scholar] [CrossRef]
  4. Zhang, X.; Li, X.; Yang, K.; Wang, Z. Lithium-Ion Battery Modeling and State of Charge Prediction Based on Fractional-Order Calculus. Mathematics 2023, 11, 3401. [Google Scholar] [CrossRef]
  5. Zhang, B.; Ren, G. Li-Ion Battery State of Charge Prediction for Electric Vehicles Based on Improved Regularized Extreme Learning Machine. World Electr. Veh. J. 2023, 14, 202. [Google Scholar] [CrossRef]
  6. He, H.; Xiong, R.; Fan, J. Evaluation of lithium-ion battery equivalent circuit models for state of charge estimation by an experimental approach. Energirs 2011, 4, 582–598. [Google Scholar] [CrossRef]
  7. Zhu, R.; Duan, B.; Wen, F.; Zhang, Z.; Zhang, C. Lithium-ion battery modeling and parameter identification based on decentralized least squares method. J. Mech. Eng. 2019, 55, 85–93. [Google Scholar]
  8. Zhang, R.; Li, X.; Sun, C.; Yang, S.; Tian, Y.; Tian, J. State of Charge and Temperature Joint Estimation Based on Ultrasonic Reflection Waves for Lithium-Ion Battery Applications. Batteries 2023, 9, 335. [Google Scholar] [CrossRef]
  9. Marques, T.M.B.; dos Santos, J.L.F.; Castanho, D.S.; Ferreira, M.B.; Stevan, S.L., Jr.; Illa Font, C.H.; Antonini Alves, T.; Piekarski, C.M.; Siqueira, H.V.; Corrêa, F.C. An Overview of Methods and Technologies for Estimating Battery State of Charge in Electric Vehicles. Energies 2023, 16, 5050. [Google Scholar] [CrossRef]
  10. Zou, C.; Klintberg, A.; Wei, Z.; Fridholm, B.; Wik, T.; Egardt, B. Power capability prediction for lithium-ion batteries using economic nonlinear model predictive control. J. Power Sources 2018, 396, 580–589. [Google Scholar] [CrossRef]
  11. Lin, Q.; Wang, J.; Xiong, R.; Shen, W.; He, H. Towards a smarter battery management system: A critical review on optimal charging methods of lithium ion batteries. Energy 2019, 183, 220–234. [Google Scholar] [CrossRef]
  12. Ning, B.; Xu, J.; Cao, B.; Yang, Q. A battery model with adaptive parameters based on equivalent circuit for state of charge estimation. J. Xi’an Jiaotong Univ. 2015, 49, 67–71+78. [Google Scholar]
  13. He, Z.; Martín Gómez, D.; de la Escalera Hueso, A.; Flores Peña, P.; Lu, X.; Armingol Moreno, J.M. Battery-SOC Estimation for Hybrid-Power UAVs Using Fast-OCV Curve with Unscented Kalman Filters. Sensors 2023, 23, 6429. [Google Scholar] [CrossRef]
  14. Wang, Q.; Wei, M.; Ye, M.; Li, J.; Xu, X. SOC estimation of lithium-ion batteries based on the Gray Wolf algorithm for optimizing the limit learning machine. Energy Storage Sci. Technol. 2021, 10, 744. [Google Scholar]
  15. Movassagh, K.; Raihan, S.A.; Balasingam, B. Performance Analysis of Coulomb Counting Approach for State of Charge Estimation. In Proceedings of the 2019 IEEE Electrical Power and Energy Conference (EPEC), Montreal, QC, Canada, 16–18 October 2019. [Google Scholar]
  16. Hou, E.; Wang, Z.; Zhang, X.; Wang, Z.; Qiao, X.; Zhang, Y. Combined State of Charge and State of Energy Estimation for Echelon-Use Lithium-Ion Battery Based on Adaptive Extended Kalman Filter. Batteries 2023, 9, 362. [Google Scholar] [CrossRef]
  17. Peng, S.; Zhang, A.; Liu, D.; Cheng, M.; Kan, J.; Pecht, M. State-of-Charge Estimation of Lithium-lon Batteries Based on Dual-Coefficient Tracking Improved Square-Root Unscented Kalman Filter. Batteries 2023, 9, 392. [Google Scholar] [CrossRef]
  18. Kler, R.; Gangurde, R.; Elmirzaev, S.; Hossain, S.; Vo, N.V.T.; Nguyen, T.V.T.; Kumar, P.N. Optimization of Meat and Poultry Farm Inventory Stock Using Data Analytics for Green Supply Chain Network. Discret. Dyn. Nat. Soc. 2022, 2022, 1–8. [Google Scholar] [CrossRef]
  19. Singh, P.; Lather, J.S. A curate power-sharing, voltage regulation, and SOC regulation for LVDC microgrid with hybrid energy storage system using artificial neural network. Int. J. Green Energy 2020, 17, 756–769. [Google Scholar] [CrossRef]
  20. Zeng, Y.; Li, Y.; Yang, T. State of Charge Estimation for Lithium-Ion Battery Based on Unscented Kalman Filter and Long Short-Term Memory Neural Network. Batteries 2023, 9, 358. [Google Scholar] [CrossRef]
  21. Wang, Q.; Gu, H.; Ye, M.; Wei, M.; Xu, X. State of Charge Estimation for Lithium-Ion Battery Based on NARX Recurrent Neural Network and Moving Window Method. IEEE Access 2021, 9, 83364–83375. [Google Scholar] [CrossRef]
  22. Zhang, Z.; Chen, S.; Lu, L.; Han, X.; Li, Y.; Chen, S.; Wang, H.; Lian, Y.; Ouyang, M. High-Precision and Robust SOC Estimation of LiFePO4 Blade Batteries Based on the BPNN-EKF Algorithm. Batteries 2023, 9, 333. [Google Scholar] [CrossRef]
  23. Huang, X.L.; Ma, X.; Hu, F. Machine learning and intelligent communications. Mob. Netw. Appl. 2018, 23, 68–70. [Google Scholar] [CrossRef]
  24. Barcellona, S.; Codecasa, L.; Colnago, S.; Piegari, L. Calendar Aging Effect on the Open Circuit Voltage of Lithium-lon Battery. Energies 2023, 16, 4869. [Google Scholar] [CrossRef]
  25. Wu, C.; Li, B.; Bei, S.; Zhu, Y.; Tian, J.; Hu, H.; Tang, H. Research on Short-Term Driver Following Habits Based on GA-BP Neural Network. World Electr. Veh. J. 2022, 13, 171. [Google Scholar] [CrossRef]
  26. Huang, Y.; Luo, W.; Lan, H. Adaptive pre-aim control of driverless vehicle path tracking based on a SSA-BP neural network. World Electr. Veh. J. 2022, 13, 55. [Google Scholar] [CrossRef]
  27. Wen, F.; Pei, W.; Li, Q.; Chu, Z.; Zhao, W.; Wu, S.; Zhang, X.; Han, C. Insulation Monitoring of Dynamic Wireless Charging Network Based on BP Neural Network. World Electr. Veh. J. 2021, 12, 129. [Google Scholar] [CrossRef]
  28. Ma, C.; Jin, S.; Yang, K.; Tan, D.; Gao, J.; Yan, D. Particle swarm optimization and real-road/driving-cycle analysis based powertrain system design for dual motor coupling electric vehicle. World Electr. Veh. J. 2020, 11, 69. [Google Scholar] [CrossRef]
  29. Azkue, M.; Miguel, E.; Martinez-Laserna, E.; Oca, L.; Iraola, U. Creating a Robust SoC Estimation Algorithm Based on LSTM Units and Trained with Synthetic Data. World Electr. Veh. J. 2023, 14, 197. [Google Scholar] [CrossRef]
  30. Li, X.; Chang, H.; Wei, R.; Huang, S.; Chen, S.; He, Z.; Ouyang, D. Online Prediction of Electric Vehicle Battery Failure Using LSTM Network. Energies 2023, 16, 4733. [Google Scholar] [CrossRef]
  31. Li, Y.; Luo, L.; Zhang, C.; Liu, H. State of Health Assessment for Lithium-Ion Batteries Using Incremental Energy Analysis and Bidirectional Long Short-Term Memory. World Electr. Veh. J. 2023, 14, 188. [Google Scholar] [CrossRef]
  32. Kong, D.; Wen, W.; Zhao, R.; Lv, Z.; Liu, K.; Liu, Y.; Gao, Z. Vehicle lateral velocity estimation based on long short-term memory network. World Electr. Veh. J. 2021, 13, 1. [Google Scholar] [CrossRef]
  33. Jiang, J.; Zhao, S.; Zhang, C. State-of-Health Estimate for the Lithium-Ion Battery Using Chi-Square and ELM-LSTM. World Electr. Veh. J. 2021, 12, 228. [Google Scholar] [CrossRef]
  34. Cai, Y.; Cen, Y.; Cen, G.; Yao, X.; Zhao, C.; Zhang, Y. Temperature prediction of PMSMs using pseudo-siamese nested lstm. World Electr. Veh. J. 2021, 12, 57. [Google Scholar] [CrossRef]
  35. Chung, D.W.; Ko, J.H.; Yoon, K.Y. State-of-Charge Estimation of Lithium-ion Batteries Using LSTM Deep Learning Method. J. Electr. Eng. Technol. 2022, 17, 1931–1945. [Google Scholar] [CrossRef]
  36. Hu, P.; Tang, W.F.; Li, C.H.; Mak, S.-L.; Li, C.Y.; Lee, C.C. Joint State of Charge (SOC) and State of Health (SOH) Estimation for Lithium-Ion Batteries Packs of Electric Vehicles Based of NSSR-LSTM Neural Network. Energies 2023, 16, 5313. [Google Scholar] [CrossRef]
  37. Mao, X.; Song, S.; Ding, F. Optimal BP neural network algorithm for state of charge estimation of lithium-ion battery using PSO with Levy flight. J. Energy Storage 2022, 49, 1041. [Google Scholar] [CrossRef]
Figure 1. Lithium-ion battery working principle diagram.
Figure 1. Lithium-ion battery working principle diagram.
Wevj 14 00275 g001
Figure 2. Flow chart of BP neural network estimation.
Figure 2. Flow chart of BP neural network estimation.
Wevj 14 00275 g002
Figure 3. Result analysis of BP neural network model. (a) Comparison of SOC estimation results of BP neural network models; (b) BP neural network model SOC error results.
Figure 3. Result analysis of BP neural network model. (a) Comparison of SOC estimation results of BP neural network models; (b) BP neural network model SOC error results.
Wevj 14 00275 g003
Figure 4. Flow chart of PSO-BP neural network model.
Figure 4. Flow chart of PSO-BP neural network model.
Wevj 14 00275 g004
Figure 5. Result analysis of PSO-BP neural network model. (a) PSO-BP neural network model prediction simulation; (b) Comparison of the errors of the two neural network models.
Figure 5. Result analysis of PSO-BP neural network model. (a) PSO-BP neural network model prediction simulation; (b) Comparison of the errors of the two neural network models.
Wevj 14 00275 g005
Figure 6. Schematic diagram of LSTM.
Figure 6. Schematic diagram of LSTM.
Wevj 14 00275 g006
Figure 7. Schematic diagram of the structure of LSTM neural network model.
Figure 7. Schematic diagram of the structure of LSTM neural network model.
Wevj 14 00275 g007
Figure 8. Result analysis of LSTM neural network model. (a) LSTM estimation results for constant flow condition; (b) Estimation error results of LSTM for constant flow condition.
Figure 8. Result analysis of LSTM neural network model. (a) LSTM estimation results for constant flow condition; (b) Estimation error results of LSTM for constant flow condition.
Wevj 14 00275 g008
Figure 9. Comparative analysis of model training results. (a) Comparison of loss values of different models; (b) Comparison of testing accuracy of different models.
Figure 9. Comparative analysis of model training results. (a) Comparison of loss values of different models; (b) Comparison of testing accuracy of different models.
Wevj 14 00275 g009
Figure 10. Comparison of results between different neural network models. (a) Comparison of estimates between different neural network models; (b) Comparison of errors between different neural network models.
Figure 10. Comparison of results between different neural network models. (a) Comparison of estimates between different neural network models; (b) Comparison of errors between different neural network models.
Wevj 14 00275 g010
Figure 11. PSO-LSTM model flowchart.
Figure 11. PSO-LSTM model flowchart.
Wevj 14 00275 g011
Figure 12. Simulation comparison of LSTM and PSO-LSTM model. (a) PSO-LSTM estimation results for constant flow condition; (b) Estimation error results of PSO-LSTM for constant flow condition.
Figure 12. Simulation comparison of LSTM and PSO-LSTM model. (a) PSO-LSTM estimation results for constant flow condition; (b) Estimation error results of PSO-LSTM for constant flow condition.
Wevj 14 00275 g012
Figure 13. Comparison of errors between LSTM and PSO-LSTM models.
Figure 13. Comparison of errors between LSTM and PSO-LSTM models.
Wevj 14 00275 g013
Figure 14. Comparison of errors between different neural network models.
Figure 14. Comparison of errors between different neural network models.
Wevj 14 00275 g014
Figure 15. Simulation results of LSTM for DST condition. (a) LSTM estimation results for DST condition; (b) Estimation error results of LSTM for DST condition.
Figure 15. Simulation results of LSTM for DST condition. (a) LSTM estimation results for DST condition; (b) Estimation error results of LSTM for DST condition.
Wevj 14 00275 g015
Figure 16. Simulation results of PSO-LSTM for DST condition. (a) PSO-LSTM estimation results for DST condition; (b) Estimation error results of PSO-LSTM for DST condition.
Figure 16. Simulation results of PSO-LSTM for DST condition. (a) PSO-LSTM estimation results for DST condition; (b) Estimation error results of PSO-LSTM for DST condition.
Wevj 14 00275 g016
Figure 17. Comparison of errors between LSTM and PSO-LSTM models for DST condition.
Figure 17. Comparison of errors between LSTM and PSO-LSTM models for DST condition.
Wevj 14 00275 g017
Figure 18. Simulation results of LSTM for US06 condition. (a) LSTM estimation results for US06 condition; (b) Estimation error results of LSTM for US06 condition.
Figure 18. Simulation results of LSTM for US06 condition. (a) LSTM estimation results for US06 condition; (b) Estimation error results of LSTM for US06 condition.
Wevj 14 00275 g018
Figure 19. Simulation results of PSO-LSTM for US06 condition. (a) PSO-LSTM estimation results for US06 condition; (b) Estimation error results of PSO-LSTM for US06 condition.
Figure 19. Simulation results of PSO-LSTM for US06 condition. (a) PSO-LSTM estimation results for US06 condition; (b) Estimation error results of PSO-LSTM for US06 condition.
Wevj 14 00275 g019
Figure 20. Comparison of errors between LSTM and PSO-LSTM models for US06 condition.
Figure 20. Comparison of errors between LSTM and PSO-LSTM models for US06 condition.
Wevj 14 00275 g020
Table 1. The key specifications of the test samples.
Table 1. The key specifications of the test samples.
TypeNominal VoltageNominal CapacityUpper/Lower Cut-Off VoltageNominal Continuous Discharge Current
186503.7 V2200 mAh4.20 V/2.75 V0.2 C
Table 2. Comparison of errors of different models under constant flow conditions.
Table 2. Comparison of errors of different models under constant flow conditions.
ModelRMSEMAEME
BP0.05450.03860.0457
PSO-BP0.04320.02180.0265
LSTM0.03500.01620.0184
PSO-LSTM0.01150.01120.0147
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Zhang, C.; Xu, X.; Li, Y.; Huang, J.; Li, C.; Sun, W. Research on SOC Estimation Method for Lithium-Ion Batteries Based on Neural Network. World Electr. Veh. J. 2023, 14, 275. https://doi.org/10.3390/wevj14100275

AMA Style

Zhang C, Xu X, Li Y, Huang J, Li C, Sun W. Research on SOC Estimation Method for Lithium-Ion Batteries Based on Neural Network. World Electric Vehicle Journal. 2023; 14(10):275. https://doi.org/10.3390/wevj14100275

Chicago/Turabian Style

Zhang, Chuanwei, Xusheng Xu, Yikun Li, Jing Huang, Chenxi Li, and Weixin Sun. 2023. "Research on SOC Estimation Method for Lithium-Ion Batteries Based on Neural Network" World Electric Vehicle Journal 14, no. 10: 275. https://doi.org/10.3390/wevj14100275

Article Metrics

Back to TopTop