Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

2019 IEEE 8th Joint International Information Technology and Artificial Intelligence Conference (ITAIC 2019)

A Recurrent Neural Network with Long Short-Term


Memory for State of Charge Estimation of
Lithium-ion Batteries
Chaoran Li ,Fei Xiao ,Yaxiang Fan* ,Guorun Yang ,Weiwei Zhang
National Key Laboratory of Science and Technology on Vessel Integrated Power System, Naval University of Engineering
799636132@qq.com, *fanyaxiang@126.com

Abstract—Lithium-ion batteries (LiBs) have been widely model with the filter method such as adaptive observers [3],
applied in energy storage systems, and accurate State of Charge Particle Filters [4][5] and Kalman Filters [6][9]. However, this
(SOC) estimation of LiBs has become a key issue. However, SOC method needs a suitable model of the battery. In addition, many
is an important LiBs state that cannot be directly observed. It parameters in the battery model need to be identified
needs to be indirectly estimated by the observable variables, and continuously with the changes of battery states. Another
SOC estimation is a challenging task due to strong nonlinear and common way to address the SOC estimation problem is the
complex electrochemical reactions change with temperature in data-driven method, which have used traditional machine
the battery. In this paper, a Recurrent Neural Network with learning techniques including Fuzzy Logic [7], Support Vector
Long Short-Term Memory (LSTM-RNN) for SOC estimation of
Machines (SVMs) [8][9], and Neural Networks [10][11]. A
LiBs is introduced. By training on the observable variables of
LiBs, the voltage, current and temperature can be mapped
significant limitation of the data-driven methods is that the
directly to SOC. Based on the dataset of LiB measured under estimation accuracy is limited to the computing power.
drive cycles of electric vehicles, the effectiveness of the LSTM- Recently, following the impressive results of neural network on
RNN for SOC estimation of LiBs proposed in this paper is a wide spectrum of domains such as natural language
validated. processing, time series forecasting and system modeling,
attempts have been made to train neural network for the task of
SOC Estimation.

Keywords—Lithium-ion batteries; State of Charge; battery


Actually, SOC estimation of battery is actually a time series
management systems; Recurrent Neural Networks with Long prediction problem. By using their internal state (memory) to
Short-Term Memory learn features and time dependencies from sequential data,
Recurrent Neural Networks (RNN) [12] is believed to able to
I. INTRODUCTION deal with time series problem. In this paper, RNN and a
modification method based on RNN which is Recurrent Neural
Because of its advantages such as long service life, high Networks with Long Short-Term Memory (LSTM-RNN) are
power and energy density, low self-discharge rate and used for SOC estimation of battery respectively. The SOC
environmental protection [1], Lithium-ion batteries (LiBs) have estimation results of battery show that LSTM-RNN for SOC
been widely applied in energy storage systems. And the Battery estimation can achieve accurate estimation results.
Management System (BMS) is also developed in pace with the
wide use of Lithium-ion battery for managing and maintaining II. SOC ESTIMATION BASED ON LSTM-RNN
battery energy. As is one of the key states of BMS, State of
Charge (SOC) is defined as a ratio of the remaining capacity A. Recurrent Neural Networks
over the maximum available capacity [2]. However, SOC of
LiBs cannot be directly measured by hardware devices, which Artificial neural network is first put forward in the 1940s
needs to be calculated by the estimation algorithms. Therefore, and ANN with recurrent connections is called Recurrent Neural
many researchers have conducted extensive research in Network (RNNs). Due to the development of back-propagation
developing the accurate SOC estimation. The two most and computational efficiency, RNN has been widely used in
frequently used SOC estimation methods are open-circuit various applications. The hidden states structure of RNN work
voltage method and ampere-hour counting method. In the as the memory of the network, and the current state is jointly
former method, the battery must be relaxed for a long time to impacted by current input and the previous state. This structure
allow it to reach a steady-state condition, which is impossible enables RNN to deal with time series data effectively. Fig. 1
for BMS in practice. And accumulative errors will have a huge show the structure of RNN unfolded in time. The output ht of
negative impact on performances of ampere-hour counting RNN hidden layer neuron A at t is determined by the
methods. Neither of the above two methods can achieve ideal previous inputs [ x0 , x1 , , xt 1 ] and the current input xt . Loss
SOC estimation results so that researchers tried to put forward function evaluates performance of the network by comparing
more effective methods. These methods can be divided into the output with the corresponding target. And back-propagation
model-based method and data-driven method. The former through time (BPTT) algorithm is used for RNN training.
combine a electrical circuit model (ECMs) or electrochemical

