Keywords

1 Introduction

Microgrids (MGs) are the new paradigm for the evolution of the distribution system. MGs are composed of distributed energy resources (DERs), such as generators, renewable energy sources (RESs), energy storage systems (ESSs) and a cluster of critical and non-critical loads. They provide stability to the main grid and offer optimal integration of these subsystems into the distribution system. MGs operate in one of two modes: grid-connected or islanded mode [1,2,3,4,5]. In grid-connected mode, a microgrid draws/supplies power from/to the main grid, depending on the generation and load requirements, and respecting certain suitable market policies to maximize the efficiency/cost, etc. Likewise, it can separate itself from the main grid whenever a fault occurs in the main grid and continues to supply power to connected critical loads. Furthermore, to ensure that the MG operates in an economical and reliable manner, it is equipped with a suitable supervisory control and data acquisition (SCADA) system. The control system is responsible for scheduling and controlling of all DERs to warrant the stability, reliability and economical operation of the MG.

In this book chapter, the microgrid control system is presented. The MG control system functions at three levels: primary, secondary and tertiary. Section 2 describes the two different types of energy management systems (EMS) used in a MG (i.e., either centralized or decentralized) and gives the advantages and disadvantages of both. Section 3 reviews various methods to assist the MG EMS to achieve optimal operation while minimizing operational costs. Section 4 deals with the different methods, i.e., using either linear, nonlinear, dynamic, rule-based, metaheuristic, artificial intelligent or multi-agent methods for establishing the EMS. Section 5 describes the role of communication systems in the area of MGs. In Sect. 6, a test case of a particle swarm optimization technique for a MG model is presented. Section 7 provides the conclusions for this chapter.

2 Microgrid Management System

A crucial unit that controls the operation of the microgrid is the microgrid management system (MGMS), which operates the system autonomously, connecting it to the utility grid appropriately for the bi-directional exchange of power and providing support to components within the microgrid. It enables the interplay of components and different controllers to operate the EMS in a safe and controlled manner. This approach will allow customization of the system to enhance optimization to improve the overall efficiency without sacrificing the plug-and-play functionality. MGMS is broken down into three different subsystems, i.e., primary, secondary and tertiary control layers that manage the entire microgrid operation as shown in Fig. 1.

Fig. 1
figure 1

Microgrid management system (MGMS) [9]

The MGMS controls the DGs to maintain the balance between generation and load demand during islanded mode, grid-connected mode or the transition period between the two modes. The three control layers are described next [6].

2.1 Primary Control Layer

This is the base layer that has the fastest response time (typically, in the region of milliseconds to minutes) and is responsible for the control of devices that respond to system dynamics and transients. It is also known as the local or internal controller. This control is based exclusively on local measurements and requires no communications. The function of this control includes islanding detection, converter output control, frequency regulation, voltage regulation and power-sharing control. In the microgrid, the voltage source inverters (VSIs) are the common interface between the DERs and the microgrid. VSI controller requires a specially designed control to simulate the inertia characteristic of synchronous generators and provide appropriate frequency regulation. The VSI has two stages of control: inverter output control and power-sharing control. The inverter typically consists of an outer control loop for voltage control and an inner loop for current regulation. The power-sharing control is used for the sharing of the active and reactive power in the system.

2.2 Secondary Control Layer

This is the central layer (Fig. 2) and is responsible for the reliable and economical operation of the microgrid. Its main function includes an EMS and automatic generation control system. The secondary control also helps reset the frequency and voltage deviations of the droop-controlled VSIs and generators, then assigns to them new optimal long-term set points calculated from the microgrid EMS. The EMS minimizes the microgrid’s operation cost and maximizes its reliability in grid-connected or islanded modes of operation. The objective of the EMS consists of finding the optimal unit commitment (UC) and economic dispatch (ED) of the available DER units to achieve load and power balance in the system. The cost function is designed in terms of economic tolls, such as fuel cost, power bill, maintenance cost, shutdown and start-up cost, emissions, and social welfare and battery degradation cost and the cost of loss of load. The reliability indices are formulated as constraints, such as load forecast, forecasted power availability of RESs, the generation and demand balance, energy storage capacity limits and power limits for all controllable generations. The EMS resolves a multi-objective optimization problem with complex constraints and falls under mixed-integer linear/nonlinear programing. The output of the optimizer is the scheduled energy import/export and DGs power output.

