Function bal_compute_imbalance(voltage_t, uint16_t, voltage_t, uint16_t)

Function Documentation

uint16_t bal_compute_imbalance(voltage_t volts[], uint16_t count, voltage_t threshold, uint16_t cells[])

Computes the cells with voltage exceeding the given threshold + lowest cell voltage.

Return
amount of cells to be discharged
Parameters
  • volts: Array of cell voltages
  • count: Size of volts
  • threshold: Balancing tolerance (voltage + threshold)
  • indexes: Output array of indexes to be balanced
  • cells: array of cell’s indexes that need to be discharged