Introduction

Under the background of “double carbon,” the advancement of the new energy vehicle sector has been remarkable. Lithium-ion batteries (LIBs) have emerged as the preeminent choice for electrochemical energy storage in electric vehicles (EVs), attributed to their superior energy density, extended service lifespan, and minimal self-discharge rates [1]. The state of charge (SOC) is the most important indicator of its residual capacity, and it is also one of the core parameters within the battery management system (i.e., EVs) [2]. Precise SOC of LIBs estimation is essential for improving battery efficiency and ensuring the safety of electric applications. However, under complex conditions, LIBs are easily influenced by variables (i.e., temperature, self-discharge, and charge–discharge rates) [3]. Therefore, obtaining a high accuracy and strong SOC estimation is extremely significant.

The SOC estimation techniques for LIBs can be categorized into four main approaches: the ampere-hour integration (AHI) method, the open-circuit voltage (OCV) method, data-driven methods, and model-based methods [4, 5]. The AHI method is a basic approach to battery energy measurement, which uses the cumulative method of ampere-hours to assess in real time the SOC of LIBs [6]. The AHI method is relatively less restricted by the battery’s own conditions and is simple and reliable in calculation. However, its accuracy can be influenced by disturbance parameters (i.e., initial SOC, temperature drift and noise in current sensors), which can cause cumulative errors during the integration process [7]. The OCV approach is simple and convenient, accuracy SOC estimation needs long time, which limits its online application [8].

Model-based methods for estimating SOC have been devised and extensively utilized, typically including the electrochemical model and equivalent circuit model (ECM) methods [9]. The electrochemical model is the basic model of LIBs, which can comprehensively describe the working characteristics of LIBs during the charging/discharging phases to enhance their safety, reliability, and efficiency. However, the electrochemical model typically comprises numerous partial differential equations, which will inevitably escalate the computational intricacy in the practical application of batteries [10, 11]. The ECM is used to simulate the dynamic behavior of batteries and to observe phenomena that occur during the charging/discharging processes. The ECM is able to better balance model accuracy and complexity due to its multiple advantages such as simplicity, fast computation speed, and good dynamic response. Zhang et al. [12] suggested a SOC estimation algorithm that leverages the square root cubature Kalman filtering (SRCKF) with multiple innovation least squares (MILS). They first constructed a second-order ECM to mimic the battery’s dynamic response. Then, they employed both MILS and the SRCKF for the reciprocal estimation of model parameters and SOC. The efficacy of their algorithm was confirmed through simulation tests. Wang et al. [13] studied a hierarchical adaptive extended Kalman filtering (HAEKF) technique for SOC estimation of LIBs, grounded on the second-order ECM. This method shows high accuracy in SOC estimation, requires low computational resources, and demonstrates strong resilience under left bias measurement noise variance. Nevertheless, it is difficult to establish an exact physical model for intricate and variable battery systems. Zhang et al. [14] proposed a holistic method for the real-time SOC estimation of LIBs based on modeling. Initially, they made use of an autoregressive model to emulate the battery’s terminal behavior. Subsequently, utilizing the trained model, two SOC estimation methods grounded in real-time modeling are introduced. Finally, data collected from LiFePO4 battery cells are used to present and analyze both the modeling outcomes and the SOC estimation results. The findings affirm the efficacy of the suggested methods, with a special emphasis on the combined extended Kalman filtering (EKF) approach. In addition, physics-based models have been used to a large extent for state estimation. Physics-based models are based on the laws of physics, which ensures that the models are theoretically accurate and have the advantages of high predictive power, high accuracy and wide range of applications. Huang et al. [15] proposed a new architecture for generating model-integrated neural networks (MINN) to allow integration at the level of learning physics-based system dynamics. The model has comparable accuracy to first-principles-based models in predicting the system output and the electrochemical behavior of any local distribution. Nath et al. [16] proposed a physics-based single-particle model (SPM) for SOC estimation of LIBs in applications involving high amplitude fluctuating current distributions. The SPM is computationally efficient and is used to design a robust observer–based SOC estimator within the framework of linear matrix inequalities, and experimental results indicate that the average SOC estimation error and the integral squared error of the estimated SOC for the proposed observer are at least one order of magnitude smaller than that of the UKF.

