Balancing states
info
- All mentioned variables are located in folder
/driver/balancing/.
Balancing configuration
Balancing is allowed in states IDLE and greater. In the OVERVOLTAGE state, balancing is forced regardless of the balStartDelta parameter (the delta is treated as 0), to discharge the highest cells as fast as possible.
Balancing is automatically disabled when:
- The balancer is overtemperature (
balStatebit 2 - see temperature limitation) - Any cell is in undervoltage (
balStatebit 8) - The cell check failed or the balancer failed (
balStatebits 16 and 32) - A cell voltage is less than 200 mV above the
cellMinVoltagethreshold (that cell is excluded from balancing)
| Parameter | Description |
|---|---|
cellBalVoltage | If voltage of cell is above this value, balancing of that cell is allowed. |
balStartDelta | If the difference between the highest and lowest cell voltage is above this value, balancing is started. |
balEndDelta | If the difference between the highest and lowest cell voltage is below this value, balancing is stopped. |
maxSimBal | Maximum number of cells balanced at one moment. If there is overtemperature of balancer, the BMS will automatically reduce number os balanced cells. |
Balancing states
balCmd
| Bit (value) | Meaning |
|---|---|
| 1 | Balancing is enabled (the state machine allows balancing in the current state) |
| 2 | Balancing is overridden by the balance shell command (ignoring cellBalVoltage and the BMS state) |
balState
| Bit (value) | Meaning | Cause and consequence |
|---|---|---|
| 1 | Is balancing | At least one cell is being balanced right now (see cellBalancePrio). The BMS will not go to sleep while balancing. |
| 2 | Balancer overtemperature | A balancer temperature sensor exceeded its max threshold. Balancing is paused until the balancer cools down. See temperature limitation. |
| 4 | Cell overvoltage | A cell voltage was above cellMaxVoltage for more than 2 s. The BMS enters the OVERVOLTAGE state. See cell voltage limitation. |
| 8 | Cell undervoltage | A cell voltage was below cellMinVoltage for more than 1 s. The BMS enters the UNDERVOLTAGE state and balancing is disabled. See cell voltage limitation. |
| 16 | Cell check error | badCells is non-zero, or the sum of cellVoltages differs from the measured pack voltage by more than 1 V. The BMS enters the FAIL state ("Cell check fail", value 106). |
| 32 | Balancer failure | The balancer IC stopped responding at runtime (communication problem). The BMS enters the FAIL state ("Balancer fail", value 103) and retries every 5 s. |
| 64 | Critical undervoltage | A cell was below CritUnderVoltage for more than 10 minutes. The BMS enters the FAIL state ("Critical undervoltage", value 104). |
| 128 | Balancing forced | Balancing was forced manually with the balance shell command (a specific cell bitmask is active). |
badCells
Bitwise state which signalizes cells with a connection error (bit index = cell index):
- If the cell is expected (index below
Scount) and its voltage is below 100 mV - If the cell is not expected (index at or above
Scount) and its voltage is above 100 mV
A non-zero badCells raises balState bit 16 (cell check error) and puts the BMS to the FAIL state. Typical cause: wrong Scount setting or a broken cell sense wire.
*All the states are bitwise
Balancer readings
| Variable | Description |
|---|---|
cellVoltages | [mV] Array of cell voltages. |
cellBalancePrio | Array of balancing priorities. 0 = cell not balanced, 1 = highest priority (highest voltage), 2 = next ... |
cellMin | [mV] Minimum cell voltage. |
cellMinIndex | Index of the cell with the lowest voltage. |
cellMax | [mV] Maximum cell voltage. |
cellMaxIndex | Index of the cell with the highest voltage. |
cellDiff | [mV] Difference between the highest and lowest cell voltage. |
cellVoltSum | [V] Sum of all cell voltages. Compared against the pack voltage by the cell check. |