Class AbstractMaxCurrentHandler
java.lang.Object
io.openems.edge.battery.protection.currenthandler.AbstractMaxCurrentHandler
- Direct Known Subclasses:
ChargeMaxCurrentHandler
,DischargeMaxCurrentHandler
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
-
Field Summary
Modifier and TypeFieldDescriptionprotected int
protected final ClockProvider
protected final AbstractForceChargeDischarge
protected Double
protected Instant
protected final PolyLine
protected final PolyLine
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractMaxCurrentHandler
(ClockProvider clockProvider, int initialBmsMaxEverCurrent, PolyLine voltageToPercent, PolyLine temperatureToPercent, Double maxIncreasePerSecond, AbstractForceChargeDischarge forceChargeDischarge) -
Method Summary
Modifier and TypeMethodDescriptionint
calculateCurrentLimit
(Battery battery) Calculates the actual allowed current limit in [A] as minimum of:.protected abstract BatteryProtection.ChannelId
Gets the ChannelId for Battery-Protection Limit originating from BMS.protected abstract BatteryProtection.ChannelId
Gets the ChannelId for Battery-Protection Limit by Force Charge/Discharge Mode.protected abstract BatteryProtection.ChannelId
Gets the ChannelId for Battery-Protection Limit by Max-Increase-Ampere ramp.protected abstract BatteryProtection.ChannelId
Gets the ChannelId for Battery-Protection Limit by Max-Cell-Temperature.protected abstract BatteryProtection.ChannelId
Gets the ChannelId for Battery-Protection Limit by Max-Cell-Voltage.protected abstract BatteryProtection.ChannelId
Gets the ChannelId for Battery-Protection Limit by Min-Cell-Temperature.protected abstract BatteryProtection.ChannelId
Gets the ChannelId for Battery-Protection Limit by Min-Cell-Voltage.protected Double
getForceCurrent
(Integer minCellVoltage, Integer maxCellVoltage) Calculates the Ampere limit in Force Charge/Discharge mode.protected Double
getMaxCellVoltageToPercentLimit
(Integer minCellVoltage) protected Double
Calculates the maximum increase limit in Ampere from the 'maxIncreasePerSecond' parameter.protected Double
getMinCellVoltageToPercentLimit
(Integer minCellVoltage) protected Double
percentToAmpere
(Double percent) Convert a Percent value to a concrete Ampere value in [A] by multiplying it with 'bmsMaxEverAllowedChargeCurrent'.
-
Field Details
-
clockProvider
-
voltageToPercent
-
temperatureToPercent
-
forceChargeDischarge
-
bmsMaxEverCurrent
protected int bmsMaxEverCurrent -
lastResultTimestamp
-
lastCurrentLimit
-
-
Constructor Details
-
AbstractMaxCurrentHandler
protected AbstractMaxCurrentHandler(ClockProvider clockProvider, int initialBmsMaxEverCurrent, PolyLine voltageToPercent, PolyLine temperatureToPercent, Double maxIncreasePerSecond, AbstractForceChargeDischarge forceChargeDischarge)
-
-
Method Details
-
getBpBmsChannelId
Gets the ChannelId for Battery-Protection Limit originating from BMS.- Returns:
- the
BatteryProtection.ChannelId
-
getBpMinVoltageChannelId
Gets the ChannelId for Battery-Protection Limit by Min-Cell-Voltage.- Returns:
- the
BatteryProtection.ChannelId
-
getBpMaxVoltageChannelId
Gets the ChannelId for Battery-Protection Limit by Max-Cell-Voltage.- Returns:
- the
BatteryProtection.ChannelId
-
getBpMinTemperatureChannelId
Gets the ChannelId for Battery-Protection Limit by Min-Cell-Temperature.- Returns:
- the
BatteryProtection.ChannelId
-
getBpMaxTemperatureChannelId
Gets the ChannelId for Battery-Protection Limit by Max-Cell-Temperature.- Returns:
- the
BatteryProtection.ChannelId
-
getBpForceCurrentChannelId
Gets the ChannelId for Battery-Protection Limit by Force Charge/Discharge Mode.- Returns:
- the
BatteryProtection.ChannelId
-
getBpMaxIncreaseAmpereChannelId
Gets the ChannelId for Battery-Protection Limit by Max-Increase-Ampere ramp. Mode.- Returns:
- the
BatteryProtection.ChannelId
-
calculateCurrentLimit
Calculates the actual allowed current limit in [A] as minimum of:.- Is the battery started? (block any charge/discharge if not)
- Is there any value from the BMS? (block any charge/discharge if not)
- Allowed Current Limit provided by Battery Management System
- Voltage-to-Percent characteristics for Min-Cell-Voltage
- Voltage-to-Percent characteristics for Max-Cell-Voltage
- Temperature-to-Percent characteristics for Min-Cell-Temperature
- Temperature-to-Percent characteristics for Max-Cell-Temperature
- Applied max increase limit (e.g. 0.5 A per second)
- Force Charge/Discharge mode (e.g. -1 A to enforce charge/discharge)
- Parameters:
battery
- theBattery
- Returns:
- the actual allowed current limit, mathematically rounded to [A]
-
getMinCellVoltageToPercentLimit
-
getMaxCellVoltageToPercentLimit
-
getMaxIncreaseAmpereLimit
Calculates the maximum increase limit in Ampere from the 'maxIncreasePerSecond' parameter.If maxIncreasePerSecond is 0.5, last limit was 10 A and 1 second passed, this method returns 10.5.
- Returns:
- the limit or null
-
getForceCurrent
Calculates the Ampere limit in Force Charge/Discharge mode. Returns:- -1 -> in force charge/discharge mode
- 0 -> in block discharge/charge mode
- null -> otherwise
- Parameters:
minCellVoltage
- the Min-Cell-Voltage, possibly nullmaxCellVoltage
- the Max-Cell-Voltage, possibly null- Returns:
- the Current, possibly null
-
percentToAmpere
Convert a Percent value to a concrete Ampere value in [A] by multiplying it with 'bmsMaxEverAllowedChargeCurrent'.- null % -> null
- 0 % -> 0
- anything else -> calculate percent; at least '1 A'.
- Parameters:
percent
- the percent value in [0,1]- Returns:
- the ampere value in [A]
-