AutoVoltix

← Back to all lessons

BMSLEVEL 3Reading time: 22 min
Learning Objectives
  • Distinguish unit, integration, MIL, SIL, and HIL test levels.
  • Explain the battery emulator and cell emulator concepts.
  • Define stimulus, expected behavior, detection, reaction, and recovery for a BMS fault scenario.
  • Explain how the test pyramid relates to production cost.

BMS-19 — BMS Validation / SIL / HIL

1. You Can’t Fault-Test a Real Cell

You need to confirm the BMS reacts correctly to dangerous scenarios like overvoltage, a short circuit, or thermal runaway — but deliberately triggering them in a real HV pack is dangerous and expensive. The solution is a test pyramid that reduces that risk in stages:

Unit Test → Integration Test → MIL → SIL → HIL → Bench → Pack → Vehicle

Catching a software bug at the unit-test stage (seconds, on a computer) is far cheaper and safer than catching the same bug during vehicle testing (a real vehicle, a campaign that takes days). That’s why the pyramid follows the principle that most bugs should be caught in the lower layers, with only a handful of integration issues surfacing higher up.

2. Six Test Levels

Level What’s tested
Unit test A single function/component (e.g., the SOC calculation function alone, no hardware)
Integration test Components working together (SOC algorithm + fault manager)
MIL (Model-in-the-Loop) The control model in a simulation environment; no production code yet
SIL (Software-in-the-Loop) The real production code, run in a model/simulation, on a PC
HIL (Hardware-in-the-Loop) Real BMS hardware, with a real-time battery simulation
Bench / Pack / Vehicle Final confirmation stages with real hardware

The difference between MIL and SIL matters: in MIL, the logic under test is still a model that hasn’t been converted into production code; in SIL, the real, compiled production code is tested. This catches translation errors between the model and the code (rounding, data-type differences, and so on).

3. Emulators: Moving the Danger Into Simulation

Actually pushing a cell to 4.5 V (overvoltage) is dangerous and destroys the cell. A battery emulator produces programmable cell voltages in place of real cells — it feeds the BMS’s measurement input a signal as if a real cell were sitting at 4.5 V, and the BMS reacts to it as if it were real, with no actual chemical risk involved. A cell emulator applies the same idea at the individual-cell level.

4. How a Fault Test Is Defined

The general framework: StimulusExpected behaviorDetectionReactionRecovery.

Cell Overvoltage: a cell voltage is pushed above the upper limit → the BMS detects the overvoltage → charging is cut / the contactor opens → once voltage returns within limits, the system safely returns to normal.

Current Sensor Offset: a constant offset is injected into the current sensor → the BMS detects the offset via plausibility → warning/derating → the system returns to normal once the offset is corrected.

Pre-charge Timeout: an artificially high resistance is injected into the pre-charge resistor circuit → DC-link voltage doesn’t reach the threshold within the expected 5τ → pre-charge is aborted on timeout, contactors stay open → retried only after the root cause is fixed.

Other typical tests: undervoltage, overcurrent, over/undertemperature, sensor open/short circuit, CAN loss, contactor welding, HVIL open, isolation fault.

ASSUMPTION — The scenarios and parameters above are representative examples for teaching purposes; real test specifications are derived from project-specific requirements and safety concept documents.

5. Test Coverage and ASIL

Test coverage measures how much of the code/requirements the written tests exercise. As ASIL level rises (BMS-17), the required depth of coverage (things like MC/DC) increases.

6. How It’s Verified in Production

The pyramid’s upper levels (Bench, Pack, Vehicle) are the final pre-production confirmation stages — reconfirming, on real hardware, scenarios that have already been tested in HIL. New fault types aren’t being hunted for here; the goal is confirming that already-defined scenarios also work correctly on the real system (BMS-20).

7. How It Connects to Other Systems

The validation strategy tests every safety mechanism in the functional safety concept (BMS-17), covers all of fault management’s (BMS-13) scenarios, and forms the backbone of the production process (BMS-20).

Summary

  • The test pyramid progresses from unit to vehicle; catching bugs early is cheaper.
  • MIL tests the model, SIL tests production code, HIL tests real hardware; emulators make it safe to simulate dangerous scenarios.
  • Every fault test is defined through the stimulus → detection → reaction → recovery framework.

Sources

  • ISO 26262 — verification and validation.
  • Gregory L. Plett, Battery Management Systems — test methodology.

Technical Diagrams

A pyramid diagram narrowing from a wide Unit Test band at the bottom through Integration, MIL, SIL, HIL, Battery Bench, Pack, up to a narrow Vehicle band at the top.
BMS Test Pyramid — The test pyramid spanning from unit testing to vehicle testing (BMS-19).

Quiz

Basic

What is tested in HIL testing?

Basic

Why is a battery emulator used?

Intermediate

What's the core difference between MIL and SIL?

Intermediate

Why is it more advantageous to catch bugs early (at the unit-test stage) in the test pyramid?

Advanced

Why does test coverage (e.g., MC/DC) need to go deeper as ASIL level rises?

Advanced

In a pre-charge timeout test scenario, what should the 'Expected behavior' be?

Glossary

English TermDefinition
HIL (Hardware-in-the-Loop)Testing real BMS hardware with a real-time battery simulation.
SIL (Software-in-the-Loop)Testing the produced software code in a model/simulation environment.
Battery EmulatorHardware that produces programmable cell voltages in place of real cells; makes BMS testing safe.
MIL (Model-in-the-Loop)Testing a control model, not yet converted to production code, in a simulation environment.
Cell EmulatorHardware simulating individual cell voltages, allowing dangerous scenarios to be tested safely without a real cell.
Test CoverageAn indicator measuring how much of the code/requirements the written tests cover; deepens as ASIL rises.