Fig. 2
figure 2

Secondary control layer [9]

2.3 Tertiary Control Layer

This is the highest control layer and provides intelligence for the whole system. It is responsible for buying and selling of energy between consumers and grid system, as well as providing active and reactive power support for the whole distribution system. Tertiary control layer is not a part of MGMS as it is recognized as a subsystem of the utility distribution system operator (DSO). But, due to the increase of microgrids within the distribution system, the tertiary control layer is evolving into a concept called virtual power plant (VPP). The objective of a VPP is to coordinate the operation of multiple microgrids interacting with one another within the system and communicate needs and requirements from the main grid. The VPP can provide transmission system primary frequency support, reactive power support and energy market participation. The control layer response time is typically of the order of several minutes to hours, providing signals to secondary controls at microgrids and other subsystems that form the full grid. Figure 3 shows the time-scales of the three MGMS control layers where the lower (primary) layer controls devices with fastest response times, and whereas the higher (secondary and tertiary) layers controls tend to have slower response times.

Fig. 3
figure 3

Response times of various layers in MGMS [9]

3 Microgrid Energy Management Systems

The International Electrotechnical Commission in the standard IEC 61970, defines an EMS as “a computer system comprising a software platform providing basic support services and a set of applications providing the functionality needed for the effective operation of electrical generation and transmission facilities so as to assure adequate security of energy supply at minimum cost” [7]. Hence, the microgrid EMS is a product of these features. It is usually equipped with decision-making algorithms, load and power forecasting, human–machine interfaces (HMI) and SCADA system. These functions help the EMS in optimizing microgrid operation, while satisfying the technical constraints.

MG EMS supervisory control can be sub-divided into two types, namely, centralized and decentralized EMSs. This section will be going into more depth about the two different types of control methods, and also into their advantages and disadvantages.

3.1 Centralized Energy Management

In the centralized EMS system, data information and collection are usually required from the tertiary and primary control layers such as operating cost, weather forecast, load demand, voltage and current readings from each component, etc. Based on the gathered information, an appropriate unit commitment and dispatch optimization algorithm are executed to achieve efficient, economical operation, and maintain power quality as well as match generation with load demand. The microgrid relies on the secondary layer, where a Master Controller with a high computing performance and a dedicated communication network is utilized for the operation. Usually, the Master Controller supports EMS and SCADA functions with an HMI which allows the system operator to control and monitor the microgrid. A centralized configuration is shown in Fig. 4.

Fig. 4
figure 4

Centralized EMS configuration [9]

In Fig. 4, the centralized configuration requires a two-way communication channel between the primary control (local controllers) and secondary control (EMS) for the exchange of information. This configuration is called a star connection topology and a master/slave technique is established. The communication channels can be either wired or wireless depending on its requirements. Some of the available technologies are based on power line carriers, telephone lines or a wireless medium.

In centralized EMS, operation is in real-time where the secondary controller frequently observes the entire system and samples the critical generation/demand information from each component. This frequent communication may cause a computational burden; therefore, a high-performance computing unit is required where the EMS can execute accurate decisions by processing the data read through the communication channel. Moreover, a high-bandwidth communication is required to meet the growing demands of EMSs.

