Skip to content

Commit

Permalink
Merge branch 'dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel authored Jun 28, 2023
2 parents 1fffdaf + 975b5fc commit 11e546d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions etc/dbus-serialbattery/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,9 @@ def manage_charge_voltage_linear(self) -> None:
penaltySum = 0
tDiff = 0
current_time = int(time())

# meassurment and variation tolerance in volts
measurementToleranceVariation = 0.022

try:
# calculate battery sum
for i in range(self.cell_count):
Expand Down Expand Up @@ -303,7 +305,12 @@ def manage_charge_voltage_linear(self) -> 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.
Expand Down

0 comments on commit 11e546d

Please sign in to comment.