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 surplus controlled #2245

Merged
merged 2 commits into from
Mar 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 6 additions & 2 deletions packages/control/algorithm/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,12 @@ def update_raw_data(preferenced_chargepoints: List[Chargepoint],

if diff_to_zero is False:
if chargepoint.data.control_parameter.min_current < max_target_set_current:
diffs = [chargepoint.data.control_parameter.min_current -
max_target_set_current if required_currents[i] != 0 else 0 for i in range(3)]
if surplus:
diffs = [chargepoint.data.set.target_current -
max_target_set_current if required_currents[i] != 0 else 0 for i in range(3)]
else:
diffs = [chargepoint.data.control_parameter.min_current -
max_target_set_current if required_currents[i] != 0 else 0 for i in range(3)]
else:
continue
else:
Expand Down
2 changes: 1 addition & 1 deletion packages/control/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ def switch_on_timer_expired(self, chargepoint: Chargepoint) -> None:
control_parameter.timestamp_switch_on_off = None
self.data.set.reserved_surplus -= pv_config.switch_on_threshold*control_parameter.phases
msg = self.SWITCH_ON_EXPIRED.format(pv_config.switch_on_threshold)
control_parameter.state = ChargepointState.CHARGING_ALLOWED
control_parameter.state = ChargepointState.WAIT_FOR_USING_PHASES

if chargepoint.data.set.charging_ev_data.charge_template.data.chargemode.pv_charging.feed_in_limit:
feed_in_yield = pv_config.feed_in_yield
Expand Down