Centralized EMS is a comparatively straightforward implementation but can also endanger the overall performance as any single-point failure or any fault at a unit can cause the entire system to breakdown. Therefore, it is considered to have a low expandability and flexibility. Considering its structure and functionality, the following options can be more desirable for the microgrid cases [8]:

  • A small-scale microgrid, with low communication and computational cost where centralized information can be processed

  • Unity between the components is required which can operate the microgrid with a common goal for generation/demand balances

  • Must operate with a high security that keeps the data information secure.

The EMS optimizes the microgrids power flow distribution, resulting in maximizing the DG’s production depending on the various parameters, constraints, variables and market prices provided as an input to the EMS controller. Some of the most commonly used data provided as input information to the controller to process and provide the reference values to the primary control layer, may include:

  • Forecasting of the grid electricity prices

  • Status of interconnection of utility grid

  • Reliability and security constraints of the microgrid

  • Operational limits of DG to be discharged

  • State of charge (SOC) of the battery energy storage system (BESS)

  • Load day-ahead forecast values

  • RESs generation forecasted power output.

Centralized EMS enables all the relevant information to be gathered at a single point for the controller to perform its function. The following steps are involved in a centralized framework for the EMS to perform its tasks [9] (Fig. 5):

Fig. 5
figure 5

Centralized framework for the EMS [9]

  1. 1.

    Performing a RES generation and day-ahead load forecast

  2. 2.

    Performing a day-ahead energy scheduling calculation by collecting information from all the components

  3. 3.

    Executing an optimization algorithm to calculate the optimal day-ahead schedules

  4. 4.

    Assigning optimal day-ahead schedules to the corresponding components

  5. 5.

    Acquiring real-time system information, as there might be unexpected events or forecast errors

  6. 6.

    Generating short-term forecasts during the operation

  7. 7.

    Re-executing the optimization algorithm and rescheduling the dispatch of RESs (15 min)

  8. 8.

    Finally, sending the EMS the most updated and optimal set points to the primary control.

When the EMS is executed, a set of information is dispatched to the local controllers at the primary control level to operate the DG’s in a cost-effective manner and simultaneously maximize the reliability of the microgrid. The set of information dispatched are [10]:

  • Set points for DG’s to dispatch the production of power

  • Set points for local loads to be shed or to be served

  • Market prices to serve as the input for EMS.

3.2 Decentralized Energy Management

In the decentralized EMS scheme (Fig. 6), local controllers are interfaced with each DG unit to communicate among each other through a communication channel within the microgrid. Each unit is controlled by its local controller where data for each of the DG controllers is exchanged. Local controllers communicate with each other to request/offer a service, exchange information, communicate expectations and share knowledge which is relevant to the microgrid operation. These controllers have advanced algorithms to make their own decisions or to process information and execute commands from the upper level. This EMS scheme is known for its intelligence as it is not fully aware of the decision made by controllers or the system-wide variables.

Fig. 6
figure 6

Decentralized EMS configuration [9]

In Fig. 6, the decentralized configuration illustrates a two-way communication channel between the local controllers for the exchange of information. This configuration is called a peer-to-peer (P2P) communication topology and is established within the primary control layer. The EMS is implemented locally in each of its local controllers connected to either DGs or the loads within the microgrid to allow the interaction of each unit to enable a decision-making process to optimally solve the energy management problem while providing flexibility within the microgrid to provide autonomy for all DG’s and loads.

In a decentralized EMS operation, the need for the secondary control layer is eliminated since the collaboration at the primary control layer between the local controllers, which work jointly to achieve local goals to meet generation and demand of the entire microgrid, overrides it. This can reduce the computational burden to some degree, as the customers no longer need to report their current or historical generation and demand data to EMS at the secondary control layer. Processing of information such as weather forecast, operating cost, load demand, etc., can be optimized by the local controllers, which reduces the use of hierarchical levels in the microgrid.

