upb-lea / openmodelica-microgrid-gym

OpenModelica Microgrid Gym (OMG): An OpenAI Gym Environment for Microgrids
GNU General Public License v3.0
184 stars 38 forks source link

droopParams in components.py #133

Closed Webbah closed 3 years ago

Webbah commented 3 years ago

In the Component class reference values are calculated to make them available to e.g. an RL-agent as input from the "environment". To calculate the reference values the wanted frequency is needed to calculate the phase needed for ref_abc.

Currently we have defined the droop-parameters in the component class, too:

https://github.com/upb-lea/openmodelica-microgrid-gym/blob/1036dfd80d2f3ccb54c061d33f9332cbe99cd9bd/openmodelica_microgrid_gym/net/components.py#L125-L126

https://github.com/upb-lea/openmodelica-microgrid-gym/blob/1036dfd80d2f3ccb54c061d33f9332cbe99cd9bd/openmodelica_microgrid_gym/net/components.py#L97-L98

Problem:

If the droop values differ, that leads to different values in the (doubled?) reference values in the env history: (master.SPVa: internal value from controller calulation; inverter1.v_ref.0: from env.components logged ref value)

grafik

the droop-params in the net will not be changed!

  1. Do we need that?
  2. is the "env"-ref value needed on the control-part on the agent side? Or is it only needed in case of feeding an RL-agent?

Solution-suggestion: Delete all droop-params in the components.py and make clear, that droop has to be considered externally. @wallscheid Do we have a problem in that case if we want to "learn droop-control" with RL-agents?

wallscheid commented 3 years ago

If an agent is still able to alter the droop parameters acting on the control loops, I do not see any issue.

Webbah commented 3 years ago

Compromise: Left droop-params in the component class but set per default to zeros. In that case it is possible to use them but per default they have no influence (like MasterInverter per definition calculates f(P) and does not reduce f if pDroopParams are zero).