Lithium-ion battery state-of-charge estimation based on long-short-term memory neural network and square-root cubature Kalman filter

Due to the widespread use of Li-ion batteries in electric vehicles, battery management systems for monitoring the status and ensuring the safe operation of Li-ion batteries have been extensively studied. Online monitoring of the state of charge (SOC) is crucial for lithium-ion batteries, but achieving precise SOC estimation is a difficult task due to battery dynamics and the influence of factors such as current, temperature, and operating conditions on SOC variability. This paper introduces a novel approach that combines a Long Short-Term Memory (LSTM) network with a square-root cubature Kalman filter (SRCKF) to address this challenge. To tackle the issue at hand, the proposed methodology employs a two-step approach. Initially, the LSTM network is utilized to capture the complex relationship between the state of charge (SOC) and the measured variables, including current, voltage, and temperature. Subsequently, the output of the LSTM network is subjected to smoothing using the SRCKF technique, leading to precise and consistent SOC estimation. A notable advantage of this method is its ability to simplify the arduous task of parameter tuning for the LSTM network, eliminating the need for constructing a battery model. The experimental results demonstrate that the maximum error in estimating the state of charge (SOC) using this particular method is constrained within the 5% threshold. Compared with using a separate LSTM method at different temperatures, by using the combination method, the root mean square error and maximum error of SOC estimation are greatly reduced.


Introduction
Lithium-ion batteries are extensively utilized because of their advantages such as large specific energy and specific volume, good safety performance, high stability, non-toxic and non-polluting.There exist many ways to optimize the performance of lithium batteries.For instance, SP proposed in [1,2] to optimize the thermal management system of the battery in different ways, so that the battery can continue to work stably with better performance under normal and harsh temperature environments; and optimize the performance of lithium batteries by AC pulse heating [3] and ensure the normal operation of lithium batteries by battery health status detection [4].Moreover, a reliable battery management system (BMS) plays a vital role in optimizing power management strategies, safeguarding the battery's operation, and mitigating the potential risks associated with overcharging or over-discharging, thereby promoting an extended battery life.The state of charge (SOC) reflects the remaining battery capacity during a charge-discharge cycle.As the basic information of BMS, it will be impacted by elements such as battery temperature, discharge current, charge and discharge rates (Crates), and cycle times, where the C-rate quantifies the charge and discharge current relative to the nominal capacity of the battery.[5,6].Accurate estimation of SOC plays an important role in optimizing the battery management system [7].At present, common battery SOC estimation methods can be divided into four categories: The first category is the open circuit voltage method (OCV).The OCV method uses the relatively stable characteristics of the relationship between the battery SOC and the open circuit voltage, and calculates the SOC through the measured OCV-SOC relationship curve.When the OCV method obtains the OCV-SOC curve, it is necessary to keep the battery in a non-working state for a long time to stabilize its internal chemical properties.Therefore, it is not suitable for online estimation and is not conductive to the realization of engineering [8].The second category is the ampere-hour counting method (AHC).AHC calculates the change of battery SOC by integrating the current.However, the ampere-hour integration method needs to obtain an accurate initial value of SOC and the capacity of the lithium-ion battery under the current working condition.At the same time, the error of the algorithm will increase with time integration, which further reduces the practical application value of AHC.The third category is model-based estimation methods.This method estimates the SOC by establishing a battery model, and common models include an electrochemical mechanism model and an equivalent model.The complexity of the electrochemical mechanism model puts forward high requirements on the computing power of the battery management system, which is not universal.Therefore, the order reduction technique is widely used in the study of electrochemical mechanism models.uses ideal circuit components to equivalently model the interior of the lithium-ion battery, which has the advantages of fewer model parameters and faster operation, but its robustness in extremely complex environments is weak.Accurate parameter identification is crucial for model-based but the parameter identification of both the electrochemical mechanistic model and the circuit equivalent requires accurate OCV-SOC testing, which means that when the ambient temperature and battery aging state change, the robustness of the method will drop sharply.
The fourth category is data-driven estimation methods.In contrast to model-based estimation methods, the data-driven approach can effectively capture the nonlinear relationship between input and output data through training, bypassing the requirement of developing a complex battery model.Deep learning models such as long short-term memory networks (LSTMs), convolutional neural networks (CNNs), and recurrent neural networks (RNNs) are widely utilized in various applications.Yang [9] proposed an RNN-based SOC estimation method, which uses RNN to directly establish the nonlinear relationship between measurable physical quantities and SOC.However, RNN has shortcomings such as short memory period, inability to process long sequence data and high training cost.The training process of CNN requires a lot of computing resources and the deeper and more complex the convolutional neural network, the greater the demand for hardware resources.As a variant of RNN, LSTM effectively solves the problem that RNN cannot process long-term information by introducing a gate structure [8].However, the results estimated by a single LSTM still have obvious noise.Especially when the application object is a lithium iron phosphate battery, there is an obvious voltage plateau region, which poses a higher challenge to accurate SOC estimation.In addition, the SOC estimation accuracy can also be optimized by optimizing the air channel of the battery pack [10].Charkhgard [11] demonstrated a SOC estimation method based on neural networks (NNs) and extended Kalman filter (EKF), which effectively improves the accuracy of SOC estimation, but the limitations of NNs and EKF still lead to the disadvantage of low robustness of this method.SRCKF optimizes CKF based on the square-root principle, so that it has strong robustness in the face of Gaussian noise and non-Gaussian noise.Therefore, to improve the robustness of SOC estimation when Gaussian noise and non-Gaussian noise coexist, a SOC estimation method based on LSTM and SRCKF is proposed, and SRCKF is used to further denoise the output of LSTM.At the same time, using the strong generalization performance of LSTM, the temperature adaptation of SOC estimation is realized.
After the introduction of the first part, the rest of this paper will adopt the following structure: the second part will introduce the basic working principle of LSTM, the third part will introduce the mathematical principle and calculation process of SRCKF, and the fourth part will introduce the experimental steps and show the experimental as a result, the fifth part will draw the conclusion of this paper through the analysis of the experimental results.