Data-driven methods have received a lot of attention so far [17]. Data-driven methods are adaptable and can continuously adapt to the dynamic performance of the battery under different operating conditions, thus maintaining the accuracy of the estimation [18]. This is particularly important for variable real-world application environments. Data-driven methods can directly utilize a large amount of data collected from the battery system, such as current, voltage, and temperature parameters, and learn the complex relationship between these parameters and SOC through algorithmic models [19]. Neural network models, in particular, have been widely used in data-driven SOC estimation, which can effectively integrate and analyze different battery information for high-precision prediction [20, 21]. Mao et al. [22] proposed a particle swarm optimization (PSO) approach that employs the Levy flight strategy to optimize the weights and thresholds of the back propagation neural network (BPNN), thereby enhancing the prediction accuracy of SOC. This technique demonstrates excellent generalization capabilities and high precision in predictions, which is of practical significance for SOC estimation. Liu et al. [23] suggested a detection technique for the charging state of LIBs based on ultrasonic waves and artificial neural networks (ANNs). With guided wave parameters as characteristic variables, the SOC was precisely estimated using a BPNN model. This system can be utilized for the detection and surveillance of the SOC of LIBs. In addition, machine learning models are also used for battery SOC estimation due to their better performance in dealing with linear problems. The training of machine learning models is mainly categorized into offline and online training, and it is important to evaluate and implement online adaptive strategies to ensure model persistence and reliability. Zhu et al. [24] proposed a new machine learning–based prediction framework. It integrates physically informative features and combines offline global modeling with vehicle-specific online adaptation to improve prediction accuracy and assess uncertainty. The effectiveness and efficiency of utilizing physically based features and vehicle-based online adaptation to predict the energy consumption of electric vehicles is demonstrated. Wei et al. [25] introduced a charge estimation state framework for LIBs that integrates physical computing, adaptive Kalman filters (AKF), and machine learning. The precision and robustness of this method were substantiated under four distinct operating conditions. Fan et al. [26] put forth a novel long short-term memory (LSTM) network and amalgamated it with the adaptive unscented Kalman filter (AUKF) technique to concurrently estimate state of energy (SOE) and SOC. The proposed method underwent verification across varying temperatures and initial errors. Cui et al. [27] proposed a hybrid approach for stable and real-time SOC estimation across diverse temperatures. This method merges an enhanced bi-directional-gated recurrent unit (BiGRU) network with the UKF algorithm. The proposed method underwent experimental validation using data from two different working conditions. The validation outcomes indicate this the method can accommodate various operating conditions, achieving commendable estimation precision and robustness. Zhang et al. [28] developed a kernel-based extreme learning machine (ELM) for SOC estimation that eliminates the need for updating network parameters. Subsequently, this kernel method was amalgamated with the ELM to sidestep overfitting during parameter estimation. Simulation results demonstrated the effectiveness of the proposed method.

In addition, the accurate estimation of SOC is highly dependent on battery parameters and other states, including state of health (SOH). SOH reflects the degree of healthy decay of a battery from a brand-new state to its current state. As the battery ages, its capacity gradually decreases and internal resistance increases, which directly affects the accuracy of SOC estimation. Therefore, in order to achieve highly accurate SOC estimation, the change of SOH must be considered at the same time. Zhang et al. [29] developed a data-driven multi-model fusion approach for estimating SOH under arbitrary usage scenarios. Appropriate feature sets are extracted to indicate SOH for six operating conditions. Based on the obtained features, four machine learning algorithms are applied to train SOH estimation models using time-series data, respectively. Then, a Kalman filter is applied to systematically fuse the results of all estimation and prediction models. Experiments validate the effectiveness and practicality of the developed methodology, as well as its superiority over individual models. Zhang et al. [30] proposed a prediction framework based on a combination of global models offline developed by different machine learning methods and cell individualised models that are online adapted. For any format of raw data collected under diverse operating conditions, statistic properties of histograms can be still extracted and used as features to learn battery ageing. Lin et al. [31] proposed an online synthesis method based on the response characteristics of load surges and an improved fuzzy cerebellar model neural network (IFCMNN) to co-estimate SOH and SOC. Experimental results on ten batteries with different aging levels show that the method can quickly estimate SOH and SOC with a resolution accuracy of 1.64% and 2%, respectively, regardless of temperature and inrush current variations. In addition, he proposed model has higher estimation accuracy and better generalization ability compared to other conventional methods.

To address the issue of weak robustness for SOC estimation of LIBs under complex and variable temperature conditions, this study presents an SOC estimation method based on the fusion of GRU and UKF. Firstly, the GRU is employed to pre-estimate the battery SOC, then the UKF online estimation is integrated to obtain a smooth lithium-ion battery SOC estimation. Finally, 18,650 and 26,650 LiFePO4 batteries were chosen for testing under diverse charging and discharging conditions at 10℃, 25℃, and 40 °C, respectively, verifying the superior accuracy of the GRU-UKF algorithm.

