|
1 | 1 | # License: MIT |
2 | 2 | # Copyright © 2022 Frequenz Energy-as-a-Service GmbH |
3 | 3 |
|
4 | | -"""Microgrid monitoring and control system. |
| 4 | +"""A {{glossary("microgrid")}} is a local electrical grid that connects a set of |
| 5 | +electrical components together. They are often built around a passive power consumer, |
| 6 | +to supplement the electricity consumed from the {{glossary("grid", "public grid")}} with |
| 7 | +on-site power generation or storage systems. |
5 | 8 |
|
6 | | -This package provides a complete suite of data structures and functionality |
7 | | -for monitoring and adjusting the state of a microgrid. |
8 | | -""" |
| 9 | +Microgrids can also function in {{glossary("island", "island-mode")}}, without a grid |
| 10 | +connection, or without a local power consumer, but they have to have at least one of the |
| 11 | +two, to be meaningful. |
| 12 | +
|
| 13 | +## Frequenz SDK Microgrid Model |
| 14 | +
|
| 15 | +The SDK aims to provide an abstract model of the microgrid that enables high-level |
| 16 | +interactions with {{glossary("component", "microgrid components")}}, without having to |
| 17 | +worry about (or even be aware of) location-specific details such as: |
| 18 | +
|
| 19 | +- where the {{glossary("meter", "meters")}} are placed, |
| 20 | +- how many {{glossary("battery", "batteries")}}, |
| 21 | +- whether there's a grid connection or a passive consumer, |
| 22 | +- what models the {{glossary("inverter", "inverters")}} are, etc. |
| 23 | +- whether components are having downtimes, because {{glossary("metric", "metrics")}} and |
| 24 | + limits get adjusted automatically when components are having downtimes. |
| 25 | +
|
| 26 | +Users of the SDK can develop applications around this interface once and deploy |
| 27 | +anywhere, and the SDK will take care of translating the requests and instructions to |
| 28 | +correspond to the specific microgrid configurations. |
| 29 | +
|
| 30 | +``` mermaid |
| 31 | +flowchart LR |
| 32 | +
|
| 33 | +subgraph Left[Measurements only] |
| 34 | +direction LR |
| 35 | + grid["Grid Connection"] |
| 36 | + consumer["Consumer"] |
| 37 | + pv["PV Arrays"] |
| 38 | + chp["CHP"] |
| 39 | +end |
| 40 | +
|
| 41 | +junction(( )) |
| 42 | +
|
| 43 | +subgraph Right[Measurements and control] |
| 44 | +direction LR |
| 45 | + bat["Batteries"] |
| 46 | + ev["EV Chargers"] |
| 47 | +end |
| 48 | +
|
| 49 | +grid --- junction |
| 50 | +consumer --- junction |
| 51 | +pv --- junction |
| 52 | +chp --- junction |
| 53 | +
|
| 54 | +junction --- bat |
| 55 | +junction --- ev |
| 56 | +``` |
| 57 | +
|
| 58 | +## Grid |
| 59 | +
|
| 60 | +This refers to a microgrid's connection to the external Grid. The power flowing through |
| 61 | +this connection can be streamed through |
| 62 | +[`grid_power`][frequenz.sdk.timeseries.logical_meter.LogicalMeter.grid_power]. |
| 63 | +
|
| 64 | +In locations without a grid connection, this method remains accessible, and streams zero |
| 65 | +values. |
| 66 | +
|
| 67 | +## Consumer |
| 68 | +
|
| 69 | +This is the main power consumer at the site of a microgrid, and often the |
| 70 | +{{glossary("load")}} the microgrid is built to support. The power drawn by the consumer |
| 71 | +is available through |
| 72 | +[`consumer_power`][frequenz.sdk.timeseries.logical_meter.LogicalMeter.consumer_power] |
| 73 | +
|
| 74 | +In locations without a consumer, this method streams zero values. |
| 75 | +
|
| 76 | +## Producers: PV Arrays, CHP |
| 77 | +
|
| 78 | +The total {{glossary("pv", "PV")}} power production in a microgrid can be streamed |
| 79 | +through [`pv_power`][frequenz.sdk.timeseries.logical_meter.LogicalMeter.pv_power] , and |
| 80 | +similarly the total CHP production in a site can be streamed through |
| 81 | +[`chp_power`][frequenz.sdk.timeseries.logical_meter.LogicalMeter.chp_power]. And total |
| 82 | +producer power is available through |
| 83 | +[`producer_power`][frequenz.sdk.timeseries.logical_meter.LogicalMeter.producer_power]. |
| 84 | +
|
| 85 | +As is the case with the other methods, if PV Arrays or CHPs are not available in a |
| 86 | +microgrid, the corresponding methods stream zero values. |
| 87 | +
|
| 88 | +## Batteries |
| 89 | +
|
| 90 | +The total Battery power is available through |
| 91 | +[`battery_pool`][frequenz.sdk.microgrid.battery_pool]'s |
| 92 | +[`power`][frequenz.sdk.timeseries.battery_pool.BatteryPool.power]. The battery pool by |
| 93 | +default uses all batteries available at a location, but battery pool instances can be |
| 94 | +created for subsets of batteries if necessary, by specifying the battery ids. |
| 95 | +
|
| 96 | +The `battery_pool` also provides |
| 97 | +[`soc`][frequenz.sdk.timeseries.battery_pool.BatteryPool.soc], |
| 98 | +[`capacity`][frequenz.sdk.timeseries.battery_pool.BatteryPool.capacity], |
| 99 | +[`temperature`][frequenz.sdk.timeseries.battery_pool.BatteryPool.temperature] and |
| 100 | +available power bounds through the |
| 101 | +[`power_status`][frequenz.sdk.timeseries.battery_pool.BatteryPool.power_status] method. |
| 102 | +
|
| 103 | +The `battery_pool` also provides control methods |
| 104 | +[`propose_power`][frequenz.sdk.timeseries.battery_pool.BatteryPool.propose_power] (which |
| 105 | +accepts values in the {{glossary("psc", "Passive Sign Convention")}} and supports both |
| 106 | +charging and discharging), or through |
| 107 | +[`propose_charge`][frequenz.sdk.timeseries.battery_pool.BatteryPool.propose_charge], or |
| 108 | +[`propose_discharge`][frequenz.sdk.timeseries.battery_pool.BatteryPool.propose_discharge]. |
| 109 | +
|
| 110 | +## EV Chargers |
| 111 | +
|
| 112 | +The [`ev_charger_pool`][frequenz.sdk.microgrid.ev_charger_pool] offers a |
| 113 | +[`power`][frequenz.sdk.timeseries.ev_charger_pool.EVChargerPool.power] method that |
| 114 | +streams the total power measured for all the {{glossary("ev-charger", "EV Chargers")}} |
| 115 | +at a site. |
| 116 | +
|
| 117 | +It also offers a |
| 118 | +[`component_data`][frequenz.sdk.timeseries.ev_charger_pool.EVChargerPool.component_data] |
| 119 | +method for fetching the status of individual EV Chargers, including state changes like |
| 120 | +when an EV is connected or disconnected, and a |
| 121 | +[`set_bounds`][frequenz.sdk.timeseries.ev_charger_pool.EVChargerPool.set_bounds] method |
| 122 | +to limit the charge power of individual EV Chargers. |
| 123 | +""" # noqa: D205, D400 |
9 | 124 |
|
10 | 125 | from ..actor import ResamplerConfig |
11 | 126 | from . import _data_pipeline, client, component, connection_manager, fuse, grid |
|
0 commit comments