978-1-5386-8178-7/19/$31.00 ©2019 IEEE 1712


Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY CALICUT. Downloaded on January 05,2024 at 12:43:44 UTC from IEEE Xplore. Restrictions apply.
ht ht 1 ht ht 1 where xt is the input of the hidden layer nodes, ht is the output
ht 1 ht ht 1 of the hidden layer nodes, Ct is the state of the hidden layer
ht nodes. f t , it , ot are intermediate variables; W and b are
A = A tanh A
weight parameter and bias parameter of networks.  represents
variables multiplied by their corresponding positions.  and
xt xt 1 xt xt 1 tanh are activation functions of gates as follows
1
Fig. 1. Structure of RNN unfolded in time.  z  (7)
1  e z
B. Recurrent Neural Networks with Long Short-Term e z  e z
tanh( z )  (8)
Memory e z  e z
Although RNN can correlate past information with current Then loss function can be calculated as follow
output, the later inputs have stronger influences on RNN than
1 N
the earlier inputs. The gradients exploding and vanishing
during back-propagation process lead to the RNN failing to
L=  ht  ht
N t 1
(9)

learn the long-term dependencies. Therefore, Jürgen


where N represents the length of the sequence, ht and ht are
Schmidhuber et al. [13] proposed the Recurrent Neural
Networks with Long Short-Term Memory which can overcome the output value and the ground truth values at time step t .
long-term dependencies of RNN. The cell structure of LSTM is And the back propagation algorithm of LSTM-RNN can be
shown in Fig. 2. Each LSTM cell is made of input, forget, and executed based on the result of loss function.
output gates. And these gates are used to maintain and control Definition 1. The error of back propagation can be defined
the state information in LSTM cells. Forget gates selectively as the derivative of loss function to output of LSTM-RNN
remove the state information in LSTM cell; input gates shown in the following equation
selectively record the input information to LSTM cells; output
gates combine the state of cells and the input information as the L
output of LSTM cells.  (10)
h
Therefore, the  in the processes of back propagation can
ht
be further represented as
tl1   f ,tWfh,t  i,tWih,t   c,tWch,t   o,tWoh,t (11)
Ct 1 Ct
    f ,tW fx ,t   i ,tWix ,t  
tanh  tl 1   ( l 1) l 1
  f ' (net t ) (12)
ft  C ot  W
 c ,t cx ,t   W
o ,t ox ,t 
t 
ht 1   tanh  ht where  tl1 is the component of  on the temporal scale;  tl 1
is the component of  on the spatial scale. f   and net l 1
l 1

are the activation function and weighted output of the hidden


layer l  1 .
xt
C. LSTM-RNN for SOC estimation
Fig. 2. Structure of Long Short-Term Memory cell. In this paper, LSTM-RNN is used for SOC estimation of
battery by taking the voltage, current, temperature of battery as
The constructed networks of LSTM-RNN can be the input variables and SOC as the output variable of the
represented by the following composite function network. Specifically, LSTM-RNN for SOC estimation of
battery is a network with three input neurons, one hidden layer
ft   Wf   ht 1 , xt   b f  (1) and one output neuron as shown in Fig. 3. The flow chart of
LSTM-RNN is shown in Fig. 4.
it   Wi   ht 1 , xt   bi  (2)
Ct  tanh WC   ht 1 , xt   bC  (3) III. DATA SETS OF LITHIUM-ION BATTERIES
Ct  ft  Ct 1  it  Ct (4) Access to adequate data sets of LiBs is the important basis
of LSTM-RNN for SOC estimation. Data sets of LiBs used in
ot   Wo  ht 1 , xt   bo  (5) this paper are measured on 18650PF [14]. The informations of
LiBs tested are shown in Table 1.
ht  ot  tanh Ct  (6)

