# Creating a Robust SoC Estimation Algorithm Based on LSTM Units and Trained with Synthetic Data

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. SoC Estimation Algorithm

#### 2.1. LSTM Network

_{k}), the current (I

_{k}), the ambient temperature (T

_{k}), and the time step (Δt

_{k}). It has been considered very useful to include this last input, since the time step may vary depending on the application and its hardware. For example, an application with fast dynamics, where the current changes rapidly, will need a faster sampling time in order to correctly estimate the SoC, whereas in an application where the dynamics are slow, such a fast sampling time will not be necessary.

#### 2.2. Long Short-Term Memory Units

_{t}denotes the unit memory at time t.

_{t}. The forget gate controls which information should be saved and which should be forgotten from the previous cell state. The output gate, on the other hand, decides what the next hidden state should be [28,29].

## 3. Dataset

## 4. Algorithm Configuration and Hyperparameter Tuning

_{i}is the real SoC value, and y

_{i}is the estimated SoC value.

#### 4.1. Window Length

#### 4.2. Dropout

#### 4.3. Batch Size

#### 4.4. LSTM Layer Size and Number of Hidden Layers

#### 4.5. Hyperparameter Tuning

## 5. Results

## 6. Conclusions and Future Work

## Author Contributions

## Funding

## Data Availability Statement

## Conflicts of Interest

## References