LSTM network for SOC estimation
Considering the shortcomings of RNN's gradient disappearance and explosion in the process of training long sequence data, LSTM selectively memorizes information by introducing forgetting gates, input gates, and output gates, thereby avoiding long-term dependence problems [2].Figure 1 shows the structure.Figure 1 provides a visual representation of the key elements in the process.The hidden layer data at the current moment is denoted as , while the input layer data at the current moment is represented as .Additionally, the cell state at the current moment is captured by , while and correspond to the hidden layer data and cell state at the previous moment, respectively.is the activation function and is the hyperbolic tangent function.Among them, the cell state runs through the whole unit, and the information is filtered on the cell state and then transmitted to the next network unit.Each LSTM neural network unit takes the hidden layer state and cell state at time 1 and the input layer data at time as input, fills valid information into the cell state or removes invalid information through three gate structures, and the state of the hidden layer at the current time step is utilized as the input for the next unit, facilitating the effective processing of long sequential data.
The forward propagation of LSTM neural network can be expressed as: The forget gate selects the information that needs to be forgotten through an activation function, and the calculation method is: • , (7) In the formula, is the output of the forget gate, is the weight matrix of the forget gate, is a variable introduced to make the training result more accurate, called the bias item.The forget gate reads and through a activation function to select information that needs to be forgotten, and its output value is between [0,1].The closer the output is to 0, the more the information needs to be forgotten.Furthermore, 1 represents complete memory, and 0 represents complete forgetting.The output value will be stored in the cell state .The input gate first determines the information to be updated through an activation function, and then constructs a vector ′ of new candidate values through a layer, and finally combines the two parts through Formula (4) to update the cell state.The calculation method is: In the formula, is the information that needs to be updated, and is the updated cell state.Formula (10) can be divided into two parts: * and * ′ .Among them, the former determines the information to be forgotten, the latter determines the information to be updated, and the combination of the two is the final output .
The output gate first selects a part of the cell state as the information to be output through a layer.At the same time, the cell state is processed by the function so that its size is between [-1,1] , multiplied by the output of the activation function, and combined to obtain the desired output.The calculation method is: • , (11) * tanh (12) 3. Square-root cubature Kalman filter SRCKF introduces orthogonal triangular decomposition on the basis of CKF, and iterates the square root of the covariance matrix in each filtering cycle, which avoids CKF's direct square extraction of the covariance matrix and improves the numerical stability in the filtering process [12].The process of SRCKF algorithm is as follows: The nonlinear system can be described by the state equation and observation equation as follows: , (13) , (14) In the formula, , is the state transition function; , is the observation likelihood function; is the state vector at time ; is the input control vector; is the observed value at time ; Both and represent Gaussian white noise with a mean value of zero, where is measurement noise, is process noise, and the covariances are and respectively, and and are independent of each other.The SRCKF utilizes the criterion of "third-order spherical-radial volume" to select the volume points.The Literature [4] shows that if the system state dimension, then the number of volume points 2 .The volume points and their weights are shown in Formula (15), Formula (16) and Formula ( 17): (15) In the formula, ℎ is to decompose the matrix Cholesky ; is to decompose the matrix into an orthogonal triangular, that is, means that is decomposed into a positive triangle.
Step 5. Calculate the volume point, then update the measurement and calculate the predicted value of the measurement.
Step 7. Calculate the cross-covariance square root matrix.
Step 9. Calculate the estimated value of the system state quantity and the covariance square root matrix.The current curve and measured voltage are shown in Figure 3. Obviously, different ambient temperatures result in different discharge data curves.At the same time, complex test conditions further increase the difficulty of accurate SOC estimation.In this paper, test data at four different temperatures are used to verify the proposed method, respectively 20 °C, 25 °C, 30 °C, and 40 °C test data.