Implementation of an EMS in decentralized control architecture can increase the overall complexity of the entire microgrid. Although this can be overcome when looking at other perspectives in terms of its flexible operation and avoidance of single-point failure, which can still maintain the normal operation of the EMS. Another advantage is that it can allow interaction of various other DG units, like a plug-and-play functionality, without the need to make continuous changes to the local controller settings. Considering its structure and functionality, the following options can be more desirable for the microgrid cases [8]:

  • Large-scale microgrids, or the consumption, storage and generation are widely isolated which can make data acquisition costly or difficult when using centralized EMS

  • Requirement of local decision-making, when the resources are owned by multiple owners

  • Adding or removing of DGs.

When modeling the microgrid using the decentralized approach, the concept of multi-agent system (MAS) has been primarily addressed in the literature. MAS has evolved from a classical distribution control system which is specially designed for automated control systems with capabilities to control large and complex entities or groups of entities by dedicated controllers. Distributed control and MAS have a similar structure but what distinguishes them is the level of intelligence which the agents are embedded with. The MAS relies on a framework to achieve multiple local and global objectives autonomously, where two or more agents or intelligent agents are provided with local information. The characteristics of the local information, responsibilities and functionalities assigned to each agent and information shared by the agents between each other play a vital role in the overall performance of the system for the enhanced robustness, reliability and flexibility of microgrid. An intelligent agent is distinguished from a hardware or a software automated system and can be described as an agent which possess the characteristics such as [6]:

  • Reactivity: the ability to show reaction and reach to the changes in the environment in a timely manner

  • Pro-activeness: seeking initiatives to achieve goals

  • Social-ability: interaction with other agents through a communication channel.

These characteristics in local controllers work toward improving the performance of the system and not have the main objective to maximize the revenue of the corresponding unit. This means that the intelligent agents can interact with other intelligent agents to react to the environmental changes and establish a goal-oriented behavior.

Overall operation of MAS is to control objectives such as: economy, reliability, energy market participation and microgrid operation. Although this is an overall global goal for the microgrid to operate in a reliable manner, in MAS only local goals are defined and not global goals. When intelligent agents cooperate among themselves and work toward local goals, the targeted global goal may be achieved with local goals responding to sub-parts of the global goal. The design of MAS algorithms is a complex process that requires a great deal of expertise to decompose global goal task by modeling the agent’s interactions and classifying agents. Intelligent agents working together to achieve various local goals is a multi-objective problem, where the complexity of the MAS algorithm is structured in a rigorous manner for the agents to communicate autonomously.

An agent communication language (ACL) is an environment for knowledge and information exchange and is required within the microgrid to enable agents to process only allowable or necessary knowledge for the agents to communicate among each other and eventually agree upon to determine the power mismatch between the demand and generation, as well as the estimated incremental cost. In decentralized EMS, MAS algorithms rely on a modern communication infrastructure which supports P2P communication between the agents for the exchange of data. IEC 61850 standards are utilized which support P2P data exchange. Communication can be either wired or wireless depending on requirements.

The general architecture of a microgrid EMS based on MAS is described in [11] and shown in Fig. 7. Several different types of agents are defined in MG secondary and local controllers including:

Fig. 7
figure 7

A general architecture of MAS- based MG EMS [8]

  • Database gateway agent for storing and retrieving information with databases

  • Data monitor agent for obtaining real-time operation data from DER and feeding essential information to databases

  • MG operator agent for optimizing the operation of the whole system

  • DER gateway agent for interfacing other agents and control system with DER devices

  • Schedule tracker agent for following the schedule from MG operator agent and sending set-point to DER

  • DER operator agent for locally optimizing the operation of DER and response with MG operator agent. Based on this scheme, a secondary control is implemented for regulating MG frequency and power flow in islanded and grid-connected modes.

3.3 Comparison Between Centralized and Decentralized EMS

In addition to the comparison shown in Table 1, the decentralized framework has the following benefits:

Table 1 Comparison of centralized and decentralized
  • Decentralized controllers require less computing power, which is more cost effective

  • Decentralized control systems have greater controller redundancy and are robust to a single point of failure. Controller failures will not cause system blackout

  • Local decision-making reduces network use, relaxing the communication bandwidth requirement

  • System maintenance and upgrades can be done without shutting down the entire system.

