A Neural Network Application for a Lithium-Ion Battery Pack State-of-Charge Estimator with Enhanced Accuracy

A State-of-Charge (SOC) real-time estimation plays an essential role in effective energy management. This paper proposes the use of an Artificial Neural Network (ANN) to design a state-of-charge estimator for a Graphite/LiCoO2 lithium-ion battery pack. The software MATLAB was used to develop and test several network configurations to find the ideal weights for the ANN. The results demonstrate that the Mean Squared Error (MSE) achieved renders the ANN as an effective technique. Thus, it predicted the battery bank’s SOC values with accuracy using only voltage, current, and charge/discharge time as inputs.


Introduction
Renewable energy generation is taking over the world since this process is clean and does not pollute the environment. Batteries are one of the most cost-effective energy storage technologies available, with energy stored electrochemically [1]. Lithium-ion batteries are promising from a technical point of view since they have high round-trip efficiency (RTE) (≥90%) and long cycle life with a high depth of discharge (DoD) [2].
Already commercial and mature for consumer electronic applications, the lithium-ion battery is being positioned as the leading technology platform for plug-in hybrid electric vehicles (PHEVs) and all-electric vehicles [3]. They are also heavily used in large facilities to support energy storage, loadleveling, and frequency regulation in the context of smart grids [4].
Many known issues with lithium-ion batteries, such as performance decay, increased maintenance costs, accelerated aging, catastrophic device failure, and even hazardous incidents, are associated with faulty State-of-Charge (SOC) estimations [5,6]. Therefore, a model that formulates the degradation process is critical to obtain a reliable SOC, ensuring safety during the process.
The definition of SOC is the percentage of the remaining load relative to the maximum capacity of the battery [7]. The most used method for directly evaluating the battery pack SOC from measurable variables such as current and voltage is the Coulomb Counting technique [8]. This method depends on the integration of the charge/discharge current values. However, any minimal error will accumulate over time due to the integration factor [9], and this is the reason why this technique is susceptible to errors.
Advanced algorithms must be developed to predict the SOC of lithium-ion batteries accurately and effectively. The use of Artificial Neural Networks (ANNs) can provide an SOC estimation under any condition; therefore, a large data storage size is also required to save the trained data [10]. In this paper, a battery model is built using ANN to predict the SOC of a battery bank provided by the Center for Advanced Life Cycle Engineering (CALCE) at the University of Maryland supported by the National Science Foundation [11]. This prediction depends directly on the current, voltage, and charge/discharge time. An essential characteristic of this system is that these inputs do not include the previous SOC level, which makes its estimation more robust.
Reference [12] proposed an SOC estimation approach for lithium-ion batteries based on coulomb counting. The SOC estimation could be more accurate by taking account the capacity degradation and the current measuring error. The proposed model presented a SOC estimation error less than 1.905%, when taking into account the current measuring error. This number was essentially caused by current integration, the source of an inaccurate current measurement of the charging/discharging cycles, resulting in misjudgment of the full capacity.
Reference [13] used the extended Kalman filter method based on a Randles model to estimate the SOC of a lithium-ion cell (LiFePO4) and reached a maximum error of estimation of 1.19%. Each parameter of the model was considered as constant and calculated as the average of the measure values at different SOCs and a fixed temperature of 25 °C.
Several relevant contributions by different researchers appeared in the literature using artificial neural networks to predict the SOC of a lithium-ion battery pack. It is possible to find studies that achieved 2.6% of Mean Square Error (MSE) error [6], others about 1% [14,15], and some authors that reached e-04 MSE [16]. Thus, the purpose of this work is to decrease these numbers further.
The paper is organized as follows: Section I provides a background and overview of the article. Section II goes over the fundamental theories used to create this paper. Section III then follows with the design and implementation of the neural network. Section IV presents the results obtained. Lastly, Section V includes the conclusions and recommendations for future work.

Theoretical Framework
In this section, the theoretical bases of this article will be presented and discussed.

State of Charge
SOC is the percentage of the maximum possible charge in the battery [17]. In order to represent the SOC of a lithium-ion in MATLAB, the capacity is typically converted as follows in Equation (1): where SOC (t) (%) is the battery SOC at time t, C(t) (ampere.hour) is the capacity at time t, and Ctotal (ampere.hour) is the total capacity of the battery. The lithium-ion battery pack was cycled between 20%-80% of the SOC in 50 cycles of charge/discharge and is represented in Figure 1.

Artificial Neural Network
An ANN is a computational model formed by a set of individual processing units, the artificial neurons, interconnected by weights that can be modified according to the quality parameters that evaluate the proximity between the required response and the one obtained [18]. ANNs are universal approximators that can model any nonlinear function with the desired accuracy [19]. The networks are arranged in layers, with the first layer taking in inputs and the last layer producing outputs. The middle layers have no connection with the external world, and that is why they are called hidden layers [20]. The artificial neurons are the central element of an ANN because they are responsible for connecting each layer [21]. The model of a neuron is illustrated in Figure 2. The input signals vector is shown by ≔ , , … , , n ∈ 1, | | , the neurons synaptic weights by ≔ , , … , , n ∈ 1, | | , is the weight's multiplication response with the input signals, is the bias which is an external parameter of the neuron, . is the activation function and is the output response of the neuron. A back-propagation algorithm based on experimental results is used to train the network. The multiple inputs are applied from previously recorded data to the input layer, with each one multiplied by a weight and the product summed. Then, this summation passes through a sigmoid function, also named the activation function. The algorithm updates the network weights in such a way that the MSE in the network's result is minimized.