The subsequent sections of the paper are structured as follows: “Fusion of gated recurrent units and traceless Kalman filtering algorithms” elucidates the integration of GRU neural network and UKF algorithm. “Experiments” shows the discharge experiments of 26,650 and 18,650 LiFePO4 batteries under three working conditions. “Results and discussion” provides an in-depth depiction of the calculation results and discussion of SOC estimation. “Conclusion” describes conclusion.

Fusion of gated recurrent units and traceless Kalman filtering algorithms

GRU neural network

Recurrent neural networks (RNNs) possess the capability to employ their internal state as memory, enabling them to address time series problems by storing, remembering, and processing complex signals over a period of time. However, their predictive performance on longer time series is not satisfactory [32, 33]. Both GRU and LSTM are variant forms of RNN that perform well in processing time-series data. Compared to LSTM, GRU combines the input and forgetting gates into a single update gate. This makes GRU simpler than LSTM with fewer parameters, which reduces the complexity of the model and improves the training efficiency [34]. With an effective gating mechanism, the GRU is able to capture subtle changes in the battery state, thus improving the accuracy of SOC estimation. Especially under variable current and temperature conditions, GRU is able to adapt to complex nonlinear relationships [35]. A GRU neural network includes two key structures: the reset gate and the update gate. This type of network is designed to handle data sequence problems with large time spans. Figure 1 shows the internal architecture of a typical GRU neural network.

Fig. 1
figure 1

GRU neural network structure

(1) Reset gate \({r}_{t}\).

$${r}_{t}=\sigma \left({W}_{r}{x}_{t}+{U}_{r}{h}_{t-1}+{b}_{t}\right)$$
(1)

(2) Update gate \({z}_{t}\).

$${z}_{t}=\sigma \left({W}_{z}{x}_{t}+{U}_{z}{h}_{t-1}+{b}_{z}\right)$$
(2)

(3) Candidate set \(\widetilde{{h}_{t}}\) and the next hidden state value \({h}_{t}\).

$$\widetilde{{h}_{t}}=\text{tan}h\left({W}_{c}{x}_{t}+U\left({r}_{t}\odot {h}_{t-1}\right)\right)$$
(3)
$${h}_{t}={z}_{t}\odot {h}_{t-1}+\left(1-{z}_{t}\right)\odot \widetilde{{h}_{t}}$$
(4)

where \({r}_{t}\) and \({z}_{t}\) represent the activation output values of the reset gate and update gate at a specific time step t; \({W}_{r}\), \({W}_{z}\), and \({W}_{c}\) correspond to different weight matrices respectively; \(b\) is the bias vector. \(\sigma\) is the activation function in the form of sigmoid, and \(\text{tan}h\) represents the hyperbolic tangent activation function; \({x}_{t}\) represents the data input to the GRU unit at time \(t\), \({h}_{t}\) denotes the output of the corresponding unit of \({x}_{t}\) at time t; \(\widetilde{{h}_{t}}\) represents the candidate set.

Both gate functions are executed through the sigmoid activation function, which can control the input value between [0,1], determining the weight of information retention. The tanh activation function aids in modulating the values coursing through the network, with the tanh function confining these values within the range of [− 1, 1].

In addition, the gradient descent optimization algorithm of the GRU network in this paper adopts the adaptive moment (Adam) estimation optimizer, this optimizer amalgamates the concepts from RMSProp and momentum optimization algorithms, normalizing the parameter updates to ensure each update possesses a consistent magnitude, thereby enhancing training efficacy [36].

The inputs to the GRU are current voltage and temperature data, and the outputs are set to SOC values. Therefore, when constructing the GRU network, three hyperparameters need to be determined: the input window, the number of hidden layers, and the number of nodes. The first hyperparameter is the input window. The larger the input window, the more accurate the GRU’s estimation of SOC will be. To satisfy real-time prediction, the input window is set to 10. The second hyperparameter is the number of hidden layers. A large number of hidden layers increases the complexity of the model, leading to long training time and risk of overfitting. In this study, the number of hidden layers is set to 1. The third hyperparameter is the number of nodes. A larger number of nodes provides greater model representation, but also increases the computational cost. In this study, the number of nodes was set to 64.

Unscented Kalman filtering algorithm

