From 975b5fc54a60eb1662fc339a5498c6ea6a32e06a Mon Sep 17 00:00:00 2001 From: Oleg Gurevich <50322596+ogurevich@users.noreply.github.com> Date: Tue, 27 Jun 2023 12:10:04 +0200 Subject: [PATCH] fix proposal for #733 (#735) * Added: Tollerance to enter float voltage once the timer is triggered --- etc/dbus-serialbattery/battery.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/etc/dbus-serialbattery/battery.py b/etc/dbus-serialbattery/battery.py index d92500fd..38f1aa62 100644 --- a/etc/dbus-serialbattery/battery.py +++ b/etc/dbus-serialbattery/battery.py @@ -250,7 +250,8 @@ def manage_charge_voltage_linear(self) -> None: voltageSum = 0 penaltySum = 0 tDiff = 0 - + # meassurment and variation tolerance in volts + measurementToleranceVariation = 0.022 try: # calculate battery sum for i in range(self.cell_count): @@ -290,7 +291,12 @@ def manage_charge_voltage_linear(self) -> None: self.max_voltage_start_time = None # we don't forget to reset max_voltage_start_time wenn we going to bulk(dynamic) mode # regardless of whether we were in absorption mode or not - if voltageSum < self.max_battery_voltage - utils.VOLTAGE_DROP: + if ( + voltageSum + < self.max_battery_voltage + - utils.VOLTAGE_DROP + - measurementToleranceVariation + ): self.max_voltage_start_time = None # INFO: battery will only switch to Absorption, if all cells are balanced.