You are on page 1of 6

Estimation of power battery SOC based on

PSO-Elman neural network


1st Guo-qing Qiu 2nd Wen-ming Zhao 3rd Geng-yun Xiong
School of Automation School of Automation School of Automation
Chongqing University of Chongqing University of Chongqing University of
Posts and Telecommunications Posts and Telecommunications Posts and Telecommunications
Chongqing, China Chongqing, China Chongqing, China
qiugq@cqupt.edu.cn 897776806@qq.com 710410597@qq.com

Abstract—Estimation of the state-of-charge (SOC) of a battery method to perform dynamics and continuously correct the
for an electric vehicle is one of the key technologies for battery ampere-hour integral method to eliminate accumulated errors.
management technology (BMS). For the problem of low SOC The method effectively avoids the accumulation of errors in the
estimation accuracy, this paper proposes an improved PSO-
Elman neural network prediction model. In this model, the open circuit voltage method and the time integration method.
current and voltage of the battery are the input of the model, and However, when the car does not stop for a long time, the
the SOC of the battery is the output of the model. In the modeling initial value of the time integral method cant be corrected
process, the PSO algorithm is improved by combining the according to the improved open circuit voltage method, and
nonlinear weight reduction of inertia weights with the stochastic the error accumulation of the time integral method may still
inertia weights. The improved PSO algorithm is used to optimize
the weights and thresholds of Elman neural network. The data be very large. The Kalman filter is an auto-regressive data
set is used to train and verify the improved PSO-Elman neural processing algorithm, which is suitable for environments with
network with data sets in the MATLAB. The results show that large changes in external environment and obvious noise.
the improved PSO-Elman neural network has higher accuracy However, this method requires the establishment of an accurate
and faster prediction speed than the basic PSO-Elman neural battery model, and the amount of computation is also large. At
network.
Index Terms—Power batteries, state of charge (SOC), Im-
the same time, some scholars have proposed using improved
proved PSO, Elman neural network Ampere-hour integration method, using a simple electrochem-
ical model of the battery model combined with the extended
I. I NTRODUCTION Kalman filter algorithm to estimate the SOC [2]. Based on the
premise of establishing a suitable network model, the neural
With the increasing shortage of energy and environmental network method is robust, fault-tolerant, non-linear, etc. after
pollution, new energy vehicles are emerging. Power lithium extensive data training, and is suitable for the prediction of
battery is the mainstream power lithium battery at present. SOC value.
The battery state SOC of an electric vehicle is an important In this paper, a large number of charge and discharge
parameter of the battery management system, and it is also tests were performed on the experimental platform, and the
a key basis for achieving functions such as fast charging and data obtained from the experiments were analyzed. In order
battery management. to avoid the local minima and slow convergence speed of
At present, commonly used methods for estimating SOC Elman neural network, this paper chooses Particle Swarm
include ampere-hour integration method, open-circuit voltage Optimization to optimize the weights and thresholds of Elman
method, Kalman filter method, and neural network method. neural network, and then uses the optimized weights and
The time integral method is a kind of basic method used to thresholds as the Elman neural network. The initial value
estimate the SOC. When other conditions such as discharge of the network is trained, and a prediction model of battery
rate and temperature are stable, the estimation error is gener- state of charge SOC based on PSO-Elman neural network is
ally small, but the estimation error of the residual quantity of established.
the battery is very large when the working conditions change
more. The obvious disadvantage of the open circuit voltage II. E STABLISH I MPROVED PSO-E LMAN N EURAL
method is that the battery needs to stand for a long time to N ETWORK
stabilize the voltage. This time takes several hours or even a In this paper, the Elman neural network model will be
dozen hours. This disadvantage causes the open circuit voltage optimized using the particle swarm optimization algorithm
method to fail to perform real-time estimation of the SOC. with improved inertia weights. It will introduce the PSO al-
Paper [1] Estimate the open-circuit voltage at this moment by gorithm, improved PSO algorithm, Elman neural network and
using the battery terminal voltage at a certain moment and use improved PSO algorithm optimization Elman neural network
this method in combination with the ampere-hour integration model establishment.

978-1-7281-1312-8/18/$31.00 ©2018 IEEE 91