1713
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY CALICUT. Downloaded on January 05,2024 at 12:43:44 UTC from IEEE Xplore. Restrictions apply.
with the sampling frequency of 10 Hz. Voltage and current are
Input Hidden Output
record at 0℃, 10℃ and 25℃ are shown in Fig. 5.
Layer Layer Layer

TABLE I. INFORMATIONS OF LITHIUM-ION BATTERIES


ht 1
Parameters Value
Type 18650
Vt
ht  2 
Capacity Rating 2900 mAh
Cell Chemistry LNMC/Graphite
It SOCt Weight 45.0g
ht  3 Dimensions 18.33±0.07mm
Tt Length 64.85±0.15mm
……

4.5 5
4

Current/(A)
Voltage/(V)
0
ht  k  3.5
-5
3
2.5 -10

Fig. 3. Architecture of LSTM-RNN for SOC estimation of LiBs. 2 -15


0 2 4 6 8 0 2 4 6 8
Time/0.1s 4 Time/0.1s 4
Start
Start 10 10

(a) 0℃
·· Normalize
Normalize the
the testing
testing
dataset
4.5 20
dataset and
and divide
divide them
them
into
into training
training set set and
and

Current/(A)
Voltage/(V)

validation
validation set.
set. 4 10
Validation
Validation of
of LSTM-RNN
LSTM-RNN
3.5 0
+1
+1
·· Constructing
Constructing LSTM
LSTM Neural
Neural 3 -10
Network
Network
·· Selecting the activation
Selecting the activation 2.5 -20
function,
function, loss
loss function
function and
and Maximum number
N 0 5 10 0 5 10
optimization
optimization algorithm
algorithm Time/0.1s 4 Time/0.1s 4
of validation 10 10

Y (b) 10℃
·· Setting
Setting hyperparameters
hyperparameters 4.5 20
·· Initializing
Initializing weights
weights and
and
Voltage/(V)

Current/(A)

biases
biases 4 10
N
Achieving demanded
accuracy 3.5 0
·· Selecting
Selecting the
the evaluation
evaluation
function
function Y 3 -10
+1
+1
2.5 -20
0 5 10 15 0 5 10 15
N 4
Time/0.1s 10 Time/0.1s 10
4
Maximum number Fixing
Fixing network
network parameters
parameters
of training
(c) 25℃
Y
Fig. 5. Voltage and current measured under randomized condition at 0℃,
10℃ and 25℃: (a) 0℃, (b) 10℃, (c) 25℃
End
End
Normalization of initial data is also an important step of
Fig. 4. Flow chart of LSTM-RNN. LSTM-RNN. In this paper, data are normalized to the range
[−1,1] as follow
In order to obtain the testing dataset, discharge tests are
conducted under US06, HWFET, UDDS, LA92 conditions x  xmin
x  (13)
which are common drive cycles of electric vehicles at 0℃, xmax  xmin
10℃ and 25℃ respectively. Datasets of LiBs measured under
where xmax and xmin are the maximum and minimum of data.
US06, HWFET, UDDS, LA92 conditions are taken as the
training set of LSTM-RNN, and a dataset of LiBs under x represents initial data and x  represents the data after
randomized condition is taken as the validation set of LSTM- normalization.
RNN, which is a combination of these four data sets. There are
300,000 sampling data of LiBs obtained during LiBs testing

1714
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY CALICUT. Downloaded on January 05,2024 at 12:43:44 UTC from IEEE Xplore. Restrictions apply.
IV. EXPERIMENTS AND RESULT TABLE II. STATISTICAL RESULTS OF RNN FOR SOC ESTIMATION

Temperature MAE(%) MAX(%)


