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

drivers: bms_ic: rework balancing control #57

Open martinjaeger opened 6 months ago

martinjaeger commented 6 months ago

Switching between automatic and manual balancing requires to enter config update mode for the bq769x2. During config update mode, all measurements and protections are disabled. As also stated in the datasheet, this mode should only be activated for initial configuration (before actual operation of the battery).

This means that we have to decide regarding automatic or manual balancing operation at the very beginning and only allow manually setting the switches if we are not in automatic balancing mode.

This behavior makes sense also for other drivers than the bq769x2, as an application firmware would either control balancing itself or let the chip/driver control balancing autonomously. It is not required to switch between automatic and manual balancing while the BMS is in operation.