Overview

Application overview

Traditional SOC estimation relies on Coulomb counting or OCV lookup tables, both of which suffer from cumulative drift, sensor noise sensitivity, and inaccuracies caused by battery aging. Because SOC is depends on long-term charge/discharge history rather than instantaneous snapshots, these legacy methods often fail to provide the precision required for modern battery management.
 
This solution replaces traditional lookup-based methods with a lightweight, NPU-optimized regression model. By processing time-series voltage, current, and temperature data directly on the edge, the system captures the complex electrochemical dynamics necessary for high-fidelity tracking. This enables engineers to implement professional-grade SOC estimation within the strict power and memory constraints of resource-limited microcontrollers.

Key performance targets:

  1. High precision: Achieve a test root mean square error (RMSE) under 2% SOC
  2. High correlation: Maintain an r-squared greater than 0.99 on held-out test data
  3. Resource efficiency: Optimize model footprint for seamless integration with  MCU budgets

Start evaluating

Data collection

The dataset is derived from the LG SoC dataset (LG_18650HG2_Liion_Battery_Data), a public time-series repository containing exhaustive charge/discharge cycles for lithium-ion battery cells. The raw data comprises 4,491 individual files logged at fixed intervals, capturing the electrochemical behavior of the cells across diverse operating profiles. 

Each sample file contains four primary input attributes: voltage (V), current (A), temperature (°C), and capacity (Ah). To prepare the data for the NPU-optimized regression model, a time-series windowing approach was implemented using a SimpleWindow method. Data was segmented into frames of 128 samples with a stride of 0.05 (dense overlap), resulting in four continuous input channels—voltage, current, temperature, and capacity (coulomb count)—used to predict the target variable: State-of-Charge (SOC) expressed as a percentage.

 

Data quality

The REGR_20k_NPU model was trained and validated on the complete 4,491-file LG dataset. The model achieved a test RMSE of 2.56% (0.0256) and a test R-squared of 0.99. During the training process (50 epochs, stride_size 0.05), the model reached a best-epoch R-squared of 0.987, confirming a high-fidelity fit between the predicted SOC and the actual ground truth across the held-out test data.

Building and train your model

Accelerate development by leveraging advanced optimization and automation to design, train, and deploy high-performance AI models. For this use case, models are trained using the tinyml-tensorolab tinyml-tensorlab CLI either directly with the provided configuration file or via the tinyml-workflow-agent skill. Executing the config_MSPM0.yaml file automates the end-to-end pipeline—handling feature extraction, training, quantization, and compilation. To maximize hardware efficiency, Quantization Mode 2 (NPU-optimized INT8) is enabled by default within the configuration.

Find the right model

Select the ideal model based on your specific accuracy and resource requirements. The recommended model for this use case is REGR_20k_NPU, a ~20,000-parameter regression model validated against the complete 4,491-file dataset. On the MSPM0G5187, this model maintains a highly efficient footprint of 26.39 KB (comprising 2.43 KB code, 21.52 KB read-only, and 2.45 KB read/write), utilizing NPU-optimized INT8 quantization. To expedite your development, pre-trained reference models and training configurations are available in the TI tinyML Model Zoo, enabling engineers to easily reproduce these results or fine-tune models using proprietary datasets.

Deploying your model

Transition from training to production with a seamless, start-to-finish workflow. CCStudio™ Edge AI Studio simplifies the deployment of trained models to embedded targets. For developers seeking deeper customization and granular control, the MSPM0-SDK provides a comprehensive framework, utilizing the TI Neural Network Compiler to convert trained models into ready-to-use libraries. This enables the integration of accelerated SOC estimation directly into your embedded BMS application with minimal manual effort.

Choosing the right device

 

Product numberProcessing coreNPU availableClock frequency (MHz)Benchmark metrics
 Latency (ms)Flash (kB)SRAM (kB)
MSPM0G5187Arm®  Cortex®-M0+80<723.952.45

 



SIMILAR USE CASES
INDUSTRIAL | ARC FAULT | PREVENTIVE MAINTENANCE

Rotor temperature prediction using multiple sensors with high framerate

Find and localize specific objects, people in real-time at R-squared value over 96.9% using AI-accelerated processors and industry-standard software.