-
Notifications
You must be signed in to change notification settings - Fork 116
phase switch: reset reserved power if vehicle is unplugged during phase switch #3303
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -184,6 +184,8 @@ def _process_charge_stop(self) -> None: | |
| self.data.set.ocpp_transaction_id, | ||
| self.data.set.rfid) | ||
| self.data.set.ocpp_transaction_id = None | ||
| # muss vor dem Zurücksetzen der control parameter aufgerufen werden | ||
| self.data.set.charging_ev_data.reset_phase_switch(self.data.control_parameter) | ||
| self.reset_control_parameter_at_charge_stop() | ||
|
Comment on lines
+187
to
189
|
||
| data.data.counter_all_data.get_evu_counter().reset_switch_on_off(self) | ||
| if self.data.get.plug_state is False and self.data.set.plug_state_prev is True: | ||
|
|
@@ -665,7 +667,7 @@ def update(self, ev_list: Dict[str, Ev]) -> None: | |
|
|
||
| if self.chargemode_changed or self.submode_changed: | ||
| data.data.counter_all_data.get_evu_counter().reset_switch_on_off(self) | ||
| charging_ev.reset_phase_switch(self.data.control_parameter) | ||
| charging_ev.reset_phase_switch_delay(self.data.control_parameter) | ||
| if self.chargemode_changed: | ||
| self.data.control_parameter.failed_phase_switches = 0 | ||
| message = message_ev if message_ev else message | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -429,21 +429,28 @@ def _remaining_phase_switch_time(self, control_parameter: ControlParameter, | |||||||||
| control_parameter.timestamp_phase_switch_buffer_start = None | ||||||||||
| return True, None | ||||||||||
|
|
||||||||||
| def reset_phase_switch(self, control_parameter: ControlParameter): | ||||||||||
| def reset_phase_switch_delay(self, control_parameter: ControlParameter): | ||||||||||
| """ Zurücksetzen der Zeitstempel und reservierten Leistung. | ||||||||||
|
|
||||||||||
|
Comment on lines
433
to
434
|
||||||||||
| """ Zurücksetzen der Zeitstempel und reservierten Leistung. | |
| """ Zurücksetzen der für die Phasenumschaltverzögerung reservierten Leistung. | |
| Zeitstempel werden hier nicht zurückgesetzt. |
Copilot
AI
Apr 17, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reset_phase_switch_delay() recomputes the reserved power with control_parameter.required_current * 3 * 230 - max_current_single_phase * 230 and then subtracts it without clamping. This does not match the reservation logic in auto_phase_switch() (which reserves max(0, min_current * max_phases * 230 - max_current_single_phase * 230)), and it can even become negative (which would increase reserved_surplus when subtracting). Please compute/release the same value that was originally reserved (including max(0, …)), and avoid hard-coding 3 phases if 2-phase hardware is supported.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In
_process_charge_stop()you callreset_phase_switch()before resetting the control parameters, butEv.reset_phase_switch()only releasesreserved_surplusforPERFORMING_PHASE_SWITCH. If the EV is unplugged whilecontrol_parameter.state == PHASE_SWITCH_DELAY(1→multi-phase delay), the reserved power added inEv.auto_phase_switch()will not be released, which can skewreserved_surplusas long as other EVs are still plugged in. Consider extending the reset to also handlePHASE_SWITCH_DELAY(or callreset_phase_switch_delay()here as well) and release exactly the amount that was reserved.