1. Introduction
Compared with the fossil fuel-based energy, renewable energy has been more and more attractive because it is renewable and cannot be depleted, and it does not contribute to global warming or greenhouse effects. As the energy buffer in renewable energy systems, energy storage could increase the electric power efficiency of the customers and load shifting [
1]. Lithium-ion batteries (LiB) have been the first choice of energy storage components [
2] due to their advantages of the high energy density, long life cycle, and low self-discharge rate. LiB has a very high energy density, hence a great deal of energy can be stored in it due to the fact that electrodes of LiB are made of lightweight lithium, which is a highly reactive element. High energy density allows a 1 kg LiB to store the same amount of energy as 6 kg batteries made by lead-acid. Additionally, hundreds of charge and discharge cycles can be handled by LiB. Moreover, the charge lost by LiB is as low as 5% per month, whereas the Nickel–Metal Hydride (NIMH) battery has a 20% charge loss per month. Therefore, applications for portable electronics, electrified vehicles, and stationary energy storage are developing and are heavily dependent on LiB technology.
As one of the most important states to be tracked in a battery, state of charge (SOC) is defined as a ratio of the residual capacity to the maximum available capacity, which represents the amount of electricity stored. SOC not only provides reference information for the endurance of the battery but is also the basis of the battery management system (BMS) of the battery pack. BMS is beneficial to the effective utilization of the battery energy and the optimal management of the upper energy system. However, SOC cannot be observed directly and needs to be indirectly estimated by the observable variables such as voltage, current, and temperature. A key issue that must be addressed is how to establish the nonlinear mapping relation between the observable variables and SOC. Additionally, the high dynamic operating conditions of battery will bring another challenge to SOC estimation due to unpredictable charging and discharging.
Traditionally, two widely used SOC estimation methods are the ampere-hour counting method [
3] and the open-circuit voltage method [
4]. Generally speaking, the former requires the battery to remain resting for a long time to reach balance in order to obtain the open circuit voltage (OCV) versus the SOC curve. On the other hand, for the ampere-hour counting method, the initial SOC needs to be obtained, which has accumulated errors. Both methods have their limitations, and researchers have devoted a lot of effort to put forward new SOC estimation methods, including the model-based method and the data-driven method. With the observable parameters, the model-based methods estimate the SOC state by combining an electrical circuit model (ECM) [
5] or an electrochemical model with adaptive filters, such as Kalman filters (KF) [
6,
7,
8,
9], particle filters [
10,
11], and adaptive observers [
12,
13]. Plett et al. [
6] first proposed the extended Kalman filter (EKF)-based SOC estimation method for LiB in hybrid electric vehicles. The EKF-based methods [
7,
8,
9] have been improved with the electrical circuit model or the filter method. In references [
10,
11] and references [
12,
13], the particle filter and the adaptive observer were respectively utilized to replace the Kalman filters to improve the accuracy of the SOC. Nevertheless, the SOC estimation accuracy of the model-based method depends very much on the accuracy of the battery model. Actually, researchers have difficulty in characterizing the non-linear characteristics of batteries. In addition, the parameters of different types of batteries are different under varying conditions. There are a lot of parameters to be identified in a battery model, which faces the bottleneck of hardware computation ability. The data-driven methods try to find the non-linear relationship between the observable variables and the battery states from a statistical point of view. These studies have used conventional machine learning techniques such as fuzzy logic [
14], support vector machines (SVMs) [
15,
16], and neural networks [
17]. In reference [
14], fuzzy logic was used to overcome the problem of battery over-discharge and associated damage resulting from inaccurate estimations of SOC. Alvarez et al. [
15] used the application of SVM for SOC estimation of a Li-ion battery. However, the model was validated only in constant pulse charging/discharging working conditions. Similarly, Hu et al. [
16] suggested the radial basis function (RBF) kernel to find the optimal parameters for the SVM to apply it to the more complicated work condition. Because the neural network is well suited for modeling complex and nonlinear systems, it has been used for SOC estimation for several years. In reference [
17], a feedforward neural network (FNN) was used for SOC estimation in full-electric-vehicle application, and terminal voltage estimation of the batteries was achieved by the SOC estimation results. With the real-time measurement of voltage, current, temperature, and the internal resistance value, Guo et al. [
18] proposed another FNN method, called the back propagation neural network (BPNN), to reduce the SOC estimation error significantly. Similarly, Dong et al. [
19] used multiple variables as inputs and SOC as the output to train a BPNN. By employing a load-classifying neural network, reference [
20] categorized battery operation modes as idle, charge, and discharge, and then estimated the SOC. Recently, in reference [
21] and reference [
22], Hannan et al. introduced a backtracking search algorithm (BSA) and lighting search algorithm (LSA) to improve the SOC estimation accuracy of the BPNN and nonlinear autoregressive with the exogenous input-based neural network (NARXNN), respectively.
Despite many successful research studies on the FNN-based SOC estimation, significant problems remain unresolved. For instance, the current SOC is not only related to the current observable variables but is also associated with the history observable variables. However, the output of the FNN depends only on the current input, and it is inaccurate to use the FNN process for time sequence problems such as SOC estimation. Moreover, the input of FNN is fixed and can not be arbitrarily changed, which makes it difficult for SOC estimation at any given moment. More recently, the most popular machine learning technique and deep learning [
23] (or deep neural network) achieved excellent results for the solution of important problems across a wide spectrum of domains [
24,
25,
26,
27]. Especially in the field of LiB state estimation, various deep/machine learning approaches have been employed to estimate parameters of LiB, such as the SOC, state of health (SOH), and remaining useful life (RUL) [
28,
29]. The key to their success is the increase in the amount of available computation and data. As one of the key technologies of deep learning, the recurrent neural network (RNN) [
30,
31] is quite different from the FNN. It can use the internal state (memory) to learn features and time dependencies from sequential data and has been widely used in natural language processing, time series forecasting, and system modeling. In reference [
32], the RNN was used for lead-acid battery modeling and SOC estimation simultaneously. Similarly, Zhao et al. [
33] presented a method to combine battery modeling and SOC estimation based on the RNN. The method of Park et al. [
34] was also based on the RNN by combining it with the single particle model to build a hybrid battery model.
Different from the RNN-based methods mentioned above, we propose an SOC method based on the gated recurrent unit recurrent neural network (GRU-RNN) to build nonlinear mapping between the observable variables and SOC. Specifically, the GRU-RNN is an improved form of the simple RNN to overcome the short term dependence problem of the simple RNN. The main contributions of our work are as follows: (1) the GRU-RNN can directly characterize the non-linear relationships between voltage, current, temperature, and SOC without the help of a battery model; (2) the GRU-RNN can achieve SOC estimation in various operating conditions with only a set of network parameters, while the other existing methods need different models and parameters for different conditions; (3) the GRU-RNN can self-learn network parameters by adaptive gradient descent algorithms. Compared with electrochemical models and equivalent circuit models that contain differential equations, the GRU-RNN is free from requiring a large amount of work to hand-engineer and parameterize; (4) two public datasets of vehicle drive cycles are used to demonstrate the effectiveness of the proposed method. Moreover, another high rate pulse discharge condition dataset of an 18Ah battery is collected to validate the GRU-RNN’s ability for SOC estimation in extreme conditions.
After a brief introduction,
Section 2 is a detailed presentation of the proposed approach. In
Section 3, three testing datasets recorded respectively under complex discharge conditions, mixed charge-discharge conditions, and high rate pulse discharge conditions are described. Then, the experimental validation of the whole method is exhibited in
Section 4. Finally,
Section 5 concludes the paper.
2. GRU-RNN for SOC Estimation
The recurrent neural network (RNN) was first put forward in the 1990s in the form of Elman and Jordan networks [
35], which are also known as the “simple recurrent networks” (SRN). Different from the FNN, the RNN can use the internal state as the memory of the network. Therefore, the current state is jointly impacted by the current input and the previous state. This structure enables the RNN to deal with the time sequence problem by storing, remembering, and processing past complex signals for a period. RNNs have been widely used in natural language processing, time series forecasting, and system modeling. However, long time series and complex hidden layers may lead to gradients exploding and vanishing during back-propagation processes. This is called the long-term dependencies problem, and plenty of improved RNNs were proposed to solve the problem by designing the gating mechanism to control gradients information propagation. Among all the improved RNNs, the GRU-RNN is not only able to capture long-term sequential dependencies but also has a simple structure. Moreover, compared with other RNNs, it is more robust to vanishing gradients and needs less memory requirements. The illustration of the GRU-RNN cell is shown in
Figure 1.
The forward propagation of the GRU-RNN is computed by Equations (1) to (4). Among these functions, Equation (1) represents the “update” operation of the GRU-RNN, Equation (2) and Equation (3) represent the “reset” operation of the GRU-RNN, and Equation (4) represents the “output” operation of the GRU-RNN.
In Equation (1) to Equation (4), represents an element-wise multiplication; is the weight parameter; is the bias parameter; is the gate activation function, which is set as sigmoid function and shown in Equation (5); is the output activation function, which is set as tanh function and shown in Equation (6). The derivatives of sigmoid and tanh are the functions of the original function, thus the derivatives can be calculated by the original functions.
By introducing the above operations, the GRU-RNN can learn the long-term sequential dependencies. Only the forward propagation is required to obtain the SOC at each timestep during the testing stage. At the end of each forward propagation, the loss function
of the GRU-RNN is calculated as follows:
where
and
are the real value and the estimated value at timestep
, respectively.
is the length of the sequence. Based on the gradient of the loss function, the GRU-RNN updates the weights and the biases by backward propagation. Since the GRU-RNN is a structure through time, it needs a different back propagation method, called the back propagation through time (BPTT), to train the network.
Suppose that the intermediate variable
is defined as:
The errors in BPTT can be represented as Equation (9), and the errors passed to the upper layer can be represented as Equation (10).
where
is the activation function of layer
neural network nodes,
is the weighted output of layer
.
,
,
can be represented as:
Gradients of weights and biases can be represented as:
The forward propagation, the loss function calculation, and the error back propagation mentioned above constitute a complete training process of the GRU-RNN.
As shown in
Figure 2, the inputs of the proposed GRU-RNN based SOC estimation method are the terminal voltage
, the current
, and the temperature
of the battery at timestep
. The output of the GRU-RNN is the
of the battery at timestep
.
are hidden layer nodes of the GUR-RNN, where
represents the number of hidden layer nodes and needs to be set in advance. The expansion diagram of a single hidden layer node in the GRU-RNN is shown in
Figure 3. Hidden layer nodes take variables [
], …, [
], [
] of time series
as inputs. The
at
is the output. Other hidden layer nodes are in the same way.
The processes of the SOC estimation method based on the GRU-RNN are as follows:
Step I: Normalize the testing dataset and divide them into a training set and a validation set.
Step II: Set the parameter of input layer nodes, hidden layer nodes, and output layer nodes of the GRU-RNN; select the form of activation functions, loss functions, and optimization algorithms [
36].
Step III: Set the hyperparameters of the GRU-RNN including the timestep, sampling interval, batch size, and iteration. Initialize the weights and biases of the GRU-RNN.
Step IV: Select evaluation function and train the GRU-RNN with the training set. The training set consisting of voltage, current, temperature, and SOC measured values is fed into the initialized GRU-RNN and network parameters can be self-learned according to Equations (1) to (14).
Step V: Validate the effectiveness of the GRU-RNN for SOC estimation with the validation set. The validation set also consists of voltage, current, temperature, and SOC measured values. The voltage, current, and temperature measured values in the validation set are fed into the trained GRU-RNN to obtain SOC estimated values. By inputting the SOC measured values in the validation set and the SOC estimated values of the GRU-RNN into the evaluation function, the effectiveness of the GRU-RNN can be evaluated.
4. SOC Estimation Results
In this section, we present the experimental settings, evaluation criteria, and experimental results. Specifically, the Panasonic 18650PF dataset, the Samsung 18650-20R dataset, and the high-rate pulse discharge dataset are used to evaluate the performance of the GRU-RNN for SOC estimation in complex and changeable discharge conditions, mixed charge and discharge conditions, and extreme conditions, respectively.
4.1. Experimental Settings
We conduct our experiments on a desktop with Intel Core i7-8700k 3.2 GHz CPU, NVIDIA GeForce GTX 1070Ti (8 GB on-board memory) GPU and 16 GB RAM. The proposed method is implemented in Python and Keras, which uses a Tensorflow backend. Actually, the architecture of the GRU-RNN is very simple, and the GRU-RNN consists of one input layer, one hidden layer, one full connection layer, and one output layer. The nodes of the input layer, the hidden layer, the full connection layer, and the output layer are set as 3, 1000, 50 and 1, respectively. Specifically, the full connection layer transforms the multiple output of the hidden layer into a single SOC value. After setting up the structure of the neural network and the loss function, the network needs to be trained to obtain parameters. The training is a process of minimizing the loss function. Adam is an adaptive optimizer used for minimizing the loss function. The Adam optimizer dynamically adjusts the variations of parameters by using the first-order and second-order matrix estimation of gradients. The parameters of the network are optimized using the Adam optimizer [
41] with a learning rate of 0.0001, the first-order momentum attenuation coefficient
of 0.9, the second-order momentum attenuation coefficient
of 0.999, and mini-batches of size 72. In addition, the timestep and the iteration are initialized as 1000 and 100 and then discussed in
Section 4.3.3.
Appropriate data normalization can make the training processes of the GRU-RNN more efficient and robust. Moreover, data normalization can remove the negative effect that improves the convergence rate. In this paper, data are normalized to the range [−1,1], as shown in Equation (15)
where
and
are the maximum and the minimum values of data;
represents initial data, and
represents the data after normalization.
4.2. Evaluation Criteria
In order to evaluate the accuracy of the GRU-RNN for SOC estimation of battery, the mean absolute error (MAE) and maximum error (MAX) are used for evaluation criteria below.
where
and
are the real value and the estimated value at timestep
, respectively.
is the length of the sequence.
4.3. SOC Estimation under Changeable Discharge Conditions
In this section, the performance of the GRU-RNN for SOC estimation is validated with the Panasonic 18650PF dataset. In these experiments, the effect of single-temperature, multi-temperature, size of training sets, and hyperparameters are discussed. Additionally, some comparisons of SOC estimation between the GRU-RNN and the RNN are made in this section. For the Panasonic 18650PF dataset, the data of Cycle 1, Cycle 2, Cycle 3, Cycle 4, and NN are used for training the GRU-RNN, and the data of US06, HWFET, UDDS, and LA92 are used for validating.
4.3.1. SOC Estimation Trained on Single-Temperature Data
In this experiment, we split the Panasonic 18650PF dataset into three subsets depending on the three different temperatures. The GRU-RNN can self-learn network parameters by the Adam optimizer, which frees researchers from establishments of battery models and identifications of parameters. Then, three single-temperature data are used to evaluate the performance of the GRU-RNN individually. The SOC estimation curves trained on single-temperature data are shown in
Figure 7, and quantitative results are shown in
Table 1. In each subgraph of
Figure 7, the first row displays the estimated curves, and the second row displays the estimated error curves.
By simple calculation with the results from
Table 1, the average MAE and MAX of SOC estimation results are 1.24%, 1.36%, and 1.08%, and 6.16%, 6.37%, and 10.64% at 0 °C, 10 °C, and 25 °C, respectively. Therefore, the average MAE and MAX of SOC estimation results at three ambient temperatures are 1.22% and 10.64%, which proves that the GRU-RNN can directly characterize the non-linear relationships between voltage, current, temperature, and SOC without the battery model, and the proposed model achieves satisfactory performance in estimating SOC for the single-temperature data.
4.3.2. SOC Estimation Trained on Multi-Temperature Data
In the last experiment, the performance of the GRU-RNN is evaluated with single-temperature data. However, the network parameters learned with the training set at 0 °C could not be used for SOC estimation with the validation set at 10 °C or 25 °C Therefore, it needs to learn a set of network parameters for the data at each temperature, which seriously increases computational complexity and memory consumption. To address this problem, in this experiment, we utilize the whole training dataset at 0 °C, 10 °C, and 25 °C to train one GRU-RNN and validate this network in HWFET, LA92, UDDS, and US06 at 0 °C, 10°C, and 25 °C The estimation curves are shown in
Figure 8. The quantitative results are shown in
Table 2. It could be concluded that the average MAE and MAX of SOC estimation results are 0.99%, 0.96%, and 0.63%, and 7.59%, 4.79%, and 3.08% at 0 °C, 10°C, and 25 °C, respectively. The experiment results prove that the GRU-RNN can achieve SOC estimation in various operating conditions with only a set of network parameters. Obviously, the high temperatures result in a low MAE and a low MAX due to reason that the performance of battery increases with the increase in temperature at ambient temperatures. This is because when the ambient temperature approaches room temperature (25 °C), the battery has excellent cycle stability. Compared with the estimation results at single temperature, the average MAE decreases from 1.22% to 0.86%, and the MAX decreases from 10.64% to 7.59% due to the increasing diversity of the training set. For the following experiments, the network parameters are trained with multi-temperature data.
4.3.3. Influences of Hyperparameters on GRU-RNNs for SOC Estimation
In this sub-section, we analyze the impact of the hyperparameters of the GRU-RNN on the detection results, which specifically include timestep and iteration. In detail, the timestep represents the depth in time of the input layer of the GRU-RNN, and the iteration is the number of the GRU-RNN’s training cycles. In the experiments, various values of timestep and iteration are applied, and the SOC estimation results in the forms of MAX and MAE are calculated.
The values of the timestep are set as 250, 500, and 1000, respectively, and other network hyperparameters are consistent with those in
Section 4.1. The training times of the GRU-RNN are 12,641 s, 25,012 s, and 51,732 s, respectively. It can be found that the training time is proportional to the value of the timestep. The estimated results are shown in
Figure 9 and
Table 3. It can be observed that the performance of the GRU-RNN increases with the timestep. Here, the reason is that the input layer of the networks with larger depths in time can learn longer term dependencies of the historical data, which is consistent with the long term dependencies of battery SOC.
Another experiment is performed to measure the impact on the estimation results of different values of iteration. In detail, the values of iteration are set as 20, 40, 60, 80, and 100, respectively, and other network hyperparameters are consistent with those in
Section 4.1. The training times of the GRU-RNN are 9979 s, 20,575 s, 29,623 s, 40,982 s and 51,732 s, respectively. Additionally, it can be found that the training time is proportional to the value of iteration. The estimated curves and the corresponding bar graph of the estimation results are shown in
Figure 10 and
Figure 11. It is immediately observable that the more iteration is exposed, the better the accuracy is. The MAE decreases from 1.46% to 0.86% and the MAX decreases from 11.23% to 7.59% when the values of iteration increase from 20 to 100. This is mainly because the value of iteration increases, thus the training data sets are randomly reused by the GRU-RNN, which increases the diversity of training samples.
4.3.4. Influences of the Size of Training Data on GRU-RNN for SOC Estimation
In order to analyze the influences of the training data size on the GRU-RNN for SOC estimation, we record the estimation result of the GRU-RNN trained on different sizes of mixed drive cycles. In detail, the GRU-RNN is trained on one to five mixed drive cycles at various temperatures. Accordingly, the sizes of the training data are three, six, nine, 12, and 15, respectively. The other network hyperparameters are consistent with those in
Section 4.1. For display purposes, only the estimated curves with sizes of three, nine, and 15 are shown in
Figure 12.
The corresponding bar graphs of the estimation results are shown in
Figure 13. It is immediately observable that, in this case, the performance of the GRU-RNN increases with the sizes of training data. It should also be noted that the GRU-RNN can achieve a MAE below 1.5% when training is conducted on nine or more training data. This means the proposed GRU-RNN is robust for SOC estimation when the training data is inadequate.
4.3.5. Comparisons between GRU-RNN and RNN
In order to demonstrate the advantages of the adopted GRU-RNN, we replace the GRU-RNN with an original RNN. The same network architecture as the GRU-RNN is adopted by the RNN for a fair comparison. The training times of the RNN and the GRU-RNN are 30,152 s and 51,732 s, respectively. The GRU-RNN takes a longer time to train the network parameters than the RNN due to a more complex structure, as shown in
Figure 1.
Figure 14 compares the performance of the RNN and the GRU-RNN. It is clear that, compared with the RNN (blue curve), the GRU-RNN (red curve) has smaller SOC errors. The detailed comparison results are shown in
Table 4. It can be seen that the GRU-RNN outperforms the RNN in both the MAE and the MAX. The GRU-RNN is more suitable than the RNN for SOC estimation with long-term dependencies. The SOC of LiBs is a sequence that increases over time, and the historical sequences have influence on the current sequences. In order to accurately estimate the current SOC of LiBs, as many historical sequences as possible should be taken into account. The RNN cannot deal with long sequences well because of exploding gradient and vanishing gradient. However, the GRU-RNN can realize the control of the current input and the historical state by GRU, as introduced in
Section 2.
4.4. SOC Estimation under Mixed Charge-Discharge Conditions
In order to validate the performance of the proposed GRU-RNN for SOC estimation in whole working states of battery, we evaluate the performance of the proposed method on the Samsung 18650-20R dataset, in which the data of charge, pause, and discharge are recorded continuously. A detailed description of the Samsung 18650-20R dataset can be found in
Section 3.2. Two sets of data at each ambient temperature under FUDS, US06, and BJDST are used in this experiment. Half of the data are used for training, and the other half are used for validating.
The SOC estimation curves are calculated and compared with the measured SOC estimation curves in
Figure 15. The curves are similar but slightly differ from each other. The quantitative results are shown in
Table 5 with a total average MAE of 1.75% and a maximum MAX of 7.04%. This proves that the GRU-RNN can accurately estimate the SOC under mixed charge-discharge conditions.
4.5. SOC Estimation under High Rate Pulse Discharge Conditions
The last experiment is conducted under high rate pulse discharge conditions with the high rate pulse discharge condition dataset to validate the GRU-RNN’s ability for SOC estimation under extreme conditions. A set of data for each temperature is used for training, and another set of data for each temperature is used for validating. The SOC estimation curves and the corresponding quantitative results are shown in
Figure 16 and
Table 6, respectively. It is clear that the GRU-RNN achieves excellent results with MAE = 1.05% and MAX = 2.22% on the high rate pulse discharge condition dataset, which indicates the feasibility and validity of this method.
In summary, the proposed SOC estimation approach for LiBs using the GRU-RNN has been evaluated in complex and changeable discharge conditions, mixed charge and discharge conditions, and extreme conditions by the Panasonic 18650PF dataset, the Samsung 18650-20R dataset, and the high-rate pulse discharge dataset. The MAEs of the experiment results are 0.86%, 1.75%, and 1.05%, and the MAXs are 7.59%, 7.04%, and 2.22%. This proves that the proposed method has good abilities in accuracy and robustness. In addition, the GRU-RNN can self-learn network parameters by the Adam optimizer, which frees researchers from the establishments of battery models and identifications of parameters.