In the realm of energy storage, lithium-ion batteries stand as a pivotal technology, driving advancements across various sectors due to their high energy density, lightweight design, and environmental adaptability. The accurate estimation of the State of Charge (SOC) for lithium-ion batteries is crucial for ensuring the safety and efficiency of systems such as electric vehicles and grid storage. However, traditional SOC estimation methods often struggle with issues like insufficient accuracy, error accumulation, and poor robustness under complex operating conditions. To address these challenges, I propose a novel approach based on a Closed-Loop Nonlinear Autoregressive eXogenous (CL-NARX) neural network. This model enhances the fitting capability for the nonlinear dynamics of lithium-ion batteries by incorporating a closed-loop feedback mechanism, effectively mitigating error propagation and improving robustness through optimized hyperparameters. In this article, I will detail the methodology, experimental setup, and results, demonstrating the superior performance of the CL-NARX model in SOC estimation for lithium-ion batteries.
The importance of lithium-ion batteries in modern energy systems cannot be overstated. As a key component in applications ranging from portable electronics to electric vehicles, lithium-ion batteries offer significant advantages over traditional alternatives like lead-acid batteries, including higher voltage output, better temperature tolerance, and longer cycle life. However, the inherent nonlinearity and sensitivity of lithium-ion batteries to factors such as temperature, aging, and load variations make SOC estimation a complex task. SOC, defined as the ratio of remaining capacity to nominal capacity, is essential for battery management systems (BMS) to prevent overcharge or deep discharge, thereby extending battery life and ensuring operational safety. Existing SOC estimation methods include ampere-hour integration, data-driven approaches, model-based techniques, and hybrid methods. While each has its merits, they often fall short in handling the dynamic and nonlinear behavior of lithium-ion batteries under real-world conditions. For instance, data-driven methods like neural networks can model complex relationships without explicit physical models, but they may suffer from overfitting or lack adaptability. Model-based methods, such as those using Kalman filters, rely on accurate battery models, which can be difficult to parameterize. Thus, there is a pressing need for advanced techniques that combine accuracy, robustness, and adaptability for lithium-ion battery SOC estimation.