- Vezzini, A. Lithium-Ion Battery Management. In Lithium-Ion Batteries; Elsevier: Amsterdam, The Netherlands, 2014. [Google Scholar] [CrossRef]
- Feng, Y.; Xue, C.; Han, Q.-L.; Han, F.; Du, J. Robust Estimation for State-of-Charge and State-of-Health of Lithium-Ion Batteries Using Integral-Type Terminal Sliding-Mode Observers. IEEE Trans. Ind. Electron.
**2020**, 67, 4013–4023. [Google Scholar] [CrossRef] - Zhang, R.; Xia, B.; Li, B.; Cao, L.; Lai, Y.; Zheng, W.; Wang, H.; Wang, W. State of the art of lithium-ion battery SOC estimation for electrical vehicles. Energies
**2018**, 11, 1820. [Google Scholar] [CrossRef] [Green Version] - Rivera-Barrera, J.P.; Muñoz-Galeano, N.; Sarmiento-Maldonado, H.O. Soc estimation for lithium-ion batteries: Review and future challenges. Electronics
**2017**, 6, 102. [Google Scholar] [CrossRef] [Green Version] - Zhou, W.; Zheng, Y.; Pan, Z.; Lu, Q. Review on the Battery Model and SOC Estimation Method. Processes
**2021**, 9, 1685. [Google Scholar] [CrossRef] - Xie, J.; Ma, J.; Bai, K. Enhanced coulomb counting method for state-of-charge estimation of lithium-ion batteries based on peukert’s law and coulombic efficiency. J. Power Electron.
**2018**, 18, 910–922. [Google Scholar] [CrossRef] - Ng, K.S.; Moo, C.-S.S.; Chen, Y.-P.P.; Hsieh, Y.-C.C. Enhanced coulomb counting method for estimating state-of-charge and state-of-health of lithium-ion batteries. Appl. Energy
**2009**, 86, 1506–1511. [Google Scholar] [CrossRef] - Jeong, Y.-M.; Cho, Y.-K.; Ahn, J.-H.; Ryu, S.-H.; Lee, B.-K. Enhanced Coulomb counting method with adaptive SOC reset time for estimating OCV. In Proceedings of the 2014 IEEE Energy Conversion Congress and Exposition (ECCE), Pittsburgh, PA, USA, 14–18 September 2014; pp. 1313–1318. [Google Scholar] [CrossRef]
- Zhang, C.; Jiang, J.; Zhang, L.; Liu, S.; Wang, L.; Loh, P.C. A generalized SOC-OCV model for lithium-ion batteries and the SOC estimation for LNMCO battery. Energies
**2016**, 9, 900. [Google Scholar] [CrossRef] [Green Version] - Ali, M.U.; Zafar, A.; Nengroo, S.H.; Hussain, S.; Alvi, M.J.; Kim, H. Towards a Smarter Battery Management System for Electric Vehicle Applications: A Critical Review of Lithium-Ion Battery State of Charge Estimation. Energies
**2019**, 12, 446. [Google Scholar] [CrossRef] [Green Version] - Lotfi, N.; Landers, R.G.; Li, J.; Park, J. Reduced-Order Electrochemical Model-Based SOC Observer with Output Model Uncertainty Estimation. IEEE Trans. Control Syst. Technol.
**2017**, 25, 1217–1230. [Google Scholar] [CrossRef] - Ye, M.; Guo, H.; Cao, B. A model-based adaptive state of charge estimator for a lithium-ion battery using an improved adaptive particle filter. Appl. Energy
**2017**, 190, 740–748. [Google Scholar] [CrossRef] - Hwang, K.; Sung, W. Single stream parallelization of generalized LSTM-like RNNs on a GPU. In Proceedings of the ICASSP, IEEE International Conference on Acoustics, Speech and Signal Processing—Proceedings, South Brisbane, Australia, 19–24 April 2015; Volume 2015, pp. 1047–1051. [Google Scholar] [CrossRef] [Green Version]
- Yang, F.; Zhang, S.; Li, W.; Miao, Q. State-of-charge estimation of lithium-ion batteries using LSTM and UKF. Energy
**2020**, 201, 117664. [Google Scholar] [CrossRef] - How, D.N.T.; Hannan, M.A.; Lipu, M.S.H.; Sahari, K.S.M.; Ker, P.J.; Muttaqi, K.M. State-of-Charge Estimation of Li-ion Battery in Electric Vehicles: A Deep Neural Network Approach. In Proceedings of the 2019 IEEE Industry Applications Society Annual Meeting, Baltimore, MD, USA, 29 September–3 October 2019; pp. 1–8. [Google Scholar] [CrossRef]
- Boutaba, R.; Salahuddin, M.A.; Limam, N.; Ayoubi, S.; Shahriar, N.; Estrada-Solano, F. A comprehensive survey on machine learning for networking: Evolution, applications and research opportunities. J. Internet Serv. Appl.
**2018**, 9, 16. [Google Scholar] [CrossRef] [Green Version] - Wang, Y.; Tian, J.; Sun, Z.; Wang, L.; Xu, R.; Li, M.; Chen, Z. A comprehensive review of battery modeling and state estimation approaches for advanced battery management systems. Renew. Sustain. Energy Rev.
**2020**, 131, 110015. [Google Scholar] [CrossRef] - Chaoui, H.; Ibe-Ekeocha, C.C. State of Charge and State of Health Estimation for Lithium Batteries Using Recurrent Neural Networks. IEEE Trans. Veh. Technol.
**2017**, 66, 8773–8783. [Google Scholar] [CrossRef] - Jiao, M.; Wang, D.; Qiu, J. A GRU-RNN based momentum optimized algorithm for SOC estimation. J. Power Sources
**2020**, 459, 228051. [Google Scholar] [CrossRef] - Song, X.; Yang, F.; Wang, D.; Tsui, K.-L. Combined CNN-LSTM Network for State-of-Charge Estimation of Lithium-Ion Batteries. IEEE Access
**2019**, 7, 88894–88902. [Google Scholar] [CrossRef] - Ng, M.-F.; Zhao, J.; Yan, Q.; Conduit, G.J.; Seh, Z.W. Predicting the state of charge and health of batteries using data-driven machine learning. Nat. Mach. Intell.
**2020**, 2, 161–170. [Google Scholar] [CrossRef] [Green Version] - Kim, J.; Yu, J.; Kim, M.; Kim, K.; Han, S. Estimation of Li-ion Battery State of Health based on Multilayer Perceptron: As an EV Application. IFAC-PapersOnLine
**2018**, 51, 392–397. [Google Scholar] [CrossRef] - Harting, N.; Schenkendorf, R.; Wolff, N.; Krewer, U. State-of-Health identification of Lithium-ion batteries based on Nonlinear Frequency Response Analysis: First steps with machine learning. Appl. Sci.
**2018**, 8, 821. [Google Scholar] [CrossRef] [Green Version] - Azkue, M.; Lucu, M.; Martinez-Laserna, E.; Aizpuru, I. Calendar ageing model for Li-Ion batteries using transfer learning methods. World Electr. Veh. J.
**2021**, 12, 145. [Google Scholar] [CrossRef] - Shen, S.; Sadoughi, M.; Li, M.; Wang, Z.; Hu, C. Deep convolutional neural networks with ensemble learning and transfer learning for capacity estimation of lithium-ion batteries. Appl. Energy
**2020**, 260, 114296. [Google Scholar] [CrossRef] - Doyle, M.; Newman, J.; Gozdz, A.S.; Schmutz, C.N.; Tarascon, J.M. Comparison of modeling predictions with experimental data from plastic lithium ion cells. J. Electrochem. Soc.
**1996**, 143, 1890. [Google Scholar] [CrossRef] - Apaydin, H.; Feizi, H.; Sattari, M.T.; Colak, M.S.; Shamshirband, S.; Chau, K.-W. Comparative Analysis of Recurrent Neural Network Architectures for Reservoir Inflow Forecasting. Water
**2020**, 12, 1500. [Google Scholar] [CrossRef] - Burkov, A. The Hundred-Page Machine Learning Book; Andriy Burkov: 2019. Available online: https://books.google.es/books?id=0jbxwQEACAAJ (accessed on 27 May 2023).
- Géron, A. Hands-on Machine Learning with Scikit-Learn, Keras and TensorFlow: Concepts, Tools, and Techniques to Build Intelligent Systems. 2019. Available online: https://www.oreilly.com/library/view/hands-on-machine-learning/9781492032632/ (accessed on 28 July 2021).
- Hong, J.; Wang, Z.; Chen, W.; Wang, L.-Y.; Qu, C. Online joint-prediction of multi-forward-step battery SOC using LSTM neural networks and multiple linear regression for real-world electric vehicles. J. Energy Storage
**2020**, 30, 101459. [Google Scholar] [CrossRef] - Schelter, S.; Biessmann, F.; Januschowski, T.; Salinas, D.; Seufert, S.; Szarvas, G. On Challenges in Machine Learning Model Management. IEEE Data Eng. Bull.
**2018**, 41, 5–15. [Google Scholar] - Vabalas, A.; Gowen, E.; Poliakoff, E.; Casson, A.J. Machine learning algorithm validation with a limited sample size. PLoS ONE
**2019**, 14, e0224365. [Google Scholar] [CrossRef] - Azlan, A.; Yusof, Y.; Mohsin, M.F.M. Determining the impact of window length on time series forecasting using deep learning. Int. J. Adv. Comput. Res.
**2019**, 9, 260–267. [Google Scholar] [CrossRef] [Green Version] - Labach, A.; Salehinejad, H.; Valaee, S. Survey of Dropout Methods for Deep Neural Networks. arXiv
**2019**, arXiv:1904.13310. [Google Scholar] [CrossRef] - Kandel, I.; Castelli, M. The effect of batch size on the generalizability of the convolutional neural networks on a histopathology dataset. ICT Express
**2020**, 6, 312–315. [Google Scholar] [CrossRef] - Douglas, Z.; Wang, H. Bayesian optimization-derived batch size and learning rate scheduling in deep neural network training for head and neck tumor segmentation. In Proceedings of the 2022 IEEE 10th International Conference on Healthcare Informatics, ICHI 2022, Rochester, MN, USA, 11–14 June 2022; pp. 48–54. [Google Scholar] [CrossRef]
- Sun, H.; Sun, J.; Zhao, K.; Wang, L.; Wang, K. Data-Driven ICA-Bi-LSTM-Combined Lithium Battery SOH Estimation. Math. Probl. Eng.
**2022**, 2022, 9645892. [Google Scholar] [CrossRef] - Azkue, M.; Lucu, M.; Oca, L.; Martinez-Laserna, E.; Iraola, U. Li-ion Battery State-of-Charge estimation algorithm with CNN-LSTM and Transfer Learning using synthetic training data. Available online: https://shorturl.at/acSU5 (accessed on 27 May 2023).
- Cho, H.; Kim, Y.; Lee, E.; Choi, D.; Lee, Y.; Rhee, W. Basic Enhancement Strategies When Using Bayesian Optimization for Hyperparameter Tuning of Deep Neural Networks. IEEE Access
**2020**, 8, 52588–52608. [Google Scholar] [CrossRef] - Wang, Y.; Wang, H.; Peng, Z. Rice diseases detection and classification using attention based neural network and bayesian optimization. Expert Syst. Appl.
**2021**, 178, 114770. [Google Scholar] [CrossRef]

