LibreSolar / bms-firmware

Firmware for LibreSolar BMS boards based on bq769x0, bq769x2 or ISL94202
https://libre.solar/bms-firmware/
Apache License 2.0
146 stars 67 forks source link

BMS current limit values configuration via thingset #71

Open ananya-wattsnext opened 3 months ago

ananya-wattsnext commented 3 months ago

When updating the nominal capacity of the battery pack using thingset the discharge overcurrent limit, discharge short circuit limit and charge overcurrent limit is not updated according to the updated nominal capacity of the battery pack.

Discharge overcurrent limit, discharge short circuit limit and charge overcurrent limit are modified according to the nominal capacity of the pack in the bms_init_config function but when the nominal capacity is updated via thingset these threshold values are not updated according to the updated nominal capacity of the pack.

In bms_init_config function the short circuit limit is calculated as bms->ic_conf.dis_sc_limit = bms->ic_conf.dis_oc_limit * 2; where bms->ic_conf.dis_oc_limit = bms->nominal_capacity_Ah;.

When bms.nominal_capacity_Ah is updated via thingset dis_sc_limit value is calculated based on the old nominal_capacity_Ah since in bms_ic_bq769x2_configure function the bms.nominal_capacity_Ah is not updated.

The discharge overcurrent limit, discharge short circuit limit and charge overcurrent limit has to be entered separately.

When the bms.nominal_capacity_Ah value is updated via thingset how to update it in the bms_ic_bq769x2_configure function?

This feature can be used to test the BMS board using battery simulator and electronic load tester.