This section proposes the UKF algorithm to improve the estimation results of GRU neural networks. The application scope of traditional Kalman filtering is linear Gaussian white noise systems. Extended Kalman filtering (EKF) represents an enhanced filtering method grounded on the traditional Kalman algorithm, which uses Taylor expansion to linearize the model and then uses Gaussian assumptions to address complications in probability computations [37]. Nevertheless, the introduction of linear errors diminishes model precision, which will lead to an increase in EKF estimation errors, or even divergence. To address this issue, unscented Kalman filtering (UKF) was introduced. This method enhances the precision and accuracy of estimates by using the unscented transform to handle nonlinear systems [38]. UKF can avoid the challenges of solving the Jacobian matrix with UT. While reducing computational burden, it improves estimation accuracy. Compared to general Kalman filtering, the UKF algorithm includes two additional unscented transformations, formulated as follows:

$$X(k)=[x(k),x(k)+\sqrt{(n+\lambda )P(k)},x(k)-\sqrt{(n+\lambda )P(k)}]$$
(5)

where \(\lambda\) denotes the process intermediate quantity, obtained via \(\lambda ={\alpha }^{2}(n+K)-n\); \(k\) denotes the coefficient of freedom associated with the Sigma point.

The weights and variances were calculated as follows:

$${\omega }_{m}^{0}=\frac{\lambda }{n+\lambda }$$
(6)
$${\omega }_{c}^{0}=(1-{\alpha }^{2}+\beta )+\frac{\lambda }{n+\lambda }$$
(7)
$${\omega }_{m}^{i}={\omega }_{c}^{i}=\frac{\lambda }{2(n+\lambda )},i=\text{1,2},\cdots ,2n$$
(8)

where \({\omega }_{m}\) represents the mean weight, \({\omega }_{c}\) denotes the covariance weight, and \(\beta\) is the pre-test distribution factor.

The specific estimation process of the UKF algorithm is as follows:

(1) Initialize the mean \({x}_{0}\) and covariance matrix \({P}_{0}\) of the state variables:

$${\hat{x}}_{0}=E[{x}_{0}]$$
(9)
$${P}_{0}=E[({x}_{0}-{\hat{x}}_{0})({x}_{0}-{\hat{x}}_{0}{)}^{T}]$$
(10)

(2) Calculate the system state values and the covariance matrix:

$${\hat{x}}{\prime}(k+1)=\sum_{i=1}^{2n}{w}_{i}^{m}{X}_{i}{\prime}(k+1)$$
(11)
$${P}{\prime}(k+1)=\sum_{i=0}^{2n}{w}_{i}^{c}[{\dot{x}}{\prime}(k+1)-{X}_{i}{\prime}(k+1)]{[{\dot{x}}{\prime}(k+1)-{X}_{i}{\prime}(k+1)]}^{T}$$
(12)

(3) Obtain predicted values of observed quantities:

$${\hat{z}}{\prime}\left(k+1\right)=\sum_{i=0}^{2n}{w}_{i}^{m}{Z}_{i}{\prime}\left(k+1\right)$$
(13)

(4) Residual covariance array and reciprocal covariance array calculations:

$${\text{P}}_{{Z}_{k}{Z}_{k}}=\sum_{i=0}^{2n}{w}_{i}^{c}[{Z}_{i}{\prime}(k+1)-{z}{\prime}(k+1)]{[{Z}_{i}{\prime}(k+1)-{\hat{z}}{\prime}(k+1)]}^{T}$$
(14)
$${P}_{{x}_{k}{Z}_{k}}=\sum_{i=0}^{2n}{w}_{i}^{c}[{X}_{i}{\prime}(k+1)-{x}{\prime}(k+1)]{[{Z}_{i}{\prime}(k+1)-{\hat{z}}{\prime}(k+1)]}^{T}$$
(15)

(5) Calculate the Kalman gain matrix \(K(k+1)\) at moment \(k+1\):

$$K(k+1)={P}_{{x}_{k}{Z}_{k}}{{P}_{{Z}_{k}{Z}_{k}}}^{-1}$$
(16)

(6) Update the state variables and covariance matrix:

$$\hat{x}(k+1)={\hat{x}}{\prime}(k+1)+K(k+1)[\hat{z}(k+1)-{\hat{z}}{\prime}(k+1)]$$
(17)
$$P(k+1)={P}{\prime}(k+1)-K(k+1)(K+1)$$
(18)

The hyperparameters of the UKF mainly include the process noise covariance and the observation noise covariance. The process noise covariance reflects the uncertainty in the system dynamics. The smaller the process noise covariance, the smaller the uncertainty in the response process. The observation noise covariance reflects the accuracy of the measurement equipment and the noise level during the measurement process. A larger observation noise covariance can be set if there is a large noise disturbance. Therefore, when using the UKF to estimate the SOC, the noise characteristic is set as Gaussian white noise, the process noise covariance is set as 0.001, and the observation noise covariance is set as 0.1.

