Balancing Module
Source: docs.foxbms.org — Balancing
Files: src/app/application/bal/bal.c, bal.h, bal_cfg.h
Strategies: bal_strategy_voltage.c, bal_strategy_history.c, bal_strategy_none.c
Strategy 1: Voltage-Based Balancing
- Find minimum cell voltage in pack
- Balance all cells with voltage >
V_min + BAL_GetBalancingThreshold_mV() - When equalization complete, new threshold =
V_min + threshold + BAL_HYSTERESIS_mV(prevents oscillation)
Strategy 2: History-Based Balancing (SOC-Based)
- Wait for rest period (voltages stabilize)
- Convert cell voltages to SOC via lookup table
- Convert SOC to DOD:
DOD = Capacity × (1 - SOC) - Most discharged cell becomes reference (DOD = 0)
- Calculate charge difference for each cell:
Charge_diff = DOD_ref - DOD_cell - Balance continuously: every second,
I_bal = V_cell / R_balancing - Reduce charge difference by
I_bal × 1seach second - Deactivate when charge difference = 0
Requirements:
- SLV_BALANCING_RESISTANCE_ohm must match physical balancing resistors
- SE_GetStateOfChargeFromVoltage() lookup table must be configured
Strategy 3: No Balancing
Disables all cell equalization.
POSIX Port Status
Balancing logic runs but has nothing to balance — all cells are identical (3700mV). GAP-ANALYSIS GA-10: need per-cell voltage variation (Phase 2 remaining work) to exercise balancing decisions.