1. Introduction
With the development of renewable energy systems and electric transportation technologies, battery energy storage systems have been increasingly deployed in large-scale renewable-energy integration, frequency regulation, and other grid-support services [
1,
2]. Against this background, sodium-ion batteries have attracted growing attention because of their abundant resources, low cost, and favorable rate performance [
3,
4]. As a key state variable of the battery management system (BMS), the state of charge (SOC) provides an important basis for energy management, power allocation, driving-range evaluation, and overcharge/overdischarge protection [
5]. Therefore, accurate online SOC estimation for sodium-ion batteries under complex operating conditions is of great significance for practical BMS applications.
Existing SOC estimation methods can generally be classified into three categories: direct measurement methods, data-driven methods, and model-driven methods [
6]. Direct measurement methods are simple to implement, but the ampere-hour integration method is prone to cumulative errors [
7,
8], while the open-circuit voltage method relies on long rest periods and is, therefore, difficult to apply under dynamic operating conditions [
9]. Data-driven methods exhibit strong nonlinear fitting capability [
10,
11]. Chen et al. [
12] proposed a multi-output fusion algorithm based on deep network migration for joint SOC and SOE estimation, in which transfer learning was introduced to improve estimation accuracy and robustness under varying temperatures, aging conditions, and noise disturbances. Yi et al. [
13] developed a Time Series Transformer with a De-noise De-stationary Inception Network for SOC estimation, showing the potential of transformer-based sequence modeling in capturing long-term temporal dependencies of battery signals. Nevertheless, these methods still depend heavily on high-quality training data and remain limited in operating-condition transferability, generalization capability, and real-time deployment [
14]. By contrast, model-driven methods provide a better balance among estimation accuracy, computational complexity, and engineering feasibility, making them more suitable for real-time onboard and energy-storage BMS applications [
15].
Model-driven SOC estimation depends on the accurate characterization of battery voltage dynamics. Compared with electrochemical mechanism models, equivalent circuit models (ECMs) have become a mainstream approach for engineering-oriented SOC estimation because of their simple structure, convenient parameter identification, and low computational complexity [
16,
17]. Among ECM-based SOC estimation methods, the extended Kalman filter (EKF) has been widely adopted because it can address the nonlinear characteristics of batteries through linearization [
18,
19]. However, in the conventional EKF, the process noise covariance matrix Q and the measurement noise covariance matrix R are usually treated as constants, making it difficult to accommodate noise variations caused by changing operating conditions and sensor drift, which, in turn, may degrade convergence and robustness [
20,
21]. Therefore, the adaptive extended Kalman filter has gradually become a research focus. Related improvements mainly include the introduction of online parameter identification and forgetting-factor mechanisms as well as adaptive adjustment of noise covariance matrices and robust statistical criteria to enhance estimation stability and accuracy under complex operating conditions [
22,
23,
24,
25].
Although adaptive extended Kalman filtering methods have demonstrated relatively high SOC estimation accuracy under ideal simulation conditions, their engineering application to sodium-ion batteries is still constrained by two factors. First, sodium-ion batteries typically exhibit a pronounced voltage plateau over the intermediate SOC range, where the slope of the open-circuit voltage (OCV)–SOC curve is relatively small. This weakens the corrective effect of measurement information on the state update, such that even slight fluctuations in the sampling chain may alter the Kalman gain and, consequently, induce abrupt changes in SOC estimation [
26]. Second, practical embedded systems are generally subject to physical hardware constraints, including limited sampling accuracy, quantization errors, communication delays, and environmental noise, which often lead to significant performance degradation when the algorithm is transferred from the theoretical environment to the physical execution environment [
27].
In recent years, hardware-in-the-loop (HIL) technology has gradually become an important means of bridging theoretical algorithms and engineering applications, as it incorporates hardware links such as sampling, communication, execution, and control into a unified validation framework [
28,
29]. In the field of battery applications, Suti et al. [
30] established a HIL test platform for a commercial passive balancing BMS to verify its functions under typical operating conditions. Le et al. [
31] developed a lithium-ion battery SOC estimation method based on a second-order Thevenin model and an adaptive unscented Kalman filter and employed a HIL platform to jointly validate online parameter identification and the SOC estimation process. Zhang et al. [
32] proposed a joint estimation method for lithium-ion battery pack SOC and state of energy based on adaptive H-infinity filtering and real-time parameter identification, and further, established a HIL platform to comparatively evaluate its estimation accuracy and robustness. However, these studies have mainly focused on functional verification, control feasibility, or algorithm operability, while few have quantitatively examined how the physical constraints of the hardware sampling chain affect SOC estimation accuracy and how such effects propagate from theoretical evaluation to practical execution.
Apart from hardware deployment validation, the source of evaluation data is also a key factor affecting the effectiveness of algorithm validation. Owing to limitations in testing cost, experimental duration, and operating-condition coverage, large-scale dynamic measured data are often difficult to obtain [
33]. Therefore, the use of model-generated data for algorithm validation is of practical significance. Existing studies have proposed various data-generation methods for SOC estimation algorithms. Channegowda et al. [
34] proposed a deep learning-based method for generating high-fidelity and diverse synthetic battery datasets. Chianese et al. [
35] proposed a data-generation method based on an electrothermal model. Hou et al. [
36] proposed a data-generation method that integrates an equivalent circuit model with a neural network model. Ramshankar et al. [
37] further explored the integrated application of digital twin technology in state estimation. However, it remains unclear whether, when used for SOC estimation algorithm performance evaluation under complex operating conditions, ECM-generated data can produce error-evolution patterns consistent with those obtained from measured data and thereby support rapid performance assessment in engineering deployment-oriented scenarios.
To address the above issues, this paper proposes a heterogeneous adaptive extended Kalman filter (HAEKF) for SOC estimation of sodium-ion batteries under complex operating conditions. Particle swarm optimization (PSO) is employed to optimize the key hyperparameters. A HIL validation framework is also established to reproduce the constraints of a practical BMS hardware sampling chain. Within this framework, the degradation in estimation performance from theoretical evaluation to practical hardware execution is systematically analyzed. In addition, measured and ECM-generated FUDS data are comparatively analyzed to assess whether ECM-generated data can serve as a feasible source for SOC estimation algorithm validation. The main contributions of this paper are summarized as follows:
A HAEKF-based SOC estimation method is developed for sodium-ion batteries to address the weak observability caused by the pronounced voltage plateau over the intermediate SOC range. This method integrates an OCV–SOC–slope-based measurement-noise regulation mechanism with the Sage–Husa posterior correction scheme. In this method, the OCV–SOC slope characterizes observability variation, while the voltage residual reflects state-prediction uncertainty, thereby enabling heterogeneous adaptive regulation of the measurement and process noise covariance matrices. Meanwhile, PSO is employed to globally optimize the key hyperparameters, thus improving SOC estimation accuracy and plateau-region robustness under complex operating conditions.
A HIL validation platform applicable to full-cell battery systems is established by incorporating key hardware links, including sampling, communication, control, and execution, thereby reproducing practical BMS hardware sampling-chain constraints and enabling quantitative evaluation of the degradation in estimation performance from theoretical evaluation to practical hardware execution.
A comparative analysis is conducted using measured and ECM-generated FUDS data. It examines whether ECM-generated data can reproduce the SOC-estimation-error evolution trends obtained with measured data. The analysis further evaluates whether such data can serve as a feasible source for SOC estimation algorithm performance evaluation and rapid validation.
The remainder of this paper is organized as follows.
Section 2 presents battery modeling.
Section 3 details the design of the proposed HAEKF algorithm with PSO-based hyperparameter optimization.
Section 4 reports the experiments conducted on the HIL platform and discusses the corresponding results.
Section 5 concludes the paper.
2. Battery Modeling
Accurate battery modeling is essential not only for SOC estimation but also for assessing the validity of ECM-generated data. Therefore, before developing the estimation algorithm and conducting data-source validation, a model capable of reproducing the battery’s dynamic behavior must first be established and verified.
2.1. Selection of the Equivalent Circuit Model
Sodium-ion batteries exhibit pronounced polarization dynamics and nonlinear voltage responses during charge and discharge. For engineering-oriented SOC estimation, the battery model should reproduce terminal-voltage variations under dynamic operating conditions while maintaining low parameterization complexity and real-time implementability. Common equivalent circuit models include the Rint model, the Thevenin model, the PNGV model, and higher-order RC network models [
38]. The Rint model is simple but cannot adequately capture polarization behavior. The Thevenin and PNGV models improve transient fitting, but they require more parameters and higher computational cost. Although higher-order RC network models can describe dynamic responses in greater detail, their strong parameter coupling and implementation cost limit their suitability for online estimation and hardware-oriented validation [
39].
Considering model accuracy, parameter identification difficulty, and the requirements of online SOC estimation and real-time HIL operation, a second-order ECM is selected in this paper. While maintaining low computational complexity, it can effectively characterize the ohmic internal resistance effect and polarization behavior over different time scales, thus achieving a practical balance between estimation accuracy and engineering feasibility. The structure of the adopted second-order ECM is shown in
Figure 1.
According to Kirchhoff’s voltage and current laws, the mathematical equations of the second-order ECM can be expressed as follows:
where
denotes the open-circuit voltage,
denotes the terminal voltage,
denotes the operating current of the battery, and
denotes the ohmic internal resistance.
and
represent the electrochemical polarization resistance and capacitance, respectively, whereas
and
represent the concentration polarization resistance and capacitance, respectively.
and
denote the polarization voltages across the two RC branches, respectively.
2.2. Model Parameter Identification Based on Genetic Algorithm
A 200 Ah prismatic sodium-ion battery is selected as the test object. The experimental platform, shown in
Figure 2, consists of a charge–discharge tester, a temperature chamber, a host computer, and the battery under test. Current and voltage data are collected by an Arbin BT2000 test system with a sampling interval of 1 s.
In this paper, the hybrid pulse power characterization (HPPC) test is employed to obtain the dynamic data required for model parameterization over the SOC range of 10–90%. At each 10% SOC interval, charge–discharge current pulses are applied, and the corresponding terminal-voltage response is recorded.
After each pulse test, the battery is allowed to rest for 30 min to reduce polarization effects from which the open-circuit voltage corresponding to the given SOC point is obtained. The experimental current profile and terminal-voltage response are shown in
Figure 3a, whereas the resulting OCV–SOC relationship is shown in
Figure 3b.
To identify the parameters of the second-order ECM at different SOC levels, a genetic algorithm is employed to optimize the parameter vector , where denotes the ohmic internal resistance, and denote the polarization resistances, and and denote the time constants of the two RC branches, respectively. The genetic algorithm is adopted here because it can search a relatively large parameter space and reduce the dependence of the identification results on initial values, which is advantageous for the nonlinear and strongly coupled parameter identification problem of the second-order ECM.
For each SOC point and current direction, an initial population is randomly generated. The model terminal voltage is calculated from the current parameter set, and the mean-squared error between the calculated and measured voltages is used as the fitness function. The population is then updated through selection, crossover, and mutation until the stopping criterion is met. Mutation is retained to alleviate premature convergence and maintain population diversity. The detailed GA procedure is given in Algorithm 1, the corresponding settings are listed in
Table 1, and the identified parameters under charge and discharge conditions at 25 °C are shown in
Figure 4.
| Algorithm 1: Genetic algorithm-based parameter identification |
1: Input: HPPC test data segmented by SOC points and current directions , each with data length . 2: Input: GA parameters: maximum generations , population size , crossover probability , mutation probability , and parameter search bounds. 3: Step 1: Initialization. 4: for each SOC point do 5: for each current direction do 6: Generate initial population of individual . 7: Step 2: Fitness evaluation. 8: Compute model terminal voltage . 9: Calculate MSE fitness . 10: Step 3: GA optimization loop. 11: for generation to do 12: Evaluate fitness for each individual . 13: Perform selection, crossover, and mutation to generate offspring. 14: Update population for the next generation. 15: end for 16: Extract best individual , compute , . 17: Record the identified parameters for current and . 18: end for 19: end for 20: Output: Optimal parameter sets for all SOC points under charge and discharge conditions. |
2.3. Model Validation Under Dynamic Operating Conditions
In this paper, the ECM is established not only as the voltage observation model for EKF-based SOC correction, but also as the basis for generating terminal-voltage sequences to evaluate SOC estimation performance under dynamic operating conditions. Therefore, an FUDS test is conducted under the same experimental conditions to verify whether the established second-order ECM can accurately reproduce the dynamic terminal-voltage characteristics of the battery.
The measured FUDS current is used as the model input, and the terminal-voltage response is calculated using the parameters identified in
Section 2.2.
Figure 5 compares the simulated and measured terminal voltages and shows the corresponding voltage error. The model can still track the terminal-voltage trajectory well under transient current fluctuations. The root-mean-square error (RMSE), mean absolute error (MAE), and maximum absolute error (MaxAE) are 5.97 mV, 4.35 mV, and 33.89 mV, respectively, indicating that the overall modeling error remains within a relatively small range.
Notably, the fitting error becomes more pronounced in the latter half of the FUDS profile. This is because the battery gradually enters the low-SOC region, where the voltage dynamics become more nonlinear, and the parameters identified at discrete SOC points and extended over the full SOC range through interpolation cannot fully characterize the local dynamic behavior. Under such conditions, a weighted fitness function may further improve the fitting performance.
Overall, these results demonstrate that the established second-order ECM can reproduce the dynamic voltage behavior of the battery with sufficient accuracy, thereby providing a reliable basis for the subsequent SOC estimation method and for model-based operating-condition data generation.
3. PSO-Based HAEKF Algorithm
To address the degraded observability in the voltage plateau region and the state-prediction uncertainty under complex operating conditions, a PSO-based HAEKF framework is proposed in this paper. As shown in
Figure 6, the proposed framework constructs a multi-layer collaborative architecture composed of a parameter optimization layer, a heterogeneous adaptive layer, and an EKF estimation layer. By integrating battery characteristic information with online noise statistical information, this framework achieves dynamic regulation of noise statistical characteristics and coordinated optimization of the estimation process through the interactions among parameter optimization, adaptive regulation, and state estimation, thereby improving the accuracy, stability, and robustness of SOC estimation under complex operating conditions.
3.1. EKF-Based SOC Estimation
Based on the second-order ECM determined in
Section 2,
and the polarization voltages
and
are selected as the system state variables. The system state vector is defined as
, the current is selected as the system input
, and the battery terminal voltage is selected as the system observation
. Considering the significant nonlinear characteristics of the battery system, the general form of the discrete state-space equations can be written as follows:
where
denotes the process noise and
denotes the measurement noise.
In the battery model considered in this paper,
is a linear function, whereas
is nonlinear because it involves the nonlinear mapping relationship between OCV and SOC. To apply the EKF,
is expanded by first-order Taylor series about the a priori state estimate
, and by neglecting higher-order terms, the following approximation is obtained,
where
denotes the Jacobian matrix of the observation function evaluated at
.
By combining the continuous-time differential equations of the second-order ECM and applying the zero-order hold discretization method under the sampling period
, the discrete parameter matrices of the model can be further derived. Specifically, the system state transition matrix
, control input matrix
, linearized observation matrix
, and feedthrough matrix
are given as follows:
where
denotes the time constant of the
th-order RC network, and
denotes the rated capacity of the battery.
Accordingly, the complete discrete state-space model of the second-order ECM can be written as
where the observation function
can be further expressed as
Based on the above discrete state-space model of the second-order equivalent circuit, the EKF can then be employed for SOC estimation. The initial estimate of the system state vector at the initial instant is set as
, and the initial error covariance matrix is set as
. Meanwhile, according to the system modeling error and external disturbance characteristics, the process noise covariance matrix
and the measurement noise covariance matrix
are specified. At the discrete time step
, the recursive procedure of the EKF mainly consists of two stages, namely, state prediction and measurement correction, and the detailed flow is shown in
Figure 7.
3.2. Heterogeneous Adaptive Mechanism
In the proposed HAEKF, two heterogeneous adaptive updates are introduced to address the time-varying uncertainty under complex operating conditions. Specifically, the measurement noise covariance matrix is regulated according to the OCV–SOC slope to account for observability variation over different SOC intervals, while the process noise covariance matrix is updated using the voltage residual through the Sage–Husa scheme to reflect state-prediction uncertainty. These two adaptive paths jointly rebalance the relative weights of model prediction and measurement correction.
3.2.1. Adaptive Adjustment of the Matrix Based on the OCV–SOC Slope
To address the weakened observation correction capability caused by the small OCV–SOC slope in the voltage plateau region, an OCV-slope-based adaptive regulation strategy for the measurement noise covariance matrix is introduced as follows,
where
denotes the adapted measurement noise covariance matrix, and
denotes the baseline sampling-noise level of the hardware measurement chain. In this paper,
is set to 0.002, according to the overall voltage sampling error level of the hardware system.
is the tuning coefficient used to linearly scale the contribution of the slope to the observation weighting.
denotes the absolute value of the first derivative of the open-circuit voltage with respect to SOC. The constant 0.005 is introduced as a limiting term to prevent the denominator from becoming excessively small when the OCV–SOC slope approaches zero in the plateau region, thereby maintaining numerical stability. These two terms provide only the basic scaling and limiting settings, while the final adaptive measurement-noise covariance is jointly determined with the PSO-optimized coefficient
.
This strategy uses the OCV–SOC slope to characterize the variation in observability over different SOC intervals. In the voltage plateau region, the small slope implies weak voltage sensitivity to SOC variation; accordingly, is increased to reduce the Kalman gain and prevent over-reliance on weakly informative voltage measurements. In regions with a larger slope, decreases accordingly, allowing the filter to place greater trust in measurement correction. In this manner, the balance between model prediction and measurement correction can be adaptively adjusted across different SOC intervals, thereby improving estimation stability in the plateau region as well as the overall estimation accuracy.
3.2.2. Adaptive Adjustment of the Matrix Based on the Sage–Husa Scheme
Because the prediction uncertainty of the battery model varies with operating conditions, a fixed process noise covariance matrix
cannot adequately reflect the time-varying uncertainty in the state prediction process. To address this issue, a Sage–Husa-based update scheme is introduced to adapt
online using the voltage residual, and the update equation is given by
where
denotes the updated process noise covariance matrix at time
;
denotes the Kalman gain;
denotes the residual between the measured voltage and the predicted voltage; and
is the dynamic forgetting factor, which is calculated as
where
is the base forgetting factor used to control the relative weight between the estimate at the previous time step and the current residual information during the updating process of
. By adjusting the value of
, the stability of the update and the response speed to error variations can be tuned.
This strategy realizes online adaptive correction of the process noise covariance matrix through the observation residual. An increase in the residual indicates that the inconsistency between the model prediction and the actual measurement is becoming larger, implying an increase in state-prediction uncertainty. Under this condition, is correspondingly increased so that the filter becomes more responsive to measurement correction. In contrast, when the residual remains relatively small, the updating magnitude of is reduced to avoid unnecessary fluctuations and to maintain estimation stability. Through this adaptive update mechanism, the algorithm can dynamically characterize the time-varying uncertainty of the prediction process and promptly adjust the filtering behavior when model mismatch occurs, thereby improving the tracking performance and robustness of SOC estimation under complex operating conditions.
3.3. Hyperparameter Optimization of the HAEKF Algorithm Based on PSO
To determine the key hyperparameters of the proposed heterogeneous adaptive mechanism, a PSO algorithm is employed to jointly optimize the forgetting factor and the tuning coefficient in the offline stage.
PSO performs iterative global search in a two-dimensional hyperparameter space through particle information sharing and position updating. At the
t-th iteration, the velocity and position of the
i-th particle are updated as follows:
where
and
denote the velocities of particle
at the (
t + 1)-th and
t-th iterations, respectively;
denotes the current position of the particle;
denotes the updated particle position;
is the inertia weight;
and
are the cognitive and social learning factors, respectively;
and
are random numbers distributed within the interval [0, 1];
denotes the historical best position found by particle
; and
denotes the global best position found by the entire particle swarm.
In the offline optimization stage, the sodium-ion battery data collected under the FUDS operating condition at 25 °C are used as the hyperparameter optimization dataset, and the particle position is defined as the candidate hyperparameter combination to be searched, namely, . During each iteration, the HAEKF is executed using the current particle to obtain the corresponding SOC estimation result. The root-mean-square error of SOC estimation is then adopted as the fitness function to evaluate the quality of the current hyperparameter combination. Based on the individual best position of each particle and the global best position of the swarm, the particle velocity and position are iteratively updated, thereby balancing global exploration and local convergence in the hyperparameter search process.
Through iterative PSO search, the optimal hyperparameter combination is gradually identified. The detailed execution procedure is shown in Algorithm 2. To ensure numerical stability of the adaptive update and effective regulation of the adaptive mechanism, the search bounds of the forgetting factor
and the tuning coefficient
are determined accordingly. The corresponding parameter settings, search bounds, and optimization results are listed in
Table 2. Based on the offline optimization results, the optimal values of the forgetting factor
and the tuning coefficient
are determined and then fixed for subsequent online HAEKF execution.
| Algorithm 2: PSO-based parameter optimization for HAEKF SOC estimation |
1: Input: FUDS dataset collected under laboratory conditions at 25 °C (current, voltage, and true SOC, with length ). 2: Input: PSO parameters: maximum iterations , swarm size , and search bounds. 3: Step 1: Initialization. 4: Generate initial 2D swarm of particles . 5: Initialize particle velocities . 6: Step 2: PSO optimization loop. 7: for iteration to do 8: for each particle do 9: Update the HAEKF hyperparameters using the current particle . 10: Execute the HAEKF to obtain the estimated SOC sequence . 11: Calculate the SOC error with respect to the true SOC. 12: Evaluate the fitness function :
|
|
13: end for 14: Update individual best position () and global best position (). 15: if then 16: Particle evolution: update velocity and position for all particles. 17: end if 18: end for 19: Extract the optimal parameters from . 20: Output: Optimal parameters and . |
4. Experiments and Discussion
To evaluate the performance of the proposed PSO-based HAEKF under complex operating conditions, this section presents the HIL experimental platform and validates the battery simulator. It then compares the SOC estimation results under different execution environments and data-source conditions. By comparing the theoretical environment with the HIL execution environment, the performance variation from theoretical evaluation to practical hardware execution is quantitatively analyzed. In addition, measured and ECM-generated FUDS data are compared to examine whether ECM-generated data can reproduce the SOC-estimation-error evolution trends obtained with measured data and serve as a feasible data source for algorithm validation.
4.1. HIL Platform Architecture Design
To quantify the variation in SOC estimation performance from theoretical evaluation to practical hardware execution, a HIL validation platform based on a self-developed battery simulator is established in this paper.
As shown in
Figure 8, the proposed platform forms a closed-loop validation chain integrating model execution, hardware response, signal sampling, and online estimation. Within this framework, dSPACE executes the battery model in real time, while the current source and the self-developed battery simulator reproduce the corresponding operating response. Based on the sampled voltage and current signals, the BMS then performs online SOC estimation. According to their respective functions, the platform can be divided into three modules, namely, the real-time simulation control module, the hardware execution module, and the sampling and algorithm execution module.
The real-time simulation control module is responsible for battery-model execution, control-command generation, and timing coordination. According to the requirements of different validation scenarios, a real-time battery model is first developed in Simulink (The MathWorks, Inc., Natick, MA, USA) on the host computer and then deployed to the dSPACE (dSPACE GmbH, Paderborn, Germany) platform for online execution. This module communicates with the hardware execution module via Ethernet and updates the control commands at a fixed time step of 1 s, thereby ensuring coordinated operation and real-time interaction among the different components of the HIL platform.
The hardware execution module converts the digital commands generated by dSPACE into physical signals that can be acquired by the BMS. For terminal-voltage emulation, the self-developed battery simulator updates the cell voltage in real time according to the model output, with an update period of 1 s, thereby reproducing the terminal-voltage response of the sodium-ion battery under dynamic operating conditions. For current execution, an IT-M3903D programmable current source (ITECH Electronic Co., Ltd., Nanjing, China) receives the current command and outputs the corresponding loop current. Its command update period is also 1 s, enabling accurate reproduction of current pulses in operating-condition tests.
The sampling and algorithm execution module is intended to reproduce the practical sampling-chain characteristics and online estimation workflow of the BMS. Specifically, the cell voltage is acquired by the LTC6804G-1 analog front-end chip (Analog Devices, Inc., Wilmington, MA, USA) and transmitted to the BMS main control board through daisy-chain communication, while the battery current is measured by the HNC-LT500 Hall sensor (Nanjing Zhongxu Electronic Technology Co., Ltd., Nanjing, China). The voltage and current data are processed by the BMS at an update period of 1 s. Based on the acquired signals, the BMS main control board runs the proposed HAEKF for real-time SOC estimation. The estimated SOC, together with the raw voltage and current data, is then uploaded to the host computer via Ethernet every 1 s, thereby enabling online observation of the estimation process and subsequent result analysis.
4.2. Performance Validation of the Battery Simulator
Before analyzing the SOC estimation results, the output performance of the self-developed battery simulator is first validated. As the core execution unit of the HIL platform, the simulator should provide sufficient output accuracy and dynamic response capability. This step is necessary to reduce the influence of simulator-induced output deviation and response delay on the subsequent comparison of SOC estimation performance. Specifically, the steady-state output accuracy and dynamic response characteristics of the simulator are evaluated to determine whether its physical output can reproduce the commanded voltage with sufficient accuracy and responsiveness over the operating range of the HIL platform.
4.2.1. Steady-State Output Accuracy
The voltage output module is driven by host-computer software developed in LabWindows, while the output voltage is measured in a closed loop using an Agilent 34410A 6
1/2-digit digital multimeter (Agilent Technologies, Inc., Santa Clara, CA, USA) controlled through the VISA library.
Figure 9 illustrates the overall test setup used for steady-state output accuracy evaluation. During the test, the single-channel output voltage is varied from 0.1 V to 5 V, with a step size of 10 mV, in order to examine the output accuracy of the battery simulator over the selected voltage range.
The test results are shown in
Figure 10. Over the tested voltage range, the error between the preset output value of the battery simulator and the value measured by the digital multimeter is controlled within 0.2 mV. These results indicate that the developed battery simulator provides high steady-state output accuracy and can support accurate voltage-command reproduction in the subsequent HIL experiments.
4.2.2. Dynamic Response Characteristics
To evaluate the dynamic response capability of the battery simulator, its output voltage is switched between 0.1 V and 5 V, and the corresponding transition process is measured using a Tektronix TPS2014 oscilloscope and a P2220 probe (Tektronix, Inc., Beaverton, OR, USA).
The test results are shown in
Figure 11. When the system output voltage changes from 0.1 V to 5 V, the rise time is approximately 1 ms, corresponding to an average voltage slew rate of about 4900 V/s. When the voltage changes from 5 V to 0.1 V, the fall time is approximately 2 ms, corresponding to an average voltage slew rate of about 2450 V/s.
In summary, the developed battery simulator exhibits high steady-state output accuracy and fast dynamic voltage response within the tested voltage range. Specifically, the steady-state output error is controlled within 0.2 mV, while the average voltage slew rates during the rising and falling processes are approximately 4900 V/s and 2450 V/s, respectively. Considering that the voltage-command update period of the HIL platform is 1 s, the response speed of the simulator is sufficient for the subsequent HIL-based SOC estimation experiments. Therefore, the influence of simulator-induced output deviation and response lag on the subsequent comparative analysis is expected to be limited.
4.3. Comparative Analysis of SOC Estimation Errors Under Multiple Scenarios
Within the unified HIL validation framework established in this paper, four comparative scenarios are designed under different data-source and execution-environment conditions to quantify the variation in SOC estimation performance from theoretical evaluation to practical hardware execution, as shown in
Figure 12.
Specifically, the data sources include measured FUDS data and ECM-generated FUDS data, whereas the execution environments include the host-computer-based theoretical environment and the HIL execution environment. To eliminate the influence of hyperparameter differences on the error comparison results, the HAEKF algorithm with fixed hyperparameters is adopted for SOC estimation in all four scenarios, where the hyperparameters are determined by the PSO-based offline optimization described in the previous section. The specific scenarios and their purposes are as follows.
Measured voltage and current data of the sodium-ion battery under the FUDS operating condition are collected using the Arbin BT2000 test system, and the HAEKF algorithm is executed in the host-computer-based theoretical environment for SOC estimation. This scenario excludes the influence of hardware sampling and execution constraints and serves as the ideal baseline for subsequent comparison.
The same measured FUDS data used in Scenario 1 are introduced into the HIL platform, where the BMS performs online SOC estimation based on the real-time physical signals provided by the platform. This scenario is used to quantify the degradation in SOC estimation performance when the algorithm is transferred from the theoretical environment to the HIL execution environment under measured-data conditions.
Based on the second-order ECM established in
Section 2, the corresponding terminal-voltage sequence is generated using the original FUDS current profile, and the HAEKF algorithm is executed in the host-computer-based theoretical environment for SOC estimation. This scenario is used to examine whether ECM-generated data can reproduce error-evolution patterns consistent with those of measured data under ideal conditions and thereby serve as a feasible validation data source in the theoretical environment.
The terminal-voltage sequence generated in Scenario 3 is introduced into the HIL platform under the same sampling and execution constraints as those in Scenario 2, and the BMS main controller executes the HAEKF algorithm online to complete SOC estimation. This scenario is used to examine whether ECM-generated data can maintain error-evolution patterns consistent with those observed under measured-data HIL execution and can, therefore, serve as a feasible validation data source in the hardware execution environment.
Through a comparative analysis of the above four scenarios, the degradation in SOC estimation performance from theoretical evaluation to practical hardware execution is quantitatively analyzed, while the feasibility of ECM-generated data as a validation data source under both the theoretical environment and HIL conditions is also evaluated.
4.3.1. Performance Comparison Between the Ideal Baseline and HIL Execution
This subsection compares Scenario 1 and Scenario 2 under measured FUDS data to quantify the degradation in SOC estimation performance from theoretical evaluation to practical hardware execution at 25 °C with an initial SOC deviation of 10%. In addition, Scenario 1 is further examined at 15 °C and 35 °C and under composite sampling disturbances to evaluate the adaptability and robustness of the proposed algorithm.
The SOC estimation results of Scenario 1 and Scenario 2 are shown in
Figure 13a,b, respectively. Under the ideal conditions in Scenario 1, the proposed HAEKF algorithm rapidly corrects the 10% initial SOC deviation and stably tracks the true SOC trajectory throughout the entire FUDS profile. The RMSE and MAE are 0.25% and 0.11%, respectively, and the deviation is corrected within 722 s. After convergence, the MaxAE remains within 0.43%. These results indicate that the proposed HAEKF maintains good convergence capability and high estimation accuracy under ideal conditions.
Scenario 2 introduces the practical sampling and execution constraints of the HIL platform on the basis of Scenario 1. The corresponding SOC estimation result is shown in
Figure 13b, and the associated current and voltage sampling results are presented in
Figure 14. As shown in
Figure 14a, the sampled current exhibits an MAE of 309.08 mA and an RMSE of 421.96 mA. As shown in
Figure 14b, the sampled voltage exhibits an MAE of 3.16 mV and an RMSE of 3.24 mV. These results indicate that measurable current and voltage sampling errors are introduced by the practical hardware chain. Even under these conditions, the proposed HAEKF still achieves an RMSE of 0.63% and an MAE of 0.60%, and it corrects the 10% initial SOC deviation within 771 s. After convergence, the MaxAE remains within 1.07%, indicating that the proposed algorithm retains stable online estimation capability under practical hardware non-idealities.
To further examine the temperature adaptability of the proposed algorithm, additional FUDS tests are conducted in Scenario 1 at 15 °C and 35 °C. The results are shown in
Figure 15a,b, respectively. The proposed algorithm maintains stable tracking performance under both temperature conditions. At 15 °C, the RMSE and MAE are 0.33% and 0.15%, respectively. At 35 °C, the corresponding values are 0.42% and 0.35%, respectively. Compared with the result at 25 °C, the estimation error increases slightly at non-nominal temperatures. However, the overall error remains low, and no divergence is observed. These results indicate good estimation accuracy and convergence capability within the tested temperature range.
Beyond temperature adaptability, a composite-disturbance test is further conducted in Scenario 1 to evaluate the algorithm’s robustness under extreme sensing environments, and the result is shown in
Figure 16. In this test, additional perturbations are introduced into the sampled current and voltage signals to emulate sensing abnormalities involving both systematic and random errors. Since random measurement errors in practical sensing systems are commonly approximated by a Gaussian distribution, Gaussian perturbations are adopted to construct the disturbance conditions. The magnitudes of the imposed perturbations are selected according to the upper error bounds specified in the datasheets of the sensing devices used in the established HIL platform so as to construct a severe yet physically meaningful boundary-condition scenario. Specifically, Gaussian perturbations with a mean of 2 A and a standard deviation of 2 A are superimposed on the current samples, while Gaussian perturbations with a mean of 20 mV and a standard deviation of 20 mV are superimposed on the voltage samples. In these settings, the mean value represents the systematic error component, whereas the standard deviation characterizes the magnitude of the random error component. In addition, 50 current sampling points and 50 voltage sampling points are randomly forced to zero to emulate communication abnormalities or intermittent sensor faults.
Even under these composite disturbances, the proposed HAEKF still maintains stable tracking of the true SOC trajectory, with an MAE of 1.04% and an RMSE of 1.20%. Although the estimation error increases compared with that in Scenario 1 at 25 °C, no evident divergence or sustained oscillation is observed, indicating that the proposed algorithm preserves stable estimation capability under severe sensing disturbances and intermittent sampling anomalies.
Overall, the proposed HAEKF maintains stable convergence and satisfactory estimation accuracy in Scenario 1 and Scenario 2 while also exhibiting good adaptability and robustness under the additional tests at 15 °C, 35 °C, and composite disturbance conditions. Meanwhile, the comparison between Scenario 1 and Scenario 2 at 25 °C indicates that practical hardware sampling and execution constraints introduce non-negligible degradation in estimation performance when the algorithm is transferred from the theoretical environment to the HIL execution environment, thereby demonstrating the necessity of HIL validation for engineering-oriented SOC estimation.
4.3.2. Effectiveness of ECM-Generated Data for Validation
This subsection evaluates the feasibility of using ECM-generated data as a validation data source for SOC estimation algorithm performance assessment under the FUDS condition at 25 °C based on the results of Scenario 3 and Scenario 4. Specifically, it examines whether ECM-generated data can reproduce error-evolution patterns consistent with those obtained from measured data under both the theoretical environment and HIL conditions.
The SOC estimation results of Scenario 3 are shown in
Figure 17a. Under an initial SOC deviation of 10%, the estimation curve obtained using ECM-generated data stably tracks the reference SOC trajectory, and its error-evolution trend, convergence process, and steady-state error level remain highly consistent with those of Scenario 1. In particular, Scenario 3 exhibits a convergence pattern similar to that observed under measured-data conditions. These results indicate that, under ideal conditions, ECM-generated data can reproduce the overall error-evolution pattern obtained from measured data and can, therefore, serve as a feasible validation data source for algorithm performance assessment in the theoretical environment.
The SOC estimation results of Scenario 4 are shown in
Figure 17b, and the corresponding current and voltage sampling results and errors are shown in
Figure 18. Under the same hardware execution chain constraints, the current and voltage sampling errors in Scenario 4 are generally close to those in Scenario 2 in both amplitude and fluctuation characteristics, indicating that the sampling error levels introduced by the hardware execution chain remain comparable in the two scenarios. Under this condition, the SOC estimation error-evolution trend and convergence process in Scenario 4 remain highly consistent with those in Scenario 2. These results indicate that, under HIL conditions, ECM-generated data can still reproduce error-evolution patterns consistent with those obtained from measured data and can, therefore, serve as a feasible validation data source in the hardware execution environment.
A further comparison of the error metrics of the four scenarios at 25 °C with an initial SOC deviation of 10%, as summarized in
Table 3, shows that ECM-generated data yield slightly higher estimation accuracy than the corresponding measured data in both the theoretical and HIL environments. This result mainly arises because ECM-generated data are derived from deterministic equivalent-circuit equations. Therefore, their state evolution and terminal-voltage response are more consistent with the prediction and update mechanism of the Kalman filter. By contrast, measured data contain polarization hysteresis, time-varying parameters, sensor noise, and stronger electrochemical nonlinearities. These factors cannot be fully captured by the model, and thus, increase the difficulty of state identification. Nevertheless, despite the difference in absolute error magnitude, the two data sources remain highly consistent in terms of SOC-estimation-error evolution trends and cross-environment variation patterns.
Overall, ECM-generated data can effectively reflect the error characteristics of the algorithm in the theoretical environment. They can also characterize, with relatively high fidelity, the performance variation under hardware-execution constraints in the HIL environment. Therefore, ECM-generated data can serve as a feasible data source for SOC-estimation algorithm performance evaluation and rapid validation.
5. Conclusions
This paper investigates SOC estimation for sodium-ion batteries under complex operating conditions. A PSO-HAEKF is proposed, and a HIL validation platform is established to reproduce practical BMS hardware sampling-chain constraints. The feasibility of using ECM-generated data as a validation data source is also evaluated. The main conclusions are as follows: (1) The proposed PSO-HAEKF achieves high estimation accuracy and stable convergence in both the theoretical and HIL environments. Under measured FUDS data at 25 °C, the MAE and RMSE are 0.11% and 0.25% in the theoretical environment, respectively. Under HIL conditions, the corresponding values are 0.60% and 0.63%, respectively. Even under HIL conditions, the proposed algorithm still achieves fast convergence, correcting the 10% initial SOC deviation within 771 s. Additional tests at different temperatures and under composite disturbance conditions further demonstrate the adaptability and robustness of the proposed algorithm. (2) The HIL results show that practical hardware sampling-chain constraints introduce noticeable degradation in SOC estimation performance. Under the FUDS condition at 25 °C, the RMSE increases from 0.25% in the theoretical environment to 0.63% under HIL conditions. This indicates that such degradation cannot be fully captured by software-only evaluation. Therefore, HIL validation is necessary to quantify the performance degradation from theoretical evaluation to practical hardware execution. (3) Under both the theoretical and HIL conditions, ECM-generated and measured FUDS data remain highly consistent in terms of SOC-estimation-error evolution trends. Although ECM-generated data yield slightly higher estimation accuracy than measured data, the difference is mainly reflected in the absolute error magnitude and does not change the overall error-evolution pattern. Therefore, ECM-generated data can serve as a feasible validation data source for SOC estimation algorithm performance evaluation and rapid validation under the tested conditions.
Overall, SOC estimation assessment should consider not only accuracy in the theoretical environment, but also performance degradation caused by practical hardware constraints. These results provide a useful reference for the deployment-oriented validation and engineering application of sodium-ion battery SOC estimation algorithms under the tested conditions.