victronenergy / venus

Victron Energy Unix/Linux OS
https://github.com/victronenergy/venus/wiki
545 stars 70 forks source link

DVCC: Charge current limit can get stuck if BMS is momentarily disconnected or lost #1224

Closed izak closed 3 months ago

izak commented 4 months ago

Steps to create situation:

  1. Connect a BMS that sends a charge current limit. This is written to com.ve.vebus/BatteryOperationalLimits/MaxChargeCurrent.
  2. Disconnect the BMS. System sees there is no BMS, and sends the limit to com.ve.vebus/Dc/0/MaxChargeCurrent instead.
  3. Lower the max charge current setting in the DVCC menu to a lower value. This writes this lower limit to com.ve.vebus/Dc/0/MaxChargeCurrent.
  4. Reconnect the BMS. System switches back to writing the higher limit to com.ve.vebus/BatteryOperationalLimits/MaxChargeCurrent.
  5. Disable the maximum charge current setting in the DVCC menu.
  6. Since system uses the lower of the two values, it is now stuck at the lower value that was previously set instead of the higher one sent by the BMS.

Possible solutions

  1. Just write the limit to both paths on every iteration (increases dbus traffic :-1:)
  2. Write the limit to /Dc/0/MaxChargeCurrent if it is lower than what the BMS wants
  3. Write a large value to /Dc/0/MaxChargeCurrent once when the DVCC setting changes, if it is unset (equal to -1). That maxes out the charge current so the BMS has full control.

Solution 3 seems like the best.