Lemonergy · Studio block

Cell contact residual monitor

Filters cell/group voltage residuals against their median and qualifies persistent differences. Residuals are not a unique contact-fault diagnosis.

Implementation ID
battery-contact-monitor
Reviewed
2026-10-27

Behavior

Forms measured-minus-predicted voltage residuals, subtracts their channel median, filters the differences and qualifies consecutive threshold crossings when current is large enough.

Interface

Cell contact residual monitor interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Cell contact residual monitorStudio blockmeasuredpredictedcurrentenableresidualfaultsfaultvalid
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
measuredinputVMeasured cell/group voltages; 3 channels at the default configuration.
predictedinputVPredicted healthy voltages; 3 channels at the default configuration.
currentinputASigned current; scalar.
enableinputtrue / falseEnable; scalar.
residualoutputVFiltered differential residual; 3 channels at the default configuration.
faultsoutputtrue / falseQualified channel symptoms; 3 channels at the default configuration.
faultoutputtrue / falseAny qualified symptom; scalar.
validoutputtrue / falseSufficient current; scalar.

Parameters

Defaults are initial model values. Select values for your own model and operating conditions.

Configuration fields
ParameterUnitDefaultMeaning and limits
Sample interval (s)
sampleTimeS
s1Positive sample interval. Initialization has zero elapsed time; subsequent accepted samples update memory.
Number of measurement channels
cells
13Number of measurement channels. This is an editable model input; the default belongs to the synthetic worked example.
Residual filter weight (0–1)
filterWeight
0–10.5Residual filter weight (0–1). This is an editable model input; the default belongs to the synthetic worked example.
Residual threshold (V)
thresholdV
V0.008Residual threshold (V). This is an editable model input; the default belongs to the synthetic worked example.
Minimum diagnostic current (A)
minCurrentA
A1Minimum diagnostic current (A). This is an editable model input; the default belongs to the synthetic worked example.
Consecutive qualifying samples
requiredSamples
12Consecutive qualifying samples. This is an editable model input; the default belongs to the synthetic worked example.

Equations and rules

  • d[j] = measured[j] - predicted[j]
  • residual[j] = filtered(d[j] - median(d))

Worked example

Cell contact residual monitor worked example

Use the defaults below with Measured cell/group voltages = [3.64, 3.66, 3.66] V, Predicted healthy voltages = [3.66, 3.66, 3.66] V, Signed current = 2 A, Enable = 1 true / false. At 0 s, Filtered differential residual is [0, 0, 0] V. Additional checks are listed below.

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Filtered differential residual
residual
0[0, 0, 0]V1e-08
Any qualified symptom
fault
0falsetrue / false1e-08
Sufficient current
valid
0truetrue / false1e-08
Any qualified symptom
fault
2truetrue / false0

Explore the recorded outputs

Cell contact residual monitor recorded example

Cell contact residual monitor / Filtered differential residual [1]
Cell contact residual monitor / Filtered differential residual [1] against timeRecorded synthetic simulation values. Time in seconds; output in V.-0.01890-0.0138250.75-0.008751.5-0.0036752.250.00143VTime (s)
Cell contact residual monitor / Filtered differential residual [1]: 0 V at 0 s

4 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.

Download the recorded samples (JSON) · Open this Studio example after release

Use in a workflow

Cell contact residual monitor worked example

Filters cell/group voltage residuals against their median and qualifies persistent differences. Residuals are not a unique contact-fault diagnosis.

  1. Cell contact residual monitor: Forms measured-minus-predicted voltage residuals, subtracts their channel median, filters the differences and qualifies consecutive threshold crossings when current is large enough.
    • Use the parameter values in the block reference.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • Requires at least three channels. Contact loss, parameter mismatch and sensor bias can produce the same symptom; this is not a unique fault diagnosis.
  • The example verifies numerical behavior for synthetic parameters. Cell characterization and validation for an intended use are separate tasks.

Scientific and mathematical references

These sources explain the scientific and mathematical background. The behavior, interface and limits above define the Lemonergy implementation; a citation does not imply every model option in the source is implemented.

  1. Getting Started with the BQ76925

    Texas Instruments · 2019

    Technical reference · A concrete BMS analog front-end example: cell voltage, current, temperature measurement and MCU integration.

Implementation sources

This reference follows the public interface and locally verified numerical checks for an upcoming release.

Contract: Lemonergy Studio public contract · Verification record: verification-2026-10-27

  • docs/glossary/native-block-verification.json

This implementation and its workflow uses (JSON) · Knowledge graph (JSON-LD)