How can I control a battery storage with two on-site generators?
I would like to model a building with two on-site electricity generation (cogen and PV) both linked to the same storage battery and with access to the grid in case of not enough on-site production. My goal is to store some of the excess electricity into my battery but in the most intelligent way possible, meaning that I want my battery to "understand" when it is the best to charge and discharge in order to avoid the highest electricity power peaks.
What I would like to know first is: how can I best define the ELCDs so that the charge and discharge of the battery are the most logical?
At first I defined 3 ELDCs (one for the cogen, one for the PV and one for the battery storage). But the charge and discharge of the battery were kind of "crazy" and they were even months during which my battery was hardly used. I thought it might be due to the fact that having several ELDCs oblige the model to use them in the order of their input.
So I decided to put all the onsite generators and the storage system (assuming the cogen can deliver DC voltage) on the same ELCD but it didn't really change anything.
So, according to you, what are the pros and cons of having several or just one ELCD and does it play a role in the control of the charge and discharge of the battery?
Do you think I have to define EMS objects to control my battery and, if yes, is there any examples of such EMS?
Note: I am using EnergyPlus v8.5