Battery knowledge · State estimation

Kalman filter

A recursive estimator that blends a model prediction with noisy measurements according to how much each is trusted. In a BMS an extended Kalman filter combines coulomb counting with a voltage model to track SOC and sometimes resistance. [1]

Example

State estimation: an example situation

Current-sensor bias accumulates in coulomb counting. Exact model SOC does not establish real estimator accuracy.

Read Kalman filter alongside Battery management system in this context. The electronics and software that keep a battery inside its safe window: measuring every cell voltage and many temperatures, estimating SOC and SOH, balancing cells, computing current limits, controlling the contactors and reporting over the vehicle network.

Use in Lemonergy

Lemonergy Studio blocks

Capacity observer worked example

Scalar capacity Kalman update from independent SOC change and removed charge.

Blocks to use

  1. Capacity observer

    Updates a scalar capacity estimate using an independently obtained SOC decrease and measured removed charge. Invalid windows retain prediction. The capacity estimate is bounded and reports clipping status.

    Inputs & settings
    • Use the parameter values in the block reference.
    • Bundled example verified on the production release of 28 October 2026.

This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.

  1. Review the block inputs, units and model limits.
  2. Open the Studio example and run its bundled model.
  3. Compare the output channels with the numerical checks; change one input and run again.

Example. Use the defaults below with Independent SOC decrease = 0.2 1 (fraction), Removed charge (Ah) = 0.4 Ah, Window valid = 1 true / false, Reset = 0 true / false. At 0 s, Estimated capacity (Ah) is 1.96 Ah. Additional checks are listed below.

Observe. Inspect the outputs and numerical checks on the block reference page.

Capacity is observable only with informative SOC changes. Feeding the same capacity-dependent SOC calculation back into the observer can create circular evidence. The example verifies numerical behavior for synthetic parameters. Cell characterization and validation for an intended use are separate tasks.

Open Studio example →

Lemonergy Studio blocks

Cell-delta SOC EKF worked example

Estimates deviation from a supplied average. Average-error variance enters voltage uncertainty under an explicit independent-error assumption.

Blocks to use

  1. Cell-delta SOC EKF

    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.

    Inputs & settings
    • Use the parameter values in the block reference.
    • Bundled example verified on the production release of 28 October 2026.

This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.

  1. Review the block inputs, units and model limits.
  2. Open the Studio example and run its bundled model.
  3. Compare the output channels with the numerical checks; change one input and run again.

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. At 0 s, SOC deviation from average is -0.01 1. Additional checks are listed below.

Observe. Inspect the outputs and numerical checks on the block reference page.

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.

Open Studio example →

Lemonergy Studio blocks

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.

Blocks to use

  1. 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.

    Inputs & settings
    • Use the parameter values in the block reference.
    • Bundled example verified on the production release of 28 October 2026.

This overview identifies the components to use. Follow the example in Lemonergy for their connections and settings.

  1. Review the block inputs, units and model limits.
  2. Open the Studio example and run its bundled model.
  3. Compare the output channels with the numerical checks; change one input and run again.

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.

Observe. Inspect the outputs and numerical checks on the block reference page.

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.

Open Studio example →
All connected Lemonergy block references

References & further reading

Technical references

  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.

Further reading on this topic

These sources provide broader context; they are not presented as citations for every statement in this entry.

  1. 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

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