GRU-UKF algorithm

This section proposes the UKF algorithm to improve the estimation results of GRU neural networks. To achieve a closed-loop SOC estimation strategy, a GRU neural network is first used to establish an offline training model, which is then integrated with the UKF algorithm for online estimation, ultimately obtaining a smooth battery SOC estimation result. Therefore, this paper establishes a state space model to estimate the battery SOC. The state equation and measurement equation are represented by eqs. (19) and (20), respectively.

State equation:

$${\text{SOC}}_{k}={\text{SOC}}_{k-1}-\frac{{I}_{k-1}\times \Delta t}{{Q}_{n}}+\omega$$
(19)

Measurement equation:

$${Y}_{k}={\text{SOC}}_{k}{\prime}+v$$
(20)

where \({\text{SOC}}_{k-1}\) is the SOC value predicted by the GRU at the k-1 moment, \({I}_{k-1}\) corresponds to the current value at the k-1 time node, \(\Delta t\) represents the sampling period of the current, \({Q}_{n}\) represents the rated capacity. \(\omega\) and \(v\) represent noise.

Relying on the state-space model of eqs. (19) and (20), the final SOC estimation can be obtained using the UKF, thereby achieving the integration of the GRU network with the UKF, as shown in Fig. 2. In this framework, the GRU network can directly establish the nonlinear relationship between measurable variables (i.e., current, voltage, and temperature) and SOC, simplifying the time-consuming process of identifying internal parameters of the model. The output of the GRU is considered as the “measured” SOC, which obtained through the AHI. The UKF is established for obtaining accuracy SOC estimation based on state and measurement equations. The GRU-UKF algorithm can bolster the precision and robustness of the model.

Fig. 2
figure 2

Flowchart of GRU-UKF-based estimation

To gauge the disparity between the estimated values and the actual values, this study calculated the root mean square error (RMSE) and mean absolute error (MAE) of the SOC estimate as follows:

$$\text{RMSE}=\sqrt{\frac{1}{n}\sum_{k=1}^{n}{\left({\text{SOC}}_{k}-{\text{SOC}}_{k}^{*}\right)}^{2}}$$
(21)
$$\text{MAE}=\frac{1}{n}\sum_{k=1}^{n}\left|{\text{SOC}}_{k}-{\text{SOC}}_{k}^{*}\right|$$
(22)

where \(N\) represents the sequence’s length in the input stratum; \({\text{SOC}}_{k}\) and \({\text{SOC}}_{k}^{*}\) are the actual and estimated values of SOC at time k, respectively.

Experiments

Experimental instruments

In view of the working characteristics of LiFePO4 batteries, 18,650 and 26,650 LiFePO4 batteries were selected as the research objects. The batteries were tested under complex conditions, and their specific parameters presented in Table 1. The battery testing experimental platform is made up of a chamber, battery testing system, and computer. The chamber ensures the constant temperature environment required for the experiment, and the battery test system is displayed in Fig. 3.

Table 1 Parameters of 18,650 and 26,650 LiFePO4 batteries
Fig. 3
figure 3

Battery testing system

Experimental methods

The temperature of the chamber was set to 10℃, 25℃, and 40℃ for battery testing. The LiFePO4 batteries, 18,650 and 26,650, were selected to undergo discharge experiments under the standard dynamic stress test (DST), Beijing dynamic stress test (BJDST), and urban dynamometer driving schedule (UDDS).

We selected a total of 18 batteries, numbered NO.1 ~ NO.18, for the SOC test of LiFePO4 batteries. The test batteries were divided into three groups, and the battery tests were carried out under three different working conditions (DST, BJDST, and UDDS) at 10 °C, 25 °C, and 40 °C, respectively. The test battery groupings are shown in the Table 2.

Table 2 Battery test grouping table for different temperatures and operating conditions

The detailed experimental procedure was as follows: the battery was gradually charged using a constant current constant voltage (CCCV) mode until it was fully charged. Subsequently, it was charged with a constant current of 1 C until the voltage reached the specified maximum value, followed by charging in constant voltage mode until the battery's current decreased to 0.02 C. Once charging was complete, the battery was left to rest for a certain period. Under DST, BJDST, and UDDS conditions, the batteries were discharged to the cut-off voltage, respectively. The changes in current and voltage of the 18,650 and 26,650 LiFePO4 batteries at 25℃ are shown in Fig. 4.

Fig. 4
figure 4

