Class AbstractAllowedChargeDischargeHandler<ESS extends SymmetricEss>

java.lang.Object
io.openems.edge.ess.generic.common.AbstractAllowedChargeDischargeHandler<ESS>
All Implemented Interfaces:
BiConsumer<ClockProvider,Battery>
Direct Known Subclasses:
AllowedChargeDischargeHandler, AllowedChargeDischargeHandler

public abstract class AbstractAllowedChargeDischargeHandler<ESS extends SymmetricEss> extends Object implements BiConsumer<ClockProvider,Battery>
Helper class to handle calculation of Allowed-Charge-Power and Allowed-Discharge-Power. This class is used by ChannelManager as a callback to updates of Battery Channels.
  • Field Details

    • DISCHARGE_EFFICIENCY_FACTOR

      public static final float DISCHARGE_EFFICIENCY_FACTOR
      See Also:
    • MAX_INCREASE_PERCENTAGE

      public static final float MAX_INCREASE_PERCENTAGE
      Allow a maximum increase per second.

      5 % of possible allowed charge/discharge power

      See Also:
    • parent

      protected final ESS extends SymmetricEss parent
    • lastBatteryAllowedChargePower

      protected float lastBatteryAllowedChargePower
    • lastBatteryAllowedDischargePower

      protected float lastBatteryAllowedDischargePower
  • Constructor Details

    • AbstractAllowedChargeDischargeHandler

      public AbstractAllowedChargeDischargeHandler(ESS parent)
  • Method Details

    • accept

      public abstract void accept(ClockProvider clockProvider, Battery battery)
      Specified by:
      accept in interface BiConsumer<ClockProvider,Battery>
    • calculateAllowedChargeDischargePower

      protected void calculateAllowedChargeDischargePower(ClockProvider clockProvider, Battery battery)
      Calculates Allowed-Charge-Power and Allowed-Discharge Power from the given parameters. Result is stored in 'lastBatteryAllowedChargePower' and 'lastBatteryAllowedDischargePower' variables - both as positive values!
      Parameters:
      clockProvider - the ClockProvider
      battery - the Battery
    • calculateAllowedChargeDischargePower

      protected void calculateAllowedChargeDischargePower(ClockProvider clockProvider, boolean isStarted, Integer chargeMaxCurrent, Integer dischargeMaxCurrent, Integer voltage)
      Calculates Allowed-Charge-Power and Allowed-Discharge Power from the given parameters. Result is stored in 'allowedChargePower' and 'allowedDischargePower' variables - both as positive values!
      Parameters:
      clockProvider - the ClockProvider
      isStarted - is the ESS started?
      chargeMaxCurrent - the Battery.ChannelId.CHARGE_MAX_CURRENT
      dischargeMaxCurrent - the
      invalid reference
      Battery.ChannelId#DISHARGE_MAX_CURRENT
      voltage - the Battery.ChannelId.VOLTAGE