Class Utils
java.lang.Object
io.openems.edge.controller.ess.timeofusetariff.Utils
Utils for
TimeOfUseTariffController
.
All energy values are in [Wh] and positive, unless stated differently.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionstatic final float
C-Rate (capacity divided by time) duringStateMachine.CHARGE_GRID
.static final int
Limit Charge Power for §14a EnWG.static final float
Keep some buffer to avoid scheduling errors because of bad predictions.static final ChannelAddress
static final ChannelAddress
static final ChannelAddress
static final ChannelAddress
static final ChannelAddress
static final ChannelAddress
-
Method Summary
Modifier and TypeMethodDescriptionstatic Utils.ApplyState
calculateAutomaticMode
(Sum sum, ManagedSymmetricEss ess, Integer essChargeInChargeGrid, int maxChargePowerFromGrid, boolean limitChargePowerFor14aEnWG, StateMachine targetState) Calculate Automatic Mode.static int
calculateChargeGridPower
(Integer essChargeInChargeGrid, ManagedSymmetricEss ess, int essActivePower, int gridActivePower, int maxChargePowerFromGrid, boolean limitChargePowerFor14aEnWG) Calculates the Max-ActivePower constraint forStateMachine.CHARGE_GRID
.static int
Calculates the ActivePower constraint forStateMachine.DELAY_DISCHARGE
.protected static int
calculateEssChargeInChargeGridPowerFromParams
(Integer essChargeInChargeGrid, ManagedSymmetricEss ess) static Integer
Calculates the Max-ActivePower constraint forinvalid reference
StateMachine#CHARGE_PRODUCTION
static int
getEssMinSocPercentage
(List<ControllerEssLimitTotalDischarge> ctrlLimitTotalDischarges, List<ControllerEssEmergencyCapacityReserve> ctrlEmergencyCapacityReserves) Returns the configured minimum SoC, or zero.static StateMachine
postprocessRunState
(StateMachine state, int pwrBalancing, int pwrDelayDischarge, int pwrChargeGrid) Post-Process a state duringController.run()
, i.e.
-
Field Details
-
ESS_MAX_SOC
public static final float ESS_MAX_SOCKeep some buffer to avoid scheduling errors because of bad predictions.- See Also:
-
ESS_LIMIT_14A_ENWG
public static final int ESS_LIMIT_14A_ENWGLimit Charge Power for §14a EnWG.- See Also:
-
ESS_CHARGE_C_RATE
public static final float ESS_CHARGE_C_RATEC-Rate (capacity divided by time) duringStateMachine.CHARGE_GRID
. With a C-Rate of 0.5 the battery gets fully charged within 2 hours.- See Also:
-
SUM_PRODUCTION
-
SUM_CONSUMPTION
-
SUM_GRID
-
SUM_UNMANAGED_CONSUMPTION
-
SUM_ESS_DISCHARGE_POWER
-
SUM_ESS_SOC
-
-
Method Details
-
getEssMinSocPercentage
public static int getEssMinSocPercentage(List<ControllerEssLimitTotalDischarge> ctrlLimitTotalDischarges, List<ControllerEssEmergencyCapacityReserve> ctrlEmergencyCapacityReserves) Returns the configured minimum SoC, or zero.- Parameters:
ctrlLimitTotalDischarges
- the list ofControllerEssLimitTotalDischarge
ctrlEmergencyCapacityReserves
- the list ofControllerEssEmergencyCapacityReserve
- Returns:
- the value in [%]
-
calculateAutomaticMode
public static Utils.ApplyState calculateAutomaticMode(Sum sum, ManagedSymmetricEss ess, Integer essChargeInChargeGrid, int maxChargePowerFromGrid, boolean limitChargePowerFor14aEnWG, StateMachine targetState) Calculate Automatic Mode.- Parameters:
sum
- theSum
ess
- theManagedSymmetricEss
essChargeInChargeGrid
- ESS Charge Energy in CHARGE_GRID State [Wh]maxChargePowerFromGrid
- the configured max charge from grid powerlimitChargePowerFor14aEnWG
- Limit Charge Power for §14a EnWGtargetState
- the scheduled targetStateMachine
- Returns:
Utils.ApplyState
-
postprocessRunState
public static StateMachine postprocessRunState(StateMachine state, int pwrBalancing, int pwrDelayDischarge, int pwrChargeGrid) Post-Process a state duringController.run()
, i.e. replace with 'better' state if appropriate.NOTE: this can be useful, if live operation deviates from predicted operation, e.g. because predictions were wrong.
- Parameters:
state
- the initial statepwrBalancing
- the power set-point as it would be inStateMachine.BALANCING
pwrDelayDischarge
- the power set-point as it would be inStateMachine.DELAY_DISCHARGE
pwrChargeGrid
- the power set-point as it would be inStateMachine.CHARGE_GRID
- Returns:
- the new state
-
calculateEssChargeInChargeGridPowerFromParams
protected static int calculateEssChargeInChargeGridPowerFromParams(Integer essChargeInChargeGrid, ManagedSymmetricEss ess) -
calculateChargeGridPower
public static int calculateChargeGridPower(Integer essChargeInChargeGrid, ManagedSymmetricEss ess, int essActivePower, int gridActivePower, int maxChargePowerFromGrid, boolean limitChargePowerFor14aEnWG) Calculates the Max-ActivePower constraint forStateMachine.CHARGE_GRID
.- Parameters:
essChargeInChargeGrid
- ESS Charge Energy in CHARGE_GRID State [Wh]ess
- theManagedSymmetricEss
essActivePower
- the ESS ActivePowergridActivePower
- the Grid ActivePowermaxChargePowerFromGrid
- the configured max charge from grid powerlimitChargePowerFor14aEnWG
- Limit Charge Power for §14a EnWG- Returns:
- the set-point or null
-
calculateMaxChargeProductionPower
Calculates the Max-ActivePower constraint forinvalid reference
StateMachine#CHARGE_PRODUCTION
- Parameters:
sum
- theSum
- Returns:
- the set-point
-
calculateDelayDischargePower
Calculates the ActivePower constraint forStateMachine.DELAY_DISCHARGE
.- Parameters:
ess
- theManagedSymmetricEss
- Returns:
- the set-point
-