The core of my approach lies in the CL-NARX neural network, which leverages a closed-loop feedback structure to enhance SOC estimation for lithium-ion batteries. The NARX model is a dynamic neural network that incorporates exogenous inputs and autoregressive feedback, making it suitable for time-series prediction. In its standard form, the NARX model relates the output at time \( t \) to past inputs and outputs, expressed as: $$y(t) = F[x(t), x(t-\Delta t), \ldots, x(t-n\Delta t), y(t), y(t-\Delta t), \ldots, y(t-m\Delta t)]$$ where \( n \) and \( m \) are the input and output delay orders, respectively. For SOC estimation in lithium-ion batteries, this allows the model to capture temporal dependencies in voltage and current measurements. However, to improve robustness and reduce error accumulation, I implement a closed-loop version, where the estimated output is fed back as input during prediction: $$\hat{y}(t) = F[x(t), x(t-\Delta t), \ldots, x(t-n\Delta t), \hat{y}(t), \hat{y}(t-\Delta t), \ldots, \hat{y}(t-m\Delta t)]$$ This closed-loop mechanism enables the model to self-correct and adapt to dynamic changes in lithium-ion battery behavior, which is critical for accurate SOC tracking under varying loads and temperatures.
Data preprocessing is a vital step to ensure the effectiveness of the neural network. Given that input features such as voltage and current may have different scales, normalization is applied to transform the data into a uniform range, typically [0, 1]. This is done using the min-max normalization formula: $$x_i’ = \frac{x_i – x_{\text{min}}}{x_{\text{max}} – x_{\text{min}}}$$ where \( x_{\text{min}} \) and \( x_{\text{max}} \) are the minimum and maximum values of the input data, respectively. This preprocessing enhances the convergence speed and stability of the network training for lithium-ion battery SOC estimation. The normalized data includes voltage, current, and corresponding SOC values, which are split into training and validation sets—typically 70% for training and 30% for testing—to evaluate model generalization.
The architecture of the CL-NARX neural network consists of an input layer, hidden layers, and an output layer. The hidden layer employs nonlinear activation functions to model the complex relationships in lithium-ion battery data. Specifically, the output \( y_t \) is computed as: $$y_t = \Phi \left[ \beta_0 + \sum_{i=1}^q \beta_i h_{it} \right]$$ where \( \Phi \) is the output activation function (often linear), \( \beta_0 \) and \( \beta_i \) are biases and weights, and \( h_{it} \) is the hidden layer output. The hidden layer output is given by: $$h_{it} = \Psi \left[ \gamma_{i0} + \sum_{j=1}^n \gamma_{ij} x_{jt} + \sum_{r=1}^q \delta_{ir} h_{r,t-1} \right]$$ Here, \( \Psi \) is the hidden layer activation function, commonly the sigmoid function: $$\Psi(t) = \frac{1}{1 + e^{-t}}$$ The terms \( \gamma_{i0} \), \( \gamma_{ij} \), and \( \delta_{ir} \) represent biases and weights for inputs and feedback connections. This structure allows the network to incorporate past states through the feedback term \( \sum_{r=1}^q \delta_{ir} h_{r,t-1} \), enhancing its ability to capture the dynamic behavior of lithium-ion batteries. For the closed-loop configuration, during the estimation phase, the predicted SOC values are used as feedback inputs, enabling real-time adjustment and reducing cumulative errors.
To evaluate the performance of the SOC estimation model for lithium-ion batteries, I use several statistical metrics. These include the Root Mean Square Error (RMSE), Mean Absolute Error (MAE), and Mean Absolute Percentage Error (MAPE), defined as follows: $$\text{RMSE} = \sqrt{\frac{1}{N} \sum_{i=1}^N (Y_i – \hat{Y}_i)^2}$$ $$\text{MAE} = \frac{1}{N} \sum_{i=1}^N |Y_i – \hat{Y}_i|$$ $$\text{MAPE} = \frac{1}{N} \sum_{i=1}^N \left| \frac{Y_i – \hat{Y}_i}{Y_i} \right| \times 100\%$$ where \( Y_i \) is the true SOC value, \( \hat{Y}_i \) is the estimated SOC value, and \( N \) is the number of samples. These metrics provide a comprehensive assessment of accuracy and robustness for lithium-ion battery SOC estimation.
The experimental setup involves a battery testing platform to validate the CL-NARX model for lithium-ion battery SOC estimation. I utilize a BTS200-100-104 battery test system from Yakeyuan Technology Co., Ltd., coupled with a ternary polymer lithium-ion battery (LiFePO₄, 70 Ah) from Shenzhen Lizhixin Technology Co., Ltd. The key parameters of the lithium-ion battery are summarized in Table 1.
| Parameter | Value |
|---|---|
| Rated Voltage | 3.7 V |
| Nominal Capacity | 70 Ah |
| Nominal Current | 0.2 C |
| Charge/Discharge Cut-off Voltage | 4.25 V / 3.00 V |
| Maximum Charge/Discharge Current | 7 A |
| Internal Resistance | 0.6 mΩ |
| Dimensions (Thickness × Width × Height) | 40 mm × 98 mm × 148 mm |
| Weight | 1.25 kg |
Experiments are conducted under a constant temperature of 25°C to control environmental effects on the lithium-ion battery. Three operational conditions are used: Constant Current-Constant Voltage (CCCV) cycles, Dynamic Stress Test (DST), and Beijing Bus Dynamic Stress Test (BBDST). The CCCV cycles provide baseline data for regular charge-discharge patterns, while DST and BBDST simulate complex dynamic loads typical in real-world applications, such as electric vehicles. The dataset is divided into training and testing subsets, with 70% for training the CL-NARX model and 30% for validation. All simulations are performed in MATLAB 2021 on a Windows 10 system with an AMD R6-2600 processor and GTX 1660 GPU to ensure computational efficiency.
Hyperparameter optimization is critical for maximizing the performance of the CL-NARX neural network in lithium-ion battery SOC estimation. I investigate the impact of training epochs, number of hidden neurons, input delay layers, and output delay layers. The training uses DST data, and testing is done on BBDST data to assess generalization. Table 2 shows the training and validation errors for different training epochs, highlighting that an epoch count of 150 yields optimal results with low RMSE and MAE, beyond which overfitting occurs.
| Epochs | Time (s) | Training RMSE (%) | Training MAE (%) | Testing RMSE (%) | Testing MAE (%) |
|---|---|---|---|---|---|
| 25 | 60 | 0.95 | 0.49 | 1.44 | 0.93 |
| 50 | 121 | 0.81 | 0.41 | 1.41 | 0.94 |
| 100 | 242 | 0.36 | 0.23 | 1.08 | 0.68 |
| 150 | 363 | 0.26 | 0.16 | 0.98 | 0.54 |
| 200 | 486 | 0.36 | 0.25 | 1.10 | 0.71 |
| 300 | 717 | 0.09 | 0.06 | 1.00 | 0.34 |
| 400 | 960 | 0.18 | 0.12 | 2.40 | 1.86 |
| 500 | 1200 | 0.23 | 0.16 | 2.64 | 1.41 |
| 800 | 1929 | 0.13 | 0.09 | 2.86 | 2.08 |
| 1000 | 2398 | 0.13 | 0.09 | 8.28 | 5.07 |
Next, I analyze the effect of hidden neurons on lithium-ion battery SOC estimation. As shown in Table 3, a hidden neuron count of 10 provides the best balance, with testing RMSE and MAE of 1.18% and 0.73%, respectively. Fewer neurons limit model capacity, while more neurons increase complexity and risk overfitting.
| Hidden Neurons | Training RMSE (%) | Training MAE (%) | Testing RMSE (%) | Testing MAE (%) |
|---|---|---|---|---|
| 5 | 0.33 | 0.24 | 1.17 | 0.70 |
| 7 | 0.37 | 0.26 | 1.11 | 0.70 |
| 9 | 0.37 | 0.26 | 1.33 | 0.64 |
| 10 | 0.28 | 0.17 | 1.18 | 0.73 |
| 11 | 0.34 | 0.23 | 1.26 | 0.82 |
| 13 | 0.32 | 0.21 | 1.32 | 0.82 |
| 15 | 0.15 | 0.10 | 1.50 | 1.04 |
The influence of delay layers is also examined for lithium-ion battery SOC estimation. Tables 4 and 5 present results for input and output delay layers, respectively. For input delays, a setting of 5 layers minimizes testing errors (RMSE: 1.17%, MAE: 0.61%), as shown in Table 4. For output delays, 2 layers are optimal, with higher layers degrading performance due to excessive feedback noise, as indicated in Table 5.
| Delay Layers (Input-Output) | Time (s) | Training RMSE (%) | Training MAE (%) | Testing RMSE (%) | Testing MAE (%) |
|---|---|---|---|---|---|
| 2-2 | 55 | 0.53 | 0.33 | 1.30 | 0.83 |
| 3-2 | 195 | 0.41 | 0.23 | 1.18 | 0.74 |
| 4-2 | 211 | 0.32 | 0.23 | 1.18 | 0.74 |
| 5-2 | 224 | 0.30 | 0.21 | 1.17 | 0.61 |
| 6-2 | 234 | 0.51 | 0.31 | 1.34 | 0.86 |
| 7-2 | 256 | 0.67 | 0.37 | 1.49 | 0.94 |
| 8-2 | 271 | 0.75 | 0.40 | 1.67 | 1.08 |
| Delay Layers (Input-Output) | Time (s) | Training RMSE (%) | Training MAE (%) | Testing RMSE (%) | Testing MAE (%) |
|---|---|---|---|---|---|
| 2-2 | 55 | 0.53 | 0.33 | 1.30 | 0.83 |
| 2-3 | 70 | 0.69 | 0.42 | 1.24 | 0.79 |
| 2-4 | 136 | 0.54 | 0.38 | 1.49 | 0.95 |
| 2-5 | 160 | 0.54 | 0.33 | 1.22 | 0.80 |
| 2-6 | 174 | 0.67 | 0.41 | 1.86 | 1.09 |
| 2-7 | 256 | 15.15 | 11.25 | 11.43 | 10.03 |
| 2-8 | 205 | 26.90 | 19.75 | 18.82 | 13.34 |
Based on these analyses, the optimal hyperparameters for the CL-NARX model in lithium-ion battery SOC estimation are: training epochs = 150, hidden neurons = 10, input delay layers = 5, and output delay layers = 2. This configuration achieves a testing RMSE of 1.17% and MAE of 0.61%, demonstrating effective error control and robustness for lithium-ion batteries.
To validate the superiority of the CL-NARX model, I compare it with other neural network models commonly used for lithium-ion battery SOC estimation: Elman Neural Network (Elman), Backpropagation Neural Network (BP), and Feedforward Neural Network (FNN). These models are configured with optimized parameters, as detailed in Table 6, to ensure a fair comparison under the same experimental conditions for lithium-ion battery data.
| Model | Network Structure | Activation Functions | Learning Rate | Training Epochs | Training Algorithm |
|---|---|---|---|---|---|
| Elman | Input layer (voltage, current) → Hidden layer (5 neurons) → Output layer (1 neuron) | Hidden: tansig; Output: purelin | 0.0001 | 1000 | Gradient Descent |
| BP | Input layer (voltage, current) → Hidden layer (5 neurons) → Output layer (1 neuron) | Hidden: logsig; Output: purelin | 0.0001 | 1000 | Gradient Descent |
| FNN | Input layer (voltage, current) → Hidden layer 1 (6 neurons) → Hidden layer 2 (5 neurons) → Output layer (1 neuron) | Hidden: logsig; Output: purelin | 0.0001 | 1000 | Gradient Descent |
The performance evaluation is conducted using CCCV cycle data for lithium-ion battery SOC estimation. The results, summarized in Table 7, show that the CL-NARX model outperforms all others with the lowest errors. Specifically, it achieves a maximum error of 2.58%, RMSE of 1.41%, MAE of 1.36%, and MAPE of 4.57%. In contrast, Elman, BP, and FNN exhibit higher errors, indicating their limitations in handling the nonlinear dynamics of lithium-ion batteries. For instance, Elman has a maximum error of 6.93%, BP of 5.46%, and FNN of 5.03%. The CL-NARX model’s closed-loop feedback effectively suppresses error accumulation, leading to more stable and accurate SOC estimates for lithium-ion batteries across varying conditions.
| Model | Maximum Error (%) | RMSE (%) | MAE (%) | MAPE (%) |
|---|---|---|---|---|
| CL-NARX | 2.58 | 1.41 | 1.36 | 4.57 |
| Elman | 6.93 | 3.20 | 2.50 | 8.90 |
| BP | 5.46 | 2.80 | 2.10 | 7.10 |
| FNN | 5.03 | 2.60 | 1.95 | 6.80 |
The effectiveness of the CL-NARX model can be attributed to its ability to leverage historical data through delay layers and self-correct via feedback, which is essential for lithium-ion battery SOC estimation under dynamic loads. Unlike traditional methods, which may rely on simplistic assumptions or suffer from noise sensitivity, the CL-NARX network adapts to the complex electrochemical behavior of lithium-ion batteries. For example, during rapid current fluctuations in DST or BBDST conditions, the model maintains low error levels, whereas other networks show significant deviations. This robustness is crucial for real-world applications where lithium-ion batteries experience unpredictable operating environments.
In terms of computational efficiency, the CL-NARX model requires moderate training time—around 224 seconds for the optimal configuration—which is acceptable given its high accuracy for lithium-ion battery SOC estimation. The use of normalized data and optimized hyperparameters further enhances convergence speed. Moreover, the model’s architecture allows for easy integration into battery management systems, providing real-time SOC updates that can improve the safety and longevity of lithium-ion batteries in electric vehicles and energy storage systems.
Looking ahead, there are several avenues for enhancing the CL-NARX approach for lithium-ion battery SOC estimation. Future work could explore adaptive learning algorithms to dynamically adjust hyperparameters based on battery aging or temperature changes. Additionally, incorporating multi-physics constraints, such as thermal effects or mechanical stress, could further improve accuracy for lithium-ion batteries under extreme conditions. Hybrid methods that combine CL-NARX with model-based techniques like Kalman filters may also yield synergistic benefits, offering both data-driven flexibility and model-based reliability for lithium-ion battery SOC estimation. Another direction is to extend the model to estimate other battery states, such as State of Health (SOH) or State of Power (SOP), leveraging the same neural network framework for comprehensive lithium-ion battery management.
In conclusion, the CL-NARX neural network presents a robust and accurate solution for SOC estimation in lithium-ion batteries. By integrating a closed-loop feedback mechanism and optimizing key hyperparameters, the model effectively addresses the challenges of error accumulation and dynamic adaptability that plague traditional methods. Experimental results under CCCV, DST, and BBDST conditions demonstrate its superiority over other neural networks, with error metrics significantly reduced. This advancement not only contributes to the academic field of lithium-ion battery management but also has practical implications for enhancing the safety and efficiency of energy storage systems. As lithium-ion batteries continue to evolve, innovative approaches like CL-NARX will play a vital role in unlocking their full potential across diverse applications.
