DOI: 10.3303/CET24114070 Paper Received: 1 June 2024; Revised: 30 August 2024; Accepted: 23 November 2024 Please cite this article as: Xiao Z., Ji C., Ma F., Wang J., Sun W., Zhai C., 2024, A Mechanism-aid Deep Learning Method for Li-ion Battery State-of-charge Estimation, Chemical Engineering Transactions, 114, 415-420 DOI:10.3303/CET24114070 CHEMICAL ENGINEERING TRANSACTIONS VOL. 114, 2024 A publication of The Italian Association of Chemical Engineering Online at www.cetjournal.it Guest Editors: Petar S. Varbanov, Min Zeng, Yee Van Fan, Xuechao Wang Copyright © 2024, AIDIC Servizi S.r.l. ISBN 979-12-81206-12-0; ISSN 2283-9216 A Mechanism-aid Deep Learning Method for Li-ion Battery State-of-charge Estimation Zhanghua Xiaoa, Cheng Jia, Fangyuan Maa , Jingde Wanga, Wei Suna, *, Chi Zhaib aCollege of Chemical Engineering, Beijing University of Chemical Technology, North Third Ring Road 15, Chaoyang District, 100029, Beijing, China bFaculty of Chemical Engineering, Kunming University of Science and Technology, 650500 Kunming, China sunwei@mail.buct.edu.cn An accurate estimation on the battery state of charge (SOC) could serve as a foundation for the secure and stable operation of battery management systems. The rapid development of data science and artificial intelligence provides a new solution for battery SOC estimation. However, existing methods that directly utilize measured data to establish the SOC estimation will suffer from low prediction accuracy due to the insufficient incorporation of mechanism information. The equivalent circuit model is a reliable battery mechanism model that could be adopted to calculate the open-circuit voltage, which has been proved to be directly correlated with the battery SOC. The open-circuit voltage has rarely been applied to the SOC estimation because it is hard to be measured online. Therefore, the physical information provided by the equivalent circuit model can be combined with data-driven prediction model to obtain the real-time approximation of the open-circuit voltage, with which more useful features can be extracted to improve prediction accuracy. For this purpose, a mechanism-aid deep learning method is proposed, in which the loss function of the LSTM neural network is modified by the equivalent circuit model. And the neural network model could converge to the mechanism relationship of the open circuit voltage in the training stage and obtain accurate estimation on the SOC. The proposed method is applied to the Panasonic battery dataset, which is collected by conducting the tests at various real-world driving profiles. Compared with related methods that only consider voltage, current and temperature, the root mean square error and mean absolute error of the SOC estimation decreases 72.49 % and 72.23 %, respectively. Then the effectiveness of the proposed method is further verified under different test conditions, demonstrating the significance to introduce mechanism information in battery SOC estimation. 1. Introduction With the continuous development of policy support on new energy technology, its application scenarios have been increasingly expanded. Under this circumstance, lithium-ion batteries are widely used in the electric vehicle (Pattaraprakorn et al, 2023) industry due to their long cycle life, high energy density, and stable performance, etc (Fang et al, 2019). Battery Management System (BMS) can help guarantee the safe and efficient use of batteries in electric vehicles. Among them, Stage of Charge (SOC) is a very important state indicator, which provides the basis for monitoring and controlling other indicators of BMS. However, there is a lack of direct measurement of SOC to provide an accurate and real-time estimation. Recent research on methods for SOC estimation includes four main categories (Peng et al, 2024), open-circuit voltage method, Ampere-time Integration method(AhI), mechanism-based modeling method, and data-driven based method. The open-circuit voltage method establishes a look-up table relationship by measuring the mapping between the open-circuit voltage and the SOC of the battery. This method requires precise experimental measurements to obtain an accurate mapping relationship, and the measurement needs to keep the terminal voltage stable and eliminate the overpotential effect, which causes significant time consumption and limits its practical applications. The AhI method utilizes the integral of current release to calculate the battery capacity change to obtain the battery SOC, which is characterized by easy calculation and high efficiency, but its performance as an open-loop method is affected by the sampling noise, i.e., there are the problems of high 415 initial estimation requirements and increased cumulative errors. Mechanism-based modeling approach is to combine the battery model and nonlinear state-space algorithm to overcome the drawbacks of the above methods, which can be specifically classified into Equivalent Circuit Model (ECM) and Electrochemical Model (EM). The ECM simulates the voltage change process by equating the battery operating process to a circuit consisting of a voltage source, resistor, capacitor, and other devices. This method is relatively simple in structure and efficient in calculation, but its accuracy is limited by several factors, including ambient temperature. Typical EM was proposed by (Dolye et al, 1993). This method describes the working behavior of the battery by establishing the internal micro-processes of the battery, and the model established by this method contains multiple partial differential equations with numerous corresponding parameters, resulting in huge computational loads that cannot satisfy the requirement of online application though the relative accuracy is high. The data-driven SOC estimation method has received more attention because of the development of computer technology. It could achieve reasonable accuracy and practicality by directly extracting the corresponding information from the input information without physical modelling. Deep Learning (DL) is widely used for SOC estimation especially Recurrent Neural Networks (RNN), which are specialized in processing data sequentially. (Chemall et al, 2018) achieved accurate estimation of SOC by using a Long Short-Term Memory Neural Network (LSTM-RNN) to map currents, voltages, and temperatures directly to the SOC, thus avoiding the filters and inference algorithms used in the mechanism modeling process. (Zou et al, 2023) investigated a CNN to extract the feature inputs in the current-voltage into a convolutional informer network and design a loss function based on Laplace distribution features for the training process. (Bian et al, 2020) use a Bidirectional LSTM (BiLSTM) to improve the model's ability of handle input sequences in both directions. (Chen et al, 2022). enhance the LSTM through cope with the fluctuation problem of SOC estimation by expanding the inputs, and at the same time, design the AhI-method based state strategy to limit the output of constrained SOC, which obtain a more efficient computational speed compared to traditional filter methods. Li-ion battery is a very complex nonlinear system, and the existing deep learning SOC estimation methods are purely data-driven "black-box" models, ignoring the battery electrochemical principles. This shortcoming makes it difficult to further improve the accuracy of deep learning-based SOC estimation methods, and research in some other fields (Daw et al, 2021) has also shown that better performance can be achieved by incorporating mechanistic information into machine learning. This paper proposes a new method that combines the mechanistic information of ECM with neural networks to estimate the SOC of the battery, and evaluates the Root Mean Square Error (RMSE), Mean Absolute Error (MAE) and test the results of the batteries under different operating conditions. 2. Methods The proposed method is schematically plotted in Figure 1. In a SOC estimation task, BMS sample signal data in different conditions. Subsequently, the voltage and current signals are input into the ECM, the voltage signal is deconstructed into open-circuit voltage (Uocv), and the current signal is calculated by the AhI method to obtain the cumulative current masked as ΔI. Finally, ΔI replaces the original current signal, with the data of Uocv, original voltage, and temperature composed of a new input sequence which is inputted into the neural network for training, validation, and testing. Figure 1: Overview of the proposed SOC estimation method 416 2.1 Identification of ECM parameters It has been pointed out that the open circuit voltage has a more direct mapping relationship with the SOC compared to the terminal voltage. The parameters proposed in this paper to increase the open-circuit voltage input are identified by the equivalent circuit model. The reason for choosing the equivalent circuit model instead of the electrochemical model is that there is a better balance between the complexity and accuracy of the ECM. As shown in Figure. 2, the method proposed in this paper uses a second-order Thevenin model, which consists of two series-connected RC loops, resistors, and an ideal voltage source. In the battery system (Hu et al,2012), the two series-connected RC loops of the ECM can simulate the electrochemical polarization and concentration polarization processes of the battery, respectively; the series-connected resistor R0 can represent the resistance to ion transfer within the battery system; and the ideal voltage source represents the amount of power that the battery can provide under ideal conditions. Figure 2: Schematic of the second-order Thevenin model The mathematical expression for the model is: { 𝑈 = 𝑈𝑜𝑐𝑣 − 𝐼𝑅0 − 𝑈1 − 𝑈2 𝑑𝑈1 𝑑𝑡 = − 𝑈1 𝐶1𝑅1 + 𝐼 𝐶1 𝑑𝑈2 𝑑𝑡 = − 𝑈2 𝐶2𝑅2 + 𝐼 𝐶2 (1) where U1 and U2 are the polarization voltages corresponding to the R1C1 and R2C2 branches, respectively, and U0 is the ohmic voltage corresponding to R1. The Laplace's equation for the equivalent circuit model is obtained after discretizing the above equations as follows as: 𝑈𝑜𝑐𝑣(𝑠) − 𝑈(𝑠) = 𝐼(𝑠)(𝑅0 + 𝑅1 1 + 𝑅1𝐶1𝑠 + 𝑅2 1 + 𝑅2𝐶2𝑠 ) (2) where s denotes the response of the system in the complex frequency domain, and then a bilinear transformation is performed for the above equations to obtain the difference equation between the input and output of the system for ECM as: 𝑦(𝑘) = 𝑈𝑜𝑐𝑣(𝑘) − 𝑈(𝑘) = 𝑎1𝑦(𝑘 − 1) + 𝑎2𝑦(𝑘 − 2) + 𝑎3𝐼(𝑘) + 𝑎4𝐼(𝑘 − 1) + 𝑎5𝐼(𝑘 − 2) (3) where I(k) is the current input to the system and y(k) is the output of the system, from which it follows: 𝜑(𝑘) = [𝑦(𝑘 − 1) 𝑦(𝑘 − 2) 𝐼(𝑘) 𝐼(𝑘 − 1) 𝐼(𝑘 − 2)]𝑇 (4) 𝜃(𝑘) = [𝑎1 𝑎2 𝑎3 𝑎4 𝑎5] (5) This leads to the recursive equation of the ECM, and in this paper, we apply the least squares approach to obtain reliable parameter identification results from the ECM, which in turn leads to the value of Uocv. 2.2 AhI method to obtain the cumulative current value The AhI method is a method of calculating SOC by integrating the cumulative battery current, which is expressed as follows 𝑆𝑂𝐶 = ∫ (− 𝜂 𝑄𝑛 ) 𝐼(𝑡) 𝑡 0 + 𝐶 (6) 417 where η represents the discharge efficiency of the battery and Qn represents the rated capacity of the battery. From the above equations, it can be seen that the AhI method is a simple and effective method for calculating the SOC. In this paper, the proposed method is to replace the current input with the cumulative current input, so as to obtain the integral information of the current, which further helps the neural network to learn the characteristics of the input information. However, the AhI method itself includes some defects in practical application, as mentioned before there is the effect of cumulative error, and the more to the end of the estimation period the greater the error. Therefore, in this work, when the AhI method is used to obtain the integral information of the current, the loss function during training will be modified accordingly to penalize the final error offset term, so as to improve the accuracy of the estimation. The loss function proposed in this work is modified to add a penalty term to the original mean square error (MSE) for the part of the SOC estimate that is lower than the true value to satisfy the SOC estimate, and the original MSE expression is as follows: 𝑀𝑆𝐸 = 1 𝑛 ∑(𝑆𝑂𝐶𝑖 − 𝑆�̂�𝐶𝑖) 2 𝑛 𝑖=1 (7) where n denotes the overall number of samples, denotes the reference SOC value, and is the estimated value. The modified loss function is: If ( 𝑆�̂�𝐶𝑖 − 𝑆𝑂𝐶𝑖)>0 𝐿𝑜𝑠𝑠 = 𝑤1 1 𝑛 ∑(𝑆𝑂𝐶𝑖 − 𝑆�̂�𝐶𝑖) 2 𝑛 𝑖=1 (8) Else 𝐿𝑜𝑠𝑠 = 𝑤2 1 𝑛 ∑(𝑆𝑂𝐶𝑖 − 𝑆�̂�𝐶𝑖) 2 𝑛 𝑖=1 (9) where w1 and w2 are both user-defined parameters and w1 < w2. 2.3 Data sets and evaluation indicators The publicly available dataset used in this work was experimentally measured by Dr. Phillip Kollmeyer (phillip.kollmeyer@gmail.com) of the University of Wisconsin-Madison. The battery model used for the experiments is Panasonic's 18650PF battery with a rated capacity of 2.9Ah. It contains a test temperature range of -20~25°C, and the test conditions also contain a variety of conditions such as US06, HWFET, UDDS, LA92, and their combinations, which satisfy the experimental needs of this work. In order to evaluate the SOC estimation performance of the proposed method, the RMSE and MAE expressions used are as follows: 𝑅𝑀𝑆𝐸 = √ 1 𝑛 ∑(𝑆𝑂𝐶𝑖 − 𝑆�̂�𝐶𝑖) 2 𝑛 𝑖=1 (10) 𝑀𝐴𝐸 = 1 𝑛 ∑|(𝑆𝑂𝐶𝑖 − 𝑆�̂�𝐶𝑖| 𝑛 𝑖=1 (11) The RMSE assesses the standard deviation of the estimation error, while the MAE assesses the robustness of the model. 3. Results and discussion This section first validates and discusses the results of the method proposed on the dataset collected at 25°C in the battery and then discusses the results under different test conditions. 3.1 SOC estimation results at 25°C As shown in Figure 3, the SOC estimation results of the proposed method at 25°C are first validated. As a comparison, the LSTM estimation model with only three inputs of current, voltage and temperature are used as a benchmark and is denoted as LSTM. the estimation model using the open circuit voltage parameter is labeled as LSTM-1, the estimation model using the cumulative current and the loss function is labeled as LSTM-2, and the estimation models that are used by all the improved methods are denoted as LSTM-1&2. A total of four operating conditions including US06, HWFET, UDDS, LA92 are used for testing, where the training set is the 418 first three cycles of cycle1~cycle4 (which is a mix of the four batches of data for the four operating conditions), the validation set is the remaining cycle4, and the test set is Neural Network (NN) drive cycles. Table 1 demonstrates the estimation results of the proposed method. It can be seen that the traditional current- voltage-temperature based three-input LSTM has an RMSE as high as 2.639 % and it can be observed from the graphs that the estimation fluctuates a lot and the results are not so accurate. Whereas the RMSE of LSTM- 1 with extended open circuit voltage input is 1.857 % and the corresponding RMSE of LSTM-2 is 1.521 %, the smallest RMSE is only 0.726 % for LSTM-1&2 using both the improved methods. The proposed method can be considered valid for the current test. Figure 3: SOC estimation results and errors at 25℃. The markers a to d represent LSTM, LSTM-1, LSTM-2 and LSTM-1&2 models Table 1: The RMSE and MAE of different SOC estimation methods Item LSTM LSTM-1 LSTM-2 LSTM-1&2 RMSE/% 2.639 2.121 1.490 0.726 MAE/% 2.035 1.706 1.018 0.565 3.2 Comparison of different test conditions In the previous section, when dividing the training and testing sets, cycle1~4 are used for training and NN for testing. A comparison experiment is carried out in which cycle1~4 are used as the test conditions and the rest are used as the training data in order to analyze the effect of the proposed method under different working conditions. The specific estimation results are shown in Figure 4. The corresponding evaluation indicators are shown in table 2. It can be seen that neither cycle1, cycle2, cycle3 nor cycle4 obtains higher accuracy than the three-input LSTM estimation model in the proposed method. Figure 4: SOC estimation results under different test conditions. The left sides show the estimation results of the three-input LSTM, and the right sides show the estimation results of the proposed method. And a to b denote the test conditions cycle1 to 4 419 Table 2: The RMSE and MAE of different SOC estimation conditions LSTM Cycle1 Cycle2 Cycle3 Cycle4 LSTM-1&2 Cycle1 Cycle2 Cycle3 Cycle4 RMSE/% 2.273 2.59 2.642 7.403 RMSE/% 2.012 1.668 1.44 1.856 MAE/% 1.853 2.075 2.244 6.182 MAE/% 1.316 1.338 1.089 1.607 The comparison test shows that the proposed method has higher estimation accuracy under different test conditions, which indicates that the proposed method can accomplish the estimation task under different test conditions. 4. Conclusion SOC estimation is a fundamental component of the battery management system to ensure the safe and reliable operation of the battery power supply system, and neural networks have been evidenced in SOC estimation research. In the Panasonic 18650PF lithium battery test dataset, the accuracy of the LSTM model with only three inputs provides low accuracy. In contrast, the deep learning algorithm combined with the equivalent circuit model proposed in this paper is used for SOC estimation by further extracting the mechanistic information of the battery and inputting it into the neural network, which results in lower RMSE and MAE in the test results of the 25°C battery data, which are reduced by 72.49 % and 72.23 %, respectively, as compared to the normal three-input LSTM model. The results of this paper show that applying battery mechanism information to the battery state estimation problem in a data-driven approach is a proven method. Reference Bian C, He H, and Yang S, “Stacked bidirectional long short-term memory networks for state-of-charge estimation of lithium-ion batteries,” Energy, vol. 191, p. 116538, Jan. 2020, doi: 10.1016/j.energy.2019.116538. Chemali E, Kollmeyer P. J, Preindl M, R. Ahmed, and A. Emadi, “Long Short-Term Memory Networks for Accurate State-of-Charge Estimation of Li-ion Batteries,” IEEE Transactions on Industrial Electronics, vol. 65, no. 8, pp. 6730–6739, Aug. 2018, doi: 10.1109/TIE.2017.2787586. Chen J, Zhang Y, Wu J, Cheng W, and Zhu Q, “SOC estimation for lithium-ion battery using the LSTM-RNN with extended input and constrained output,” Energy, vol. 262, p. 125375, Jan. 2023, doi: 10.1016/j.energy.2022.125375. Daw A, Karpatne A, Watkins W, Read J, and Kumar V, “Physics-guided Neural Networks (PGNN): An Application in Lake Temperature Modeling.” arXiv, Sep. 28, 2021. doi: 10.48550/arXiv.1710.11431. Doyle M, Fuller T. F, and. Newman J, “Modeling of Galvanostatic Charge and Discharge of the Lithium/Polymer/Insertion Cell,” J. Electrochem. Soc., vol. 140, no. 6, p. 1526, Jun. 1993, doi: 10.1149/1.2221597. Fang L, Li J, and Peng B, “Online Estimation and Error Analysis of both SOC and SOH of Lithium-ion Battery based on DEKF Method,” Energy Procedia, vol. 158, pp. 3008–3013, Feb. 2019, doi: 10.1016/j.egypro.2019.01.974. Hu X, Li S, and Peng H, “A comparative study of equivalent circuit models for Li-ion batteries,” Journal of Power Sources, vol. 198, pp. 359–367, Jan. 2012, doi: 10.1016/j.jpowsour.2011.10.013. Pattaraprakorn W, Pattaraprakorn, Chairakorn S, Tippayarom D, Grisdanurak N, and T. Areerob, “Li Recovery via Physical-Chemical Treatment from Spent EV Lithium-Ion Battery for Circular Economy,” Chemical Engineering Transactions, vol. 106, pp. 1183–1188, Dec. 2023, doi: 10.3303/CET23106198. Peng J, Takyi-Aninakwa P, Wang S, Masahudu F, Yang X, and Guerrero J. M, “A hybrid-aided approach with adaptive state update for estimating the state-of-charge of LiFePO4 batteries considering temperature uncertainties,” Journal of Energy Storage, vol. 76, p. 109758, Jan. 2024, doi: 10.1016/j.est.2023.109758. Zou R, Duan Y, Wang Y, Pang J, Liu F, and Sheikh S. R, “A novel convolutional informer network for deterministic and probabilistic state-of-charge estimation of lithium-ion batteries,” Journal of Energy Storage, vol. 57, p. 106298, Jan. 2023, doi: 10.1016/j.est.2022.106298. 420