A. Evaluation functions
0℃ 3.78 12.92
Evaluation functions are used to judge the performance of 10℃ 3.47 11.36
SOC estimation method. In this paper, Mean Absolute Error 25℃ 2.2 11.14
(MAE) and Maximum Error (MAX) are used as evaluation Total 3.15 12.92
functions as follows The quantitative results of Fig. 6 are shown in Table 2.
From the Table 2, it is obvious that the MAE of RNN are
1 n
MAE=  SOCt  SOCt
n t 1
(14) 3.78%, 3.47%, 2.2% at 0℃, 10℃, 25℃ respectively. And the
MAX of RNN are 12.92%, 11.36%, 11.14% at 0℃, 10℃,
MAX=max SOCt  SOCt (15) 25℃ respectively. Therefore, the average MAE and MAX of
RNN for three temperatures is 3.15% and 12.92%.
where SOCt and SOCt are the real value and estimated value
The results of LSTM-RNN for SOC estimation of LiBs at
at timestep t , respectively. n is the total number of samples. 0℃, 10℃ and 25℃ are shown in Fig. 7.
100 10
B. SOC estimation results LSTM-RNN

SOC error/(%)
Measured 8
In this section, RNN and LSTM-RNN for SOC estimation

SOC/(%)
6
are validated respectively with the testing dataset of introduced 50
in Section 3. The RNN have the same structure as the LSTM- 4
RNN. Specially, the network contains 3 input neurons, 1 2
hidden layer and 1 output neuron. Sigmoid and tanh functions 0 0
are used as activation functions. Loss function is shown in 0 400 800 1200 1600 0 400 800 1200 1600
formula (9) and Adam optimization algorithm is used to Time/0.1s Time/0.1s
optimize the network. The results of RNN for SOC estimation (a) 0℃
of LiBs at 0℃, 10℃ and 25℃ are shown in Fig. 6.
100 10
LSTM-RNN
100 15

SOC error/(%)
RNN Measured 8
SOC/(%)
SOC error/(%)

Measured
6
SOC/(%)

10 50
4
50
5 2
0 0
0 500 1000 1500 2000 0 500 1000 1500 2000
0 0
0 400 800 1200 1600 0 500 1000 1500 Time/0.1s Time/0.1s
Time/0.1s Time/0.1s
(b) 10℃
(a) 0℃ 100 10
LSTM-RNN
100 15
SOC error/(%)

Measured 8
RNN
SOC/(%)
SOC error/(%)

Measured 6
SOC/(%)

10 50
4
50
5 2
0 0
0 500 1000 1500 2000 2500 0 500 1000 1500 2000 2500
0 0
0 500 1000 1500 2000 0 500 1000 1500 2000 Time/0.1s Time/0.1
Time/0.1s Time/0.1s
(c) 25℃
(b) 10℃
Fig. 7. SOC estimation results of LSTM-RNN at 0℃, 10℃ and 25℃: (a)
100 15
RNN 0℃, (b) 10℃, (c) 25℃
SOC error/(%)

Measured
SOC/(%)

10
50 TABLE III. STATISTICAL RESULTS OF LSTM-RNN FOR SOC ESTIMATION
5
Temperature MAE(%) MAX(%)
0 0
0℃ 1.29 6.05
0 500 1000 1500 2000 2500 0 500 1000 1500 2000 2500 10℃ 0.96 8.7
Time/0.1s Time/0.1s 25℃ 0.66 4.41
(c) 25℃ Total 0.97 8.7
The statistical results of Fig. 7 are shown in Table 3. The
Fig. 6. SOC estimation results of RNN at 0℃, 10℃ and 25℃: (a) 0℃, (b) MAE of LSTM-RNN are 1.29%, 0.96%, 0.66% at 0℃, 10℃,
10℃, (c) 25℃ 25℃ respectively. And the MAX of LSTM-RNN are 6.05%,