The decentralized control framework is more flexible and scalable for future modifications and expansions.

4 MG EMS Solution

Many researchers have used different approaches to achieve optimal and efficient operation of MGs. This section outlines some popular methods used by researchers to solve the EMS.

4.1 EMS Based on Linear and Nonlinear Programming Methods

In [12], the authors present an optimal energy management of a residential MG to help minimize the operation cost. The cost function consists of: energy trading cost, penalty cost on adjustable load shedding, electric vehicles (EVs) batteries wearing out cost, the range anxiety term for EVs. Three test cases have been defined using three different range anxiety levels and have been studied to analyze the trade-off between operational cost of MG and average SOC of EVs battery. As well, three different types of load are considered, namely: critical, adjustable and shiftable loads. This optimal EMS is formulated using mix-integer linear programing (MILP). Similarly, in [13], the authors proposed MILP optimization model for an optimal MG EMS to maximize daily revenue with main grid peak shaving application by introducing demand-responsive loads. For the system, it was assumed that the load demand of the MG will always be more than generation. Two different systems were used to test and analyze the performance of the algorithm: first, a one-bus MG, and second a 14-bus MG system.

The authors in [14] proposed a centralized architecture for EMS of a grid-connected MG using sequential quadratic programing method. The EMS aims to optimize the operation of the MG during interconnected operation, i.e., maximize its value by optimizing production of the local DGs and power exchanges with the main distribution grid. Two policies are used: first policy is operational cost minimization, while second policy aims to maximize its profit considering energy transactions with the main grid. Likewise, [15] introduced strategic EMS of a grid-connected MG, constrained by an operation window of transformer nominal operation and voltage security. The developed model minimizes MG operational cost using modified gradient descent solution method. The forward–backward sweep algorithm determines power flow solution of MG. Three scenarios are considered in the objective function with respect to customer benefits, network losses and load leveling.

4.2 EMS Based on Dynamic Programming and Rule-Based Methods

Another solution of MG EMS is presented in [16]. An approximate dynamic programming (ADP) approach is to overcome the curse of dimensionality in the proposed EMS model of a grid-connected MG. The cost function is computed using receptive field weight regression and lookup table. Various scenarios of wind speed, load demand and ambient temperature are generated to consider their uncertainty in the proposed model, which uses economic dispatch and unit commitment operations to optimize the energy scheduling of MG. The proposed system is compared to myopic optimization and dynamic programming methods. In comparison with myopic optimization, the proposed system had lower operation cost, but higher computational time. But, with dynamic programming, the system had faster computational time and higher operation cost for MG.

4.3 EMS Based on Metaheuristic Approaches

Various authors have used metaheuristic approaches to solve the MG EMS. In [17], the authors proposed a genetic algorithm (GA) and rule-based approach to solve an economic load dispatch and battery degradation cost-based multi-objective EMS for a remote MG. The system both day-ahead and real-time operations considers diesel generator supply, battery supply and load shedding options in a sequential order to maintain load generation balance. An optimal EMS for grid-connected MG that considers uncertainties of renewable energy sources (RESs), load demand and electricity price using particle swarm optimization (PSO) [18]. The efficiency of PSO in finding the best solution is better in comparison with GA, combinatorial PSO, fuzzy self-adaptive PSO and adaptive modified PSO. Similarly, a differential evaluation (DE) based EMS for a grid-connected MG is presented in [19]. The objectives of the proposed EMS are minimization of operational and emission costs of the MG. Operational cost of MG includes bidding cost of DERs, demand response (DR) incentives and energy trading cost with the main grid. The results obtained using DE algorithm are compared with the PSO-based results. On comparison, the proposed DE algorithm was found to be superior in terms of solution quality and convergence speed. In [20], an ant colony optimization-based multi-layer EMS model for an islanded MG is proposed to minimize its operational cost. The objective function is comprised of bidding cost of RESs, DGs and battery, penalty cost on load shedding, and DR incentives in both day-ahead scheduling and 5 min interval real-time scheduling layers. Three case studies were used to analyze the system: operation, sudden high requirement of load demand and plug-and-play ability. The proposed approach reduces operational cost of MG by almost 20% and 5% more than the modified conventional EMS and PSO-based EMS, respectively.

