Skip to main content
Firmware Stable

BEST - Battery SOC estimator

The CAPRA firmware includes the BEST module to estimate the battery SOC (State Of Charge) and SOH (State Of Health). CAPRA uses the OCV table variant — the cell OCV curve is entered as a table per temperature breakpoint (T, ocv_T1..ocv_T6, 6 breakpoints), with a cell resistance per temperature (R0).

The CAPRA build additionally enables:

  • Current-dependent SOC gain — separate voltage-correction strengths at rest and under load (soc_gain, soc_gain_I)
  • Flat-curve (LFP) tuning — advanced tuning of the voltage correction for chemistries with a flat voltage curve (slope_ref, slope_min)
  • Online SOH & R0 tracking — battery capacity and internal resistance are estimated during operation
  • SOC reserve — the reported SOC is remapped to hide a bottom/top capacity reserve
  • Cycle counting — battery charge/discharge cycles are accumulated in a permanent
info

The BEST parameters are located in the /driver/best folder.

Single-cell mode

CAPRA runs BEST in single-cell mode — the S and Rs parameters are not present, and all voltages and capacities are per cell. The battery temperature for the OCV lookup is taken from the BMS battery temperature sensors.

Parameters​

P​

Number of cells in parallel. Set to 0 to disable coulomb counting.

soc_gain​

Array of 2 gains: soc_gain[0] sets how fast the SOC follows the cell voltage when the battery is at rest; soc_gain[1] the same under load above soc_gain_I. Higher values re-align the SOC with the voltage faster, lower values give a steadier SOC. Set to 0 to disable voltage correction.

soc_gain_I [A]​

Load current above which soc_gain[1] applies.

slope_ref [V]​

Advanced tuning of the voltage correction for chemistries with a flat voltage curve (LFP). Leave at default unless advised by siliXcon.

slope_min​

Advanced tuning of the voltage correction for chemistries with a flat voltage curve (LFP). Leave at default unless advised by siliXcon.

soc_rsv [%]​

SOC reserve array (index 0 = bottom, index 1 = top). The reported SOC reaches 0% / 100% at the reserve limits — e.g. {10, 3} means internal 10% is displayed as 0% and internal 97% as 100%.

note

The SOC reserve remapping applies to the SOC and energy values reported to the application. The SOC state always shows the internal, unmapped value.

reset_time [ms]​

How long the SOC re-sync phase at device startup lasts. Negative value for manual-only reset via the breset command or from the app. Set to 0 to disable the reset feature.

reset_gain​

How fast the SOC re-syncs to the cell voltage during the reset phase (reset_time after startup or breset).

Cc [mAh]​

Cell nominal capacity.

OCV tables​

ParameterUnitDescription
TCTemperature breakpoints array (6 values)
R0OhmCell resistance per temperature (array, one value per temperature breakpoint)
ocv_T1VOCV table for temperature T[0] (index 0 = 0% SOC, last index = 100% SOC)
ocv_T2VOCV table for temperature T[1]
ocv_T3VOCV table for temperature T[2]
ocv_T4VOCV table for temperature T[3]
ocv_T5VOCV table for temperature T[4]
ocv_T6VOCV table for temperature T[5]

SOH tracking​

ParameterUnitDescription
soh_TrestsHow long the battery must be at rest before the health estimate is updated
soh_IthrACurrent below which the battery is considered at rest
Cmax_lpfSmoothing of the reported capacity (Cmax) estimate
R0_lpfSmoothing of the reported cell resistance (R0_est) estimate

States​

StateUnitDescription
SOC0-1Battery state of charge
OCVVEstimated cell open circuit voltage
SOH0-1Battery state of health
R0_estOhmEstimated cell resistance at the current temperature
R0_rel-Relative cell resistance estimate, 1.0 = nominal

Permanents​

tip

Located at folder /permanents.

PermanentUnitDescription
CmaxmAhMaximum battery capacity (at 100% charge)
CactmAhActual battery capacity
cycles%Battery cycle counter; divide by 200 to obtain full charge/discharge cycles
R0r-Relative cell resistance estimate, 1.0 = nominal

Shell commands​

CommandDescription
bresetReset the whole BEST algorithm — SOC, SOH and R0. During reset_time, SOC is corrected using reset_gain
breset socReset SOC only
breset sohReset SOH only (capacity back to nominal)
breset r0Reset the R0 estimate to nominal. Use breset r0 nan to invalidate the estimate