SOC Estimation | EV Fundamentals | Skill-Lync Resources

50% OFF - Ends Soon!

Lesson 4 of 13 15 min

State of Charge (SOC) Estimation

The State of Charge (SOC) is the "fuel gauge" of an EV. Unlike a petrol tank where you can physically measure the liquid level, measuring the charge remaining in a battery requires sophisticated algorithms.

Accurate SOC estimation is essential for:

  • Range prediction: How far can you drive?
  • Charging control: When to stop charging?
  • Power management: How much power can you draw?
  • Battery health: Avoiding over-discharge/overcharge

The Challenge

You cannot directly measure SOC. Unlike voltage or current, it's not a physical quantity you can sense with a meter. SOC must be estimated from measurable quantities:

Sponsored

70% of India's auto industry trusts Skill-Lync

For training their engineers in CAD, CAE & simulation

Learn More
  • Terminal voltage
  • Current (in/out)
  • Temperature
  • Internal impedance

Each method has tradeoffs between accuracy, computational cost, and robustness.

Method 1: Coulomb Counting

The simplest and most intuitive approach: track how much charge flows in and out.

$$SOC(t) = SOC(t_0) - \frac{1}{Q_n} \int_{t_0}^{t} i(t) \, dt$$

Sponsored

3,000+ engineers placed at top companies in 2024

Mahindra, Bosch, TATA ELXSI, Capgemini and more

See Placement Stats

Where:

  • $SOC(t_0)$ = initial SOC
  • $Q_n$ = nominal capacity (Ah)
  • $i(t)$ = current (positive = discharge)

In discrete form (implemented in BMS):

$$SOC_k = SOC_{k-1} - \frac{i_k \cdot \Delta t}{Q_n}$$

Sponsored

175+ hours of industry projects & 12 IIT faculty sessions

Master CATIA, NX, LS-DYNA, HyperMesh and more

View Full Curriculum
Watch how SOC changes as current flows. Notice the drift that accumulates over time due to measurement errors.

Implementation Example

class CoulombCounter:
    def __init__(self, capacity_ah, initial_soc=1.0):
        self.capacity = capacity_ah * 3600  # Convert to As
        self.soc = initial_soc

    def update(self, current_a, dt_s):
        # Positive current = discharge
        charge_delta = current_a * dt_s
        self.soc -= charge_delta / self.capacity
        self.soc = max(0, min(1, self.soc))
        return self.soc

The Drift Problem

Coulomb counting has a critical flaw: drift. Errors accumulate because:

  • Current sensor offset: Even a 10 mA offset causes 36 mAh error per hour
  • Sampling errors: Discrete integration misses some charge
  • Unknown initial SOC: Error propagates forever
  • Capacity variation: Actual capacity changes with temperature and age

After a few hours of driving, the estimate can be off by 5-10%.

Mitigation Strategies

1. Periodic OCV calibration:
  • When vehicle is parked (zero current), measure OCV
  • Look up SOC from OCV table
  • Reset Coulomb counter
2. High-precision current sensing:
  • Use shunt resistors with <0.1% accuracy
  • Sample at high frequency (>100 Hz)
  • Apply temperature compensation
🎯 3,000+ Engineers Placed
Sponsored
Harshal Sukenkar

Harshal

Fiat Chrysler

Abhishek

Abhishek

TATA ELXSI

Srinithin

Srinithin

Xitadel

Ranjith

Ranjith

Core Automotive

Gaurav Jadhav

Gaurav

Automotive Company

Bino K Biju

Bino

Design Firm

Aseem Shrivastava

Aseem

EV Company

Puneet

Puneet

Automotive Company

Vishal Kumar

Vishal

EV Startup

Method 2: OCV-SOC Lookup

Use the relationship between Open Circuit Voltage and SOC (learned in Lesson 2).

Pros:
  • No drift (each measurement is independent)
  • Simple lookup table
Cons:
  • Only works at rest (zero current)
  • LFP has very flat curve (poor resolution)
  • Temperature affects OCV
Practical use: Calibrate Coulomb counter when vehicle starts or after long parking.

Method 3: Kalman Filter

The Kalman Filter is the gold standard for SOC estimation. It combines:

  • Coulomb counting (predict)
  • OCV measurement (correct)

The key insight: neither method is perfect, but together they're more accurate than either alone.

The Kalman filter combines prediction (Coulomb counting) with correction (OCV measurement) to reduce uncertainty.

How Kalman Filter Works

1. Prediction Step:

Use the battery model to predict next SOC:

$$\hat{SOC}_{k|k-1} = \hat{SOC}_{k-1} - \frac{i_k \cdot \Delta t}{Q_n}$$

$$P_{k|k-1} = P_{k-1} + Q$$

