Skip to content

Commit

Permalink
Revert "Fixed no current adjustment if the control range is maintained (
Browse files Browse the repository at this point in the history
#1926)" (#1928)

This reverts commit 910c72c.
  • Loading branch information
LKuemmel authored Oct 9, 2024
1 parent 910c72c commit 980a9fe
Showing 1 changed file with 2 additions and 15 deletions.
17 changes: 2 additions & 15 deletions packages/control/algorithm/surplus_controlled.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from control.algorithm import common
from control.chargepoint.charging_type import ChargingType
from control.loadmanagement import LimitingValue, Loadmanagement
from control.counter import ControlRangeState, Counter
from control.counter import Counter
from control.chargepoint.chargepoint import Chargepoint
from control.algorithm.filter_chargepoints import (get_chargepoints_by_mode, get_chargepoints_by_mode_and_counter,
get_preferenced_chargepoint_charging)
Expand Down Expand Up @@ -53,20 +53,7 @@ def _set(self,
feed_in_yield)
cp.data.control_parameter.limit = limit
available_for_cp = common.available_current_for_cp(cp, counts, available_currents, missing_currents)
if counter.get_control_range_state(feed_in_yield) == ControlRangeState.MIDDLE:
pv_charging = data.data.general_data.data.chargemode_config.pv_charging
dif_to_old_current = available_for_cp + cp.data.set.target_current - cp.set_current_prev
# Wenn die Differenz zwischen altem und neuem Soll-Strom größer als der Regelbereich ist, trotzdem
# nachregeln, auch wenn der Regelbereich eingehalten wird. Sonst würde zB nicht berücksichtigt werden,
# wenn noch ein Fahrzeug dazu kommmt.
if (pv_charging.control_range[1] - pv_charging.control_range[0]) / 230 < dif_to_old_current:
current = available_for_cp
else:
current = cp.set_current_prev - cp.data.set.target_current
else:
current = available_for_cp

current = common.get_current_to_set(cp.data.set.current, current, cp.data.set.target_current)
current = common.get_current_to_set(cp.data.set.current, available_for_cp, cp.data.set.target_current)
self._set_loadmangement_message(current, limit, cp, counter)
limited_current = self._limit_adjust_current(cp, current)
limited_current = self._fix_deviating_evse_current(limited_current, cp)
Expand Down

0 comments on commit 980a9fe

Please sign in to comment.