Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix proposal for #733 #735

Merged
merged 24 commits into from
Jun 27, 2023
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
d491b07
Refactor: Change time() to int(time()) for consistency in max_voltage…
ogurevich Jun 8, 2023
6c20cfe
The time difference ('tDiff') added to the debug output in the charge…
ogurevich Jun 8, 2023
9137fa3
Introduce PENALTY_BUFFER for Overcharge Prevention
ogurevich Jun 9, 2023
db6ed1b
Refactor battery voltage calculations for efficiency and clarity
ogurevich Jun 9, 2023
23db9e5
Refactor battery.py to use existing class variables for min/max voltage
ogurevich Jun 9, 2023
8ce3661
remove unnecessary brackets
ogurevich Jun 9, 2023
c385803
fix formatting with black formatter
ogurevich Jun 10, 2023
6cabc93
hm, fix imported but unused (flake8 action failed)
ogurevich Jun 10, 2023
f8c00c7
calc self.max_battery_voltage, self.min_battery_voltage in manage_cha…
ogurevich Jun 10, 2023
8bc2b9c
reduce PENALTY_BUFFER (do we really need it at all ?)
ogurevich Jun 10, 2023
187723f
calculate min/max battery voltage on battery class init
mr-manuel Jun 10, 2023
75a8f26
Update battery.py
mr-manuel Jun 10, 2023
c52c7d0
init max min voltage in prepare_voltage_management()
ogurevich Jun 10, 2023
43672c8
Merge branch 'ogdev' of github.com:ogurevich/dbus-serialbattery into …
ogurevich Jun 10, 2023
4449850
Merge remote-tracking branch 'origin/dev' into ogdev
ogurevich Jun 10, 2023
027e694
remove penalty_buffer
ogurevich Jun 10, 2023
6391341
removed debug output, comment on resetting of max_voltage_start_time
ogurevich Jun 11, 2023
4fc9e43
Merge branch 'dev' into ogdev
ogurevich Jun 11, 2023
54d013c
Merge branch 'dev' of github.com:ogurevich/dbus-serialbattery into dev
ogurevich Jun 16, 2023
465413e
Merge branch 'dev' into ogdev
ogurevich Jun 26, 2023
18d5333
Merge remote-tracking branch 'origin/dev' into ogdev
ogurevich Jun 26, 2023
81a2fc7
fix proposal for #733
ogurevich Jun 26, 2023
8d2440b
format with BlackFormatter
ogurevich Jun 26, 2023
712e332
use 3 digit in constant, removed unnecessary code
ogurevich Jun 26, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions etc/dbus-serialbattery/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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.
Expand Down