Skip to content

Commit

Permalink
ISL94202: Enable balancing during idle
Browse files Browse the repository at this point in the history
If the EOC voltage threshold is not low enough, balancing is only active
if the battery is charged, which does not make much sense.
  • Loading branch information
martinjaeger committed May 20, 2021
1 parent 8ff8c09 commit 11d60a4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
14 changes: 8 additions & 6 deletions src/isl94202/bms_isl94202.c
Original file line number Diff line number Diff line change
Expand Up @@ -157,12 +157,14 @@ float bms_apply_dis_ocp(BmsConfig *conf)
int bms_apply_cell_ovp(BmsConfig *conf)
{
// also apply balancing thresholds here
isl94202_write_voltage(ISL94202_CBVL, conf->bal_cell_voltage_min, 0);
isl94202_write_voltage(ISL94202_CBVU, 4.5F, 0); // no upper limit for balancing
isl94202_write_voltage(ISL94202_CBDL, conf->bal_cell_voltage_diff, 0);
isl94202_write_voltage(ISL94202_CBDU, 1.0F, 0); // no tight limit for voltage delta

isl94202_write_voltage(ISL94202_EOC, conf->cell_chg_voltage, 0);
isl94202_write_voltage(ISL94202_CBMIN, conf->bal_cell_voltage_min, 0);
isl94202_write_voltage(ISL94202_CBMAX, 4.5F, 0); // no upper limit for balancing
isl94202_write_voltage(ISL94202_CBMINDV, conf->bal_cell_voltage_diff, 0);
isl94202_write_voltage(ISL94202_CBMAXDV, 1.0F, 0); // no tight limit for voltage delta

// EOC condition needs to be set to bal_cell_voltage_min instead of cell_chg_voltage to enable
// balancing during idle
isl94202_write_voltage(ISL94202_EOC, conf->bal_cell_voltage_min, 0);

// keeping CPW at the default value of 1 ms
return isl94202_write_voltage(ISL94202_OVL_CPW, conf->cell_ov_limit, 1)
Expand Down
24 changes: 12 additions & 12 deletions src/isl94202/registers.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,24 @@
#define ISL94202_SCD_Msk (0x7U << ISL94202_SCD_Pos)

// Cell Balance Minimum Voltage (CBMIN)
#define ISL94202_CBVL (0x1CU)
#define ISL94202_CBVL_Pos (0x0U)
#define ISL94202_CBVL_Msk (0xFFFU << ISL94202_CBVL_Pos)
#define ISL94202_CBMIN (0x1CU)
#define ISL94202_CBMIN_Pos (0x0U)
#define ISL94202_CBMIN_Msk (0xFFFU << ISL94202_CBMIN_Pos)

// Cell Balance Maximum Voltage (CBMAX)
#define ISL94202_CBVU (0x1EU)
#define ISL94202_CBVU_Pos (0x0U)
#define ISL94202_CBVU_Msk (0xFFFU << ISL94202_CBVU_Pos)
#define ISL94202_CBMAX (0x1EU)
#define ISL94202_CBMAX_Pos (0x0U)
#define ISL94202_CBMAX_Msk (0xFFFU << ISL94202_CBMAX_Pos)

// Cell Balance Minimum Differential Voltage (CBMINDV)
#define ISL94202_CBDL (0x20U)
#define ISL94202_CBDL_Pos (0x0U)
#define ISL94202_CBDL_Msk (0xFFFU << ISL94202_CBDL_Pos)
#define ISL94202_CBMINDV (0x20U)
#define ISL94202_CBMINDV_Pos (0x0U)
#define ISL94202_CBMINDV_Msk (0xFFFU << ISL94202_CBMINDV_Pos)

// Cell Balance Maximum Differential Voltage (CBMAXDV)
#define ISL94202_CBDU (0x22U)
#define ISL94202_CBDU_Pos (0x0U)
#define ISL94202_CBDU_Msk (0xFFFU << ISL94202_CBDU_Pos)
#define ISL94202_CBMAXDV (0x22U)
#define ISL94202_CBMAXDV_Pos (0x0U)
#define ISL94202_CBMAXDV_Msk (0xFFFU << ISL94202_CBMAXDV_Pos)

// Cell Balance On Time (CBON)
#define ISL94202_CBONT (0x24U)
Expand Down

0 comments on commit 11d60a4

Please sign in to comment.