# Microgrid

A microgrid is a local electrical grid with defined electrical boundaries, acting as a single and controllable entity. It is able to operate in grid-connected and off grid. A stand-alone or isolated microgrid only operates off-the-grid and cannot be connected to a wider electric power system. Very small microgrids are called nanogrids.
A grid-connected microgrid normally operates connected to and synchronous with the traditional wide area synchronous grid (macrogrid), but is able to disconnect from the interconnected grid and to function autonomously in "island mode" as technical or economic conditions dictate. In this way, they improve the security of supply within the microgrid cell, and can supply emergency power, changing between island and connected modes. This kind of grid is called an islandable microgrid.
A stand-alone microgrid has its own sources of electricity, supplemented with an energy storage system. They are used where power transmission and distribution from a major centralized energy source is too far and costly to operate. They offer an option for rural electrification in remote areas and on smaller geographical islands. A stand-alone microgrid can effectively integrate various sources of distributed generation (DG), especially renewable energy sources (RES).
Control and protection are difficulties to microgrids, as all ancillary services for system stabilization must be generated within the microgrid and low short-circuit levels can be challenging for selective operation of the protection systems. An important feature is also to provide multiple useful energy needs, such as heating and cooling besides electricity, since this allows energy carrier substitution and increased energy efficiency due to waste heat utilization for heating, domestic hot water, and cooling purposes (cross sectoral energy usage).

## Definitions

The United States Department of Energy Microgrid Exchange Group defines a microgrid as ‘‘a group of interconnected loads and distributed energy resources within clearly defined electrical boundaries that acts as a single controllable entity with respect to the grid. A microgrid can connect and disconnect from the grid to enable it to operate in both grid-connected or island-mode.’’
The Berkeley Lab defines: "A microgrid consists of energy generation and energy storage that can power a building, campus, or community when not connected to the electric grid, e.g. in the event of a disaster." A microgrid that can be disconnected from the utility grid (at the 'point of common coupling' or PCC) is called an 'islandable microgrid'.
An EU research project describes a microgrid as comprising Low-Voltage (LV) distribution systems with distributed energy resources (DERs) (microturbines, fuel cells, photovoltaics (PV), etc.), storage devices (batteries, flywheels) energy storage system and flexible loads. Such systems can operate either connected or disconnected from the main grid. The operation of microsources in the network can provide benefits to the overall system performance, if managed and coordinated efficiently.
Electropedia defines a microgrid as a group of interconnected loads and distributed energy resources with defined electrical boundaries, which form a local electric power system at distribution voltage levels, meaning both low and medium voltage up to 35 kV. This cluster of associated consumer and producer nodes acts as a single controllable entity and is able to operate in either grid-connected or island mode.
Microgrid Knowledge defines a microgrid as a "self-sufficient energy system that serves a discrete geographic footprint, such as a college campus, hospital complex, business center or neighborhood."
A stand-alone microgrid or isolated microgrid, sometimes called an "island grid", only operates off-the-grid and cannot be connected to a wider electric power system. They are usually designed for geographical islands or for rural electrification. In many non-industrialized countries, microgrids that are used to provide access to electricity in previously unelectrified areas are often referred to as "mini grids". Nanogrids belong to a single home or building and the interconnection of multiple nanogrids forming a network (microgrid), facilitating the sharing of power between individual nanogrids.

### Campus environment/institutional microgrids

The focus of campus microgrids is aggregating existing on-site generation to support multiple loads located in a tight geographical area where an owner can easily manage them.

### Community microgrids

Community microgrids can serve thousands of customers and support the penetration of local energy (electricity, heating, and cooling). In a community microgrid, some houses may have some renewable sources that can supply their demand as well as that of their neighbors within the same community. The community microgrid may also have a centralized or several distributed energy storages. Such microgrids can be in the form of an ac and dc microgrid coupled together through a bi-directional power electronic converter.

### Remote off-grid microgrids