4.4 EMS Based on Artificial Intelligent Methods

In [21], the authors presented a fuzzy-based MG EMS . The algorithm utilized two GAs to optimize its day-ahead MG scheduling and built a fuzzy expert system to control the power output of the storage system. The first GA determined MG energy scheduling and fuzzy rules, while the second GA tuned fuzzy membership functions. Reference [22] proposed an intelligent adaptive dynamic EMS for a grid-connected MG. It maximized the utilization of RESs and minimized carbon emissions to achieve a reliable and self-sustainable system. It also improved battery lifetime. The proposed EMS was modeled using evolutionary adaptive dynamic programming and reinforcement learning concepts and solved by use of two neural networks (NNs). An active NN is used to solve the proposed EMS strategy, while a critical NN checks its performance with respect to optimality. The newly defined performance index evaluates the performance of dynamic EMS in terms of battery lifetime, utilization of renewable energy and minimum curtailment of controllable load. The performance of the proposed approach is better as compared to decision tree approach-based dynamic EMS.

4.5 EMS Based on Multi-agents Systems (MAS)

A decentralized MAS-based MG EMS for a grid-connected MG is presented in [23]. For optimal operation of MG all the consumers, storage units, generation units and grid are considered as agents. Also, the consumer consumption preference has been considered as an important factor for decision-making. The algorithm helps reduce the power imbalance cost while considering consumer consumption preference as an important factor in the decision-making process. In [24], multi-objective hierarchical MAS-based EMS for a grid-connected MG system is presented to minimize its operational cost, emission cost and line losses. The hierarchical MAS is divided into three levels: The upper level agent in a centralized control responsible for energy management of the whole system to maximize economical and environmental benefits, the middle level agent is responsible for operational mode switching of this region to maintain secure voltages and the lower level agent responsible of f/V and PQ-based control strategies for unit agents to manage real-time operation of DERs.

5 MG EMS Wireless Communication

Traditional power grids which only supported one-way communication are now evolving into smart grids with two-way communication infrastructure to support intelligent mechanisms for predicting failures and monitoring the condition of the network. Communication will play a vital role to transform the smart grids into a set of microgrids. One important aspect of concern in microgrid is the security, load sharing and the variability of DG’s. The variability of power generation by the DG’s influences two aspects which are a matter of concern, i.e., power flow management and voltage control in the microgrid. Therefore, effective communication combined with advanced control techniques is needed to maintain the stability and safe operation during islanded mode operation of the microgrid [25].

The communication network can be treated as the spinal cord of a MG. It connects the power generating sources, transmission, distribution and consumption systems to the management block in order to evaluate the real-time data that reflects the stability of the entire grid [26]. Information is exchanged bi-directionally among operators, energy generating sources and consumers. Microgrid communication networks can be divided into the following categories:

  1. 1.

    Home Area Networks (HANs): Provides low bandwidth, two-way communication between the home appliances and equipment such as smart meters to collect the real-time data

  2. 2.

    Field Area Networks (FANs): Provides low bandwidth, two-way communication between the microgrid control station and customer premises

  3. 3.

    Wide Area Networks (WANs): Provides high bandwidth, two-way communication between the microgrid and utility grid.

To establish a reliable, secure and effective two-way communication for the information exchange, a communication subsystem in a microgrid must consist of the following requirements:

  • Must support the quality of service (QoS) of data. This is because the critical data must be delivered promptly

  • Must be highly reliable since large number of devices will be connected and will be communicating with different devices

  • Must have a high coverage, so it can respond to any event in the microgrid

  • Must guarantee security and privacy.