Battery data under DST, BJDST, and UDDS conditions at 25 °C. a The DST data of the 18,650 LiFePO4 battery. b The DST data of the 26,650 LiFePO4 battery. c The BJDST data of the 18,650 LiFePO4 battery. d The BJDST data of the 26,650 LiFePO4 battery. e The UDDS data of the 18,650 LiFePO4 battery. f The UDDS data of the 26,650 LiFePO4 battery

Results and discussion

SOC estimation results of GRU under different operating conditions

In this section, LiFePO4 batteries of models 18,650 and 26,650 were used, and three working conditions (BJDST, DST, and UDDS) were selected as experimental conditions to obtain data and verify the effectiveness of the GRU. The data obtained at 40℃ was used for model training, while the current and voltage data recorded at 25℃ were used to construct the test set, thereby predicting and evaluating the battery SOC. The results of SOC estimation based on GRU are shown in Fig. 5. Figure 5a indicates that under three different driving conditions, the SOC values estimated by the GRU network are generally similar to the actual values, capturing the downward trend of the SOC curve well. Figure 5b demonstrates the application capability of the GRU in estimating SOC. However, in certain specific areas, the evaluation process exhibits relatively large prediction errors, with the estimated results fluctuating more significantly within the SOC range of 30–70%. This is due to the presence of a voltage plateau in the OCV-SOC curve of the LiFePO4 batteries within this range, making the nonlinear mapping of the battery difficult to identify.

Fig. 5
figure 5

SOC estimation results at 25℃ based on GRU neural network. a 18,650 battery; b 26,650 battery

Considering that LiFePO4 batteries are closely related to the external environment and exhibit temperature sensitivity, the SOC estimation effect of the GRU was verified at 40 °C, using current data and voltage data collected at 25 °C as training data to train the GRU, and experimental data collected at 40 °C as test data to implement SOC estimation. Figure 6 shows the SOC estimation results of the GRU under three operating conditions at 40 °C. From Fig. 6, it can be seen that at 40 °C, the GRU has a good estimation effect and can learn the relationship between measurable values such as voltage and current and SOC, indicating that the GRU neural network has good generalization. However, there are also cases in the figure where fluctuations are larger, suggesting that the GRU network prediction is not stable enough.

Fig. 6
figure 6

SOC estimation results at 40℃ based on the GRU. a 18,650 battery; b 26,650 battery

In order to verify the generalizability of the GRU at low temperatures, the data obtained at 25 °C were used for model training, while the current and voltage data recorded at 10 °C were used to construct a test set to predict and evaluate the battery SOC. Figure 7 shows the SOC estimation results of the GRU under three operating conditions at 10 °C. From Fig. 7, it can be seen that the GRU can effectively follow the real value of SOC under the condition of low temperature 10 °C, with good estimation results, and satisfy the requirement of SOC estimation accuracy.

Fig. 7
figure 7

SOC estimation results at 10℃ based on the GRU. a 18,650 battery; b 26,650 battery

Table 3 displays the estimation results of the GRU neural network under diverse temperatures and three operating conditions. As observed from Table 3, the GRU can effectively estimate the SOC of LiFePO4 batteries, with both RMSE and MAE not exceeding 4% at different temperatures. This indicates that the GRU can meet the expected accuracy requirements across diverse temperatures, demonstrating good generalization and robustness. However, the estimation results in the table show that the maximum error (MAXE) is relatively large and can reach about 6% under different operating conditions. Adjusting the hyperparameters of the GRU can lead to a slight improvement in the predictions, but with a corresponding increase in the cost of computational time. Therefore, in this study, the output of the GRU is treated as the “measured” SOC, and the UKF is employed to further minimize the errors in the SOC estimation results, thereby enhancing the robustness and stability of the SOC estimation.

Table 3 The SOC estimation error results based on GRU

SOC estimation results under different working conditions based on GRU-UKF

To enhance the robust and accuracy of SOC estimation for LiFePO4 batteries, the GRU-UKF method is put forward. The SOC estimation strategy is bifurcated into two phases. In the offline training phase, a GRU dynamic neural network is used, where the output value from the GRU is defined as the observed SOC value, replacing the measurement equation of the battery system. Meanwhile, the result obtained from the AHI method is characterized as the state value of the SOC. By combining these two SOC values, the UKF algorithm is then applied to integrate them, producing the final SOC estimate.