These microgrids are generally not designed or intended to connect to the macrogrid and instead operate in an island mode at all times because of economic issues or geographical position. Typically, an "off-grid" microgrid is built in areas that are far distant from any transmission and distribution infrastructure and, therefore, have no connection to the utility grid. Studies have demonstrated that operating a remote area or islands' off-grid microgrids, that are dominated by renewable sources, will reduce the levelized cost of electricity production over the life of such microgrid projects. In some cases, off-grid microgrids are indeed incorporated into a national grid or 'macrogrid', a process that requires technical, regulatory and legal planning.
Large remote areas may be supplied by several independent microgrids, each with a different owner (operator). Although such microgrids are traditionally designed to be energy self-sufficient, intermittent renewable sources and their unexpected and sharp variations can cause unexpected power shortfall or excessive generation in those microgrids. Without energy storage and smart controls, this will immediately cause unacceptable voltage or frequency deviation in the microgrids. To remedy such situations, it is possible to interconnect such microgrids provisionally to a suitable neighboring microgrid to exchange power and improve the voltage and frequency deviations. This can be achieved through a power electronics-based switch after a proper synchronization or a back to back connection of two power electronic converters and after confirming the stability of the new system. The determination of a need to interconnect neighboring microgrids and finding the suitable microgrid to couple with can be achieved through optimization or decision making approaches.
Because remote off-grid microgrids are often small and built from scratch, they have the potential to incorporate best practices from the global electricity sector and to incorporate and drive energy innovation. It is now common to see remote off-grid microgrids being largely powered by renewable energy and operated with customer-level smart controls, something that is not always easy to implement in the larger power sector because of incumbent interests and older, pre-existing infrastructure.

### Military base microgrids

These microgrids are being actively deployed with focus on both physical and cyber security for military facilities in order to assure reliable power without relying on the macrogrid.

### Commercial and industrial (C&I) microgrids

These types of microgrids are maturing quickly in North America and eastern Asia; however, the lack of well-known standards for these types of microgrids limits them globally. Main reasons for the installation of an industrial microgrid are power supply security and its reliability. There are many manufacturing processes in which an interruption of the power supply may cause high revenue losses and long start-up time. Industrial microgrids can be designed to supply circular economy (near-)zero-emission industrial processes, and can integrate combined heat and power (CHP) generation, being fed by both renewable sources and waste processing; energy storage can be additionally used to optimize the operations of these sub-systems. Microgrids can also be anchored by a large commercial retailer with a large quantity of generation for resiliency or economic reasons.

## Topologies of microgrids

Architectures are needed to manage the flow of energy from different types of sources into the electrical grid. Thus, the microgrid can be classified into three topologies:

### AC microgrid

Power sources with AC output are interfaced to AC bus through AC/AC converter which will transform the AC variable frequency and voltage to AC waveform with another frequency at another voltage. Whilst power sources with DC output use DC/AC converters for the connection to the AC bus.

### DC microgrid

In DC microgrid topology, power sources with DC output are connected to DC bus directly or by DC/DC converters. On the other hand, power sources with AC output are connected to the DC bus through AC/DC converter.

### Hybrid microgrid

The hybrid microgrid has topology for both power source AC and DC output. In addition, AC and DC buses are connected to each other through a bidirectional converter, allowing power to flow in both directions between the two buses.

## Basic components in microgrids
### Local generation

A microgrid presents various types of generation sources that feed electricity, heating, and cooling to the user. These sources are divided into two major groups – thermal energy sources (e.g.,. natural gas or biogas generators or micro combined heat and power) and renewable generation sources (e.g. wind turbines and solar).

### Consumption

In a microgrid, consumption simply refers to elements that consume electricity, heat, and cooling, which range from single devices to the lighting and heating systems of buildings, commercial centers, etc. In the case of controllable loads, electricity consumption can be modified according to the demands of the network.

### Energy storage

In a microgrid, energy storage performs multiple functions, such as ensuring power quality, performing frequency and voltage regulation, smoothing the output of renewable energy sources, providing backup power for the system, and playing a crucial role in cost optimization. Energy storage may be achieved by a combination of chemical, electrical, pressure, gravitational, flywheel, and heat storage technologies. When multiple energy storage devices with various capacities are available in a microgrid, it is preferred to coordinate their charging and discharging such that a smaller energy storage device does not discharge faster than those with larger capacities. Likewise, it is preferred that a smaller storage device does not get fully charged before those with larger capacities. This can be achieved under a coordinated control of energy storage devices based on their state of charge. If multiple energy storage systems (possibly working on different technologies) are used and they are controlled by a unique supervising unit (an energy management system - EMS), a hierarchical control based on a master/slaves architecture can ensure best operations, particularly in the islanded mode.

### Point of common coupling (PCC)

This is the point in the electric circuit where a microgrid is connected to a main grid. Microgrids that do not have a PCC are called isolated microgrids which are usually present in remote sites (e.g., remote communities or remote industrial sites) where an interconnection with the main grid is not feasible due to either technical or economic constraints.

## Advantages and challenges of microgrids
### Advantages

