bio_img_deep-learning

Artificial Intelligence

Apply embedded AI and agentic AI

Advanced Battery State of Charge Estimation with AI

Guest writer: Riccardo Di Dio
Riccardo Di Dio is an Industrial PhD Candidate sharing his time between the University of Pisa and Marelli, working on artificial intelligence methods for Battery Management Systems. His research focuses on deep learning algorithms for estimating battery internal states such as State of Charge (SOC) and State of Health (SOH), developed using MATLAB and Deep Learning Toolbox.
As a global leader in automotive technology, Marelli is driven by innovation supporting the electrification revolution. This article's aim is to show a cutting-edge solution developed for Battery State of Charge (SOC) estimation using artificial intelligence. Accurate SOC estimation is essential for Battery Management System, directly impacting vehicle performance safety and battery lifespan. Since SOC cannot be measured directly, it must be estimated using available sensor data and advanced modelling techniques. Marelli saw an opportunity to use a data driven approach powered by AI to overcome the limitations of the traditional physical models.
The article describes how the Marelli company developed the AI algorithm using synthetic dataset generated through a Virtual Environment developed using model-based design techniques in MATLAB.
The entire workflow executed using the MathWorks toolchain spans from data generation to embedded device deployment.
The MathWorks toolchain was selected due to the following reasons: visual development environment enabled intuitive graphical modeling with blocks, facilitating easy connection between the controls system and the plant model; compatibility with the Hardware in the Loop design for testing the interaction between the software and the embedded device; automatic code generation; possibility of training the algorithm in MATLAB and exporting the trained network to a real-time system.

Data Preparation

The dataset for training and validation was generated using a virtual environment repeating several times the homologation driving cycle.
The Operating Domain Definition (ODD) conditions are:
  • new electrochemical cell (cell with a State of Health equal to 100%)
  • constant temperature of 25 C and 35 C
  • ideality of the current sensor and the voltage sensor %[text] The inputs chosen for estimating the state of charge are the cell voltage, the cell current and the temperature. The reference state of charge is calculated using the Coulomb counting equation. All the inputs were normalized considering the operating limits of the cell (cut-off voltage, maximum or minimum current and temperature).

AI Modeling

Due to the time-related evolution of a battery's SOC, the Long Short Term Memory (LSTM) architecture was selected as the neural network. LSTM networks are particularly well-suited for capturing time-dependent patterns and sequential relationships, making them ideal for accurately estimating SOC based on historical sensor readings. The data samples were not fed to the networks individually; instead, a temporal observation window was considered.
The network was designed and trained using the Deep Learning Toolbox, provided by MathWorks, due to its powerful features for building, training and evaluating neural network models within the MATLAB environment.
A grid search technique was used to find the best performance and in particular to select the best number of neurons, the learning rate and the window size.
The Deep Learning Toolbox facilitates advanced hyperparameter tuning, making it efficient to develop and optimize complex deep learning architectures.

Real-Time Simulation

The trained network was exported to the Simulink environment to run Real-Time Testing based on different driving cycles for testing and validation, both inside and outside the ODD conditions.
The performance of the developed networks were evaluated considering the following metrics: Root Mean Square Error (RMSE), Mean Absolute Percentage Error (MAPE) and Mean Absolute Error (MAE), defined as:
$ \begin{array}{ll} \mathrm{RMSE} &= \sqrt{\frac{1}{N} \sum_{k=1}^{N} \left( Y_{\mathrm{predicted},k} - Y_{\mathrm{true},k} \right)^2} \\ \mathrm{MAE} &= \frac{1}{N} \sum_{k=1}^{N} \left| Y_{\mathrm{predicted},k} - Y_{\mathrm{true},k} \right| \\ \mathrm{MAPE} &= \frac{100}{N} \sum_{k=1}^{N} \left| \frac{Y_{\mathrm{predicted},k} - Y_{\mathrm{true},k}}{Y_{\mathrm{true},k}} \right| \end{array} $
The algorithm was validated using a drive cycle different from the WLTP employed for training and validation, in order to assess its robustness and generalization across varied and realistic operating scenarios. The performance achieved is reported in the table below.
RMSE
MAPE
MAE
1 Simulation WLTP, no aging, ideal current and voltage sensors, 25 C
0.29
0.44
0.22

Compression

At this stage, the network contained over 10,000 parameters. To address this, a compression technique based on network projection was applied, reducing the number of parameters by 70% while ensuring that the performance of the algorithm remained uncompromised for real-world deployment.

Deployment

The last step is the C code generation of the network using Embedded Coder and the integration of the AI algorithm into Marelli's BMS architecture.
The AI algorithm embedded on a real Battery Management System hardware was tested in a Hardware-in-the-Loop (HIL) environment, which enables realistic integration between simulation and physical hardware. In this setup, the virtual environment representing the battery system dynamics was deployed directly onto the processor board of the simulator. The simulator was responsible for generating representative signals for key parameters such as voltage, current, and temperature. These signals were converted from digital to analog format using dedicated DACs and sent to the embedded device, which hosts the AI algorithm. The internal software variables of the AI algorithm were continuously monitored using ETAS INCA, allowing direct access to algorithm outputs and internal states.
The results recorded by INCA are reported in the figure below.

Conclusion

The application of AI techniques to the estimation of highly nonlinear parameters such as battery SOC has proved a powerful alternative to more classic approaches. The compression of the model enables its implementation in a real production use case. The MATLAB toolchain has provided a single workflow which has enabled accelerated design and implementation of this program - from concept to on-target implementation.
|
  • print

コメント

コメントを残すには、ここ をクリックして MathWorks アカウントにサインインするか新しい MathWorks アカウントを作成します。