International Symposium on Fundamentals of Electrical Engineering, 28-29 November, 2014, Bucharest, Romania
Estimating a battery State of Charge using neural networks Bogdan-Adrian Enache, Member, IEEE, Eugen Diaconescu, Member, IEEE
Abstract— This paper presents the means for estimating a battery State of Charge (SoC) using neural networks. Several neural networks such as: radial basis function (RBF), feed forward (FF) and nonlinear autoregressive with exogenous (external) input (NARX) are used for curve fitting and predicting features values. The conclusions are drawn after comparing the values obtained from the models and the data obtained from discharging a LiFePO4 (LFP) battery. Index Terms— battery modelling, LFP battery, neural networks, NARX network, State of Charge
I. INTRODUCTION
F
OR battery powered systems one of the most important problem is the battery availability energy estimation. Batteries are chemically storage energy systems which don’t have direct access to the electrical energy stored. This issue makes the estimation of the available energy a difficult task [1]. One of the parameters that offers information about the available energy that exists into a battery is the State of Charge (SoC). The SoC is usually defined as the percentage of current capacity (Q(t)) as compared with the nominal capacity ( ) [2]. Considering this terms the SoC can be defined as: SoC ( t ) =
Q (t ) Qn
(1)
From the practical point of view the battery SoC can be seen, in the figurative sense, as a fuel gauge used in conventional vehicles [3]. There are various methods to establish the SoC of a battery and there are usually grouped in four categories: direct, indirect, adaptive methods and hybrid methods. The direct methods involve monitoring one or more of the battery parameters such as: output voltage, output current, open circuit voltage (OCV) [4], [5], [9], Electro-Motive Force The authors gratefully acknowledge the support and facilities provided by the ELECTROMET Research Center from University of Pitesti, Arges, România. Special thanks to Mr. Jumară Ion for his valuable assistance in this work. Bogdan-Adrian Enache is with the Electronics, Computing and Electrical Engineering Department, University of Pitesti, jud. Arges, Romania (e-mail:
[email protected]). Eugen Diaconescu is with the Electronics, Computing and Electrical Engineering Department, University of Pitesti, jud. Arges, Romania (e-mail:
[email protected]).
(EMF) [6], impedance [7], [8], [9], etc., in order to establish the battery SoC at a given moment. The big disadvantage of these methods is that they require total access to the battery and standardized test conditions, so they are not suitable for online or onsite determinations. The indirect methods relay only on the discharge current. They integrate it over time to approximate the remaining energy into the battery [10]. The performance of the indirect methods depends on the current sensor and the exact determination of the battery initial conditions. The adaptive methods use auto configuring systems that can automatically adjust to the operating conditions in order to accurately predict the battery SoC [1]. The most used adaptive system for estimating a battery SoC are: Kalman Filter [11], [12], Neural Networks [13], [14], Genetic Algorithms [15] and Fuzzy Logic Systems [16]. Because in operation a battery can be affected by a wide range of external and internal (chemical) factors and has a pronounced nonlinear evolution of the SoC, adaptive systems are a good solution for SoC estimation [16]. Hybrid methods are combinations of the other methods in order to maximize their potential. Some of the best known methods imply using Neural Networks and Kalman Filter [17], Neural Networks and Genetic Algorithms [18], Neural Networks and Fuzzy Logic [19] or Kalman Filter and indirect methods (Coulomb Integration Techniques) [20]. Usually hybrid methods produce better results in the terms of accuracy, than the methods used individually [21]. Estimating a battery SoC using neural networks is a process that requires extended data about the battery behavior in different conditions. Several experiments involving constant current or varying currents at different temperatures [14], [18] were performed in order to extract de necessary data for training the networks. Based on these tests different architectures of networks were analyzed. In [14] a Feed Forward (FF) Network is trained with the data (voltage, current, SoC, temperature) obtained from constant current discharges at currents between C/5 and C/1, where C is the battery rated capacity and varying currents discharges that correspond to the US federal urban driving schedule (FUDS), the US federal highway driving schedule (FHDS), the standard European reference cycle (ECE) and the Japanese mode 10.15 (JM10.15). After this the network is submitted to approximate the SoC corresponding to the UDCC, the FUDS and ECE without regenerative current and the FUDS and ECE with regenerative current. The error obtained for all the tests is within 2% [14].
A Radial Basis Function (RBF) network ussed for estimating a battery SoC is presented in [18]. Here the nnetwork is trained with data obtained from 10 different levells of discharging current (set from 0.05 C to 0.95 C). To verifyy the performance of the RBF network several tests with diffe ferent discharging currents were used. The tests include a ffixed discharging current of 0.3 C, 0.7 C, and 1 C and varrying discharging current. The results of these tests were comppared against data obtained from a FF network and coulomb inttegration method. For the constant current discharges the aaverage absolute percentage error recorded for the RBF netw work was between 0.0008 and 0.002, while for FF network waas between 0.064 and 0.127 and for the coulomb integration method the error was between 2.537 and 5.01. For the varying current discharge the performance of the two neural networks ddropped reporting 0.021 (RBF) respectively 0.188 (FF) aaverage absolute percentage error, while the coulomb inttegration method improved its performance reporting 1.58 averrage error [18]. Evaluating a battery SoC using neural network usually involves one of the two tasks: • Approximating the evolution off the SoC for a known discharge current (Curve fi fitting); • Estimating the evolution of thhe SoC for an unknown discharge current (Predicting values). In this paper all the neural networks analyzzed are submitted to both of this tasks but only for the case off constant current discharge at constant temperature. The main idea of this paper is to present tthe advantages of another type of neural network for estimatinng a battery SoC. The proposed network is a Nonlinear Auttoregressive with Exogenous (external) Input (NARX). This nnetwork is usually used for predicting elements from a ttime series, but considering the evolution of the SoC of a baattery at constant current discharge, this network becomes a viaable solution. The structure of the paper is as follows, secttion 2 presents an extended experimental study which was condducted in order to obtain the necessary data for training the neuural networks and also for validating their performances. Sectioon 3 presents the main contributions of the paper. Usually esttimating a battery SoC with neural networks is done by using eeither FF or RBF networks [1], [16], but we propose a new appproach by using a NARX network. The last section of the papeer is dedicated to the conclusions and future developments. II. EXPERIMENTAL STUDY AND INITIIAL DATA The battery chosen for this study was a commercially available 3.3 V 1400 mAh 18650 LiFePO4 baattery. In the first part of the study the goal was to determine the C Electric Vehicle actual battery capacity. For this the USABC Battery Test Procedures Manual was usedd. The procedure consist in a series of three consecutive constant current discharges at C/1 for one hour, C/2 for two hhours and C/3 for three hours, where C is the rated capacity in Ampere-hours [23]. After this series is repeated three tiimes the battery capacity is considered to be the one obtainned from the C/3 current. In our case the battery capacity was found to be 1420 mAh.
In the second part of the study a correlation between the battery terminal voltage and SoC was w determined. For this a series of discharges at constant current were performed. All the discharges were done at constan nt temperature (23 °C) with the currents of: 0.9 A, 0.8 A, 0.7 A (nominal current), 0.60 A, A 0.2 A, 0.1 A. 0.55 A, 0.5 A, 0.4 A, 0.35 A, 0.30 A, The data obtained from these testts were separated into two categories: one for training the netw work (presented in Table 1) and one for validating the results. TABLE I TERMINAL VOLTAGE CORRELATED TO THE DISCHARGE CURRENT AND SOC SoC Id
100 %
90 %
80 %
70 %
60 %
50 %
40 %
30 %
20 %
10 %
0%
0.9A
2.70
2.60
2.59
2.58
2.57
2.56
2.55
2.55
2.54
2.52
2.50
0.8A
2.71
2.64
2.67
2.65
2.64
2.63
2.62
2.61
2.59
2.55
2.50
0.7A
2.84
2.74
2.73
2.72
2.71
2.70
2.69
2.67
2.65
2.61
2.51
0.6A
2.89
2.80
2.78
2.77
2.76
2.75
2.74
2.72
2.69
2.65
2.50
0.5A
3.03
2.91
2.90
2.88
2.87
2.86
2.85
2.83
2.80
2.75
2.50
0.4A
3.01
2.94
2.94
2.92
2.91
2.90
2.89
2.88
2.85
2.80
2.50
0.3A
3.12
3.03
3.02
3.00
2.99
2.99
2.98
2.96
2.93
2.89
2.50
0.2A
3.13
3.10
3.09
3.07
3.06
3.06
3.06
3.04
3.00
2.96
2.50
0.1A
3.29
3.20
3.19
3.17
3.15
3.15
3.14
3.13
3.09
3.05
2.50
For validating the results the 0.55 A, 0.5 A and 0.35 A his curves are presented in discharge curves were selected. Th Fig. 1.
Fig. 1. Battery targ get SoC
From this data the 0.55 A and 0.35 A discharge curves are used for validating the predicted values of the networks and ng. the 0.5 A one is used for curve fittin III. ESTIMATING A BATTERY SOC USING NEURAL NETWORKS A neural network is composed off an input layer with nodes to represent the input variables, on ne or more hidden layers with nodes to reproduce the non nlinearity behavior of the system, and an output layer to rep present the system output variables. In the input layer there is no information processing, w to the next layers. here the inputs are passed on with weights The hidden layers and output layerrs are the processing ones, here the input information is processsed in conjunction with the activation function at each node [17]]. In our case the inputs to the neural network are the v (V), and the output discharge current (I) and terminal voltage is the battery SoC.
A. Feed-forward networks The FF networks are the simplest neural nnetworks because the information moves in only one directionns forward. They are used for any kind of input to output m mapping and with sufficient neurons in the hidden layer they ccan fit any curve [17]. The architecture of the FF network consistss of two neuron in the input layer for terminal voltage and dischaarge current, nine neurons in the hidden layer, and one neuron inn the output layer for the battery SoC. The nine neurons for the hidden layer were obtained through try and error so thee neural network wouldn’t be over fitted or under fitted. The total input of a neuron in the hidden layyer is given by: net i , j =
2
∑x
⋅ vi , j + b j
i
(2)
Fig. 2. FF Training peerformance
i =1
where, net i , j is the total input of the hidden llayer neuron , x i is the input (voltage or current) to the hiddeen layer neuron ; v i , j is the weight between the input layer neuuron and hidden
Once the weights were establlished the network was submitted to approximate the 0.5 A discharge curve (Fig. 3) and to estimate the 0.55 A and 0.35 A discharge curves (Tables II, III).
layer neuron , b j is bias of the hidden layer nneuron . The activation function i j , applied to thee nine neurons in hidden layer is the hyperbolic tangent functionn which is: i j = f (net i , j ) =
− 2 ⋅ net
i, j 1− e − 2 ⋅ neti , j 1+ e
(3)
The total input of the output neuron SoC O is: SoC O =
9
∑h
i
⋅ ωi + k
(4)
i =1
where SoC O is the total input for the outputt layer neuron; hi is the input to the output layer neuron from the hidden layer neuron ; ω i is the weight between the hidden layer neuron and output layer neuron; k is bias of the outpput layer neuron. The activation function o, applied to the outtput neuron is the sigmoid function given by (5): 1 o = f (SoC O ) = 1 + e − SoC O
(5)
For the two tasks the FF network was trainned with the data from Table I and the Levenberg-Marrguardt learning algorithm. The data were divided as follow ws: 70% of them training data, 15% validation data and 15% test data. After 41 epochs the desired mean squared error was reached (Fig. 2) were considered and the weights for the hidden layer w determined.
Fig. 2. FF network 0.5A discharg ge SoC approximation TABLE II FF PREDICTED SOC FOR 0.55 A DISCHARGE CURVE SoC [%] Target Soc [%] Output Error [%]
100
90
0 80
70
60
99.112
84.925
79.9 935
68.245
62.170
0.888
5.600
0.0813
2.5071
3.617
TABLE II (CONTINU UATION) FF PREDICTED SOC FOR 0.55 A DISCHARGE CURVE 50
40
30
20 0
10
0
56.317 12.634
50.861 27.153
41.400 38.000
30.4 443 52.22 215
19.3356 93.560
0.068 -
TABLE III FF PREDICTED SOC FOR 0.35 A DISCHARGE CURVE SoC [%] Target Soc [%] Output Error [%]
90
0 80
70
60
98.533
83.332
83.332
64.673
57.555
1.4670
7.4089
4.16 65
7.610
4.075
100
TABLE III (CONTINUATION) FF PREDICTED SOC FOR 0.35 A DISCHARGEE CURVE 50
40
30
20
110
0
57.555 15.110
50.580 26.450
44.009 46.697
27.767 38.835
11..322 13..220
0.003 -
The FF network behaves well for currve fitting. The maximum relative error is reached for the 200% SoC at about 25% while the rest of the errors varies aroound the average error at about 3.6%. Tables II and III show the pattern regardinng the predicting capability of the FF network. Until the 50% SoC the FF predicts the SoC with high accuracy, after which the error increases exponentially. B. Radial basis function Radial basis functions are means to approximate multivariable functions by linear combinationns of terms based on a single variable function (the radial basis function) [24]. The RBF network receives as input thee values for the voltage, current and the desired error goaal. Based on this information a RBF network with a specific nuumber of neurons in the hidden layer is produced. For the input values from Table I and a desired error of 0.01% (lower than FF network average error)), a RBF network with 99 neurons in the hidden layer is used inn our study. Any neuron from the hidden layer compputes a Gaussian function using: (
− x −φ j
b j (x ) = e
where
2σ
2 j
)2 , j = 1, 2 ,... 99
φ j and σ j
(6)
are the center and respecctive the width of
the Gaussian potential function for a neuroon in the hidden layer and x is the input. The output neuron SoC O is computed usingg a linear function given by: SoC O =
99
∑ ω b (x ) j
j
(7)
j =1
where ωj is the weight between the hidden laayer neuron j and the output neuron and b j (x ) is the output oof the j th neuron from the hidden layer. The results obtained using the RBF network for approximating the 0.5A discharge curve are presented in Fig. 3.
Fig. 3. RBF network 0.5A discharrge SoC approximation
duced by the RBF network The maximum relative error prod was 0.00053% which is well below the t desired error. The same RBF network was used d to estimate the values for the other discharge curves. The resu ults present inconsistencies and very high errors, so they are nor presented here. Based on them the only conclusion that could d be drawn was that for our training data the RBF network caannot estimate values for unknown discharge currents. e input networks C. Nonlinear autoregressive with exogenous The NARX networks are especially used for time series approximations, but due to their ab bility to use past values to predict current ones, they representt a good alternative to the FF and RBF networks. Some of the advantages of the NARX network over the other types involve more efficient leearning, faster convergence and better generalization [22]. Ano other fact that needs to be considered before implementing a NARX N network is that the initial state of the system has to be well w determined. A state space representation of a NARX network is given by: ⎧φ (u (k ), z i (k )), i = 1 z (k + 1) = ⎨ ⎩ z i (k ), i = 2 ,3 ... N
(8)
nd z i are space variables of where y (k ) = z i (k ) is the output an the neural network. The model of the NARX network used is composed of a feed-forward neural network with embedded memory. The embedded memory is in fact a dellayed connection from the output to the input (Fig. 4).
Fig. 4. NARX network architecture
Based on this model the NARX networrk is made of a hidden layer with ten neurons and an outpuut layer with one neuron. The input variables are representedd by an array of output voltage and discharge currents from Table I and the estimated SoC from one step behind. The output neuron SoC O is computed by: 10 1 ⎛ ⎛ ⎞⎞ SoC O = φ0 ⎜ b0 + ∑ ω i ⋅ φi ⎜⎜ bi 0 + ∑ ω ji ⋅ SoC O (i − j )⎟⎟ ⎟ ⎜ ⎟ i =1 j=0 ⎝ ⎠⎠ ⎝
TABLE IV NARX PREDICTED SOC FOR 0.55 A DISCHARGE CURVE SoC [%] Target Soc [%] Output Error [%]
80 0
70
60
89.98
89.97
11 80.1
70.31
60.47
10.020
0.033
0.13 37
0.443
0.783
50
40
30
20 0
10
0
50.58 1.160
40.46 1.150
30.70 2.333
20.5 56 2.80 00
8.26 17.390
31.51 -
layer and hidden layer neuron i, ω i , j is the weeight between the hidden layer neuron and output layer neuronn. As for the FF network the same Leveenberg-Marguardt algorithm was used for training the network. After 856 epochs the desired mean squared error was reachedd (Fig. 5) and the weights for the hidden layer were considered determined.
90
TABLE IV (CONTIN NUATION) NARX PREDICTED SOC FOR 0.55 A DISCHARGE CURVE
(9)
where b0 is the bias of the output neuron, bi 0 is the bias of the i neuron from the hidden layer, ω i is the weigght between input
100
TABLE V NARX PREDICTED SOC FOR 0.35 A DISCHARGE CURVE SoC [%] Target Soc [%] Output Error [%]
100
90
0 80
70
60
90.01
90.10
12 80.1
70.16
60.18
9.990
0.111
0.15 50
0.229
0.300
TABLE V (CONTINU UATION) NARX PREDICTED SOC FOR 0.35 A DISCHARGE CURVE
Fig. 5. NARX Training performancce
Once the weights were established thhe network was submitted to approximate the 0.5 A dischargge curve (Fig. 6) and to estimate the 0.55 A and 0.35 A discharge curves (Tables IV, V).
Fig. 6. NARX network 0.5A discharge SoC appproximation
50
40
30
20 0
10
0
50.19 0.380
40.20 0.500
30.20 0.667
20.2 21 1.0 05
10.37 3.70
6.58 -
The initial conditions are a majorr factor for any system that uses NARX networks. Although thee first two initial SoC used for input were 1 (100%), the higheest error is reached during this stage. After this initial stage the NARX network enters the operating regime, the error drops and a the performance of the network is superior to the tested FF and RBF network. If we exclude the first and the lasst values for the both tasks, the average error for curve fit is 0.025% 0 and for predicting values is between 0.787% and 0.954 4%. IV. CONCLUSION In this paper we presented thee means for estimating a battery SoC using the appropriate types of neural networks. oximating the evolution of The networks were used for appro the SoC for a known discharge currrent (curve fitting) and for estimating the evolution of the SoC for an unknown discharge current (predicting values). The FF network accomplisheed both tasks with fair accuracy. Considering that batteriess should not operate below 30% SoC the area where the errrors of the network were significant, FF network can be used u in all systems that approximate or predict the battery SoC. d the predicting values task, Although the RBF network failed the very high accuracy obtained du uring curve fitting and the ease in implementation makes it a good alternative to the system that use lookup tablee or interpolations for approximating a battery SoC. Considering all the facts, for estiimating a battery SoC at a constant current discharge (mono otonically evolution) and
taking in account the errors produces by the tested networks and the ease of implementation, we concluded that NARX neural networks are desirable to FF and RBF networks for estimating a battery SoC. REFERENCES [1] [2]
[3] [4] [5]
[6]
[7] [8] [9]
[10]
[11]
[12]
[13]
[14] [15]
[16] [17]
[18]
Wen-Yeau Chang, “The State of Charge Estimating Methods for Battery: A Review”, ISRN Applied Mathematics, Hindawi Publishing Corporation, Volume 2013, Article ID 953792, pp. 1 - 7. Yonghua Li, R. Dyche Anderson, Jing Song, Anthony M. Phillips, Xu Wang, “A Nonlinear Adaptive Observer Approach for State of Charge Estimation of Lithium-Ion Batteries”, in Proc. AACC, San Francisco, CA, USA June 29 - July 01, 2011, pp. 370 - 375. Wladislaw Waag, Christian Fleischer, Dirk Uwe Sauer, “Critical review of the methods for monitoring of lithium-ion batteries in electric and hybrid vehicles”, Journal of Power Sources, 258, (2014), pp. 321-339. Xiaosong Hua, Shengbo Li, Huei Peng, Fengchun Sun, “Robustness analysis of State-of-Charge estimation methods for two types of Li-ion batteries”, Journal of Power Sources, 217, (2012), pp. 209-219. Seongjun Lee, Jonghoon Kim, Jaemoon Lee, B.H. Cho, “State-of-charge and capacity estimation of lithium-ion battery using a new open-circuit voltage versus state-of-charge”, Journal of Power Sources, 185, (2008), pp. 1367–1373. Wladislaw Waag, Dirk Uwe Sauer, “Adaptive estimation of the electromotive force of the lithium-ion battery after current interruption for an accurate state-of-charge and capacity determination”, Applied Energy, 111, (2013), pp. 416–427. Ahmad Rahmoun, Moritz Loske, Argo Rosin, “Determination of the Impedance of Lithium-Ion Batteries using Methods of Digital Signal Processing”, Energy Procedia, 46, ( 2014 ), pp. 204 – 213. J. Illig, J.P. Schmidt, M. Weiss, A. Weber, E. Ivers-Tiffée, “Understanding the impedance spectrum of 18650 LiFePO4-cells”, Journal of Power Sources, 239, (2013), pp. 670-679. Yi-Hsien Chiang, Wu-Yang Sean, Jia-Cheng Ke, “Online estimation of internal resistance and open-circuit voltage of lithium-ion batteries in electric vehicles”, Journal of Power Sources, 196, (2011), pp. 3921– 3932. Kong Soon Ng, Chin-Sien Mooa, Yi-Ping Chen, Yao-Ching Hsieh, “Enhanced coulomb counting method for estimating state-of-charge and state-of-health of lithium-ion batteries”, Applied Energy, 86, (2009), pp. 1506–1511. Yong Tian, Bizhong Xia, Wei Sun, Zhihui Xu, Weiwei Zheng, “A modified model based state of charge estimation of power lithium-ion batteries using unscented Kalman filter”, Journal of Power Sources, 270, (2014), pp. 619-626. Rui Xiong, Xianzhi Gong, Chunting Chris Mi, Fengchun Sun, “A robust state-of-charge estimator for multiple types of lithium-ion batteries using adaptive extended Kalman filter”, Journal of Power Sources, 243, (2013), pp. 805-816. E. Jensi Miriam, S. Sekar, S. Ambalavanan, “Artificial Neural Network Technique for Predicting the Lifetime and Performance of Lead - Acid Battery”, IRACST – Engineering Science and Technology: An International Journal (ESTIJ), ISSN: 2250-3498, Vol.3, No.2, April 2013, pp. 393-401. W.X. Shen, “State of available capacity estimation for lead-acid batteries in electric vehicles using neural network”, Energy Conversion and Management, 48, (2007), pp. 433–442. Jonathan Brand, Zheming Zhang, Ramesh K. Agarwal, “Extraction of battery parameters of the equivalent circuit model using a multiobjective genetic algorithm”, Journal of Power Sources, 247, (2014), pp. 729-737. Nicolas Watrin, Benjamin Blunier, Abdellatif Miraoui, “Review of adaptive systems for lithium batteries State-of-Charge and State-ofHealth estimation”, in Proc. ITEC, Dearborn, 18-20 June 2012, pp. 1-6. Wei He, Nicholas Williard, Chaochao Chen, Michael Pecht, “State of charge estimation for Li-ion batteries using neural network modeling and unscented Kalman filter-based error cancellation”, Electrical Power and Energy Systems, 62, (2014), pp. 783–791. Wen-Yeau Chang, “Estimation of the state of charge for a LFP battery using a hybrid method that combines a RBF neural network, an OLS algorithm and AGA”, Electrical Power and Energy Systems, 53, (2013), pp. 603–611.
[19] I. H. Li, W. Y. Wang, S. F. Su, Y. S. Lee, “A merged fuzzy neural network and its applications in battery state-of-charge estimation”, IEEE Transactions on Energy Conversion, vol. 22, no. 3, 2007, pp. 697–708. [20] M. Mastali, J. Vazquez-Arenas, R. Fraser, M. Fowler, S. Afshar, M. Stevens, “Battery state of the charge estimation using Kalman filtering”, Journal of Power Sources, 239, (2013), pp. 294-307. [21] V. Pop, H. J. Bergveld, P. H. L. Notten, J. H. G. Op het Veld, P. P. L. Regtien, “Accuracy analysis of the state-of-charge and remaining runtime determination for lithium-ion batteries”, Measurement, vol. 42, no. 8, 2009, pp. 1131–1138. [22] Eugen Diaconescu, “The use of NARX Neural Networks to predict Chaotic Time Series”, WSEAS TRANSACTIONS on COMPUTER RESEARCH, Issue 3, Volume 3, March 2008, pp. 182 - 191. [23] ***, USABC Electric Vehicle Battery Test Procedures Manual, 1996. [24] ***,http://www.scholarpedia.org/article/Radial_basis_function, accessed on 10.11.2014.