Communication technologies can be wired or wireless. Wireless technologies offer significant benefits over wired technologies such as rapid deployment, low installation cost, mobility, etc. Most commonly used wireless technologies are: Wireless mesh network, Cellular communications, Cognitive Radio, IEEE 802.15, Satellite communications and Microwave communications. Whereas, some of the most commonly used wired technologies are: Fiber-optic communications and power line communications.

6 MG EMS Test Case

As a case study, a MG EMS based on PSO is presented for grid-connected and islanded modes of operation, while considering a full-day load demand profile. The proposed EMS is required to verify load demand during 24 h operation with the lowest operating cost for the DGs, while taking into account the grid tariff and various system constraints [27].

6.1 Modeling of the Microgrid

The schematic diagram of the MG model used for the EMS is shown in Fig. 8. For this study, a typical MG model is used which includes different DGs such as: Combined heat and power (CHP) plant, diesel generator, natural gas-fired generator, photovoltaic (PV) generator, wind generator and energy storage system (ESS). The DGs are connected and integrated at the point of common coupling (PCC) to provide power to a cluster of loads. The rated power for DGs is shown in Table 2. The MG is capable to operate in two different modes:

Fig. 8
figure 8

Overall system [27]

Table 2 Rating of all the DGs in the system
  • Grid-connected mode where the MG is able to buy power from the grid if demand exceeds available power or sell power back to the grid if production exceeds demand. The load demand in this mode is 4.35 MW.

  • Islanded mode where it supplies power to only the critical loads. The load demand in this mode is 2.50 MW.

6.2 Mathematical Model of System

In this section, the mathematical modeling of the system is presented.

6.2.1 Generator Cost Function

The fuel cost function for the CHP, diesel generator and natural gas generator are typically approximated by a quadratic function, as stated in Eq. (1):

$$F_{j} (P_{j} ) = \alpha_{j} + \beta_{j} P_{j} + \gamma_{j} P_{j}^{2}$$
(1)

where j = generating source; Pj = power output of a source j; Fj = operation cost of source j in $/h; α, β, γ are the cost coefficients in $/h (shown in Table 3) [28].

Table 3 Cost figures for various generators

6.2.2 Solar Generation Cost Function

The solar generation cost function is given by:

$$F\left( {P_{\text{s}} } \right) = a*I_{\text{p}} *P_{\text{s}} + G^{\text{e}} *P_{\text{s}}$$
(2)
$$a = \frac{r}{{\left[ {1 - (1 + r)^{ - N} } \right]}}$$
(3)

where

Ps:

Solar generation (kW)

a:

Annuitization coefficient (dimensionless)

r:

Interest rate

N:

Investment lifetime (taken as N = 20 years)

Ip:

Investment costs, per unit installed power ($/kW)

Ge:

Operation and maintenance (O&M) costs, per unit generated energy ($/kW).

Equations (2) and (3) are used to calculate the total generating cost of the solar energy considering the depreciation of all the equipment for generation. In this system, the values for the investment costs per unit of installed power (Ip) and O&M costs per unit of generated energy (Ge) are assumed to be equal to $5000 and 1.6 cents per kW, respectively. Therefore, the final cost function can be derived, represented in Eq. (4) [29].

$$F(P_{\text{s}} ) = 5 4 5. 0 1 6P_{\text{s}}$$
(4)

Figure 9 depicts the forecasted power for the solar farm for this study over an aggregated 24-h period. This data is not based on any one particular season or geographical area; however, it is a typical curve and is used here for discussion purposes. The seasonality over the year of particular geographical regions can also be accommodated, if desired.

Fig. 9
figure 9

Forecasted power for solar farm [27]

6.2.3 Wind Generation Cost Function

