Lemonergy · Studio block
Cell-delta SOC EKF with resistance input
Estimates deviation from a supplied average. Average-error variance enters voltage uncertainty under an explicit independent-error assumption.
- Implementation ID
battery-cell-delta-soc-ekf-variable-resistance- Reviewed
- 2026-10-27
Behavior
Estimates the target cell SOC deviation from a supplied pack average. The variable-resistance version accepts the target resistance as an input. Average-estimate variance enters the voltage uncertainty under an independent-error assumption.
Interface
| Name | Direction | Unit | Meaning |
|---|---|---|---|
current | input | A | Series current; scalar. |
voltage | input | V | Measured cell voltage; scalar. |
average | input | 1 (fraction) | Average SOC; scalar. |
averageVariance | input | 1 | Average SOC variance; scalar. |
valid | input | true / false | Aligned measurements valid; scalar. |
reset | input | true / false | Reset; scalar. |
resistance | input | 1 | Cell resistance (ohm); scalar. |
delta | output | 1 | SOC deviation from average; scalar. |
fraction | output | 1 (fraction) | Reconstructed cell SOC; scalar. |
variance | output | 1 | Delta SOC variance; scalar. |
innovation | output | V | Cell voltage innovation; scalar. |
gain | output | 1 | Correction gain; 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. |
Target-cell capacity (Ah)cellCapacityAh | Ah | 2 | Target-cell capacity (Ah). This is an editable model input; the default belongs to the synthetic worked example. |
Average-cell capacity (Ah)averageCapacityAh | Ah | 2 | Average-cell capacity (Ah). This is an editable model input; the default belongs to the synthetic worked example. |
Initial SOC deviation from averageinitialDelta | 1 | 0 | Initial SOC deviation from average. 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.01 | 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. |
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. |
Equations and rules
innovation = Vmeasured - VpredictedK = Ppredicted*H / (H^2*Ppredicted + R)fraction = predictedFraction + K*innovationP = (1-K*H)^2*Ppredicted + K^2*RcellSOC = suppliedAverageSOC + estimatedDelta
Worked example
Cell-delta SOC EKF with resistance input worked example
Use the defaults below with Series current = 1 A, Measured cell voltage = 3.73 V, Average SOC = 0.8 1 (fraction), Average SOC variance = 0 1, Aligned measurements valid = 1 true / false, Reset = 0 true / false, Cell resistance (ohm) = 0.05 1. At 0 s, SOC deviation from average is -0.01 1. Additional checks are listed below.
Open Studio example after release →| Output | Time (s) | Expected value | Unit | Absolute tolerance |
|---|---|---|---|---|
SOC deviation from averagedelta | 0 | -0.01 | 1 | 1e-08 |
Reconstructed cell SOCfraction | 0 | 0.79 | 1 (fraction) | 1e-08 |
Delta SOC variancevariance | 0 | 0.005 | 1 | 1e-08 |
Cell voltage innovationinnovation | 0 | -0.02 | V | 1e-08 |
Correction gaingain | 0 | 0.5 | 1 | 1e-08 |
Explore the recorded outputs
Cell-delta SOC EKF with resistance input recorded example
Cell-delta SOC EKF with resistance input / SOC deviation from average2 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
Cell-delta SOC EKF with resistance input worked example
Estimates deviation from a supplied average. Average-error variance enters voltage uncertainty under an explicit independent-error assumption.
- Cell-delta SOC EKF with resistance input: Estimates the target cell SOC deviation from a supplied pack average. The variable-resistance version accepts the target resistance as an input. Average-estimate variance enters the voltage uncertainty under an independent-error assumption.
- 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.
- No jointly estimated correlated covariance between the average and the cell deviation.
- 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)