The 18,650 LiFePO4 batteries were selected, and experimental data were obtained at 10℃, 25 °C, and 40 °C under three different working conditions (DST, BJDST, UDDS). Figure 8 shows the SOC estimation outcomes for the 18,650 LiFePO4 battery at 25 °C. It is evident that the GRU-UKF curve shows a stable trend and is closest to the true value, followed by UKF, with GRU having the weakest estimation accuracy. The GRU-UKF achieves high-precision SOC estimation results under three operating conditions. Figure 9 shows the SOC estimation outcomes for the 18,650 LiFePO4 battery at 40 °C. It is apparent that the GRU-UKF can better capture the downward trend of the SOC, and achieve high stability under three working conditions. Figure 10 shows the SOC estimation results of the 18,650 LiFePO4 cell at a low temperature of 10 °C. It can be seen that the GRU-UKF is still closest to the real SOC at low temperature, and the curve trend is relatively smooth, obtaining good estimation results.

Fig. 8
figure 8

SOC estimation results of 18,650 LiFePO4 battery based on GRU-UKF (25 °C). a DST working condition; b BJDST working condition; c UDDS working condition

Fig. 9
figure 9

SOC estimation results of 18,650 LiFePO4 battery based on GRU-UKF (40 °C). a DST working condition; b BJDST working condition; c UDDS working condition

Fig. 10
figure 10

SOC estimation results of 18,650 LiFePO4 battery based on GRU-UKF (10 °C). a DST working condition; b BJDST working condition; c UDDS working condition

The 26,650 LiFePO4 batteries were selected, and experimental data were obtained at 10℃, 25 °C, and 40 °C under three different working conditions (DST, BJDST, UDDS). Figures 11, 12, and 13 show the SOC estimation results for the 26,650 LiFePO4 battery at 10 °C, 25 °C, and 40 °C, respectively. From Figs. 11, 12, and 13, it is noted that although the GRU can estimate the SOC, the estimation has a slightly larger deviation and exhibits fluctuations. In comparison to the GRU, the UKF is closer to the true value, while the GRU-UKF curve nearly coincides with the true value. This indicates that among the comparison of GRU, UKF, and the combined GRU-UKF algorithm, the latter demonstrates a significant advantage in SOC estimation. This indicates that GRU-UKF can achieve high-precision and robust SOC estimation results.

Fig. 11
figure 11

SOC estimation results of 26,650 LiFePO4 battery based on GRU-UKF (25 °C). a DST working condition; b BJDST working condition; c UDDS working condition

Fig. 12
figure 12

SOC estimation results of 26,650 LiFePO4 battery based on GRU-UKF (40 °C). a DST working condition; b BJDST working condition; c UDDS working condition

Fig. 13
figure 13

SOC estimation results of 26,650 LiFePO4 battery based on GRU-UKF (10 °C). a DST working condition; b BJDST working condition; c UDDS working condition

In addition, during the model training process, we find that the training of the GRU model alone takes 363 s, while the GRU model combined with UKF takes 375 s. Compared with the GRU model, the GRU-UKF model takes slightly longer and the computational cost increases accordingly, which mainly stems from the complexity of the GRU-UKF algorithm. However, in terms of SOC estimation accuracy, the GRU-UKF model has a significant improvement. Therefore, GRU-UKF achieves a high SOC estimation accuracy while maintaining a reasonable computational cost.

To provide a more precise assessment of the performance of the GRU-UKF algorithm, the RMSE, MAE, and MAXE comprehensive indicators were used for quantification. Figure 14 shows a comparison of SOC error results at 25 °C. Figure 14a represents the SOC error results for the 18,650 LiFePO4 battery at 25 °C. It can be seen that under the current and voltage dataset of the 18,650 LiFePO4 battery, the RMSE value of GRU exceeds 2%, the RMSE value of the UKF averages around 1.5%, while the proposed GRU-UKF has both RMSE and MAE values within 1%. Furthermore, under the BJDST condition, the MAXE accuracy of GRU-UKF is improved by 5.14%; under the DST condition, the RMSE of the GRU-UKF improved by 1.72%; under the UDDS condition, the MAE of the GRU-UKF algorithm improved by 1.34%.

Fig. 14
figure 14

Comparison of SOC result error between GRU algorithm and GRU-UKF algorithm (25 °C). a 18,650 LiFePO4 battery; b 26,650 LiFePO4 battery

Figure 14b represents the SOC error results of 26,650 LiFePO4 battery at 25 °C. We found that the RMSE accuracy of GRU-UKF is improved by up to 2.38%, the MAE accuracy by up to 1.85%, and the MAXE accuracy by up to 4.1% compared with the GRU method.

