Thomas 2021
Thomas 2021
A R T I C L E I N F O A B S T R A C T
Keywords: Battery life prediction helps in smooth and uniform functioning of the battery-operated systems. Although, the
Battery capacity of the battery can be monitored by some devices, they cannot estimate how long the battery can work
BMS before a failure occurs. The technique that we have proposed here, estimates the life span of a battery using Long
Lithium-ion
Short Term-Memory (LSTM), an artificial Recurrent Neural Network (RNN) architecture in Machine Learning
Rechargeable
LSTM
(ML). The battery life is measured by considering each cell voltage, load voltage, temperature of the battery and
Health charge-discharge cycle. The voltage and temperature of the battery cells are measured by a thermistor and
microcontroller. The voltage values fetched by the micro controller are sent to a web server and these values are
displayed on a web based mobile phone application. Balance charging of the battery cells and over charge
protection is provided by constantly monitoring the battery status. This paper includes explanation on different
circuit parts, algorithm used in training the model, Graphical User Interface (GUI) and the test results.
1. Introduction ML has been increasing over the years. Most ML methods cover SOC
prediction through neural networks [11], deep neural networks [12],
The progress in the field of rechargeable batteries has garnered it a LSTM cells [13,14]. ML could be a promising modeling approach to
wide popularity among different energy storage systems. The renewable estimate the SOH, SOC and remaining useful life of batteries. The two
energy sources require an energy storage system (ESS) to support a widely studied types of battery models for prediction of state of battery
reliable and smooth supply to the customer. Among different energy are equivalent circuit and physics-based models. Due to their limita
storage systems, Li-ion battery is preferred over other batteries in many tions, we use the ML technology for fast and better efficient battery state
fields owing to its high reliability, efficiency, power and energy density, prediction [15–18]. Lithium batteries require constant and accurate
long lifespan and low discharge rate. If a circuit can equalize the charge monitoring to check their condition, specifically, the level of the
within the cells of a battery, the performance can be increased even if the remaining available energy, indicated by the SOC. An accurate and
cells differ with capacities [1–3]. Battery Management System (BMS) is a reliable knowledge of the SOC mitigates psychological factors such as
vital and an essential element in any battery driven system to assure the the range anxiety [19]. Precise SOC estimations are a crucial and
safety, reliability, efficiency and long-last operation of a Li-ion battery. consequential concern in designing a BMS. Accurate and precise esti
Each cell in a battery pack has different temperature though they have mations can not only evaluate the battery reliability but also impart the
an effectively built cooling system [4]. Hence, the cells deteriorate un information on the unexploited energy with its useable time [20]. The
evenly and cell capacity variation occurs [5,6]. The BMS senses the SOC cannot be directly measured, and its value can only be estimated
voltage and current of the battery cells and its corresponding tempera from the measurement of other battery parameters, such as current,
ture to prevent over-charge and over-discharge conditions which occurs voltage, internal resistance, and temperature [21].
when the battery is connected to a load. These measured variables are Approaches using statistical and machine learning techniques to
employed in estimating the Li-ion battery states i.e., the State of avail predict cycle life are attractive, mechanism-agnostic alternatives [22].
able Power (SOP), State of Charge (SOC), State of Life (SOL) and State of As the battery state of health is highly non-linear ML is an appropriate
Health (SOH) [7–9]. approach. ML can significantly accelerate calculations to improve pre
Early detection of inadequate performance facilitates timely main diction accuracy and make optimized decisions for real time manage
tenance of battery systems. This reduces operational costs and prevents ment. Vidal et,al presented a paper on comparison of SOC models based
accidents and malfunctions [10]. Modeling the battery behavior using on FNN,RNN and Kalman filter models and their studies showed that
* Corresponding author.
E-mail address: [email protected] (H.R. Crasta).
https://doi.org/10.1016/j.est.2021.102741
Received 15 December 2020; Received in revised form 12 May 2021; Accepted 17 May 2021
Available online 31 May 2021
2352-152X/© 2021 Elsevier Ltd. All rights reserved.
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
2
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
( )
R7 + R25 above the required voltage range, the battery may get damaged. As the
Vactual = V (1)
R25 battery reaches the threshold 4.2 V, the MOSFET is triggered and the
battery is connected to a 2 Ω resistor which will reduce the voltage from
The voltage and temperature value obtained are then sent to
4.2 V and charging the battery is carried by maintaining 4.2 V across all
ESP8266 which appends data related to the URL, posts the URL request
the cells. The resistor is chosen in such a way that the charging current
and waits for the confirmation from the server. Fig. 4(d) shows the pin
does not increase more than the voltage of the battery. Once all the cells
configuration of the Multiplexer CD74HC4067.
of the battery are charged to 4.2 V, the charging mechanism is stopped
by the circuit.
2.1.1. Pre-Processing of Battery Voltages and Temperature
The protection circuit consists of a MOSFET which cuts off the
2.1.4. Protection Circuits
connection from the battery if the voltage exceeds or goes below the
The BMS circuit provides following protections to the battery:
threshold voltage and also if the battery is fully charged or the battery
voltage goes low. In the Fig. 4(e), the terminals b1 to b8 are connected to
a) Over Charge Protection – when all the cells of the battery are
the positive terminal of 8-cell battery pack. The terminals c1-c16 are
charged to the maximum voltage i.e., 4.2 V, the supply is cut-off by
connected to multiplexer. The terminals of female header are used to
this circuit.
connect to a 10k Ω thermistor. R7 to R14 with R25 to R32 form voltage
b) Over Discharge Protection – when one of the cell potential drops
divider network (1) and R15 to R22 with thermistors connected at the
below the minimum voltage i.e., 3.6 V, the load connection is cut-off
header terminal forms voltage divider network (2) which gives pro
from the battery by this circuit
portional voltage of the battery under 3.3 V. The following equations
c) Over Voltage Protection – if the battery is being charged at a
give voltages across the above-mentioned voltage divider networks
voltage greater than 33.6 V (in case of 8-cell battery pack where each
respectively.
cell is charged up to 4.2 V), the supply is cut-off by this circuit.
b1 R25 d) Over Current Protection – if the current at which battery is
Vc1 = (2)
R7 + R25 charged is greater than the rated input current, supply is cut-off.
e) Short Circuit Protection – if the current at which battery is dis
Vt1 =
Vcc Rt1
(3) charging is greater than the rated output current, load is cut-off.
Rt1 + R25
2.1.5. ESP8266
2.1.2. Temperature Control Circuit ESP8266 Wi-Fi microchip takes the temperature and voltage value
The temperature control circuit is shown in Fig. 4(e). It includes a from the microcontroller in the form of strings and appends it with the
thermistor with voltage divider network which measures the tempera URL data, posts it and waits for approval from server as ‘OK’ success
ture of the battery. Thermistor is a small device with metallic oxide response. If approved, it is inserted in the table else, ESP tries again by
encapsulated by epoxy or glass, which gives temperature value corre sending request. The circuit in Fig. 4(b) shows an ESP module connected
sponding to the variation in its resistance. If the temperature exceeds the to an opto-coupler which is done to isolate the transmission and
threshold limit, this circuit cuts-off the battery connection until the reception (TX, RX) pins.
temperature becomes normal. The temperature senor is calibrated by
measuring two known temperatures and the voltage is scaled accord 2.2. LSTM
ingly. This voltage and temperature value is converted into string and
sent to ESP8266 Wi-Fi microchip [29]. Recurrent neural network is a segment of machine learning involving
memory directed cycles giving excellent performance for sequential
2.1.3. Balancing Circuit pieces of figures. LSTM is applied to avoid long term dependency as
The balancing circuit has an optocoupler along with IRLZ44N LSTM’s default behavior is remembering information for long term,
MOSFET to isolate the GND with respect to MOSFET as shown in Fig. 4 which reduces the vanishing gradient problem [3,13,25]. A simple
(c) [30]. This circuit checks the voltages of individual cell in the battery LSTM component contains a block, an input, output and forget gate as
and ensures that they all have the same voltage. This is an important shown in the Fig. 5. The LSTM block stores values over random duration
factor to be observed because if one cell’s voltage drops or increases and 3 gates regulate the bidirectional information flow of the block.
3
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
Fig. 4. BMS Components: (a) Pin diagram of Atmega328p (b) ESP Board schematic (c) Balancing Circuits (d) Pin diagram of Multiplexer CD74HC4067 (e) Voltage
Divider Network with temperature measurement.
4
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
LSTM defines an internal storage block state to store information for a The output is computed using the frameworks of weights and biases with
larger period of time. The storage block state links with the previous the Rectified Linear Unit (RеLU) activation function. RеLU activation
output and next input to update, maintain or erase among the existing function is used to vanquish the vanishing gradient problem. Compu
elements [4]. tation of gates is by
In Fig. 5, the forget gate fk, which is the first section of LSTM, ( )
together with the input gate ik, decides what information is to be stored. fk = σ Wxf Xk + Wkf hk− 1 + bf (4)
The new entry, gk is a short-term value which is discarded as soon as a ( )
new block state is added. At each stage, hk-1 and xk arrive as input values. ik = σ Wxi Xk + Wki hk− 1 + bi (5)
5
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
( ) data. Flowchart (i) shows how the LSTM model accepts dataset. Flow
gk = ReLU Wxg Xk + Wkg hk− 1 + bg (6)
chart (ii) prepares train and test set from the input dataset values.
The forget gate fk is multiplied with the block state ck− 1 which is Flowchart (iii) shows how the input data is processed to predict battery
previous time step, by Hadamard product, a matrix multiplication where fail cycle number.
corresponding elements of two matrices with same dimensions are
multiplied. Similarly, the input gate ik is multiplied with new entry gk 2.4. Displaying Data on Graphical User Interface
[31]. The sum of these elementwise products gives the block state c,
The data obtained from the battery cells are updated in the web
Ck = fk ⊙ Ck− 1 + ik ⊙ gk (7)
application. The data from the microcontroller is converted to string and
The output gate Ok decides the information to output and is calcu is sent to web server through ESP8266 which is connected to Wi-Fi. The
lated as shown below: data from the web server i.e., data base, is sent to the web application
( ) using POST method where information is shared via HTTP headers and
Ok = σ Wxo Xk + Wko hk− 1 + bo (8)
encoding by URL encoding scheme.
At the end, the hidden state hk is computed by We used Hostinger to create web page. The PHP code fetches the
values from the URL and updates the database table. A unique API key is
hk = Ok ⊙ ReLU(Ck ) (9) assigned to user table which is used in updating the table values. The
values stored are then displayed on the webpage by another code which
2.3. Data Procurement and Model Training is a combination of HTML and CSS. The user interface of the webpage is
shown in Fig. 7. After running the machine learning algorithm over
Battery data sets that were given by Prognostics centre of Excellence battery cells and updating the result in the database table, user can see
(NASA) Data Repository were utilized in training the LSTM model. The the result on the webpage by entering. The webpage shows the average
data set contains a couple of lithium-ion batteries that were operated at voltage and temperature values, charging voltage (CV), discharging
three main working profiles, charge, discharge and idle, all at 24ºC voltage (DCV), charging current (CC), discharging current (DCC),
temperature. The observation was performed on commercially available number of readings (ID). Fig. 7 shows result of a sample battery with 8
18,650 Li-ion cells to achieve accelerated aging. The experiment cells under test. Its charging voltage is 34 V at an average temperature of
involved discharging and charging of batteries. Batteries were charged 33 ◦ C. The battery under test will start losing its full capacity at 49th
by an appropriate battery charger using the principle Constant Current cycle of charging and discharging.
Constant Voltage (CCCV) [32,33]. Current of 1.5 A was applied till the
battery reached 4.2 V and then a constant voltage was applied until the 3. Test Results and Discussion
current dropped to 0.020 A [34]. Discharging was done with the help of
variable load to maintain a constant current of 2000 mA until the cell The Machine Learning model was trained over the data sets from
voltage fell to 2.2 V, 2.5 V and 2.7 V, for different batteries. The ex NASA and evaluated. On evaluation, the obtained result for known
periments were performed until the batteries had only 70% of its orig batteries were accurate i.e., charge and discharge cycles and lifespan.
inal life of the rated capacity, i.e., 1.4 Ah [35]. The flowcharts shown in We have used SHAP to plot the outcome. Force and Summary plots are
Fig. 6 explains how the machine learning model works. Two sets of data plotted using the training data. SHAP shows the impact of different
have been used at a time in this model. Based on the length of the features in the model. Fig. 8(a) and 8(b) shows the result of the Machine
training dataset, around 40 iterations for training the data from (0–50) Learning model tested over two different datasets, set1 and set2. The test
of set 1 and 29 iterations for training the data from (51–90) of set 2 with result of set1 predicted that the battery capacity will reduce i.e., effi
200 epochs respectively were performed. The length of the data could be ciency will decrease after 117 cycles of charging and discharging
anywhere from 200 cycles to few thousand cycles depending upon the (Fig. 8a) and for set2, the efficiency will decrease after 112 cycles of
availability of large capacity batteries with large cycle numbers. charging and discharging (Fig. 8b). The data sets set1 and set2 were
The algorithm takes voltage values from dataset as input parameters taken from two exhausted batteries which had shown variation in their
with first 50 entries for training data and rest of the entries for testing the efficiency i.e., battery capacity started deteriorating at their 128th and
6
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
Fig. 8. The machine learning model output: (a) Life Cycle analysis of a known Battery Dataset Result 1 (b) Life Cycle analysis of a known Battery Dataset Result 2.
112th cycle respectively. The result obtained over a number of data set the discharging value that battery gives is of the whole battery and not of
and iterations show an efficiency of more than 90%. each cell. Hence, there are chances of a cell draining more voltage than
The graph shown in Fig. 9(b) is Force plot of set2 which shows the other cells. The work presented in our paper BMS-ML will monitor each
capacity of the battery over a number of charge-discharge cycles. cell in a battery, thereby maintaining constant utilization of each cell.
Initially, the capacity is constant but after certain number of cycles, it This will increase the overall lifespan of the battery. Also, lifespan pre
reduces. The graph area in pink has more impact on the prediction and diction of a battery will be useful in avoiding situations pertaining to
area in blue has less impact. The point at which color transition takes failures of battery. The accuracy of the ML prediction can be increased if
place is the point of mean capacity of the battery. Fig. 9(a) is summary the model is trained with larger datasets.
plot of set2 and it shows that capacity and ambient temperature had no The BMS-ML system that we have developed, works for a battery
effect on the prediction as the battery taken for test had 18,650 Li-ion pack with up to 8 cells only. If a battery has more than 8 cells, a greater
cells and temperature was maintained at 24 ◦ C. number of Atmega microcontrollers are needed to be connected in series
The novelty of this research is to provide an optimized strategy to with the ESP8266 as a single Atmega chip cannot handle more than 8
charge the battery using BMS. The paper helps in predicting how long cells.
the battery will last before failure. The concept of equalizing the charge
within the cells of a battery by continuously monitoring the battery 4. Conclusion
status is also been implemented in this paper which is currently not used
in conventional rechargeable batteries. The battery chargers that are The proposed technique includes an optimized strategy to charge the
being used now, are equipped with BMS which monitor each cell in the battery using BMS to predict how long the battery can be used i.e.,
battery while charging. Once battery is disconnected from the charger, charge and discharge without affecting the performance. The designed
7
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
Fig. 9. Machine Learning model output analysis: (a) Summary plot showing impact of different features on the prediction (b) Force plot of Cycle v/s Capacity of the
battery under test.
BMS circuit can protect the battery from over charging, over voltage,
over discharge, high temperature, imbalance charging and discharging Algorithm 1
of the battery cells. The designed circuit is compact and its functioning Data conversion.
was verified by charging the batteries. The data obtained from the Input: Dataset in mat format, positive integers i and j
battery was successfully stored in the data base by ESP8266 connected Output: dataset, capacity_data
mat ← load mat file
to a Wi-Fi and displayed in the web application. The LSTM model used in
count ← 0
the Machine Learning cleared the test when run over a known battery’s create dataset list
data, accurately. Thus, the idea of battery monitoring using Machine create capacity_data list
Learning has proved efficient and effective in predicting the life span of for i є range(cycle) do
the battery. row ← cycle[0, i]
if row(‘type’) == ’discharge’ then
temp ambient ← row(temp ambient)
Declaration of Competing Interest datetime ← datetime(time)
data ← row(data)
The authors declare that they have no known competing financial capacity ← data(capacity)
for j є range(V measured) do
interests or personal relationships that could have appeared to influence
V measured ← data(V measured)
the work reported in this paper. I measured ← data(I measured)
temp measured ← data(tempmeasured)
Acknowledgements I load ← data(I load)
V load ← data(V load)
time ← data(time)
All persons who have made substantial contributions to the work
add (count+1, temp ambient,datetime, capacity, V measured, I measured, temp measured, I
reported in the manuscript (e.g., technical help, writing and editing load, V load, time) to dataset
assistance, general support), but who do not meet the criteria for add (count+1, temp ambient, datetime, capacity) to capacity_data
authorship, are named in the Acknowledgements and have given us their count + 1
written permission to be named. If we have not included an Acknowl end for
end if
edgements, then that indicates that we have not received substantial end for
contributions from non-authors. return dataset, capacity_data
end
Appendix
8
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
9
J.K. Thomas et al. Journal of Energy Storage 40 (2021) 102741
Neural Network for Mild-Hybrid Vehicle Applications, Appl. Sci. 10 (2020) 7880, [31] Kyungnam Park, Yohwan Choi, Won Jae Choi, Hee-Yeon Ryu, Hongseok Kim,
https://doi.org/10.3390/app10217880. LSTM-based battery remaining useful life prediction with multi-channel charging
[25] Tianhan Gao, Wei Lu,Machine learning toward advanced energy storage devices profiles, IEEE Access 8 (2020) 20786–20798, https://doi.org/10.1109/
and systems, iScience,24(1), 2021, 101936,ISSN 2589-0042. doi:10.1016/j.isci.20 ACCESS.2020.2968939.
20.101936. [32] Zhang Sheng Shui, The effect of the charging protocol on the cycle life of a Li-ion
[26] Zhao Dong, Jing Men, Zhiwen Yang, Jason Jerwick, Airong Li, Rudolph E. Tanzi, battery, J Power Sources 161 (2) (2006) 1385–1391, https://doi.org/10.1016/j.
Chao Zhou, FlyNet 2.0: drosophila heart 3D (2D + time) segmentation in optical jpowsour.2006.06.040. ISSN 0378-7753.
coherence microscopy images using a convolutional long short-term memory [33] Peter Keil, Andreas Jossen, Charging protocols for lithium-ion batteries and their
neural network, Biomed. Opt. Express 11 (3) (2020) 1568–1579, https://doi.org/ impact on cycle life—an experimental study with different 18650 high-power cells,
10.1364/BOE.385968. J. Energy Storage 6 (2016) 125–141, https://doi.org/10.1016/j.est.2016.02.005.
[27] Ruiguo Yu, Jie Gao, Mei Yu, Wenhuan Lu, Tianyi Xu, Mankun Zhao, Jie Zhang, ISSN 2352-152X.
Ruixuan Zhang, Zhuo Zhang, LSTM-EFG for wind power forecasting based on [34] M.A. Hannan, Hossain Lipu, S. M, Aini Hussain, Pin Jern Ker, T M Indra Mahlia,
sequential correlation features, Future Generat. Comput. Syst. 93 (2019) 33–42, Muhamad Mansor, Afida Ayob, Md Saad, Mohamad Hanif, Z.Y Dong, Toward
https://doi.org/10.1016/j.future.2018.09.054. ISSN 0167-739X. enhanced state of charge estimation of lithium-ion batteries using optimized
[28] CD74HC4067 Data Sheet, Texas Instruments, Dallas, Texas, 2003. https://www.ti. machine learning techniques, Sci Rep (2020), https://doi.org/10.1038/s41598-
com/lit/gpn/CD74HC4067. 020-61464-7.
[29] Marco. Schwartz, Internet of Things with ESP8266, Packt Publishing Ltd, 2016. [35] Yohwan Choi, Seunghyoung Ryu, Kyungnam Park, Hongseok Kim, (Senior
https://www.i-element.org/PDF/E09.pdf. Member, IEEE), “Machine learning-based lithium-ion battery capacity estimation
[30] Rectifier, I. "IRLZ44N." linha]. Disponível em: http://www.irf.com/productinfo/ exploiting multi-channel charging profiles, 7, IEEE Access, 2019,
datasheets/data/irlz44n.pdf. [Acedido: 14-Nov-2019] (1997). pp. 75143–75152, https://doi.org/10.1109/ACCESS.2019.2920932.
10