A microgrid is capable of operating in grid-connected and stand-alone modes and of handling the transition between the two. In the grid-connected mode, ancillary services can be provided by trading activity between the microgrid and the main grid. Other possible revenue streams exist. In the islanded mode, the real and reactive power generated within the microgrid, including that provided by the energy storage system, should be in balance with the demand of local loads. Microgrids offer an option to balance the need to reduce carbon emissions with continuing to provide reliable electric energy in periods of time when renewable sources of power are not available. Microgrids also offer the security of being hardened from severe weather and natural disasters by not having large assets and miles of above-ground wires and other electric infrastructure that need to be maintained or repaired following such events.
A microgrid may transition between these two modes because of scheduled maintenance, degraded power quality or a shortage in the host grid, faults in the local grid, or for economical reasons. By means of modifying energy flow through microgrid components, microgrids facilitate the integration of renewable energy, such as photovoltaic, wind and fuel cell generations, without requiring re-design of the national distribution system. Modern optimization methods can also be incorporated into the microgrid energy management system to improve efficiency, economics, and resiliency.

### Challenges

Microgrids, and the integration of distributed energy resource (DER) units in general, introduce a number of operational challenges that need to be addressed in the design of control and protection systems, in order to ensure that the present levels of reliability are not significantly affected, and the potential benefits of Distributed Generation (DG) units are fully harnessed. Some of these challenges arise from assumptions typically applied to conventional distribution systems that are no longer valid, while others are the result of stability issues formerly observed only at a transmission system level. The most relevant challenges in microgrid protection and control include:
* Bidirectional power flows: The presence of distributed generation (DG) units in the network at low voltage levels can cause reverse power flows that may lead to complications in protection coordination, undesirable power flow patterns, fault current distribution, and voltage control.
* Stability issues: Interactions between control system of DG units may create local oscillations, requiring a thorough small-disturbance stability analysis. Moreover, transition activities between the grid-connected and islanding (stand-alone) modes of operation in a microgrid can create transient instability. Recent studies have shown that direct-current (DC) microgrid interface can result in a significantly simpler control structure, more energy efficient distribution and higher current carrying capacity for the same line ratings.
* Modeling: Many characteristics of traditional schemes such as the prevalence of three-phase balanced conditions, primarily inductive transmission lines, and constant-power loads, do not necessarily hold true for microgrids, and consequently, models need to be revised.
* Low inertia: Microgrids exhibit a low-inertia characteristic that makes them different to bulk power systems, where a large number of synchronous generators ensures a relatively large inertia. This phenomenon is more evident if there is a significant proportion of power electronic-interfaced DG units in the microgrid. The low inertia in the system can lead to severe frequency deviations in island mode operation if a proper control mechanism is not implemented. Synchronous generators run at the same frequency as the grid, thus providing a natural damping effect on sudden frequency variations. Synchronverters are inverters which mimic synchronous generators to provide frequency control. Other options include controlling battery energy storage or a flywheel to balance the frequency.
* Uncertainty: The operation of microgrids involves addressing much uncertainty, which is something the economical and reliable operation of microgrids relies on. Load profile and weather are two uncertainties that make this coordination more challenging in isolated microgrids, where the critical demand-supply balance and typically higher component failure rates require solving a strongly coupled problem over an extended time horizon. This uncertainty is higher than those in bulk power systems, due to the reduced number of loads and highly correlated variations of available energy resources (the averaging effect is much more limited).

### Modelling tools

To plan and install microgrids correctly, engineering modelling is needed. Multiple simulation tools and optimization tools exist to model the economic and electric effects of microgrids. A comprehensive commercial platform is XENDEE which won the 2021 Edison Gold Award and is the standard platform for the US Department of Defense. A widely used economic optimization tool is the Distributed Energy Resources Customer Adoption Model (DER-CAM) from Lawrence Berkeley National Laboratory. Another free tool is the Solar Alone Multi-objective Advisor (SAMA), an open-source microgrid optimization software program designed to optimize hybrid energy system sizes economically (primarily powered with solar photovoltaic systems) using metaheuristic algorithms based on specific load profiles and meteorological data. Another is HOMER (Hybrid Optimization Model for Multiple Energy Resources), originally developed by the National Renewable Energy Laboratory. There are also some power flow and electrical design tools guiding microgrid developers. The Pacific Northwest National Laboratory designed the publicly available GridLAB-D tool and the Electric Power Research Institute (EPRI) designed OpenDSS. A European tool that can be used for electrical, cooling, heating, and process heat demand simulation is EnergyPLAN from Aalborg University in Denmark. The open source grid planning tool OnSSET has been deployed to investigate microgrids using a three‑tier analysis beginning with settlement archetypes (case‑studied using Bolivia).

## Microgrid control

In regards to the architecture of microgrid control, or any control problem, there are two different approaches that can be identified: centralized and decentralized. A fully centralized control relies on a large amount of information transmittance between involving units before a decision is made at a single point. Implementation is difficult since interconnected power systems usually cover extended geographic locations and involve an enormous number of units. On the other hand, in a fully decentralized control, each unit is controlled by its local controller without knowing the situation of others. A compromise between those two extreme control schemes can be achieved by means of a hierarchical control scheme consisting of three control levels: primary, secondary, and tertiary.