Where:

  • $\hat{SOC}$ = estimated SOC
  • $P$ = estimation uncertainty (covariance)
  • $Q$ = process noise (model uncertainty)
2. Update Step:

Correct prediction using voltage measurement:

$$y_k = V_{measured} - V_{predicted}$$

$$K_k = P_{k|k-1} H^T (H P_{k|k-1} H^T + R)^{-1}$$

$$\hat{SOC}_k = \hat{SOC}_{k|k-1} + K_k \cdot y_k$$

$$P_k = (1 - K_k H) P_{k|k-1}$$

Where:

  • $y_k$ = innovation (measurement residual)
  • $K_k$ = Kalman gain
  • $R$ = measurement noise

Intuitive Understanding

Think of it as weighted averaging:

  • High Kalman gain ($K \approx 1$): Trust measurement more
  • Low Kalman gain ($K \approx 0$): Trust prediction more

The gain automatically adjusts based on:

  • How uncertain is our prediction?
  • How noisy is our measurement?

Extended Kalman Filter (EKF)

For batteries, the OCV-SOC relationship is nonlinear. The Extended Kalman Filter linearizes around the current estimate:

$$H_k = \frac{\partial V}{\partial SOC} \bigg|_{SOC=\hat{SOC}_k}$$

This requires computing the slope of the OCV curve at the current SOC estimate.

Battery Model for Kalman Filter

The Kalman filter needs a model to predict voltage from SOC:

Equivalent Circuit Model (ECM)

First-order RC model:
         R0          R1
   +----/\/\/\----+--/\/\/\--+
   |              |          |
  OCV            C1          V_terminal
   |              |          |
   +--------------+----------+

$$V_t = OCV(SOC) - i \cdot R_0 - V_{C1}$$

$$\frac{dV_{C1}}{dt} = \frac{i}{C_1} - \frac{V_{C1}}{R_1 C_1}$$

Where:

  • $R_0$ = internal resistance (ohmic)
  • $R_1, C_1$ = polarization (diffusion dynamics)
Second-order RC model: Adds another RC pair for better accuracy at different time scales.

Parameter Identification

Model parameters vary with:

  • SOC (higher resistance at low SOC)
  • Temperature (higher resistance when cold)
  • Age (resistance increases over life)

Parameters are typically identified using:

  • Pulse testing (HPPC: Hybrid Pulse Power Characterization)
  • EIS (Electrochemical Impedance Spectroscopy)
  • Real-time recursive estimation

Practical BMS Implementation

A real BMS typically uses:

  • Primary: Kalman filter with ECM model
  • Fallback: Coulomb counting (if model fails)
  • Calibration: OCV lookup when parked >2 hours
  • Bounds check: Never exceed 0-100% range
class BMS_SOC_Estimator:
    def __init__(self):
        self.coulomb_counter = CoulombCounter(100)  # 100 Ah
        self.kalman = ExtendedKalmanFilter()
        self.rest_time = 0

    def update(self, voltage, current, dt):
        if abs(current) < 0.1:  # At rest
            self.rest_time += dt
            if self.rest_time > 3600:  # Parked >1 hour
                ocv_soc = self.ocv_to_soc(voltage)
                self.kalman.reset(ocv_soc)
        else:
            self.rest_time = 0
            self.kalman.update(voltage, current, dt)

        return self.kalman.get_soc()

Accuracy Comparison

MethodAccuracyDriftComputational Cost
Coulomb counting±5-10%YesVery low
OCV lookup±2-5%No (at rest)Low
Kalman filter±1-3%MinimalModerate
Neural network±1-2%NoHigh

Indian Market Considerations

Temperature range: India sees 0°C to 50°C. SOC algorithms must handle:
  • Reduced capacity at extremes
  • Different OCV curves
  • Model parameter variation
Computational constraints: Entry-level EVs use low-cost MCUs:
  • First-order ECM + EKF is typical
  • Lookup tables over complex functions
  • Fixed-point math for speed
Practical accuracy: ±3% is acceptable for consumer EVs. Commercial vehicles (buses, trucks) may need ±1% for fleet optimization.

Key Takeaways

  • Coulomb counting is simple but drifts due to accumulated errors
  • OCV lookup works only at rest but provides no-drift reference
  • Kalman filter combines both methods optimally
  • Battery models (ECM) relate voltage to SOC for prediction
  • Practical BMS uses multiple methods with fallbacks
  • Accuracy of ±1-3% is achievable with modern algorithms

What's Next

In the next lesson, we'll learn about the Battery Management System (BMS) — the electronic system that implements SOC estimation, cell balancing, protection, and communication in a real EV.

3,000+ Engineers Placed in Top Companies
Career Growth

3,000+ Engineers Placed in Top Companies

Join the ranks of successful engineers at Bosch, Tata, L&T, and 500+ hiring partners.

Battery Pack Design