Authorized licensed use limited to: ULAKBIM UASL - CUKUROVA UNIVERSITESI. Downloaded on November 16,2022 at 10:53:21 UTC from IEEE Xplore. Restrictions apply.
A. Standard Particle Swarm Optimization inertia weight. This paper proposes an improved algorithm
The PSO is a swarm intelligence optimization algorithm based on the combination of nonlinear weight reduction of
that comes from research on predatory behavior of flock. The inertia weights and stochastic inertia weights, with faster
basic idea of PSO particle swarm optimization algorithm is global search capability and convergence speed. Compared
to find the optimal solution through the cooperation among with the basic PSO algorithm and PSO algorithm with linearly
individuals in the group and information sharing. Each particle decreasing inertia weights, the improved performance of the
in the algorithm represents a possible solution to the problem. improved algorithm has been significantly improved. Based
Each particle can calculate a fitness value based on the fitness on the combination of inertia weight nonlinear reduction and
function [3]. The speed of the particle corresponds to the random inertia weight, the inertia weight W is changed as
direction and distance of the particle’s movement, and the follows:
speed is dynamically adjusted according to its own or other W (i) = Wmax −(K1 + K2 ∗ rand)∗(Wmax − Wmin )∗i3 /i3max
particle movement experience, so as to achieve the purpose of (3)
finding the optimal solution in the solvable space. Assuming In the formula, i is the number of current iterations, imax is
an N-dimensional space, use X = [X1 , X2 , · · · , XN ], to the maximum number of iterations, the maximum number of
represent the position of particle i in N-dimensional space, iterations, 300; Wmax is the initial value of the inertia weight
and use V = [V1 , V2 , · · · , VN ], to represent particle i in W , 1.2; Wmin is the minimum of the inertia weight, 0.05;
N The speed in dimensional space. PSO initialization is a K1 is the weight of the nonlinear variation part, K2 is the
group of random particles (random solutions). Then iteratively weight of the random variation part, and K1 + K2 = 1, in
find the optimal solution. During each iteration, particles are which K1 takes 0.6, K2 takes 0.4; Rand is a random number
updated by tracking two extremes. The first is the optimal that produces a uniform distribution. In the whole optimization
solution found by the particle itself. The pbest is called the process, the Wi decreases with the number of iterations, and
individual maximal value. The other maximal value is the the larger inertia weight may be obtained under the influence
optimal solution currently found by the entire population. of K2 in the later period.
The gbest is the global maximal gbest. After finding the In the later stage of fitness iteration, when the change of
two optimal values, the particle updates its velocity and new fitness value is relatively small, the particle swarm may fall
position according to the following formulae (1) and (2) [3]: into local minimum. Using the formula (3), the inertia weight
Vi = Vi +C1 ∗rand ()∗(pbest + Xi )+C2 ∗rand ()∗(gbest + Xi ) W can get relatively large inertia weight at random, so that
(1) the particle can get a better global searching ability, and the
Xi = Xi + Vi (2) particle can jump out of the local extreme value.
In Equations (1) and (2), i = [1, 2, · · · , N ] , N is the total C. Elman neural network
number of particles in this group. Vi is the velocity of the The Elman neural network consists of an input layer, an
particle, Xi is the position of the current particle, and C1 , C2 implicit layer, a receiver layer, and an output layer. The role
are the learning factors. Rand() is a random number between of each layer is as follows: Input layer, signal transmission.
(0,1). pbest and gbest are extreme and global extremes. Acceptor layer: The signal received from the hidden layer is
used to remember the input value of the hidden layer neuron at
B. Improved PSO
the previous moment. The output of the receiving layer neuron
The parameter setting of the standard particle swarm op- is delayed and stored, and is input to the hidden layer. This
timization algorithm is very important to the performance of has sensitivity to historical data and increases the ability of
the algorithm. The rational setting of the inertia weight W is the network to handle dynamic information itself. The output
the key to the global searching ability and the local optimiza- layer is linearly weighted. The Elman neural network structure
tion ability of the balance algorithm. The usual methods of diagram is shown in the following figure.
improving the inertia weight W of PSO algorithm are linear
decreasing inertia weight, nonlinear decrement inertia weight, D. Parameter determination of Elman neural network
random inertia weight value, adaptive inertia weight value and The SOC of the battery is related to the temperature, voltage
so on. Literature [4] proposed a PSO algorithm that improved and current of the battery, but the correlation between the three
linear decreasing inertia weights to nonlinear decreasing inerti- is very small. Considering that the electric vehicle has a battery
a weights; literature [5] proposed an improved PSO algorithm discharge temperature management system, the operating tem-
based on stochastic inertia weights; literature [6] proposed a perature of battery charging and discharging can be considered
Adaptive PSO Algorithm for Dynamically Changing Inertia to be in a stable range. Therefore, it is considered that SOC
Weights. In this paper, a modified particle swarm optimization is related to voltage and current. The voltage and current are
(PSO) algorithm is proposed to solve the shortcomings of the input to the network, and the battery SOC is the output of the
basic PSO algorithm with poor stability, slow convergence network [7]. The number of neurons in the hidden layer can
speed and easy to fall into local convergence, and an improved affect the performance of the network. It is very important to
particle swarm optimization algorithm is proposed for the select the appropriate number of neurons. When the number of
combination of inertia weight nonlinear reduction and random the input neurons of the network is n, the number of the hidden

