The problem
Internal short circuits and sensor faults are among the most important battery safety and reliability issues, and they often begin with small signatures hidden in normal variation and noise. Model-based fault detection uses observers to generate residuals that react to faults but not to normal operation. Designing residuals that are sensitive, robust and able to tell faults apart is a demanding research problem.
Objectives
- Build a module model with fault injection for internal short circuits and sensor faults.
- Design observers (Luenberger or Kalman) that generate residuals for each fault type.
- Design a structured residual set and an isolation logic.
- Set thresholds and statistical tests to balance detection time and false alarms.
- Evaluate performance across fault sizes, noise levels and model mismatch.
What you need
Tools and toolboxes
- MATLAB — Observer design, threshold selection, Monte Carlo evaluation and result analysis.
- Simulink — Module plant with fault injection, observer bank, residual evaluation and test harness.
- Control System Toolbox — Observer gain design with place or kalman, observability checks and linearised analysis.
- Stateflow (optional) — Fault confirmation and isolation logic with timers and latching; a MATLAB Function block is an alternative.
- Simscape Battery (optional) — A higher-fidelity plant for robustness testing against model mismatch.
Software
- MATLAB R2023b or later
- Simulink
- Cell model tables and test data
Extra parts and data
- Published cell test data — To identify the cell model and test residual behaviour on measured, fault-free data to estimate realistic false-alarm rates.
Key concepts
- Residual
- The difference between a measured signal and an observer's prediction. Near zero without faults; it deviates when a fault changes the system.
- Internal short circuit model
- A resistance R_isc placed in parallel with one cell, which causes extra self-discharge and lowers that cell's voltage and SOC relative to its neighbours. Severity is set by R_isc.
- Structured residuals
- A set of residuals designed so that each fault affects a known subset. The pattern of residuals that cross thresholds identifies which fault is present.
- CUSUM test
- A cumulative sum test on residuals that detects small persistent changes in mean faster than a fixed threshold for the same false-alarm rate.
Step-by-step guide
- 1
Define faults and requirements
Use an example 12S module of 50 Ah cells with one current sensor and individual cell voltage sensors. Define faults: internal short circuit in any cell (R_isc from 10 Ω down to 1 Ω), current sensor offset and gain fault, and a cell voltage sensor bias or stuck value. Set requirements: detection time for each fault size, false-alarm rate per hour of operation and correct isolation rate.
Checkpoint: A fault list with sizes, and a requirements table for detection time, false alarms and isolation.
- 2
Build the plant with fault injection
Build the module from per-cell ECMs (OCV, R0, one or two RC branches) with small parameter spread. Add R_isc across a chosen cell through a switch timed by a parameter, and sensor fault blocks for offset, gain, bias and stuck faults. Add realistic noise and quantisation to all measurements. Drive with drive-cycle currents and rest periods. Log the injected fault signals so detection times can be measured.
Checkpoint: A short-circuit test shows the faulty cell's SOC falling faster than its neighbours at the rate expected from V/R_isc.
- 3
Analyse detectability
For each fault, compute how it affects measurable outputs. A 10 Ω short at 3.7 V draws about 0.37 A, which is small against drive currents but clear over hours of rest. Check observability of the augmented model and estimate the smallest detectable fault for the given noise. This gives a theoretical reference to compare with results. Keep the calculation as a reusable script.
Checkpoint: A detectability table estimating the minimum detectable size for each fault under the stated noise.
- 4
Design the observer bank
Design one observer per cell that uses the common current and that cell's voltage to estimate its SOC and RC voltages, with gains from place or kalman on the linearised model. The voltage residual and the drift of the cell's SOC estimate relative to the module mean are the residuals for short-circuit detection. Add a module-level residual comparing the sum of cell voltages with a pack voltage measurement if available.
Checkpoint: Without faults, residuals are near zero-mean noise across a drive cycle and rest.
- 5
Design structured residuals for isolation
Build a fault signature matrix: an internal short in cell i affects that cell's SOC-drift residual; a current sensor fault affects all cells' residuals similarly; a voltage sensor fault in cell i affects its voltage residual but not its true SOC drift. Add residuals that separate these patterns, such as the common-mode component across cells. Check that every fault has a distinct signature.
Checkpoint: A signature matrix in which every fault column is unique.
- 6
Set thresholds and tests
Run long fault-free simulations, and the fault-free measured data, to estimate residual distributions. Set fixed thresholds for a target false-alarm rate and design CUSUM tests for slow faults such as small shorts. Add a confirmation time and latching logic in Stateflow, and isolate faults by matching threshold patterns to the signature matrix. Keep the threshold-setting data separate from the evaluation data so false-alarm rates are not optimistic.
Checkpoint: False-alarm rate on fault-free data within the requirement, with thresholds and CUSUM parameters recorded.
- 7
Fault-injection campaign
Script a Monte Carlo campaign over fault type, size, location, onset time, current profile and noise seed using Simulink.SimulationInput arrays, running hundreds of cases. Record detection time, correct isolation and false alarms for each case. Save results in a table for analysis. Include fault-free runs in the campaign at the same rate as faulty runs, so false alarms are measured under exactly the same conditions. Use parsim if Parallel Computing Toolbox is available to keep the campaign time manageable.
Checkpoint: A complete campaign results table with no failed runs.
- 8
Evaluate performance
Plot detection time against fault size for each fault type, and the isolation confusion matrix. Compute false-alarm and missed-detection rates and compare them with the requirements and the detectability estimates. Identify the hardest cases, typically small shorts during heavy driving and current-sensor gain faults at low current. Explain each misclassification in the confusion matrix by examining the residual traces of a few representative cases.
Checkpoint: Detection-time curves, a confusion matrix and a comparison with requirements.
- 9
Robustness to model mismatch
Repeat a subset of the campaign with a plant that differs from the observer model: different temperature, aged cells with higher resistance, or a Simscape Battery plant. Measure the increase in false alarms and detection time. Test a simple adaptation, such as slowly re-estimating R0, and report whether it restores performance. Report which residuals are most sensitive to mismatch, as these guide where adaptation is most needed.
Checkpoint: Performance under mismatch with and without adaptation, compared with the nominal case.
- 10
Compare with a baseline
Implement a simple baseline used in practice: comparing cell voltage deviation from the module mean at rest against a threshold. Compare detection time, false alarms and isolation with the observer-based method on the same campaign. Discuss the cost in computation and calibration of the observer approach. Tune the baseline threshold for the same false-alarm rate as the observer method, otherwise the detection-time comparison would be unfair to one of them.
Checkpoint: A comparison table of the baseline and observer methods on the same cases.
- 11
Write up
Document the plant and fault models, detectability, observer design, residual structure, thresholds, campaign, performance, robustness and baseline comparison. State the limits clearly: simulated faults, a simplified short-circuit model and no thermal signatures. Note that real short-circuit validation requires controlled laboratory testing by qualified staff and is outside this project. Include the fault signature matrix, threshold settings and campaign scripts so the benchmark can be rerun with other observers or fault models.
Checkpoint: A thesis chapter with quantified detection and isolation results and a reproducible fault-injection campaign.
Testing & validation
- Fault models produce the expected physical effects.
- Residuals are zero-mean noise without faults.
- False-alarm rate measured on long fault-free and measured data.
- Every fault has a unique signature.
- Performance tested under model mismatch.
Expected results
An observer-based fault detection and isolation scheme for an example battery module with quantified detection time, false-alarm and isolation rates across fault types and sizes, robustness results under model mismatch and a comparison with a voltage-deviation baseline.
Research angle for your PhD
Research questions: what are the smallest internal short circuits and sensor faults that an observer-based scheme can detect and isolate in a series module under realistic noise and model mismatch, and how quickly, compared with simple voltage-deviation methods? Baselines: voltage deviation from module mean and a single EKF residual. Metrics: detection time against fault size, false-alarm rate per hour, isolation accuracy and computation. A reproducible fault-injection benchmark, a structured residual design with guaranteed isolability, or robust thresholds under ageing would be publishable contributions.
Take it further
- Add temperature measurements and a thermal residual for short-circuit heating.
- Estimate R_isc online to grade short-circuit severity.
- Use data-driven residual evaluation on top of the observers.
- Generate code and measure computation on a BMS-class MCU.
Viva and review questions
How does an internal short circuit show up in your residuals?
The faulty cell loses charge faster than the current sensor indicates, so its observer's SOC drifts away from its neighbours and its voltage residual grows, especially during rest.
How do you tell a current-sensor fault from a short circuit?
A current-sensor fault affects all cells' residuals in the same way, while a short circuit affects only one cell. The signature matrix uses this difference.
Why use a CUSUM test?
Small persistent faults shift the residual mean slightly; CUSUM accumulates evidence over time, detecting them faster than a fixed threshold at the same false-alarm rate.
How did you set the false-alarm rate?
From long fault-free simulations and fault-free measured data, choosing thresholds so the observed alarm rate stayed below the requirement.
Learn it at DIYguru
These DIYguru courses and programmes teach what this project needs.
