Class BatteryProtection
- java.lang.Object
-
- io.openems.edge.battery.protection.BatteryProtection
-
public class BatteryProtection extends java.lang.Object
This utility class provides algorithms to calculate maximum allowed charge and discharge currents for batteries.The logic uses:
- Allowed Current Limit provided by Battery Management System
- Voltage-to-Percent characteristics based on Min- and Max-Cell-Voltage
- Temperature-to-Percent characteristics based on Min- and Max-Cell-Temperature
- Linear max increase limit (e.g. 0.5 A per second)
- Force Charge/Discharge mode (e.g. -1 A to enforce charge/discharge)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BatteryProtection.Builder
static class
BatteryProtection.ChannelId
-
Constructor Summary
Constructors Modifier Constructor Description protected
BatteryProtection(Battery battery, ChargeMaxCurrentHandler chargeMaxCurrentHandler, DischargeMaxCurrentHandler dischargeMaxCurrentHandler)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
apply()
Apply the logic on theBattery
.static BatteryProtection.Builder
create(Battery battery)
Create aBatteryProtection
using builder pattern.
-
-
-
Constructor Detail
-
BatteryProtection
protected BatteryProtection(Battery battery, ChargeMaxCurrentHandler chargeMaxCurrentHandler, DischargeMaxCurrentHandler dischargeMaxCurrentHandler)
-
-
Method Detail
-
create
public static BatteryProtection.Builder create(Battery battery)
Create aBatteryProtection
using builder pattern.- Parameters:
battery
- theBattery
- Returns:
- a
BatteryProtection.Builder
-
apply
public void apply()
Apply the logic on theBattery
.- Set CHARGE_MAX_CURRENT Channel
- Set DISCHARGE_MAX_CURRENT Channel
- Set FORCE_DISCHARGE_ACTIVE State-Channel if Charge-Max-Current < 0
- Set FORCE_CHARGE_ACTIVE State-Channel if Discharge-Max-Current < 0
- SET
-
-