46045-syslab/readme.md

3.0 KiB

Power-sharing controller

This is an example of a power sharing controller for the Microgrid case.

The case consists of the following units:

  • A battery
  • A mobile load, representing controllable consumption that gives us money, e.g. an electrolyzer which produces hydrogen.
  • A wind turbine
  • A solar panel
  • A dump load, which is controlled externally from the controller, representing load that must be served, for instance the local neighbourhood.

The controller uses the battery and mobile loads to attempt to keep the active power at 0 on the grid connection (PCC). Further, we try to keep the battery's state of charge somewhat away from being full or empty, to give the most flexibility if we are called on to deliver services. The service delivery is not implemented here, and so we just try to keep the battery in a certain range of state of charge.

If we need more power in the system, i.e. we are importing from the grid, the battery will be asked to provide the missing amount, up to its maximum.

If we have too much power, both the battery and mobile load will act together to consume the excess. How much will be consumed by each unit is determined by a splitting factor:

  • If the battery's state of charge is less than an soc_lower, the battery will consume all excess power.
  • If the battery's state of charge is above an soc_upper, the mobile load will consume all excess power.
  • If the battery's state of charge is in between these two values, the excess will be split between the two in a manner which linearly depends on the battery's state of charge; the higher the state of charge, the more power is given to the mobile load.

See the included "d7_controller_splitting.pdf" for a graph of the splitting factor. Essentially, we are trying to keep the battery charged to above soc_lower plus some buffer, and then use the rest of the power for production.

In addition to changing the splitting factor, the boundaries soc_lower and soc_upper change depending on the currently available renewable energy:

  • If there is a lot of renewable energy available, the range from soc_lower to soc_upper gets wider. We are less worried about getting the battery charged, so we use more power for the dump load.
  • If there is only a small amount of renewable energy available, the range from soc_lower to soc_upper gets narrower. We need to ensure the battery gets charged up so we are ready to handle a high load or a request for energy from elsewhere.

Included scripts

  • battery_local_control.py: Connects to the battery and acts on the splitting factor delivered by the supervisor. Makes the battery state of charge available to the supervisor.
  • mobileload_local_control.py: Connects to the battery and acts on the splitting factor delivered by the supervisor.
  • supervisory_controller.py: Is in charge of calculating the splitting factor depending on the available renewable production.

Each script can be started independently, and will use defaults or re-use last known values if the other scripts are down.