Fault Injection on a HIL Bench: Methods, Test Cases and Coverage

Fault Injection on a HIL Bench: Methods, Test Cases and Coverage
In this article

Cet article existe aussi en français. Lire en français →

Fault injection testing deliberately introduces faults into a system to verify that it detects them and reacts as specified. On a hardware-in-the-loop (HIL) bench it is the standard way to prove that the safety mechanisms of a controller, such as a BMS, really work on the real hardware and software.

Functional tests show that a system does what it should when everything is fine. Fault injection tests show what it does when something breaks, which is what safety standards and assessors care about most.

4 + 1electrical fault classes: open, short to ground, short to supply, pin-to-pin, plus resistive
100 %of safety mechanisms need a fault injection test
msthe resolution needed to check FTTI
1 faultper test case, then recovery

How it works on a HIL bench

Fault injection on a hardware-in-the-loop benchTest automationsequences, verdicts, reportsReal-time simulatorplant model, cell emulatorsFailure insertion unitrelays on each signalBMS under testreal hardware and softwareopen circuitshort to groundshort to supplypin-to-pin shortresistive faultelectrical faults the FIU can insertplus CAN faults (lost, late or corrupted frames) and model faults (drift, stuck sensor)
The failure insertion unit sits between the simulator and the device under test and can open, short or bridge each signal on command.

The HIL bench simulates the environment of the controller: cells, sensors, contactors, loads, the rest of the vehicle or system. A failure insertion unit (FIU) is a matrix of relays on the signal lines. Commanded by the test automation, it can disconnect a wire or short it to another potential, at a precise moment in the test.

What to inject

Fault familyExamplesWhere it is injected
ElectricalOpen wire, short to ground, short to supply, pin-to-pin short, resistive leakFIU on the harness signals
Sensor (model level)Drift, gain error, stuck value, out-of-range, noisePlant model or cell and sensor emulators
CommunicationLost frames, delays, wrong CRC, wrong alive counter, bus-offRestbus simulation or a CAN fault injector
Power supplyUndervoltage, interruption, ramp, rippleProgrammable power supply
Actuator feedbackContactor that does not close, welded contactor, slow openingLoad and contactor models, FIU

A BMS example

FaultExpected detectionExpected reaction
Open cell sense wireOpen-wire diagnostic of the analog front endFault reported, cell voltage marked invalid, derate or open contactors per the safety concept
Cell voltage above limit (emulated)Primary measurement and independent channelContactors open within the FTTI
Temperature sensor shortedOut-of-range detectionSensor invalid, fallback value, derating
Current sensor stuckPlausibility between two current sensorsFault, limited operation or safe state
Daisy-chain communication lostTimeout and CRC checksSafe state after the defined timeout
Main contactor weldedVoltage check before and after openingFault, sequence blocked, precharge not started

Pass criteria

  • The fault is detected, with the right diagnostic code.
  • Detection time and reaction time are measured, and their sum fits within the fault tolerant time interval (see BMS functional safety).
  • The system reaches the specified safe state, and stays there.
  • No unintended side effects: other functions keep working as specified.
  • After the fault is removed, the system recovers exactly as the requirements say (latched, or after a reset, or automatically).

Building the test campaign

  • Start from the safety mechanisms list in the FMEDA: each mechanism needs at least one test that triggers it.
  • Define each test at the operating point where the fault matters most (charging for overvoltage, cold for low temperature).
  • Automate: fault injection campaigns run to hundreds of cases and must be repeatable on every software release.
  • Trace every test to a safety requirement and keep the measured timings in the report.
  • Review coverage: which failure modes are never injected, and why.

Traps of the method

  • Relay artefacts: FIU relays bounce and add resistance. A short through a relay and long wires is not a dead short; check what the ECU really sees.
  • Simulated vs real faults: an open wire in the model is not the same as an open wire on the harness; the diagnostic circuits only see the second one.
  • Test order dependency: a latched fault from the previous test silently invalidates the next one. Reset and check the initial state every time.
  • Timing resolution: measuring a 100 ms reaction with a 50 ms logging rate proves nothing.
  • Only one fault at a time: double faults and latent faults need their own reasoning.

FAQ

What is fault injection testing?

A test method that deliberately introduces faults (electrical, communication, sensor or software faults) to verify that a system detects them and reacts as specified.

What is a failure insertion unit?

A relay matrix on a HIL bench that can open, short or bridge the signal lines between the simulator and the device under test, on command from the test automation.

Is fault injection required by ISO 26262?

ISO 26262 lists fault injection among the methods to verify safety mechanisms, and it is highly recommended at higher ASILs. IEC 61508 has similar expectations.

Can fault injection be done without HIL?

Partly, in simulation or on a test rig, but HIL is the practical way to inject repeatable electrical faults on real hardware with a realistic environment.

How many fault injection tests are needed?

At least one per safety mechanism and per relevant operating condition, typically hundreds for a BMS, automated and rerun on every release.

Learn it live

This topic is covered in depth, with industrial case studies, in the HIL validation with dSPACE program. Join the waitlist to hear first when it opens — or browse the 64 free guides in the meantime.

Mohamed Yasser El Mekadem, Technical Leader in battery systems and power electronics

Written by

Mohamed Yasser El Mekadem

Technical Leader on a 1500 V rail traction battery. Eight years in onboard railway energy: power converters, HIL validation, battery systems.

Waitlist

Learn this live, with industrial case studies.

Three programs — power electronics, battery systems & BMS, HIL validation. Join the list to hear first when one opens.

One email when a program opens. Unsubscribe in one click. Privacy policy.

Keep reading

Related articles

Drone batteries: LiPo vs Li-ion, specific energy, flight time and BMS
Batteries & BMS

Drone Batteries: LiPo vs Li-Ion, Wh/kg, C-Rate and BMS

A drone battery is the heaviest component in the aircraft and the one that sets its endurance. LiPo against Li-ion, the Wh/kg of real packs and cells, how flight time depends on battery mass, what C-rate a mission actually needs, and what the BMS of a flight battery does differently.

Read the article →