### Primary control

The primary control is designed to satisfy the following requirements:
* To stabilize the voltage and frequency
* To offer plug and play capability for DERs and properly share the active and reactive power among them, preferably, without any communication links
* To mitigate circulating currents that can cause over-current phenomenon in the power electronic devices
The primary control provides the setpoints for a lower controller which are the voltage and current control loops of DERs. These inner control loops are commonly referred to as zero-level control.

### Secondary control

Secondary control has typically seconds to minutes sampling time (i.e. slower than the previous one) which justifies the decoupled dynamics of the primary and the secondary control loops and facilitates their individual designs. The setpoint of primary control is given by secondary control in which, as a centralized controller, it restores the microgrid voltage and frequency and compensates for the deviations caused by variations of loads or renewable sources. The secondary control can also be designed to satisfy the power quality requirements, e.g., voltage balancing at critical buses.

### Tertiary control

Tertiary control is the last (and the slowest) control level, which considers economical concerns in the optimal operation of the microgrid (sampling time is from minutes to hours), and manages the power flow between microgrid and main grid. This level often involves the prediction of weather, grid tariff, and loads in the next hours or day to design a generator dispatch plan that achieves economic savings. More advanced techniques can also provide end to end control of a microgrid using machine learning techniques such as deep reinforcement learning.
In case of emergencies such as blackouts, tertiary control can manage a group of interconnected microgrids to form what is called "microgrid clustering", acting as a virtual power plant to continue supplying critical loads. During these situations the central controller should select one of the microgrids to be the slack (i.e. master) and the rest as PV and load buses according to a predefined algorithm and the existing conditions of the system (i.e. demand and generation). In this case, the control should be real time or at least at a high sampling rate.

### IEEE 2030.7

A less utility-influenced controller framework is that from the Institute of Electrical and Electronics Engineers, the IEEE 2030.7. The concept relies on 4 blocks: a) Device level control (e.g. voltage and frequency control), b) Local area control (e.g. data communication), c) Supervisory (software) control (e.g. forward looking dispatch optimization of generation and load resources), and d) Grid layers (e.g. communication with utility).

### Elementary control

A wide variety of complex control algorithms exist, making it difficult for small microgrids and residential distributed energy resource (DER) users to implement energy management and control systems. Communication upgrades and data information systems can be expensive. Some projects try to simplify and reduce the expense of control via off-the-shelf products (e.g. using a Raspberry Pi).

## Examples
### Hajjah and Lahj, Yemen

The UNDP project “Enhanced Rural Resilience in Yemen” (ERRY) uses community-owned solar microgrids. It cuts energy costs to just 2 cents per hour (whereas diesel-generated electricity costs 42 cents per hour). It won the Ashden Awards for Humanitarian Energy in 2020.

### Île d'Yeu

A two-year pilot program, called Harmon’Yeu, was initiated in the spring of 2020 to interconnect 23 houses in the Ker Pissot neighborhood and surrounding areas with a microgrid that was automated as a smart grid with software from Engie. Sixty-four solar panels with a peak capacity of 23.7 kW were installed on five houses and a battery with a storage capacity of 15 kWh was installed on one house. Six houses store excess solar energy in their hot water heaters. A dynamic system apportions the energy provided by the solar panels and stored in the battery and hot water heaters to the system of 23 houses. The smart grid software dynamically updates energy supply and demand in 5-minute intervals, deciding whether to pull energy from the battery or from the panels and when to store it in the hot water heaters. This pilot program was the first such project in France.

### Les Anglais, Haiti

A wirelessly managed microgrid is deployed in rural Les Anglais, Haiti. The system consists of a three-tiered architecture with a cloud-based monitoring and control service, a local embedded gateway infrastructure and a mesh network of wireless smart meters deployed at over 500 buildings.
Non-technical loss (NTL) represents a major challenge when providing reliable electrical service in developing countries, where it often accounts for 11-15% of total generation capacity. An extensive data-driven simulation on seventy-two days of wireless meter data from a 430-home microgrid deployed in Les Anglais investigated how to distinguish NTL from the total power losses, aiding in energy theft detection.

### Mpeketoni, Kenya

The Mpeketoni Electricity Project, a community-based diesel-powered micro-grid system, was set up in rural Kenya near Mpeketoni. Due to the installment of these microgrids, Mpeketoni has seen a large growth in its infrastructure. Such growth includes increased productivity per worker, at values of 100% to 200%, and an income level increase of 20–70% depending on the product.

### Stone Edge Farm Winery

A micro-turbine, fuel-cell, multiple battery, hydrogen electrolyzer, and PV enabled winery in Sonoma, California.