1715
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY CALICUT. Downloaded on January 05,2024 at 12:43:44 UTC from IEEE Xplore. Restrictions apply.
8.7%, 4.41% at 0℃, 10℃, 25℃ respectively. Therefore, the [3] J.N. Du, Z.T. Liu, Y.Y. Wang, et al, “An adaptive sliding mode observer
average MAE of LSTM-RNN for three temperatures is 0.97% for lithium-ion battery state of charge and state of health estimation in
electric vehicles,” Control Engineering Practice 54(2016):81-90.
and the MAX of LSTM-RNN for three temperatures is 8.7%.
[4] X.T. Liu, Z.H. Chen, C.B. Zhang, et al, “A novel temperature-
As can be observed from the SOC estimation results above, compensated model for power Li-ion batteries with dual-particle-filter
compared with the RNN method, LSTM-RNN for SOC state of charge estimation,” Applied Energy 123(2014):263-272.
estimation can achieve SOC estimation with lower errors. It is [5] Y.Y. Wang, C.B. Zhang, and Z.H. Chen, “A method for state-of-charge
estimation of LiFePO4 batteries at dynamic currents and temperatures
proved that LSTM-RNN can overcome the long-term using particle filter,” Journal of Power Sources 279(2015):306-311.
dependencies of RNN and can achieve SOC estimation [6] Y.L. Shang, C.H. Zhang, N.X. Cui, et al, “State of charge estimation for
accurate result. In addition, the high temperatures result in a lithium-ion batteries based on extended Kalman filter optimized by
low MAE and low MAX due to reason that the performance of fuzzy neural network,” Control Theory & Applications 33.2(2016):213-
battery increases with the increase in temperature at ambient 220.
temperature. This is because when the ambient temperature [7] R.J. Feng, S. Zhao, and X.D. Lu, “On-line estimation of Dynamic State-
approaches to the room temperature, the battery has excellent of-Charge for lead acid battery based on fuzzy logic,” 2013 2nd
International Conference on Measurement, Information and Control
cycle stability. It is easier for the RNN and LSTM-RNN to (ICMIC) IEEE, 2013.
learn the characteristics of LiBs.
[8] Alvarez Anton, Juan Carlos, et al, “Support Vector Machines Used to
Estimate the Battery State of Charge,” IEEE Transactions on Power
V. CONCLUSIONS Electronics 28.12(2013):5919-5926.
[9] J.H. Meng, G.Z. Luo, and F. Gao, “Lithium Polymer Battery State-of-
Accurate SOC estimation of LiBs is an urgent problem to Charge Estimation Based on Adaptive Unscented Kalman Filter and
be solved in BMS. This paper achieves accurate SOC Support Vector Machine,” IEEE Transactions on Power Electronics
estimation of LiBs by RNN and LSTM-RNN. Based on the (2015):1-1.
testing datasets of LiBs, RNN achieves SOC estimation of [10] I. Anand, B.L. Mathur, “State of charge estimation of lead acid batteries
LiBs with the average MAE of 3.15% and MAX of 12.92%; using neural networks,” International Conference on Circuits IEEE,
LSTM-RNN achieves SOC estimation of LiB with the average 2013.
MAE of 0.97% and MAX of 8.7%. It is proved that LSTM- [11] J. B. David, F.A. Jesus, C.S. Sandra, et al, “Using Dynamic Neural
Networks for Battery State of Charge Estimation in Electric Vehicles,”
RNN is more suitable for SOC estimation of LiBs. We Procedia Computer Science 130(2018):533-540.
consider the application of LSTM-RNN for SOC estimation of [12] H. Chaoui, C.C. Ibe-Ekeocha, “State of Charge and State of Health
LiBs under more complex operating conditions in the future. Estimation for Lithium Batteries using Recurrent Neural Networks,”
IEEE Transactions on Vehicular Technology (2017):1-1.
REFERENCES [13] S. Hochreiter, J. Schmidhuber, “Long short-term memory,”
Neuralcomputation, vol. 9, no. 8, pp. 1735–1780, 1997.
[1] T. L. Kulova, “New electrode materials for lithium-ion batteries
[14] C. Ephrem, P. J. Kollmeyer, P. Matthias, et al, “State-of-charge
(Review),” Russian Journal of Electrochemistry 49.1(2013):1-25.
estimation of Li-ion batteries using deep neural networks: A machine
[2] F. Huet, “A review of impedance measurements for determination of the learning approach,” Journal of Power Sources 400(2018):242-255.
state-of-charge or state-of-health of secondary batteries,” Journal of
Power Sources 70.1(2012):59-69.

1716
Authorized licensed use limited to: NATIONAL INSTITUTE OF TECHNOLOGY CALICUT. Downloaded on January 05,2024 at 12:43:44 UTC from IEEE Xplore. Restrictions apply.

You might also like