This repository contains an Extended Kalman Filter (EKF) designed to estimate the State of Charge (SOC) of an LG M50T 21700 Nickel Manganese Cobalt (NMC) lithium-ion cell.
Standard Coulomb counting accumulates integration drift over time, especially under the highly erratic power demands typical of electric vehicle (EV) accumulators. This estimator solves that drift by utilizing a 1-Resistor-Capacitor (1RC) Equivalent Circuit Model (ECM) to continuously balance theoretical cell physics against real-world sensor measurements. Validated against aggressive Hybrid Pulse Power Characterization (HPPC) load profiles, the algorithm successfully maintains an SOC tracking error of
The Open Circuit Voltage (OCV) vs. SOC relationship was extracted from a Begining-of-Life (BOL)
The transient thermodynamic parameters—Ohmic Resistance (scipy.optimize.curve_fit). The model was fitted to the voltage relaxation phase of a
The EKF predicts the internal polarization voltage and SOC at each time step
-
State Vector:
$x = [\text{SOC}, V_1]^T$ -
Prediction: Integrates current and decays
$V_1$ based on the time constant$\tau = R_1 \times C_1$ . - Update: Calculates the Kalman Gain to minimize the residual between the measured voltage and the model's predicted voltage.
ev_soc_estimator/
│
│── estimator.py # Run this file after installing requirements.txt for visualization of SOC Estimation
│── cell_D_RPT1_Hybrid_CC-Pulse_0.5C.csv # Dynamic validation data
│── ocv_soc_lookup.csv # Extracted OCV-SOC mapping
│── soc_estimator.ipynb
├── README.md
└── requirements.txt
For Deployment,
pip install -r requirements.txt
python estimator.py
- [Sanket Agarwal - 23ME30051] - Parameter Extraction, OCV Modeling & System Integration
- [Gokul R - 23ME10029] - EKF Implementation & Statistical Validation
Developed as part of the Battery Modeling Project for the course ES60208, Energy Science Department, IIT Kharagpur.