The cost function for wind generation by Eqs. (2), and (3) is similar to solar generation. But, the investment costs per unit installed power (Ip) and O&M costs per unit generated energy (Ge) are assumed to be equal to $1400 and 1.6 cents per kW. Therefore, the final cost function can be derived and is represented in Eq. (5) [29].

$$F\left( {P_{\text{w}} } \right) = 152.616P_{\text{w}}$$
(5)

Figure 10 depicts the forecasted aggregated power for the wind farm for this study over a 24-h period. Again, this data is not based on any particular season or geographical area; however, it is typical, and it is just assumed here for test purposes.

Fig. 10
figure 10

Forecasted power for wind farm [27]

6.2.4 Constraints Function

The constraints functions are used to help guide the system to achieve the desired results.

  1. A.

    Grid-Connected Mode

In grid-connected mode, the MG is able to buy/sell power from/to the main grid depending on the load demand. Hence,

$$P_{\text{generated}} \ne P_{\text{Load}}$$
(6)

If Eq. (6) is true then

$$P_{\text{grid}} = P_{\text{generated}} - P_{\text{Load}}$$
(7)

Therefore, if Pgrid is positive, then microgrid is purchasing power from the grid and if Pgrid is negative then microgrid is selling power to the grid.

  1. B.

    Islanded Mode

Since, in islanded mode, the MG is disconnected from the main grid, there cannot be any buying/selling of power. Hence,

$$P_{\text{generated}} = P_{\text{Load}}$$
(8)

Thus, Eq. (8) must always be true.

  1. C.

    Power Generation Limits

Each DG has a power rating as shown in Table 1.

$$P_{j}^{\hbox{min} } \le P_{j} \le P_{j}^{\hbox{max} }$$
(9)

6.3 Results of PSO

The load demand for a 24-h period, as used for both case studies, is presented in Fig. 11. It can be seen in Fig. 11 that load demand for the islanded mode is significantly lower than load demand during grid-connected mode. That is because when the system goes into islanded condition, then load shedding takes place and the system only supplies power to the critical loads.

Fig. 11
figure 11

Load demand [27]

6.3.1 First Case Study: Grid-Connected Mode

Figure 12 depicts the best output achieved from the EMS for grid-connected mode. The algorithm was able to find the optimal solution to dispatch DGs to satisfy the given load demand for the time period. It can be observed that the system is able to buy and sell power from the grid during off-peak and peak hours. The total cost of operation during the 24-h period achieved is $2297.96.

Fig. 12
figure 12

Output of PSO (first case study) [27]

6.3.2 Second Case Study: Islanded Mode

Figure 13 depicts the best output achieved from the EMS for islanded mode of operation. The algorithm was able to find the optimal solution to dispatch every generator to satisfy the given load demand for each time interval. As can be observed, the three generators CHP (Gen1), diesel generator (Gen2) and natural gas generator (Gen3) are being rapidly ramped up and down to help for each time interval to help reduce or increase the generation to help satisfy the load. This ramping in the system has to be controlled by adding a ramp rate constraint in the algorithm, but for this study, the ramp rate has been ignored due to the use of a one-hour time step. The total operation cost achieved during the 24-h period for case is $2277.92.

Fig. 13
figure 13

Output of PSO (second case study) [27]

7 Conclusion

Microgrid management system (MGMS) operates the system autonomously connecting it to the utility grid appropriately for the bi-directional exchange of power and providing support to components within the microgrid. It enables the interplay of components and different controllers to operate the EMS in a safe and controlled manner. MGMS is broken down into three different subsystems, i.e., primary, secondary and tertiary control layers. Furthermore, the MGMS supervisory control can be sub-divided into two types, namely, centralized and decentralized. Many researchers have used different approaches to achieve optimal and efficient operation of MGs. This chapter outlines some popular methods used by researchers to solve the EMS. A test case with a particle swarm optimization technique is provided. Also, the requirements for a communication system within the MG are briefly discussed.