forked from OpenEMS/openems
-
Notifications
You must be signed in to change notification settings - Fork 0
Closed
Labels
julesTasks for Jules agentTasks for Jules agent
Description
Implementation Plan - Layer 2 Dispatch Controller
Goal: Implement io.openems.edge.controller.microgrid.dispatcher to manage power flows in the microgrid based on the state provided by the Supervisor.
[Goal Description]
Develop a rule-based dispatch controller that optimizes energy usage and ensures stability in both Grid-Connected (SS1) and Islanded (SS2) modes. It will actively control:
- BESS (Battery Energy Storage System)
- Genset (Diesel Generator)
- PV Inverter (Curtailment)
User Review Required
- Genset Interface: Identifying the correct channel for "Genset Status" and "Start/Stop" control. We verify if
io.openems.edge.controller.chp.socor a simpleDigitalOutput+Meteris used. - Microgrid State: Reading the
Statechannel fromio.openems.edge.controller.microgrid.
Proposed Changes
[NEW] Bundle: io.openems.edge.controller.microgrid.dispatcher
Config.java
ess_id(String)meter_id(String) - Grid Metergenset_id(String) - Genset Component IDpv_id(String) - PV Inverter Component IDgrid_limit(int) - Peak Shaving Limit [W]genset_start_soc(int) - Default 20%genset_stop_soc(int) - Default 80%genset_capacity(int) - Genset Capacity [W]
MicrogridDispatcherImpl.java
-
Components:
@ReferenceComponentManager@ReferenceSymmetricEss@ReferenceElectricityMeter(Grid)@ReferenceManagedSymmetricPvInverter@ReferenceMicrogridSupervisor(or access via ComponentManager)
-
Loop (
run()):- Read Inputs:
MicrogridStatefrom Supervisor.Ess.SoCGridMeter.ActivePowerGenset.Status(if available) orGenset.ActivePower
- Switch/Case on State:
- SS1 (Grid Connected):
- Peak Shaving: Calculate
Grid - GridLimit. If positive,Ess.SetActivePowerEquals(Discharge). - Genset: Send
Stopcommand (via ChannelStart=false or similar).
- Peak Shaving: Calculate
- SS2 (Islanded):
- Genset Control:
- SoC <
StartSoC-> Start Genset. - SoC >
StopSoC-> Stop Genset.
- SoC <
- Genset Loading:
- If Genset ON:
TargetLoad = GensetCapacity * 0.40. - If
SiteLoad < TargetLoad,Ess.SetActivePowerEquals(Charge = TargetLoad - SiteLoad).
- If Genset ON:
- PV Curtailment:
- If
SoC > 95%ANDEss.MaxChargePower~ 0:- limit =
Load. Pv.setActivePowerLimit(limit).
- limit =
- If
- Genset Control:
- SS1 (Grid Connected):
- Read Inputs:
Verification Plan
Automated Tests
- Unit Test:
MicrogridDispatcherTest- Mock Components (Ess, Meter, Genset, PV).
- Simulate States (SS1, SS2).
- Verify Output Channels (
SetActivePowerEquals,SetGridMode, etc. wait, Dispatcher doesn't set GridMode). - Verify Logic:
- Test Peak Shaving triggers.
- Test Genset Start/Stop hysteresis.
- Test PV Curtailment.
Delegation to Jules
- Create GitHub Issue with this plan.
- Label:
jules
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
julesTasks for Jules agentTasks for Jules agent