Hi everyone,
I am a beginner currently using OpenEMS for my Master’s thesis, where I am developing an Energy Management System (EMS).
At the moment, I am using the ESS Balancing Controller. I was able to successfully run simulations and analyze the logs in the terminal using the ‘Getting started guide”
From my understanding, this controller distributes power dynamically with the goal of keeping the grid setpoint at 0 W (i.e., minimizing grid exchange). Because of this, the power flow is continuously adjusted between the battery and the grid.
However, for my use case, I need a static rule-based EMS, with the following behavior:
- If there is excess PV generation:
First charge the battery
If surplus still remains ,feed it into the grid
- If there is a power deficit:
First discharge the battery
If still needed ,draw from the grid
I also searched through the forum but couldn’t find any existing discussion addressing this specific requirement.
So my questions are:
- Is it possible to achieve this behavior using existing OpenEMS configurations or controllers?
- If not, what would be the recommended approach?
Using something like Generic JsonLogic?
Or creating a custom controller?
- Are there any existing examples or controllers with similar rule-based logic?
I would really appreciate any guidance or suggestions.
Thank you!
Hi and welcome to the OpenEMS Community,
- If there is excess PV generation:
First charge the battery
If surplus still remains ,feed it into the grid
- If there is a power deficit:
First discharge the battery
If still needed ,draw from the grid
This is exactly what the Balancing-Controller does.
- “excess PV generation” means “Production is larger than Consumption” - we evaluate this simply by detecting sell-to-grid power at the grid connection point; otherwise you would have to measure all the consumers.
- “power deficit” means “Consumption is larger then Production” - simply detected via buy-from-grid power at the grid connection point.
Hi Stefan ,
Thank you for your response. To clarify my question further:
I understand that the Balancing Controller indirectly follows the logic of using excess PV for charging the battery and using the battery during deficit by observing the grid power.
Currently, I am using the existing simulator setup with predefined CSV data sources for both the load profile and PV production, in order to understand how the system behaves.
However, my doubt is more about the exact behavior of the controller in practice, based on the logs I am observing.
For example, in situations where:
-
There is no production, and the battery is capable of supplying the full consumption,
-
Or when there is a small deficit that the battery can fully cover,
I notice that the battery does not supply exactly the required power.
Instead:
-
Sometimes it supplies slightly more, and the excess is fed into the grid
-
Sometimes it supplies slightly less, and a small amount is drawn from the grid
Example logs:
L:501 W Grid:-29 W Production:0 W Consumption:472 W
L:492 W Grid:-27 W Production:0 W Consumption:465 W
Here, the battery supplies more than needed and exports to the grid.
And:
L:467 W Grid:13 W Production:1030000 W Consumption:1030480 W
Here, there is a deficit of 480 W, but the battery supplies only 467 W and the remaining 13 W comes from the grid, even though the battery is capable of supplying more (Allowed:-10000;10000 W).
So my question is:
Is this behavior due to:
-
Controller dynamics (e.g., PID or smoothing)?
-
Measurement delays or resolution?
-
Or some internal control strategy of the Balancing Controller?
In other words, is it expected that the controller does not exactly match the required power but instead keeps the grid power around 0 W with a small tolerance?
Thank you!
Is this behavior due to:
Yes, both. The Balancing-Controller calculates the exact required power - which is applied in the next Cycle. PID- or PT1-Filter smoothes the behaviour.