To validate the estimation performance of GRU-UKF at high temperatures, Fig. 15 shows the SOC error results for LiFePO4 batteries at 40°C. Figure 15a represents the SOC error results for the 18,650 battery at 40°C. It can be seen that under the BJDST condition, the MAE of GRU-UKF is only 0.32%, while the MAE of UKF is 0.73%. The MAXE accuracy of GRU-UKF is improved by 4.11%, 3.65%, and 3.12% over GRU for the three operating conditions, respectively. Figure 15b represents the SOC error results for the 26,650 battery at 40°C. It can be observed that compared to the GRU network, the GRU-UKF algorithm significantly improves the accuracy of SOC estimation across the board. This demonstrates that the GRU-UKF algorithm greatly enhances the precision and accuracy of SOC estimation, and it also highlights the temperature adaptability and robustness of GRU-UKF.

Fig. 15
figure 15

Comparison of SOC result error between GRU algorithm and GRU-UKF algorithm (40 °C). a 18,650 LiFePO4 battery; b 26,650 LiFePO4 battery

The SOC estimation performance of GRU-UKF at low temperature 10 °C is shown in Fig. 16. Figure 16a represents the SOC error results of 18,650 battery at 10 °C. It can be seen that the GRU-UKF estimation error is small, and the MAE is only 0.29% for the BJDST case. For the single network GRU, the SOC estimation is the worst. The SOC estimation accuracy of UKF is better than that of GRU, with MAXE and MAE less than 2% for all three working conditions, while the estimation accuracy of GRU-UKF is within 1%. Figure 16b represents the SOC error results for 26,650 cells at 10 °C. The SOC estimation accuracy of the GRU-UKF is significantly better than that of the GRU and UKF alone. The RMSE of the GRU-UKF is only 0.47%, the MAE is 0.36%, and the MAXE is 1.06% for the BJDST operating condition.

Fig. 16
figure 16

Comparison of SOC result error between GRU algorithm and GRU-UKF algorithm (10 °C). a 18,650 LiFePO4 battery; b 26,650 LiFePO4 battery

In order to evaluate the effectiveness of the GRU-UKF algorithm in various driving scenarios, 26,650 LiFePO4 battery was used in this study, and battery testing experiments were conducted under three different temperature conditions, namely, 10 °C, 25 °C, and 40 °C, for both federal urban driving schedule (FUDS) and United States advanced battery consortium US06 drive schedule (US06) conditions. The estimation results of SOC by the GRU-UKF algorithm are shown in Fig. 17. Figure 17a, b, and c shows the SOC estimation results at 10 °C, 25 °C, and 40 °C, respectively. It can be seen that the trends of GRU-UKF curves for FUDS case and US06 case are relatively smooth under different temperature conditions, and both of them can effectively follow the true value of SOC with obvious tracking. It can be further shown that the GRU-UKF algorithm has high accuracy and effectiveness in various driving situations.

Fig. 17
figure 17

SOC estimation results. a FUDS and US06(10℃); b FUDS and US06 (25℃); c FUDS and US06 (40℃)

In order to evaluate the validity of GRU-UKF in depth, Table 4 shows the comparison of the errors at different temperatures, FUDS and US06 operating conditions. The comparison results show that the estimation accuracy of GRU-UBF is very high, with the RMSE and MAE less than 1% for all three temperatures and two operating conditions, and the MAXE not exceeding 1.35% at maximum. This demonstrates the effectiveness of the GRU-UBF algorithm in various driving scenarios.

Table 4 Comparison of errors

In summary, we can find that compared to the GRU neural network, the GRU-UKF-combined algorithm has very high accuracy in SOC estimation under different temperatures and working conditions, with RMSE and MAE within 1%. This combined algorithm effectively suppresses errors under different temperatures, exhibiting high precision and robustness.

Conclusion

In this study, to improve the accuracy and robustness for the SOC estimation of LIBs, a closed-loop method based on machine learning and Kalman filtering is proposed. Firstly, the gate recurrent unit network is utilized to establish the offline training model. Then, the unscented Kalman filtering is introduced to obtain the online estimation. Finally, the effectiveness and accuracy of the combined GRU and UKF methods are verified at two temperatures and different operating conditions. The main contributions are summarized as follows:

  1. (1)

    Experiments were conducted on 18,650 and 26,650 LiFePO4 batteries at 10℃, 25℃, and 40 °C, using different working conditions (BJDST, DST, and UDDS).

  2. (2)

    A closed-loop method based on machine learning and Kalman filtering is proposed. The GRU is utilized to capture complex nonlinear patterns for preliminary estimation of SOC, and then UKF is introduced to provide stable online adjustment thereby achieving accurate and stable SOC estimation.

  3. (3)

    By comparing with a single GRU neural network under different working conditions and temperatures, confirming that the SOC estimation results achieved by the proposed method have high accuracy and strong robustness, with both RMSE and MAE values within 1%.