Performance Metrics
In this paper, two errors will be taken into account for the performance metrics-the MSE and the percentage average of all errors. Equation (2) demonstrates the calculation of the MSE: where is the total number of samples and is the current position of the vector. The real SOC is obtained through the input data, and the estimated SOC is the output of the ANN. The percentage average of all errors was calculated to further quantify the results. The vector containing the absolute difference between the actual output value and the estimated output value was traversed so that the error percentage could be calculated. Taking this into consideration, the average of this vector was calculated. The formula of the error used is in Equation (3): where the higher number defines its dividend. Figure 3 shows the flow chart and the methodology used in this work, starting with importing and processing the data, designing and training the neural network, arriving at the MSE calculation and validation of the prediction.

Design of the Artificial Neural Network
All steps taken to implement the neural network are described here, from data acquisition through input pre-processing to the network topology choice and training.

Data Acquisition and Data Pre-Processing
The input data consist of window sequences of load data extracted from the battery bank provided by the Center for Advanced Life Cycle Engineering (CALCE) at the University of Maryland-United States of America [10]. The files contain the test time in seconds, the cell current in ampere, the cell terminal voltage in volts, and the cumulative charge/discharge capacity of the cell in ampere-hour. The lithium-ion battery pack was tested under 20%-80% of the SOC condition C/2 rate in 50 cycles of charge/discharge at room temperature (25 ± 2 °C). The cell chemistry used was the Graphite/LiCoO2 with a 1500-mAh capacity rating.
The data inputs must be processed to obtain a satisfactory ANN. The inputs were normalized and randomized to be separated into three sections: Training, Validation, and Test. The data in each section are different from one another. Table 1 shows the quantitative data for each step.

Network Topology
The ANN topology chosen was the Multi-Layer Perceptron (MLP) network. For the implementation of the proposed model, the MATLAB software was used. The data set to be used as input and output parameters by the neural network is defined below. The structure of the neural network is represented in Figure 4, and each circle corresponds to a neuron, as discussed in Chapter II. The input parameters are: The output parameter is: • Capacity (SOC). The amount that the weights are updated during training is called the "learning rate." The proposed network was submitted to training with a learning rate of ŋ = 0.001. In order to improve the process, the maximum number of validation failures criteria was defined as "5". If the ANN reaches this consecutive number of errors, the training is stopped. After testing several network configurations, the most suitable characteristics were defined and are described in Table 2.

Network Training
The network was trained with 50% of the data and was validated and tested with another 50%. The initial weights were given randomly, and trial and error methods determined the sizes of hidden layers. The validation the error target was defined as MSE = 1, and once the MSE of the neural network was equal or less than the error target, the ANN was approved.
The ANN was trained with voltage, current and time as inputs parameters in order to predict the natural degradation of the battery over the 50 cycles.
The ANN training achieved an MSE of approximately 3.11 × 10 −6 and was considered satisfactory as the ANN'training performance and ANN'training state shown, respectively, in Figure 5 and Figure 6. As it is possible to identify in the two figures, the maximum number of training in the network was 173 Epochs due to the limit of five validation checks inserted. When the network reaches this limit, it stops training. This is an ideal number as it demonstrates that the network is not specialized in the set of tests, avoiding over-fitting (a phenomenon that happens when a network becomes an expert in the training set).
After having finished the net training, the weights were saved so that the network could estimate the SOC of the charge/discharge cycles according to the given inputs.

Design of the Artificial Neural Network
After the training phase, model validation was performed comparing the estimated results and the real database. Figure 7 shows that the ANN is accurate enough, achieving an MSE equivalent to 1.57 × 10 −6 , and obtaining an approximate hit ratio of 99.81%. A second validation was also performed to estimate the SOC of cycles of a different month. Figure 8 shows that the ANN-2 is also able to perform this task, obtaining an MSE equivalent 3.13 × 10 −5 and an approximate hit ratio of 99.06%.

Conclusions
This paper presented a neural network methodology to estimate the SOC of lithium-ion battery banks' usage. The neural network used was an MLP with two-layer architecture. The proposed ANN outlined in this paper resulted in an accurate MSE for both situations.
The results show that the ANN was able to self-learn the battery dynamics, allowing one to compete with the traditional SOC estimation techniques. Moreover, the inputs of the ANN do not include the previous SOC level, which makes its estimation more robust.
An alternative to improve this work is to use other types of neural systems, such as recurrent neural networks combined with Extended Kalman Filtering (EKF). Another option is to map the nonlinear characteristics of different battery cell chemistries such as LiFePO4, LiCoO2, and LNMC/Graphite.