Skip to content

Commit

Permalink
Troubleshooting
Browse files Browse the repository at this point in the history
  • Loading branch information
mr-manuel committed Jul 12, 2024
1 parent 26475e1 commit 89549b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions etc/dbus-serialbattery/battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,10 +569,12 @@ def manage_charge_voltage_linear(self) -> None:
else:
control_voltage = self.max_battery_voltage

logging.info(f"control_voltage #1: {control_voltage:.2f} V")
control_voltage = min(
max(control_voltage, self.min_battery_voltage),
self.max_battery_voltage,
)
logging.info(f"control_voltage #2: {control_voltage:.2f} V")

# use P-Controller
else:
Expand All @@ -593,6 +595,7 @@ def manage_charge_voltage_linear(self) -> None:
control_voltage = self.max_battery_voltage

self.control_voltage = control_voltage
logging.info(f"control_voltage #3: {control_voltage:.2f} V")

self.charge_mode = (
"Bulk" if self.max_voltage_start_time is None else "Absorption"
Expand Down Expand Up @@ -651,6 +654,7 @@ def manage_charge_voltage_linear(self) -> None:
else:
self.control_voltage = float_voltage

logging.info(f"control_voltage #4: {control_voltage:.2f} V")
self.charge_mode = charge_mode

self.charge_mode += " (Linear Mode)"
Expand Down
4 changes: 2 additions & 2 deletions etc/dbus-serialbattery/dbushelper.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,10 +834,10 @@ def publish_battery(self, loop):
if time_since_first_error >= 60 * 20 and not utils.BLOCK_ON_DISCONNECT:
loop.quit()

# This is to mannage CVCL
# This is to manage CVCL
self.battery.manage_charge_voltage()

# This is to mannage CCL\DCL
# This is to manage CCL\DCL
self.battery.manage_charge_current()

# Manage battery state, if not set to error (10)
Expand Down

0 comments on commit 89549b3

Please sign in to comment.