92

Authorized licensed use limited to: ULAKBIM UASL - CUKUROVA UNIVERSITESI. Downloaded on November 16,2022 at 10:53:21 UTC from IEEE Xplore. Restrictions apply.
2XWSXW\
parameters of the PSO particle number and the maximum
\ W
number of iterations of the particle swarm particle swarm
algorithm.
 P
3) The weights and thresholds of the input layer to the
QHWP W hidden layer, the hidden layer to the output layer in the Elman
neural network are encoded into real numbers to represent
individual particles.
 Q 4) Take the mean square error between the actual output
: and the expected output of the neural network as the fitness
: QHWQ W
function and update the fitness value. According to the fitness
value, obtain the individual maximal pbest and the global
 Q
:
maximal gbest, and then update the particle velocity and
position.
9L 5) If the maximum number of iterations is not reached, if the
QHWQ W
[F W   U global maximal value satisfies the PSO termination condition,
exit the PSO optimization and go to step 6. If the global
:L
maximal value is not satisfied, update the particles and go
,QSXWX
to step 4 when the If the maximum number of iterations and
the global maximal do not meet the end condition, go to step
Fig. 1. Elman neural network structure 4.
6) Decode the particles corresponding to the global maximal
and assign corresponding weights and thresholds to the Elman
layer neurons is m = 2 ∗ n + 1. After the number of the theory network.
of the hidden layer neurons is determined in paper [8], the 7) Assign the weights and thresholds obtained in step 6 to
rules are determined by thenumber of hidden layers proposed the Elman network, train the network, and then use the trained
in the document m  4 ∗ n ∗ (k + 3) + 1, k is the number network model to predict the SOC charge state.
of output layer nodes. By comparing the experimental results,
III. BATTERY DATA ACQUISITION A ND P ROCESSING
when the number of hidden neurons is 7, the average relative
error is the smallest, and the experimental results are the best. In order to estimate the SOC value in the process of rapid
Therefore, the number of hidden neurons is 7. The neurons current charging with variable current, the common constant
in the middle layer choose logsig as the activation function, current and constant voltage charging mode was chosen in
and the output layer neurons choose purelin as the activation this paper. The 36AH ternary polymer lithium battery was
function. The training function is selected by trainlm. selected for testing on the New Will Battery Experimental
Equipment. The upper computer selected BTS software. In
E. Improved PSO optimize Elman neural network order to simplify the experiment, the experiment temperature
was controlled at 25◦ C, and the current and voltage of the bat-
Refer to paper [9], the network structure of this article is
tery were recorded as a function of time, and the corresponding
set as follows. Since the structure of the Elman network is
SOC value was calculated. After sampling, 4396 data sets were
2-6-1, that is, the input layer has 2 nodes, the hidden layer 7
obtained.
nodes, and the output layer 1 node, a total of 2 ∗ 7 + 7 ∗ 1 = 21
The 439 groups were selected as the test set and the
weights, 7+1 = 8 thresholds. Therefore, the particle length of
remaining 3957 sets of data as training set. In order to reduce
the improved PSO algorithm is 21 + 8 = 29, and the number
the influence of noise, the selected training set and data set
of particles is 20, the maximum number of iterations is 300,
are normalized.
C1 = C2 = 1.4, Vmax = 1, Vmin = −1, the individual
maximum value Pmax = 1, and the individual minimum value X = (Xi − Xmin ) / (Xmax − Xmin ) (4)
Pmin = −1. In the form, Xi is a sample input, and Xmin and Xmax are the
In the iterative process, the fitness value of the particle is upper and lower values of the sample input. In this article, the
the mean square error between the actual output of the neural maximum value of the input data is taken by Xmax . Xmin
network and the expected output by the parameters of the is the minimum value of the input data, and the data are
current element corresponding to the network of each particle. normalized to 0 and 1, and X is the normalized data.
The steps for optimizing the Elman neural network with the
improved PSO algorithm are as follows: IV. N ETWORK T RAINING A ND R ESULTS A NALYSIS
1) The given training set and test set are normalized, and the A. Model Training
structure of the Elman neural network is determined according The Elman neural network model is created in MATLAB,
to the input and output parameters. and the network is optimized by the improved PSO algorithm,
2) Determine the length of the PSO particle based on and the training sample data is input to train the network. In
the determined Elman neural network structure, and set the this network, the error precision is 5 ∗ 10−5 .