Estimation of SOC utilizing the LSTM network
The experiment uses MATLAB integrated algorithm application to process data.In this experiment, the training method of LSTM is set to Adam method [14], the maximum number of training rounds is set to 200 rounds, and the initial learning rate is set to 0.01.First, the data under three temperature situations are used as the training data set, and the remaining one temperature cycle is used as the test data set to evaluate the generalization ability of the LSTM network.The model exhibited fast convergence using the Adam optimizer and was trained for 2000 iterations with an initial learning rate of 0.01. Figure 4 shows the SOC estimation results of the FUDS cycle of the LSTM network at different temperatures.Due to the battery being discharged from a 100% state of charge (SOC) and the accurate calibration of the current sensor, the integration error can be deemed insignificant.As a result, the actual SOC is determined using the coulomb counting method.
The findings of the study indicate that the LSTM approach effectively captures the decreasing trend of the state of charge (SOC).However, it is worth noting that the maximum error surpasses 10%, suggesting the instability of the estimation results.This error primarily manifests within the intermediate range of the charge state (20%-80%) due to the presence of a plateau in the battery discharge voltage characteristic curve.Additionally, the process of optimizing parameters is both time-

SOC estimation after SRCKF filtering
Based on the observations presented in Section 4.1, it is evident that the LSTM network demonstrates remarkable adaptability across various operating temperatures.Nevertheless, to fulfill the demands of real-world applications, it is essential to enhance both the accuracy and stability of the SOC estimation.
As the outputs generated by the LSTM are characterized by noticeable fluctuations, they can be deemed as noisy measurements.Hence to increase the precision and stability of SOC estimation, the SRCKF algorithm is employed.To achieve this objective, a state space model is formulated as follows: State function: Measurement function: , (36) The current, denoted by 'I,' is positive when the battery is discharging and negative when it is charging, The sample period, denoted as ΔT, the nominal capacity of the battery, denoted as , at time step k, the Ampere-hour integral method in Equation (35) provides the output state of charge (SOC) denoted as , , while the LSTM network yields the output SOC denoted as , .Subsequently, the application of the SRCKF to the state space model described in Equation ( 35) and Equation (36) allows for the derivation of the ultimate estimation of the state of charge (SOC).This, in turn, facilitates the successful integration of the LSTM network and the SRCKF.
Figure 5 shows the SOC estimation results after using SRCKF to filter the output of the LSTM network during the FUDS driving period.It is showed from Figure 5 that adding SRCKF can capture the variation trend of SOC at all temperatures, and significantly smooth the fluctuation of the original output.The findings indicate that the implementation of the combined method leads to a significant reduction in both the root mean square error and the maximum error in estimating the state of charge (SOC) compared to employing standalone LSTM methods at varying temperatures.For example, when considering the FUDS cycle, a significant reduction is observed at 20 °C, with the decrease in estimation errors from 12.3% to 4.2%.Similarly, at 25 °C, the maximum error decreases from 6.2% to 5%, while at 40 °C, it further decreases from 5.3% to 2.9%.Generally, the largest error after SRCKF filtering is limited not exceeding 5%, indicating that SRCKF is an effective method to increase the SOC estimation accuracy of LSTM network.At the same time, according to the calculation results, the R2 of LSTM alone is 0.9994, while the R2 of LSTM combined with SRCKF is 0.9997.The SOC estimation accuracy increases after the combination of the two.It is important to note that while the proposed combined method demonstrates strong generalization capabilities regarding temperature, there is still some degree of influence on the estimation results of state of charge (SOC).Generally, lower temperatures contribute to increased error in estimation.For instance, during the FUDS cycle, the combined LSTM-SRCKF method exhibits a rise in maximum error from 2.9% to 5% as the temperature decreases from 40 °C to 20 °C.

