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
| Name | Direction | Unit | Meaning |
|---|---|---|---|
current | input | A | Series pack current; scalar. |
voltage | input | V | Measured pack voltage; scalar. |
valid | input | true / false | Voltage valid; scalar. |
reset | input | true / false | Reset; scalar. |
fraction | output | 1 (fraction) | Average SOC; scalar. |
variance | output | 1 | Average SOC variance; scalar. |
innovation | output | V | Pack voltage innovation; scalar. |
gain | output | 1 | Correction gain; scalar. |
noise | output | 1 | Pack voltage-noise variance; scalar. |
status | output | 1 | Observer status; scalar. |
Parameters
Defaults are initial model values. Select values for your own model and operating conditions.
| Parameter | Unit | Default | Meaning and limits |
|---|---|---|---|
Sample interval (s)sampleTimeS | s | 1 | Positive sample interval. Initialization has zero elapsed time; subsequent accepted samples update memory. |
Charge capacity (Ah)capacity | Ah | 2 | Charge capacity (Ah). This is an editable model input; the default belongs to the synthetic worked example. |
Initial SOC (0–1)initialFraction | 0–1 | 0.75 | Initial SOC (0–1). This is an editable model input; the default belongs to the synthetic worked example. |
Initial fraction varianceinitialVariance | 1 | 0.01 | Initial fraction variance. This is an editable model input; the default belongs to the synthetic worked example. |
Process variance rate (fraction²/s)processNoise | fraction²/s | 0 | Process 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.04 | Voltage measurement variance (V²). This is an editable model input; the default belongs to the synthetic worked example. |
Series resistance (Ω)resistanceOhm | Ω | 0.05 | Series resistance (Ω). This is an editable model input; the default belongs to the synthetic worked example. |
Noise adaptation weight (0–1)adaptationRate | 0–1 | 0.1 | Noise 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-06 | Minimum voltage variance (V²). This is an editable model input; the default belongs to the synthetic worked example. |
Maximum voltage variance (V²)maximumNoise | V² | 1 | Maximum 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 cellsseriesCells | 1 | 4 | Number of series cells. This is an editable model input; the default belongs to the synthetic worked example. |
Equations and rules
innovation = Vmeasured - VpredictedK = Ppredicted*H / (H^2*Ppredicted + R)fraction = predictedFraction + K*innovationP = (1-K*H)^2*Ppredicted + K^2*RVpack,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 →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
Average SOCfraction | 0 | 0.79 | 1 (fraction) | 1e-08 |
Average SOC variancevariance | 0 | 0.002 | 1 | 1e-08 |
Pack voltage innovationinnovation | 0 | 0.2 | V | 1e-08 |
Correction gaingain | 0 | 0.2 | 1 | 1e-08 |
Explore the recorded outputs
Pack-average SOC adaptive EKF recorded example
Pack-average SOC adaptive EKF / Average SOC2 actual recorded samples. Lines are visual guides between samples. Synthetic example, not measured cell data.
Read the selected signal as a table
| Time (s) | Value |
|---|
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.
- 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.
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.
- 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.
- 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)