93

Authorized licensed use limited to: ULAKBIM UASL - CUKUROVA UNIVERSITESI. Downloaded on November 16,2022 at 10:53:21 UTC from IEEE Xplore. Restrictions apply.
B. Experimental Result
In order to prove the optimization characteristics of the
improved PSO algorithm, the common linear decrement inertia
weight PSO algorithm is used to optimize the Elman network
and the improved PSO Elman network, which is improved in
this paper. When the network is trained, the test set is entered
into a trained network to predict, with the average relative
error as the contrast index. The average relative error formula
is as follows:
M
1  |Pi − Pti |
Ms = ∗ (5)
M i=1 Pti
Pi is the predicted value, Pti is the value of the test set,
M is the number of test sets, and Ms is the average relative
error.
Fig. 4. Optimal fitness value change curve
The predicted results of the Elman algorithm using the linear
decreasing inertia weight PSO algorithm are as follows: In

Fig. 5. Network training change curve


Fig. 2. linear decreasing inertia weight PSO-Elman- voltage and SOC diagram

of the predicted results of Elman neural network is 2.67%.


Figure 3 is a relative error graph of a linearly decreasing inertia
weight PSO-Elman network. From Figure 3, it can be seen that
the maximum relative error is 24.13%. The maximum relative
error is relatively large because the actual value of the first
point is small, with a slight deviation, the relative error is
relatively large. Figure 4 is the curve of the optimal fitness
value in the optimization process of the linear decreasing
inertia weight PSO. The final fitness value of convergence
is 0.0524. Figure 5 shows that the network converges in 685
steps.
Improved inertia weight PSO algorithm optimization Elman
network prediction experiment is as follows:
In Figure 6, the red curve is the predicted value and the blue
curve is the data of the test set. The average relative error of the
prediction results of the Elman neural network prediction test
Fig. 3. relative error of linear decreasing inertia weight PSO-Elman set is calculated to be 1.9%. Figure 7 is a plot of the relative
error of the improved inertia weight PSO-Elman network.
figure 2, the red curve is the predicted value and the blue From Figure 7 it can be seen that the maximum relative error
curve is the data of the test set. The average relative error is 9.49%. Figure 8 is the change curve of the optimal fitness

94

Authorized licensed use limited to: ULAKBIM UASL - CUKUROVA UNIVERSITESI. Downloaded on November 16,2022 at 10:53:21 UTC from IEEE Xplore. Restrictions apply.
Fig. 9. Network training change curve
Fig. 6. improving inertia weight PSO-Elman voltage and SOC curve

value during the optimization of the PSO optimization process


for the improved inertia weights. The optimal fitness value
for the final convergence is 0.0512. Figure 9 shows that the
network converges in 666 steps.
The comparison of experimental results is as follows:
• Table I shows the comparison of experimental results
about Linear decrement and Improve weights.

TABLE I
S IMULATION RESULTS

Average Maximum Fitness Training


relative relative convergence steps
error error value completed
Linear decrement 2.67% 24.13% 0.0524 685

Improve weights 1.9% 9.49% 0.0512 666

Fig. 7. Improved inertia weight PSO-Elman relative error curve

C. Analysis of results
In the experimental results, the average relative error of
the commonly used linear decrement inertia weight PSO
optimization Elman network is 2.67%, the average relative
error of the improved inertia weight PSO optimization Elman
network is 1.9%, the average error of the improved inertia
weight value is small 0.77%. The Linear Reduced Inertia
Weight PSO optimizes the Elman network. When the SOC
value is initially estimated, the SOC value is relatively small,
and when the predicted value shows a slight deviation from the
measured value, a large error will occur. Therefore, the linear
decreasing inertia weight is maximum value. The relative
error is relatively large, which is 24.13%. The improved
inertial weight is relatively stable at the beginning of the
prediction, and the maximum relative error is relatively small.
In the PSO optimization process, it can be seen from the
Fig. 8. the curve of the optimal fitness value during the optimization of
comparison between Figure 6 and Figure 10 that the fitness
inertial weight PSO value of the improved inertia weight PSO algorithm converges
faster than the linear decreasing inertia weight PSO, and