Conclusions
In this paper, a novel approach is introduced for estimating the state of charge (SOC) by integrating a long short-term memory (LSTM) network and a square-root cubature Kalman filter (SRCKF).The proposed method combines the strengths of both techniques: the LSTM network provides an initial SOC estimate, which is subsequently refined using the SRCKF to enhance the accuracy of the estimation.By leveraging this combined approach, improved SOC estimation results can be achieved.
The SRCKF algorithm is employed to dynamically upgrade the process noise covariance and measurement noise covariance.To evaluate the generalization capability of the suggested method, the LSTM network is trained on data collected from three temperature cycles and subsequently validated using the remaining cycles.Experimental results demonstrate that the proposed method surpasses the performance of an individual LSTM network in terms of SOC estimation accuracy.The maximum error of the proposed method remains below 5%.Moreover, the proposed method exhibits remarkable generalization across various temperatures.Notably, the proposed method eliminates the need for constructing a precise battery model or meticulously designing LSTM network parameters, both of which are time-consuming and cumbersome tasks.Future studies will explore the influence of battery capacity degradation and inconsistencies on SOC estimation.Additionally, to further enhance the applicability of the proposed method under realworld conditions, efforts will be made to incorporate lightweight network architectures and transfer learning techniques.

References
rates of a battery hidden layer data at the current moment input layer data at the current moment cell state at the current moment weight matrix of the forget gate a variable introduced to make the training result more accurate

) 4 .
Experimental results and discussionsIn this paper, the Federal Urban Driving Schedule (FUDS) is used as the test condition.The data used comes from the University of Maryland Center for Advanced Lifecycle Engineering data repository[13].The experimental test equipment is shown in Figure2, which consists of a constant temperature box, a host computer and a battery test system.
, typically relying on the designers' extensive expertise.Consequently, to mitigate the error and fluctuations in SOC estimation results, this research incorporates the square-root cubature Kalman filter.Section 4.2 will present and discuss the outcomes obtained through this integration.
Propagate volume points and calculate system state predictions.Calculate the predicted value of the state quantity error square root covariance matrix.

