Skip to content
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
2 changes: 1 addition & 1 deletion packages/control/algorithm/surplus_controlled.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def phase_switch_necessary() -> bool:
if cp.chargemode_changed or cp.submode_changed:
if (control_parameter.state in CHARGING_STATES):
if cp.data.set.charging_ev_data.ev_template.data.prevent_charge_stop is False:
threshold = evu_counter.calc_switch_off_threshold(cp)[0]
threshold = evu_counter.calc_switch_off_threshold(cp)
if evu_counter.calc_raw_surplus() - cp.data.set.required_power < threshold:
control_parameter.required_currents = [0]*3
control_parameter.state = ChargepointState.NO_CHARGING_ALLOWED
Expand Down
15 changes: 7 additions & 8 deletions packages/control/counter.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,25 +386,24 @@ def switch_off_check_timer(self, chargepoint: Chargepoint) -> None:
except Exception:
log.exception("Fehler im allgemeinen PV-Modul")

def calc_switch_off_threshold(self, chargepoint: Chargepoint) -> Tuple[float, float]:
def calc_switch_off_threshold(self, chargepoint: Chargepoint) -> float:
pv_config = data.data.general_data.data.chargemode_config.pv_charging
control_parameter = chargepoint.data.control_parameter
if chargepoint.data.set.charge_template.data.chargemode.pv_charging.feed_in_limit:
# Der EVU-Überschuss muss ggf um die Einspeisegrenze bereinigt werden.
# Wnn die Leistung nicht Einspeisegrenze + Einschaltschwelle erreicht, darf die Ladung nicht pulsieren.
# Abschaltschwelle um Einschaltschwelle reduzieren.
feed_in_yield = (-data.data.general_data.data.chargemode_config.pv_charging.feed_in_yield
+ pv_config.switch_on_threshold*control_parameter.phases)
threshold = (-data.data.general_data.data.chargemode_config.pv_charging.feed_in_yield
+ pv_config.switch_on_threshold*control_parameter.phases)
else:
feed_in_yield = 0
threshold = pv_config.switch_off_threshold + feed_in_yield
return threshold, feed_in_yield
threshold = pv_config.switch_off_threshold
return threshold

def calc_switch_off(self, chargepoint: Chargepoint) -> Tuple[float, float]:
switch_off_power = self.calc_surplus() - self.data.set.released_surplus
threshold, feed_in_yield = self.calc_switch_off_threshold(chargepoint)
threshold = self.calc_switch_off_threshold(chargepoint)
log.debug(f'LP{chargepoint.num} Switch-Off-Threshold prüfen: {switch_off_power}W, Schwelle: {threshold}W, '
f'freigegebener Überschuss {self.data.set.released_surplus}W, Einspeisegrenze {feed_in_yield}W')
f'freigegebener Überschuss {self.data.set.released_surplus}W')
return switch_off_power, threshold

def switch_off_check_threshold(self, chargepoint: Chargepoint) -> bool:
Expand Down