95

Authorized licensed use limited to: ULAKBIM UASL - CUKUROVA UNIVERSITESI. Downloaded on November 16,2022 at 10:53:21 UTC from IEEE Xplore. Restrictions apply.
the convergence value is smaller. It can be seen from the [8] Zhao Gang, Sun Haosai, Luo Shuzhen. Estimation of power battery
comparison between Figure 7 and Figure 11 that the improved SOC based on BP neural network. Chinese Journal of Power Sources.
2016(4):818-819.
inertia weight PSO algorithm optimizes the number of steps [9] Chen Jie, Gao Cuiyun,Hu Chong. Short-term Electric Load Forecasting
used by the Elman network to complete the predetermined Based on PSO-Elman Neural Network, Journal of Anhui Institute of
training target at 666 steps, while the linear decreasing inertia Architecture & Industry,2016,24(1):82-86.
weight PSO optimizes the 685 step of the Elman network. In
the four aspects of the average relative error the maximum
relative error the fitness convergence value and the number of
training completion steps, the experimental results show that
the predicting performance of PSO which is improved inertia
weight optimizing Elman network is better than the predicting
performance that PSO which is linear decrement inertia weight
optimize the Elman network.

V. C ONCLUSION
In this paper, the data of the constant current and constant
voltage charging process is selected, and then the SOC value
prediction of the 36AH ternary polymer lithium battery on the
electric vehicle is studied. Based on the Elman neural network,
the particle swarm optimization algorithm with improved
inertia weights is introduced to optimize it. After obtaining
the experimental data and processing the training set and the
test set, the training and simulation experiments of optimizing
the Elman network with the linearly decreasing inertia weight
PSO optimization Elman network and the modified inertia
weight PSO were performed. The experimental results not only
verify the feasibility of the commonly used linear decrement
inertia weight PSO optimization Elman network in the SOC
prediction of the lithium battery state of the electric vehicle,
but also verify the feasibility of inertia weight of the improved
inertial weight PSO algorithm. In the four aspects of the
average relative error the maximum relative error the fitness
convergence value and the number of training completion
steps, the experimental results show that the predicting perfor-
mance of PSO which is improved inertia weight optimizing
Elman network is better than the predicting performance that
PSO which is linear decrement inertia weight optimize the
Elman network.

R EFERENCES
[1] DENG Ye1, HU Yue-li2, TENG Hua-qiang3. Open-circuit Voltage
Prediction and SOC Estimation of Li-ion Battery. Instrumentation Tech-
nology. 2:21-24,2015.
[2] ZHANG Liping1, CHEN Haotian1, WANG Weifen2, LI Kaituo1, Ther-
mal Power Generation. 3:53-57,2015.
[3] ZHOU Mei-lan, ZHAO Qiang, ZHOU Yong-qin. State of Charge Esti-
mation for Li Fe PO4 Cell Using Improved PSO-BP Neural Network.
Journal of Harbin University of Science and Technology. 4:88-92,2015.
[4] WEI Wei, SHI Ya. The Application of ImprovedPSO-BP Algorithm
in Nonlinear Function Approximating. Microelectronics & Computer.
9:112-115, 2017.
[5] ZHAO Zhigang, LIN Yujiao, YIN zhaoyun. A mean particle swarm
optimization algorithm based on adapitive inertia wight. Computer
Engineering &Science. 38(3):501-506,2016.
[6] REN Zihui, WANGJian. New Adapitive Particle Swarm Optimization
Algorithm with Dynamically Changing Inertia Weight. Computer Sci-
ence. 36(2): 227-229+256,2009.
[7] Ma Jun, Gong Guoqing, Chen Yong et al. Influence of different driving
cycle on precision of SOC estimation. Chinese Journal of Power Sources.
2016(12):2335-2338.

96

Authorized licensed use limited to: ULAKBIM UASL - CUKUROVA UNIVERSITESI. Downloaded on November 16,2022 at 10:53:21 UTC from IEEE Xplore. Restrictions apply.

You might also like