Table 1
utilized for both current and voltage sampling, as well as for loading purposes; (4) an Arbin BT2000 tester, serving as the battery test system; (5) a personal computer equipped with Arbins' Mits Pro Software (v4.27), responsible for controlling the battery charging and discharging procedures; and (6) MATLAB R2009b, employed for data analysis.The parameters of the test cells are shown in Table1: ;(2) a temperature test chamber manufactured by Vötsch, wherein the cells were positioned within dedicated holders; (3) 7 a cable

Table 1 .
The key specifications of the test samples.
[1] Hasan Najafi Khaboshan, Farzad Jaliliantabar, Abdul Adam Abdullah and Satyam Panchal 2022 Improving the Cooling Performance of Cylindrical Lithium-Ion Battery Using Three Passive Methods in a Battery Thermal Management System Available at SSRN 4276692 [2] Talele V, Patil M, Panchal S, Fraser R, Fowler M and Gunti S 2023 Novel metallic separator coupled composite phase change material passive thermal design for large format prismatic battery pack Journal of Energy Storage 58 106336 [3] Li Wei, Xie Yi, Hu Xiaosong, Manh-Kien Tran, Michael Fowler, Satyam Panchal, Zheng Jintao and Liu Kailong 2022 An internal heating strategy for lithium-ion batteries without lithium plating based on self-adaptive alternating current pulse IEEE Transactions on Vehicular Technology [4] Panchal Satyam, Vinicius Pierre, Massimo Cancian, Oliver Gross, Fadi Estefanous and Tamer Badawy 2023 Development and Validation of Cycle and Calendar Aging Model for 144Ah NMC/Graphite Battery at Multi Temperatures, DODs, and C-rates In.: SAE Technical Paper [5] Braga Raphael, Anosh Mevawalla, Soumya Gudiyella, Satyam Panchal, Mattia Giuliano, Giovanna Nicol and Yi Zheng 2023 Transient Electrochemical model development and validation of a 144 Ah Cell performance under different drive cycles conditions In.: SAE Technical Paper [6] Choudhari Vivek, Dhoble Ashwinkumar S and Panchal Satyam 2022 Experimental and Numerical Investigation on Thermal Characteristics of 2×3 Designed Battery Module Available at SSRN 42209 [7] Dickson N T How, M Hannan, M S Hossain Lipu, et al. 2019 State of Charge Estimation for Lithium-Ion Batteries Using Model-Based and Data-Driven Methods: A Review IEEE Access 7 136116-136136 [8] Zheng Chen, Zhao Hongqian, Shu Xing, Zhang Yuanjian, Shen Jiangwei and Liu Yonggang 2021 Synthetic state of charge estimation for lithium-ion batteries based on long short-term memory network modeling and adaptive H-Infinity filter Energy 228 [9] Yang Fangfang, Li Weihua, Li Chuan and Miao Qiang 2019 State-of-charge estimation of lithium-ion batteries based on gated recurrent neural network Energy 175 66-75 [10] Xie Yi, Liu Yujie, Michael Fowler, Manh-Kien Tran, Satyam Panchal, Li Wei and Zhang Yangjun 2022 Enhanced optimization algorithm for the structural design of an air-cooled battery pack considering battery lifespan and consistency International Journal of Energy Research [11] Charkhgard Mohammad and Mohammad Farrokhi 2010 State-of-Charge Estimation for Lithium-Ion Batteries Using Neural Networks and EKF IEEE Transactions on Industrial Electronics 57 4178-87 [12] Cui Xiangyu, Zhu Jing, Luo Maji, Guo Yazhou and Qiao Huimin 2018 A new method for state of charge estimation of lithium-ion batteries using square root cubature Kalman filter Energies 11 209 [13] Xing Yinjiao, He Wei, Michael Pecht and Kwok Leung Tsui 2014 State of charge estimation of lithium-ion batteries using the open-circuit voltage at various ambient temperatures Applied Energy 113 106-15 [14] Kiran Kumar Chandriah and Raghavendra V Naraganahalli 2021 RNN/LSTM with modified Adam optimizer in deep learning approach for automobile spare parts demand forecasting Multimedia Tools and Applications 80 26145-59