**Figure 1.**Proposed architecture using LSTM units [27].

Profile Type | Used for | Temperatures | C-Rate CHA | C-Rate DCH |
---|---|---|---|---|

Designed profile | Training | 0 °C, 10 °C, 25 °C and 45 °C | 0.05C, 0.2C, 0.5C and 1C | 0.05C, 0.2C, 0.5C, 1C, 2C and 4C |

HPPC | Validation | 0 °C, 10 °C, 25 °C and 45 °C | Pulses of 1C and 2C | Pulses of 1C and 2C |

Driving cycles | Test | 0 °C, 10 °C, 25 °C and 45 °C | Driving profiles (NEDC, WLTC, US06, HWFET, NYCC, and UDDS) |

Window length | 15 |

Dropout | 0 |

Batch Size | 512 |

LSTM Layers | 3 |

LSTM units per layer | 50 |

MAE | Max Error | |
---|---|---|

Training | 1.48% | 10.85% |

Validation | 1.54% | 13.21% |

Test | 1.64% | 11.50% |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Azkue, M.; Miguel, E.; Martinez-Laserna, E.; Oca, L.; Iraola, U.
Creating a Robust SoC Estimation Algorithm Based on LSTM Units and Trained with Synthetic Data. *World Electr. Veh. J.* **2023**, *14*, 197.
https://doi.org/10.3390/wevj14070197

**AMA Style**

Azkue M, Miguel E, Martinez-Laserna E, Oca L, Iraola U.
Creating a Robust SoC Estimation Algorithm Based on LSTM Units and Trained with Synthetic Data. *World Electric Vehicle Journal*. 2023; 14(7):197.
https://doi.org/10.3390/wevj14070197

**Chicago/Turabian Style**

Azkue, Markel, Eduardo Miguel, Egoitz Martinez-Laserna, Laura Oca, and Unai Iraola.
2023. "Creating a Robust SoC Estimation Algorithm Based on LSTM Units and Trained with Synthetic Data" *World Electric Vehicle Journal* 14, no. 7: 197.
https://doi.org/10.3390/wevj14070197