Lemonergy · Studio block

Pack-average SOC adaptive EKF

Homogeneous series-cell average observer. Voltage, resistance and observation slope scale by series count; output is an average, not individual cell SOC.

Implementation ID
battery-pack-soc-adaptive-ekf
Reviewed
2026-10-27

Behavior

Estimates the average SOC of homogeneous series cells. Voltage, resistance and observation slope scale by series count. Predicts a charge or energy fraction from signed throughput and corrects it using terminal voltage and a calibrated fraction-to-OCV table. Scalar Joseph covariance updates preserve nonnegative variance. Invalid voltage measurements skip correction; flat OCV regions report limited observability. Adaptive variants bound an innovation-based voltage-noise estimate.

Interface

Pack-average SOC adaptive EKF interfaceInputs or arguments on the left, observed outputs on the right. Conserving terminals appear below the component. The tables give units and behavior.Pack-average SOC adaptive EKFStudio blockcurrentvoltagevalidresetfractionvarianceinnovationgainnoisestatus
Original Lemonergy interface view. Lines identify ports; they are not a completed simulation circuit.
Ports and observed outputs
NameDirectionUnitMeaning
currentinputASeries pack current; scalar.
voltageinputVMeasured pack voltage; scalar.
validinputtrue / falseVoltage valid; scalar.
resetinputtrue / falseReset; scalar.
fractionoutput1 (fraction)Average SOC; scalar.
varianceoutput1Average SOC variance; scalar.
innovationoutputVPack voltage innovation; scalar.
gainoutput1Correction gain; scalar.
noiseoutput1Pack voltage-noise variance; scalar.
statusoutput1Observer status; 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.
Charge capacity (Ah)
capacity
Ah2Charge capacity (Ah). This is an editable model input; the default belongs to the synthetic worked example.
Initial SOC (0–1)
initialFraction
0–10.75Initial SOC (0–1). This is an editable model input; the default belongs to the synthetic worked example.
Initial fraction variance
initialVariance
10.01Initial fraction variance. This is an editable model input; the default belongs to the synthetic worked example.
Process variance rate (fraction²/s)
processNoise
fraction²/s0Process variance rate (fraction²/s). This is an editable model input; the default belongs to the synthetic worked example.
Voltage measurement variance (V²)
measurementNoise
V²0.04Voltage measurement variance (V²). This is an editable model input; the default belongs to the synthetic worked example.
Series resistance (Ω)
resistanceOhm
Ω0.05Series resistance (Ω). This is an editable model input; the default belongs to the synthetic worked example.
Noise adaptation weight (0–1)
adaptationRate
0–10.1Noise adaptation weight (0–1). This is an editable model input; the default belongs to the synthetic worked example.
Minimum voltage variance (V²)
minimumNoise
V²1e-06Minimum voltage variance (V²). This is an editable model input; the default belongs to the synthetic worked example.
Maximum voltage variance (V²)
maximumNoise
V²1Maximum voltage variance (V²). This is an editable model input; the default belongs to the synthetic worked example.
Open-circuit voltage table [SOC fraction, V]
ocvTable
See field order[[0, 3], [1, 4]]Open-circuit voltage table [SOC fraction, V]. Rows are ordered coordinate/value pairs; the first column must be strictly increasing.
Number of series cells
seriesCells
14Number of series cells. This is an editable model input; the default belongs to the synthetic worked example.

Equations and rules

  • innovation = Vmeasured - Vpredicted
  • K = Ppredicted*H / (H^2*Ppredicted + R)
  • fraction = predictedFraction + K*innovation
  • P = (1-K*H)^2*Ppredicted + K^2*R
  • Vpack,predicted = seriesCells * (OCV(averageSOC) - I*Rcell)

Worked example

Pack-average SOC adaptive EKF worked example

Use the defaults below with Series pack current = 1 A, Measured pack voltage = 15 V, Voltage valid = 1 true / false, Reset = 0 true / false. At 0 s, Average SOC is 0.79 1 (fraction). Additional checks are listed below.

Open Studio example after release →
Numerical checks for the bundled synthetic example
OutputTime (s)Expected valueUnitAbsolute tolerance
Average SOC
fraction
00.791 (fraction)1e-08
Average SOC variance
variance
00.00211e-08
Pack voltage innovation
innovation
00.2V1e-08
Correction gain
gain
00.211e-08

Explore the recorded outputs

Pack-average SOC adaptive EKF recorded example

Pack-average SOC adaptive EKF / Average SOC
Pack-average SOC adaptive EKF / Average SOC against timeRecorded synthetic simulation values. Time in seconds; output in 1 (fraction).0.789629400.79097280.250.79231620.50.79365960.750.795002911 (fraction)Time (s)
Pack-average SOC adaptive EKF / Average SOC: 0.79 1 (fraction) at 0 s

2 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

Pack-average SOC adaptive EKF worked example

Homogeneous series-cell average observer. Voltage, resistance and observation slope scale by series count; output is an average, not individual cell SOC.

  1. Pack-average SOC adaptive EKF: Estimates the average SOC of homogeneous series cells. Voltage, resistance and observation slope scale by series count. Predicts a charge or energy fraction from signed throughput and corrects it using terminal voltage and a calibrated fraction-to-OCV table. Scalar Joseph covariance updates preserve nonnegative variance. Invalid voltage measurements skip correction; flat OCV regions report limited observability. Adaptive variants bound an innovation-based voltage-noise estimate.
    • Use the parameter values in the block reference.
    • Implementation tested locally; public release pending.
Open Studio example after release

Connected concepts

Limits and interpretation

  • One-state extended Kalman observers, without an unscented transform, RC polarization states or automatic cell identification. SOE requires its own energy-fraction-to-OCV calibration. Synthetic filter settings are not accuracy guarantees.
  • The estimate is a pack average, without independently estimated cell states.
  • 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. Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs: Part 3. State and parameter estimation

    Gregory L. Plett · Journal of Power Sources · 2004

    Technical reference · Model-based battery state-of-charge and parameter estimation with extended Kalman filtering, including uncertainty and model dependence.

  2. Extended Kalman filtering for battery management systems of LiPB-based HEV battery packs: Part 2. Modeling and identification

    Gregory L. Plett · Journal of Power Sources · 2004

    Technical reference · Battery charge balance, open-circuit voltage, ohmic loss, polarization dynamics and model identification; parameters require cell-specific data.

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)