**Coordinated Demand Response and Distributed Generation Management in Residential Smart Microgrids**

Amjad Anvari-Moghaddam, Ghassem Mokhtari and Josep M. Guerrero

Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/63379

#### **Abstract**

Nowadays with the emerging of small-scale integrated energy systems (IESs) in form of residential smart microgrids (SMGs), a large portion of energy can be saved through coordinated scheduling of smart household devices and management of distributed energy resources (DERs). There are significant potentials to increase the functionality of a typical demand-side management (DSM) strategy, and typical implementation of building-level DERs by integrating them into a cohesive, networked package that fully utilizes smart energy-efficient end-use devices, advanced building control/automation systems, and an integrated communications architecture to efficiently manage energy and comfort at the end-use location. By the aid of such technologies, residential consumers have also the capability to mitigate their energy costs and satisfy their own requirements paying less attention to the configuration of the energy supply system. Regarding these points, this chapter initially defines an efficient framework for coordinated DSM and DERs manage‐ ment in an integrated building and SMG system. Then a working energy manage‐ ment system (EMS) for applications in residential IESs is described and mathematically modeled. Finally, the effectiveness and applicability of the proposed model is tested and validated in different operating modes compared to the existing models. The findings of this chapter show that by the use of an expert EMS that coordinates supply and demand sides simultaneously, it is very possible not only to reduce energy costs of a residential IES, but also to provide comfortable lifestyle for occupants.

**Keywords:** demand response, distributed energy resources, energy management, smart microgrids, multi-objective optimization

© 2016 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

## **1. Introduction**

The present intelligent energy networks together with the future smart electricity grids could highly affect the process of energy generation, transmission, distribution, and consumption at differentlevels (e.g., industrial, commercial, andresidential sectors)in an efficient,reliable, and secure manner. By the use of these emerging technologies and advanced components in micro/ macro scales, not only the energy can be delivered to householders and business owners more cost-efficient, but also more renewable energy sources (RESs) can be exploitedin a greener way. Through the joint operation of smart energy management systems (SEMSs) and advanced components within a smart microgrid (SMG) environment, it is possible to enable two-way digital communications between the utility and household devices and to provide the users with appropriate tools to improve their energy efficiency, consumption behavior and comfort levels [1]. On the other hand, optimal design, control and operation management of energyrelated production and consumption units have been attracting an increasing interest over the past decade and turning into a major part of energy management programs. Although the term "EnergyManagement" is widelyusednowadays in literature andinterpreteddifferently based on different operating scenarios, this chapter covers the subject of monitoring, controlling and conserving energy in building units and in residential SMGs, in broader perspective. In these environments, the users not only produce energy from several local and distributed genera‐ tion (DG) units and play a "prosumer" role, but also participate in different incentive-based demand response (DR) programs to change their consumption behavior during different times of a day. However, integration of end-users as active components of future SMGs can inject unwantedrisksanduncertainties inplanningandoperationphases [2,3].Toaddress theseissues suitably, this chapter first outlines an efficient framework for coordinated DR and DG manage‐ ment in an integrated building and SMG system. Then, a fully-featured SEMS for managing loads at demand-side and domestic controllable generation units at the supply-side is descri‐ bed, mathematically modeled and validated.

## **2. Smart microgrids (SMGs)**

In many parts of the world, the existing electricity networks at transmission and distribution levels use technologies, digital communication, control systems, and strategies that are many decades old. To update this aging infrastructure and to create an energy network that meets the ever-growing needs of today's power market, developed societies are aiming at creating intelligent facilities so as to use advanced sensing, communication, and control technologies to generate and distribute energy in a more efficient, economic, and secure fashion. Moreover, pursuing other objectives such as potential lower cost, higher service reliability, better power quality, increased energy efficiency and energy independence, is becoming the driving force to advocate the utilization of distributed energy resources (DERs) and to focus on what is called "Smart Microgrid", as the future of power systems. While details about the characteristics of a SMG vary greatly, key features include [4]:

## **• Reliable and resilient**

**1. Introduction**

28 Energy Management of Distributed Generation Systems

bed, mathematically modeled and validated.

a SMG vary greatly, key features include [4]:

**2. Smart microgrids (SMGs)**

The present intelligent energy networks together with the future smart electricity grids could highly affect the process of energy generation, transmission, distribution, and consumption at differentlevels (e.g., industrial, commercial, andresidential sectors)in an efficient,reliable, and secure manner. By the use of these emerging technologies and advanced components in micro/ macro scales, not only the energy can be delivered to householders and business owners more cost-efficient, but also more renewable energy sources (RESs) can be exploitedin a greener way. Through the joint operation of smart energy management systems (SEMSs) and advanced components within a smart microgrid (SMG) environment, it is possible to enable two-way digital communications between the utility and household devices and to provide the users with appropriate tools to improve their energy efficiency, consumption behavior and comfort levels [1]. On the other hand, optimal design, control and operation management of energyrelated production and consumption units have been attracting an increasing interest over the past decade and turning into a major part of energy management programs. Although the term "EnergyManagement" is widelyusednowadays in literature andinterpreteddifferently based on different operating scenarios, this chapter covers the subject of monitoring, controlling and conserving energy in building units and in residential SMGs, in broader perspective. In these environments, the users not only produce energy from several local and distributed genera‐ tion (DG) units and play a "prosumer" role, but also participate in different incentive-based demand response (DR) programs to change their consumption behavior during different times of a day. However, integration of end-users as active components of future SMGs can inject unwantedrisksanduncertainties inplanningandoperationphases [2,3].Toaddress theseissues suitably, this chapter first outlines an efficient framework for coordinated DR and DG manage‐ ment in an integrated building and SMG system. Then, a fully-featured SEMS for managing loads at demand-side and domestic controllable generation units at the supply-side is descri‐

In many parts of the world, the existing electricity networks at transmission and distribution levels use technologies, digital communication, control systems, and strategies that are many decades old. To update this aging infrastructure and to create an energy network that meets the ever-growing needs of today's power market, developed societies are aiming at creating intelligent facilities so as to use advanced sensing, communication, and control technologies to generate and distribute energy in a more efficient, economic, and secure fashion. Moreover, pursuing other objectives such as potential lower cost, higher service reliability, better power quality, increased energy efficiency and energy independence, is becoming the driving force to advocate the utilization of distributed energy resources (DERs) and to focus on what is called "Smart Microgrid", as the future of power systems. While details about the characteristics of By the use of advance technologies such as smart metering, sensing, and state estimation, SMG improves fault detection and allows self-healing of the network without the interven‐ tion of technicians. This will ensure more reliable supply of electricity, and reduced vulnerability to natural disasters or attacks. SMG can also help utilities to speed outage restoration following major events, reduce the total number of affected customers, and improve overall service reliability to reduce customer losses from power disruptions [5].

### **• Efficient and sustainable**

By the emergence and deployment of SMGs, efficiency improvement of energy infrastruc‐ tures is expected. More than half of potential reductions in greenhouse gas (GHG) emissions would be achieved, transmission losses would be reduced, peak-load would be managed and transparency in electricity prices would be increased. By having a better understanding of equipment conditions through real-time equipment monitoring, utilities could also keep vital components operating at high efficiency. Moreover, through integration of digital technologies to the modernization of many sectors of the economy, higher efficiency gains, new opportunities, and greater productivity can be also guaranteed.

On the other hand, with the increasingly serious energy shortage and global warming, sustainable development can be obtained via integration of smart grid technologies, sustainable energy resources and low carbon emissions in power systems. The improved flexibility of the smart grid permits high penetration of green and sustainable RESs such as solar power and wind power, even without the addition of energy storage. However, the difficulties in dealing with intermittent power and the low utilization efficiency of power system appeared to be obstacles.

## **• Flexible and bidirectional**

**Figure 1** illustrates the way how the future smart electricity grids are different from the ones we know today. Our conventional energy networks have been designed and controlled in a way to support unidirectional flow of electricity and information from centralized large power generation units toward the end-use passive consumers, while the SMG relies more on bidirectional communication between consumers, suppliers and smart devices. The flow of energy across the network is also based on a mesh-grid structure rather than a unidirec‐ tional top-down system [6].

## **• Demand-side management support**

SMG technology will allow customers to make more informed decisions about their energy consumption, adjusting both the timing and quantity of their electricity use. Such an ability which is called demand-side management (DSM) allows supply and demand sides to interact in an automated way in real-time, coordinating demand to flatten spikes. By doing this, the cost of adding reserve capacity is mitigated, wear and tear costs are reduced, and the life of equipment is increased. In a like manner, participating in DSM programs allows users to cut their energy bills by telling low priority devices to use energy only when it is cheapest. It should be noted that DSM programs comprise two different activities, demand response (DR) and energy efficiency/conservation (EE/C). A DR action transfers customer load during periods of high demand to off-peak periods and can reduce critical peak demand while EE/C program encourages customers to give up some energy use in return for saving money and allows them to use less energy while receiving the same level of end service [7].

#### **• Market-enabling**

By the use of two-way communications between the suppliers/retailers and consumers it is possible to introduce more flexibility in operational strategies and enable effective market environments for suppliers who want to sell energy at higher prices and consumers who are willing to pay less. On the other hand, the development of market-driven operation procedures of the SMG will lead to a significant reduction of market power exerted by the established generation companies (GenCos). Widespread application of modular plug-andplay micro-sources may contribute to a reduction in energy price in the power market. Moreover, micro-sources may be used to provide ancillary services and further increase their market share in voltage support and stability services [8].

As a whole, SMG can be defined as an ingenious self-healing system that can be operated automatically by any source of fuel such as renewable energies and/or non-conventionals. It is an efficient way of RESs utilization and pollutant emission reduction. A SMG can realize existing overloads throughout the network and has the ability to reconfigure the network so as to impede potential outages. It is a base that enables active participation of und-users as informed consumers, accommodates all energy generation and storage options, advo‐ cates advanced products, markets or services, enables high penetration of intermittent sources, optimizes assets, resists attacks, and provides the energy quality for the range of needs in a digital economy [6,9,10].

**Figure 1.** Conventional energy system vs. future smart micro-grids.

## **3. Integrated energy systems**

Integrated energy systems (IESs) provide the infrastructure to use SMGs to enable different mechanisms such as DR through SEMS. Smart energy management is an innovative approach to managing loads at the demand-side and domestic controllable units at the supply-side. It incorporates the conventional energy use management principles represented in DSM, DR, and DER programs and merges them in an integrated framework that simultaneously addresses permanent energy savings, demand reductions, and temporary peak load mitiga‐ tions. In the context of residential SMGs, this is accomplished through an integrated dynamic system comprised of intelligent end-use devices (such as smart home appliances, lighting systems, and heating, ventilation, and air conditioning (HVAC)) and DERs with highly advanced sensing, controls and communications capabilities that enable real-time manage‐ ment of the system as a whole. A main residential SEMS consists of four components:


response (DR) and energy efficiency/conservation (EE/C). A DR action transfers customer load during periods of high demand to off-peak periods and can reduce critical peak demand while EE/C program encourages customers to give up some energy use in return for saving money and allows them to use less energy while receiving the same level of end

By the use of two-way communications between the suppliers/retailers and consumers it is possible to introduce more flexibility in operational strategies and enable effective market environments for suppliers who want to sell energy at higher prices and consumers who are willing to pay less. On the other hand, the development of market-driven operation procedures of the SMG will lead to a significant reduction of market power exerted by the established generation companies (GenCos). Widespread application of modular plug-andplay micro-sources may contribute to a reduction in energy price in the power market. Moreover, micro-sources may be used to provide ancillary services and further increase

As a whole, SMG can be defined as an ingenious self-healing system that can be operated automatically by any source of fuel such as renewable energies and/or non-conventionals. It is an efficient way of RESs utilization and pollutant emission reduction. A SMG can realize existing overloads throughout the network and has the ability to reconfigure the network so as to impede potential outages. It is a base that enables active participation of und-users as informed consumers, accommodates all energy generation and storage options, advo‐ cates advanced products, markets or services, enables high penetration of intermittent sources, optimizes assets, resists attacks, and provides the energy quality for the range of

their market share in voltage support and stability services [8].

needs in a digital economy [6,9,10].

**Figure 1.** Conventional energy system vs. future smart micro-grids.

service [7].

**• Market-enabling**

30 Energy Management of Distributed Generation Systems


The aforementioned components are built upon each other and interact with one another to provide an infrastructure that is intelligent, highly energy-efficient, automated, reliable and robust. The result is a system of systems that is capable of working in unison to optimize overall operation based on consumer requirements, utility constraints, available incentives and other variables such as weather and building occupancy. In the following section, the predominant characteristics of each of these four components are summarized.

#### **3.1. Smart energy efficient end-use devices**

The availability of system-wide electricity generation and transmission capacity can be increased for other uses through an investment in end-use energy efficiency. End-use energy efficiency, often referred to as a "negawatt", can be noted as a resource available to remove the mismatch between energy supply and demand, just as is done with other resources such as non-conventional or renewable power generations. Similar to other resources, saved energy from end-use efficiency is available in different amounts and levels of investment. When considering costs over the lifetime of an investment, end-use energy efficiency can be one of the lowest-cost means of meeting energy demand and of reducing GHG emissions [10]. On the other hand, to increase energy efficiency and reduce GHG emissions from the residential sector, there exist a number of solutions from which utilizing smart energy-efficient end-use devices is seemed to be a wise solution. Generally these devices includes but not limited to: efficient personal computers and peripherals (e.g., printers, scanners, and speakers), television and other audio–visual equipment, personal care appliances (e.g., hair dryers and electric toothbrushes), kitchen appliances (e.g., coffee makers, toasters, and microwaves), refrigeration and freezers, dishwashers, clothes washers and dryers, lighting, space conditioning, and integrated HVAC-water heating systems with the highest energy efficiencies. It is noteworthy that the smart end-use devices should be equipped with embedded features allowing for twoway communications and automated control.

## **3.2. Smart DERs**

Over the past few years, the utility industry has made significant progress in defining common grid-supportive functions for distributed resources such as photovoltaics (PV), diesel engines, micro-turbines, and fuel cells (FCs), and also in defining the open standard communication protocols needed to make them smart and to connect these devices into SMGs. The functions include, for example [11,12]:


#### **3.3. Advanced building control/automation systems**

Advanced building control/automation system is the key component of the future smart buildings that benefits from several communication domains, including the smart meter domain Advanced metering infrastructure (AMI), the internet domain and building area network (BAN). It is a system that receives information about task operating status, usage requests and network signals and sends control actions back to the smart devices, i.e., it optimizes the performance of end-use devices and DERs based on operational requirements, user preferences and external signals from the utility, end-user or other authorized entity. Such a system also provides the occupants with useful feedbacks about energy usage pattern, and helps making control decisions more autonomously. To identify solutions based on different objectives (e.g., energy saving and living comfortably), it also gathers information from the home's environment as well as the outside situation [13].

Other controllers that allow for two-way communications and those that have the ability to learn from past experience and apply that knowledge to future events are also playing crucial role in an advanced building control systems.

## **3.4. Integrated communications architecture**

integrated HVAC-water heating systems with the highest energy efficiencies. It is noteworthy that the smart end-use devices should be equipped with embedded features allowing for two-

Over the past few years, the utility industry has made significant progress in defining common grid-supportive functions for distributed resources such as photovoltaics (PV), diesel engines, micro-turbines, and fuel cells (FCs), and also in defining the open standard communication protocols needed to make them smart and to connect these devices into SMGs. The functions

way communications and automated control.

32 Energy Management of Distributed Generation Systems

**3.2. Smart DERs**

include, for example [11,12]: **•** Intelligent Volt–Var control **•** Intelligent Volt–Watt control **•** Reactive power/power factor

**•** Low-voltage ride through

**•** Connect/disconnect

**•** Load and generation following

**•** Maximum generation limiting

**•** Intelligent frequency–Watt control

**•** Storage systems charge/discharge management

**•** Peak limiting function for remote points of reference

**3.3. Advanced building control/automation systems**

home's environment as well as the outside situation [13].

role in an advanced building control systems.

**•** Dynamic reactive current injection (responding to changes in voltage dV/dt)

Advanced building control/automation system is the key component of the future smart buildings that benefits from several communication domains, including the smart meter domain Advanced metering infrastructure (AMI), the internet domain and building area network (BAN). It is a system that receives information about task operating status, usage requests and network signals and sends control actions back to the smart devices, i.e., it optimizes the performance of end-use devices and DERs based on operational requirements, user preferences and external signals from the utility, end-user or other authorized entity. Such a system also provides the occupants with useful feedbacks about energy usage pattern, and helps making control decisions more autonomously. To identify solutions based on different objectives (e.g., energy saving and living comfortably), it also gathers information from the

Other controllers that allow for two-way communications and those that have the ability to learn from past experience and apply that knowledge to future events are also playing crucial A typical integrated communication architecture allows automated control of smart end-use devices and DERs in response to various signals such as pricing or load reduction signals from the utility, weather forecast in an hourly/daily basis, and bidirectional data transmission (such as external alerts as well as end-user signals) between multiple nodes. It also allows the enduse devices, DERs and/or control systems to send operational data to external parties (e.g., advanced meters that communicate directly with utilities).

**Figure 2.** Energy management infrastructure for residential buildings.

**Figure 2** shows an example of an energy management infrastructure applied to a generic residential building. As can be seen, building energy management systems (EMSs), and to a broader extent BAN, are not single-technology networks, but combine various specialized networking technologies. Interoperability and coexistence are key to guaranteeing the cooperation between all protocols in the same area, especially when building EMSs need to coexist with legacy home automation, home security systems or home A/V systems. In this example, there are two-way communications via the Internet, Ethernet PLM, as well as via the power line or ZigBee. The building is equipped with smart energy-efficient end-use devices, an energy manager, automated controls with data management capabilities, DERs such as rooftop solar PVs, and other on-site generation and storage systems such as electric vehicles (EVs). Thus, energy-efficient devices, controls and DR strategies are coupled with on-site energy sources to serve as an additional energy "resource" for the utility. Not only do all of these elements contribute to the utility's supply-side by reducing building demand, DERs can also feed excess power back to the grid. A SEMS is likely to have a much larger impact on a building's electricity consumption and demand than just implementing energy efficiency and/ or DR on their own.

## **4. SEMS operation from an integrated perspective**

As described earlier, smart end-use devices which benefit from advanced highly efficient controls, sensing and communications capabilities are regarded as key components of a SEMS. These devices can dynamically communicate with other smart components and adjust their performance in response to external reference signals. This marks an emergence from static to dynamic end-use devices with advancements in distributed intelligence. In addition to electric end-use devices, a SEMS would also include DERs such as solar PV systems, wind turbines (WTs), micro-combined heat and power (micro-CHP) units, diesel generators, and FCs. The performances of these DERs are also programmed to operate in an integrated manner with end-use devices at the facility so as to be able to optimize overall system performance based on the predefined goals and objectives. Here, we use "smart device" as a common term referring either to an energy-efficient end-use device or to a controllable DER. Each program‐ mable smart device has its own control strategy, which assures optimal performance of the device based on external reference signals coming from SEMS and a variety of external parameters such as weather conditions, energy price signals, consumer habits and user's preferences. For interoperability among the smart devices and other components within a SEMS's domain, advanced meters with two-way communications infrastructure are also required. This will enable the SEMS to connect the electric meter and smart devices in the building to the BAN, thereby giving the SEMS direct access and control of these devices. Depending on the hourly energy price or other external parameters and based on the prede‐ fined objectives and available constraints, the smart devices equipped with the responsive controls automatically respond to the external signals and optimize entire system performance, say within the user "comfort range" to minimize energy costs. For autonomous operation in response to environmental conditions and other influential parameters within the controlled space, SEMS must be capable of very abstract decision making, ranging from determining a meaningful balance between cost and comfort for current conditions, to the very physical, such as turning a smart device on or off. Within a building unit, the response strategy of each smart device is also networked and interacts with the response strategies of other devices in a way to optimize the entire system performance. The system should be also able to execute a fully automated control strategy with override provisions, i.e., although the system is able to control multiple devices automatically, user preference may be dominated to autonomous operation and direct control is adopted accordingly. Likewise, for devices that are controlled indirectly, signaling approaches with some means of indication (such as blinking lights, colored LEDs) can be applied for the occupants' awareness to assist them when is propitious to run these appliances. For a SEMS to be able to interact effectively with its environment and learn from prior experiences without being explicitly programmed, learning functionalities with learning logic and artificial intelligence can be also integrated into the system. In this way, the system searches through data to look for patterns. However, instead of extracting data for human comprehension, machine learning is used to process data, improve the program's own understanding and adjust program actions accordingly.

## **5. SEMS modeling and design for IESs**

also feed excess power back to the grid. A SEMS is likely to have a much larger impact on a building's electricity consumption and demand than just implementing energy efficiency and/

As described earlier, smart end-use devices which benefit from advanced highly efficient controls, sensing and communications capabilities are regarded as key components of a SEMS. These devices can dynamically communicate with other smart components and adjust their performance in response to external reference signals. This marks an emergence from static to dynamic end-use devices with advancements in distributed intelligence. In addition to electric end-use devices, a SEMS would also include DERs such as solar PV systems, wind turbines (WTs), micro-combined heat and power (micro-CHP) units, diesel generators, and FCs. The performances of these DERs are also programmed to operate in an integrated manner with end-use devices at the facility so as to be able to optimize overall system performance based on the predefined goals and objectives. Here, we use "smart device" as a common term referring either to an energy-efficient end-use device or to a controllable DER. Each program‐ mable smart device has its own control strategy, which assures optimal performance of the device based on external reference signals coming from SEMS and a variety of external parameters such as weather conditions, energy price signals, consumer habits and user's preferences. For interoperability among the smart devices and other components within a SEMS's domain, advanced meters with two-way communications infrastructure are also required. This will enable the SEMS to connect the electric meter and smart devices in the building to the BAN, thereby giving the SEMS direct access and control of these devices. Depending on the hourly energy price or other external parameters and based on the prede‐ fined objectives and available constraints, the smart devices equipped with the responsive controls automatically respond to the external signals and optimize entire system performance, say within the user "comfort range" to minimize energy costs. For autonomous operation in response to environmental conditions and other influential parameters within the controlled space, SEMS must be capable of very abstract decision making, ranging from determining a meaningful balance between cost and comfort for current conditions, to the very physical, such as turning a smart device on or off. Within a building unit, the response strategy of each smart device is also networked and interacts with the response strategies of other devices in a way to optimize the entire system performance. The system should be also able to execute a fully automated control strategy with override provisions, i.e., although the system is able to control multiple devices automatically, user preference may be dominated to autonomous operation and direct control is adopted accordingly. Likewise, for devices that are controlled indirectly, signaling approaches with some means of indication (such as blinking lights, colored LEDs) can be applied for the occupants' awareness to assist them when is propitious to run these appliances. For a SEMS to be able to interact effectively with its environment and learn from prior experiences without being explicitly programmed, learning functionalities with learning logic and artificial intelligence can be also integrated into the system. In this way, the system

**4. SEMS operation from an integrated perspective**

or DR on their own.

34 Energy Management of Distributed Generation Systems

Energy management for an IES includes optimal scheduling and running of different energyrelated generation devices as well as consumption units considering predefined goals such as energy conservation, environment protection and cost savings. It is also connected tightly to the people's way of life and their comfort zones. In this regard, a residential energy manage‐ ment (REM) strategy can be seen as a multiple-criteria optimization and decision-making problem that should be handled in a way to meet the system's goals and constraints. For this problem, it is crucial to model the components of the IES carefully. In the following subsections different compartments of a REM problem are introduced and mathematically modeled.

#### **5.1. Heat transfer and thermal modeling of a residential building unit**

For diagnosis and control strategy analysis, there is a strong need to develop suitable thermal model for different components of a residential building unit. Based on a simplified lumped capacitance model, the thermal resistance across a layer of area (*A*), thickness (*x*), and thermal conductivity (*k*) is as follows [2]:

$$R\_{\text{layers}} = \frac{\text{x}}{k \cdot A} = \frac{R\_{\text{valw}}}{A} \tag{1}$$

where *Rvalue* denotes the insulation level of the layer. As an example, for a multi-layer exterior wall such as one depicted in **Figure 3**, the total thermal resistance can be calculated as follows:

$$R\_r = \frac{\sum\_{l=1}^{3} R\_{rl}}{2} \tag{2}$$

$$R\_{\Pi} = \frac{100}{\frac{\%area \, with \, frame}{RI\_{F,i}} + \frac{\%area \, without \, frame}{RI\_{I,i}}} \tag{3}$$

where *RT1* and *RIF,i* are the thermal resistances in insulation and framed wall, respectively. *RII,i* is the thermal resistance in insulated portion. *RT2* is the thermal resistance between the planes bounding the inner and outer faces of the metal framing members, and *RT3* is the resistance of remaining components. Likewise, *RT* is the total thermal resistance.

**Figure 3.** A typical steel stud framing wall insulating sheathing [2].

Having calculated thermal resistances for different materials and components of a house structure using the same procedure, one can easily evaluate the amount of heat flows between different nodes as follows:

$$\phi\_{io}\left(h\right) = \frac{T\_{in}\left(h\right) - T\_{out}\left(h\right)}{R\_{io}}\tag{4}$$

$$\phi\_{\beta}\left(h\right) = \frac{T\_{\nearrow}\left(h\right) - T\_{\nearrow}\left(h\right)}{R\_{\nearrow}}\tag{5}$$

$$\phi\_{\beta\ell}\left(h\right) = \frac{T\_f\left(h\right) - T\_g\left(h\right)}{R\_{\beta\ell}}\tag{6}$$

in which, *φio*, is the heat flow between the indoor air node and the outdoor environment through thermal resistance *Rio*, *φfi* is the heat flow between the floor and the indoor air through thermal resistance *Rfi*, and *φfg* is the heat flow between the floor and the ground through thermal resistance *Rfg*, as shown in **Figure 4**. In a similar manner, *Tin* (*h*), *Tout* (*h*), *Tf* (*h*), and *Tg* (*h*) are the temperatures of the indoor air, the outdoor environment, the floor, and the ground at hour *h*.

Coordinated Demand Response and Distributed Generation Management in Residential Smart Microgrids http://dx.doi.org/10.5772/63379 37

**Figure 4.** Thermal modeling of a building.

**Figure 3.** A typical steel stud framing wall insulating sheathing [2].

36 Energy Management of Distributed Generation Systems

different nodes as follows:

Having calculated thermal resistances for different materials and components of a house structure using the same procedure, one can easily evaluate the amount of heat flows between

> *io Th T h*

*fi Th Th*

*fg Th Th*

*R*

in which, *φio*, is the heat flow between the indoor air node and the outdoor environment through thermal resistance *Rio*, *φfi* is the heat flow between the floor and the indoor air through thermal resistance *Rfi*, and *φfg* is the heat flow between the floor and the ground through thermal resistance *Rfg*, as shown in **Figure 4**. In a similar manner, *Tin* (*h*), *Tout* (*h*), *Tf* (*h*), and *Tg* (*h*) are the temperatures of the indoor air, the outdoor environment, the floor, and the ground at hour *h*.

*R*




*R*

( ) *in out* ( ) ( ) *io*

( ) *<sup>f</sup>* ( ) *in* ( )

( ) *f g* ( ) ( )

*h*

f

*fi*

*fg*

f

*h*

f

*h*

Regarding to an under-floor heating/cooling system (RFH/CS) as a heat node in the house, the amount of thermal energy that is supplied to the floor is determined as follows:

$$
\phi\_{\rm HP}\left(h\right) = \left(u\_{\rm HP}\left(h\right) \cdot \eta\_{\rm H}\left(h\right) - \left(1 - u\_{\rm HP}\left(h\right)\right) \cdot \eta\_{\rm C}\left(h\right)\right) P\_{\rm HP}\left(h\right) \tag{7}
$$

where *uHP* is a binary variable stands for heating ("1") or cooling ("0") status, and *PHP* [0, *PHP,max*] is the power consumption of the heat pump at hour *h*. *ηH* [*ηH,min*, *ηH,max*] and *ηC* [*ηC,min*, *ηC,max*] are the heating and cooling coefficients of performance (COPs) which are roughly linear functions of outdoor temperature.

As another source of thermal energy, solar radiation has a great effect on the heating/cooling load of a building. During different months in a year, the Sun's path varies across the sky and affects the overall thermal behavior of the building by its direct and diffuse radiation [14]. As shown in **Figure 5**, the hourly heat flow into an exterior surface of a building due to solar radiation can be introduced as follows:

$$\begin{aligned} \phi\_{\text{surf}}\left(h\right) &= h\_o A\_s \left(T\_{\text{out}}\left(h\right) - T\_{\text{surf}}\left(h\right)\right) + \alpha\_s A\_s \phi\_{\text{solar}}\left(h\right) - \varepsilon A\_s \sigma \left(T\_{\text{out}}^4\left(h\right) - T\_{\text{surr}}^4\left(h\right)\right) \\ &= h\_o A\_s \left(T\_{\text{eq\\_out}}\left(h\right) - T\_{\text{surf}}\left(h\right)\right) \end{aligned} \tag{8}$$

**Figure 5.** The solar radiation effect on heating/cooling load of a building.

where *ho* is the combined convection and radiation heat transfer coefficient, *αs* is the solar absorptivity, *ε* is the emissivity of the surface, *ϕsolar* is the solar radiation incident on the surface and *σ* is Stefan–Boltzmann constant. *Tsurf* and *Tsurr* are the average temperatures of the exposed surfaces and other surrounding surfaces, respectively. Likewise, *Teq\_out* is the equivalent temperature of outdoor air considering the effect of solar radiation. The previous equation can be rewritten as:

$$T\_{aq\\_out}\left(h\right) = T\_{out}\left(h\right) + \frac{\alpha\_s \wp\_{solar}\left(h\right)}{h\_o} - \frac{\varepsilon \sigma \left(T\_{out}^4\left(h\right) - T\_{sur}^4\left(h\right)\right)}{h\_o} \tag{9}$$

Once *Teq\_out* is available, heat transfer through an exterior surface with the overall heat transfer coefficient of *U*, thermal resistivity of *Rsi*, and surface area of *A*<sup>s</sup> into the indoor environment can be expressed as:

$$\phi\_{sl}\left(h\right) = UA\_s\left(T\_{aq\\_out}\left(h\right) - T\_{in}\left(h\right)\right) = \frac{T\_{aq\\_out}\left(h\right) - T\_{in}\left(h\right)}{R\_{sl}}\tag{10}$$

The internal heat gain of a building unit is also affected by a number of factors such as the heat generated by the occupants (i.e., occupant metabolisms), lights and appliances (e.g., stove, television, and radio). Although this heat gain cannot be determined exactly, its average amount can be estimated from the people's lifestyle. As an example, **Table 1** shows the metabolic rates per unit body surface area for various activities [15]:

$$A\_{\rm body} = 0.202 \times m^{0.425} \cdot L^{0.725} \tag{11}$$


**Table 1.** Metabolic rates during various activities.

( ) ( ( ) ( )) ( ) ( ( ) ( ))

where *ho* is the combined convection and radiation heat transfer coefficient, *αs* is the solar absorptivity, *ε* is the emissivity of the surface, *ϕsolar* is the solar radiation incident on the surface and *σ* is Stefan–Boltzmann constant. *Tsurf* and *Tsurr* are the average temperatures of the exposed surfaces and other surrounding surfaces, respectively. Likewise, *Teq\_out* is the equivalent temperature of outdoor air considering the effect of solar radiation. The previous equation can

( ) ( ) ( ) ( ( ) ( )) 4 4

Once *Teq\_out* is available, heat transfer through an exterior surface with the overall heat transfer coefficient of *U*, thermal resistivity of *Rsi*, and surface area of *A*<sup>s</sup> into the indoor environment

( ) ( ( ) ( )) \_ ( ) ( ) \_

The internal heat gain of a building unit is also affected by a number of factors such as the heat generated by the occupants (i.e., occupant metabolisms), lights and appliances (e.g., stove,

a j

*si s eq out in*

*h UA T h T h*

*out surr s solar*

*h ThT h*

*eq out in*


*R*

*si T h Th*


*o o*

*h h*

es

 es

<sup>=</sup> - (8)

*h hA T h T h A h A T h T h*

*surf o s out surf s s solar s out surr*

 = -+ - a j

4 4

( ( ) ( ))

**Figure 5.** The solar radiation effect on heating/cooling load of a building.

\_

f

*eq out out*

*T hTh*

\_

38 Energy Management of Distributed Generation Systems

f

be rewritten as:

can be expressed as:

*o s eq out surf*

*hA T h T h*

where *m* is the mass of the body in kilogram, and *L* is the height in meter.

Considering all the heat flows described earlier, the thermal behavior of a building in terms of temperature update functions can be determined as [2,12]:

$$T\_{\ln}\left(h\right) = T\_{\ln}\left(h - 1\right) + \frac{\Delta h\_{\text{sup}}}{m\_{\text{i}}c\_{p,i}}\left(\phi\_{\beta}\left(h\right) + \phi\_{\text{si}}\left(h\right) + \phi\_{\text{bp}}\left(h\right) - \phi\_{\text{io}}\left(h\right)\right) \tag{12}$$

$$T\_f\left(h\right) = T\_f\left(h - 1\right) + \frac{\Delta h\_{sup}}{m\_f c\_{p,f}} \left(\phi\_{HP}\left(h\right) + \phi\_{sf}\left(h\right) - \phi\_{fg}\left(h\right) - \phi\_{f}\left(h\right)\right) \tag{13}$$

where *mf* (*mi* ) and *cp,f* (*cp,i*) are the floor (indoor air) mass and specific heat capacity coefficients, respectively, and *Δhstep* is the time step. Likewise, *φbp* (*h*) is the house background power calculated by the hourly internal heat gain of the building. *φsf* (*h*) denotes the heat obtained from direct solar radiation:

$$\phi\_{\circ'}\left(h\right) = \alpha\_{f} \cdot A\_{\circ'} \cdot \phi\_{\text{solar}}\left(h\right) \tag{14}$$

where *α<sup>f</sup>* and *Asf* are the solar absorptivity and the area of the floor on the sunny side.

#### **5.2. Schedulable tasks and residential load model**

To derive the electrical load model of a residential building unit, it is very important to understand the behaviors of different household appliances and devices. From controllability prospective, in-home appliances are normally categorized into Class I (i.e., non-schedulable) and Class II (i.e., schedulable) appliances. Class I devices which is also labeled as "manually operated" or "non-schedulable" tasks have their own fixed power consumption rates (*PDfix*) and must be operated upon the user's request. From the other side, Class II appliances which are further sub-classified as "temperature-shiftable" and "time-shiftable" tasks have the capability to be controlled either automatically or manually [2]. HVAC and refrigerators are examples of "temperature-shiftable" devices that are normally running hour after and can be stopped once in a while provided that an acceptable temperature interval is guaranteed. Differently, a number of appliances such as washing machine, dishwasher, and dryer which are regarded as "time-shiftable" tasks can be operated at planned or desired time-intervals. For optimal operation of such devices, there exist several parameters that need to be set by residents [13]:


where *m* is the mass of the body in kilogram, and *L* is the height in meter.

,

,

 aj

*f pf h*

1 *step*

1 *step*

f

**5.2. Schedulable tasks and residential load model**

where *mf*

where *α<sup>f</sup>*

residents [13]:

**•** utilization time range (*UTRi*

**•** preferred time range (*PTRi*

to the user's preferences,

(*mi*

from direct solar radiation:

D

D

of temperature update functions can be determined as [2,12]:

40 Energy Management of Distributed Generation Systems

Considering all the heat flows described earlier, the thermal behavior of a building in terms

( ) ( ) ( ( ) ( ) ( ) ( ))

( ) ( ) ( ( ) ( ) ( ) ( ))

respectively, and *Δhstep* is the time step. Likewise, *φbp* (*h*) is the house background power calculated by the hourly internal heat gain of the building. *φsf* (*h*) denotes the heat obtained

and *Asf* are the solar absorptivity and the area of the floor on the sunny side.

To derive the electrical load model of a residential building unit, it is very important to understand the behaviors of different household appliances and devices. From controllability prospective, in-home appliances are normally categorized into Class I (i.e., non-schedulable) and Class II (i.e., schedulable) appliances. Class I devices which is also labeled as "manually operated" or "non-schedulable" tasks have their own fixed power consumption rates (*PDfix*) and must be operated upon the user's request. From the other side, Class II appliances which are further sub-classified as "temperature-shiftable" and "time-shiftable" tasks have the capability to be controlled either automatically or manually [2]. HVAC and refrigerators are examples of "temperature-shiftable" devices that are normally running hour after and can be stopped once in a while provided that an acceptable temperature interval is guaranteed. Differently, a number of appliances such as washing machine, dishwasher, and dryer which are regarded as "time-shiftable" tasks can be operated at planned or desired time-intervals. For optimal operation of such devices, there exist several parameters that need to be set by

fff

) and *cp,f* (*cp,i*) are the floor (indoor air) mass and specific heat capacity coefficients,

 f

*sf* (*hA h* ) =×× *f sf solar* ( ) (14)

= [*hs,i*, *hf,i*]) during which, task *i* is valid for scheduling,

= [*he,i*, *hl,i*]) during which, task *i* is better to be scheduled according

= -+ + + - (12)

fff

= -+ +-- (13)

*in in fi si bp io i pi h*

*f f HP sf fg fi*

*Th Th h h hh m c* f

*Th Th hh hh m c*

Through these definitions, the power consumption of shiftable task *i* at hour *h* would be:

$$P\_{Dachd,i}\left(h\right) = \frac{EEC\_i}{LOT\_i} \cdot s\_i\left(h\right); \; \forall \left(h \in UTR\_i, i \in N\right) \tag{15}$$

where *si* (*h*) is a binary variable showing the *i th* device status as "scheduled: 1" or "dropped: 0 ". There are also several constraints that must be met suitably for each task *i* ∈ *N*:

First, task *i* must be completed before the end of optimization time *hf,i*:

$$\sum\_{h=h\_{i,j}}^{h\_{f,i}} s\_i \binom{h}{h} = LOT\_i \tag{16}$$

Second, some tasks need to run once within a time window and should not be turned off before the completion:

$$\sum\_{h=h\_{i,j}}^{h\_{f,i}} \left| \mathbf{s}\_i(h) - \mathbf{s}\_i(h-1) \right| \le 2 \tag{17}$$

Third, one task (e.g., task *j*) may depend on the completion of another task (e.g., task *i*):

$$\sum\_{h=k\_{s\_{\hat{\lambda}}}}^{h\_{f,\downarrow}} \mathbf{s}\_{\cdot}(h) \cdot H \left(\boldsymbol{\lambda} - LOT\_{i} + \sum\_{h=h\_{i}}^{h} \mathbf{s}\_{i}(\hat{h})\right) = LOT\_{\cdot} \tag{18}$$

where *hs* = *min*(*hs,i,hs,j*), 0 < *λ* < 1, and *H*(·) is the Heaviside step function. The following constraint must be also considered if a definite time gap between the operations of two consecutive tasks is desired:

$$\begin{aligned} \left(\operatorname{Ord}\left(\hat{h}\right)\cdot H\left(s\_{/}\left(\hat{h}\right)-s\_{/}\left(\hat{h}-1\right)-\lambda\right) \leq & \left(\operatorname{Ord}\left(h\right)-1\right)\cdot H\left(s\_{i}\left(h-1\right)-s\_{i}\left(h\right)-\lambda\right) \\ + + \Lambda\_{i,j}\cdot\forall\left(h\in UTR\_{i}, \hat{h}\in UTR\_{j}\right) \end{aligned} \tag{19}$$

in which, *Λi,j* denotes the largest allowed time gap and *Ord*(·) shows the time order in the examined period. Maximum power consumption of a building unit (*PHouse max* ) must be also included as a technical constraint:

$$P\_D\left(h\right) = P\_{D\text{fix}}\left(h\right) + \sum\_{l=1}^{N} P\_{D\text{sch}d,l}\left(h\right) \le P\_{\text{Haux}}^{\text{max}}\tag{20}$$

#### **5.3. Modeling of distributed generation and storage units**

In a typical IES there exist some means of energy generation and storage both in forms of nonconventionals and renewables. This section presents the mathematical modeling of low voltage (LV) grid-connected distributed generation (DG) units.

#### *5.3.1. Wind-powered electrical generators (wind turbines)*

Today's utility-scale LV grid-connected WTs are extensively utilized for grid-support appli‐ cations as well as empowering local loads. The amount of power generated at a WT site depends on the wind speed (*V*), air density at the location (*ρ*), the turbine power rating and its technical specifications such as performance coefficient (*Cp*) and generator and gearbox efficiencies (*Ng* and *Nb*). In this regard, the electrical power output of a wind-powered electrical generator can be described as [2]:

$$P\_{wr} = \frac{V^3 \left(\rho \cdot A\right) \left(C\_p\right) \left(N\_g \cdot N\_b\right)}{2} \tag{21}$$

#### *5.3.2. PV power system*

Similar to other RESs, photovoltaic power systems (PVs) can be used for electrification of domestic demands. PVs are ranged from small-scale systems with power capacities of kilowatts (such as rooftop-mounted or building-integrated) to large utility-scale power plants with several megawatts capacity. The amount of electric power generated by a PV module is also depended on multiple factors including but not limited to, the array rated capacity (*YPV*), system derating factor (*fPV*), cell temperature in real operating and standard test conditions (*Tc*, *Tc,STC*), temperature coefficient of power (*αp*) and solar radiation incident in real and standard test conditions (*GT*, *GT,STC*) [13]:

$$P\_{PV} = \left(\frac{G\_r}{G\_{T, \text{STC}}}\right) \left(Y\_{PV} \cdot f\_{PV}\right) \cdot \left[1 + \alpha\_p \left(T\_c - T\_{c, \text{STC}}\right)\right] \tag{22}$$

#### *5.3.3. Micro-combined heat and power system (micro-CHP)*

FC based micro-CHP is another highly-efficient, low-maintenance means of cogeneration at residential places where quiet operation is also intended. Similar to other combined heat and power facilities, a FC-based micro-CHP system encompasses three subsystems including a hot water storage tank (DHW), a FC unit and an auxiliary boiler. As shown in **Figure 6**, a typical micro-CHP consumes natural gas *gCHP* and converts it into the heat (*Pth CHP*) and electricity (*Pe CHP*) with corresponding efficiencies (*ηe*, *ηth*) considering electrical/thermal power limits and ramp-rates as follow [2]:

( ) ( ) ( ) max

1 *N D Dfix Dschd i House i Ph P h P h P* =

In a typical IES there exist some means of energy generation and storage both in forms of nonconventionals and renewables. This section presents the mathematical modeling of low voltage

Today's utility-scale LV grid-connected WTs are extensively utilized for grid-support appli‐ cations as well as empowering local loads. The amount of power generated at a WT site depends on the wind speed (*V*), air density at the location (*ρ*), the turbine power rating and its technical specifications such as performance coefficient (*Cp*) and generator and gearbox efficiencies (*Ng* and *Nb*). In this regard, the electrical power output of a wind-powered electrical

> ( )( )( ) <sup>3</sup> 2

Similar to other RESs, photovoltaic power systems (PVs) can be used for electrification of domestic demands. PVs are ranged from small-scale systems with power capacities of kilowatts (such as rooftop-mounted or building-integrated) to large utility-scale power plants with several megawatts capacity. The amount of electric power generated by a PV module is also depended on multiple factors including but not limited to, the array rated capacity (*YPV*), system derating factor (*fPV*), cell temperature in real operating and standard test conditions (*Tc*, *Tc,STC*), temperature coefficient of power (*αp*) and solar radiation incident in real and

( ) ( , )

a

*V AC N N*

r

*p gb*

× × <sup>=</sup> (21)

(22)

**5.3. Modeling of distributed generation and storage units**

42 Energy Management of Distributed Generation Systems

(LV) grid-connected distributed generation (DG) units.

*5.3.1. Wind-powered electrical generators (wind turbines)*

*WT*

,

*5.3.3. Micro-combined heat and power system (micro-CHP)*

æ ö

*T STC*

. 1 *<sup>T</sup> PV PV PV p c c STC*

*<sup>G</sup> P Y f TT <sup>G</sup>*

= × ×+ - ç ÷ é ù ç ÷ ë û è ø

FC based micro-CHP is another highly-efficient, low-maintenance means of cogeneration at residential places where quiet operation is also intended. Similar to other combined heat and power facilities, a FC-based micro-CHP system encompasses three subsystems including a hot

*P*

generator can be described as [2]:

standard test conditions (*GT*, *GT,STC*) [13]:

*5.3.2. PV power system*

,

=+ £ å (20)

$$P\_{\rm CHP\,\,\mu\text{in}}^{\epsilon} \le P\_{\rm CHP}^{\epsilon} \left( h \right) = \mathbf{g}\_{\rm CHP} \left( h \right) \cdot \eta\_{\epsilon} \le P\_{\rm CHP\,\,\mu\text{in}}^{\epsilon} \tag{23}$$

$$P\_{CHP,\min}^{\text{th}} \le P\_{CHP}^{\text{th}}\left(h\right) = \mathbf{g}\_{CHP}\left(h\right) \cdot \eta\_{ch} \le P\_{CHP,\max}^{\text{th}}\tag{24}$$

$$\left| P\_{\rm{cup}}^{\epsilon} \left( h \right) - P\_{\rm{cup}}^{\epsilon} \left( h - 1 \right) \right| \le P\_{\rm{CHP}, \rm{uup}}^{\epsilon} \tag{25}$$

$$\left| P\_{cw}^{\text{th}} \left( h \right) - P\_{cw}^{\text{th}} \left( h - 1 \right) \right| \le \left( \eta\_{th} / \eta\_{e} \right) \cdot P\_{CHP, \text{ ramp}}^{\epsilon} \tag{26}$$

To mathematically model the behavior of a hot water storage tank, the energy equivalent of the stored water should be considered as follow:

$$\underline{Q}\_{\text{at}}\left(h+1\right) = \underline{Q}\_{\text{at}}\left(h\right) + \left(P\_{\text{CHP}}^{\text{th}}\left(h\right) + P\_{\text{aux}}^{\text{th}}\left(h\right) - P\_{\text{D}}^{\text{th}}\left(h\right) - P\_{\text{loss}}^{\text{th}}\left(h\right)\right) \cdot \Delta h\_{\text{sup}}\tag{27}$$

**Figure 6.** Energy flows in a FC-based co-generation system.

in which *Qst* (*h*) is the energy content of the storage at hour *h*, *Pth D* (h) and *Pth loss* (h) are the heat demand and heat losses at hour *h*, respectively. From the above equation, the temperature update function of the hot water at each time step can be derived as follow [2]:

$$\begin{split} T\_{\rm{ul}}\left(h+1\right) &= \frac{V\_{D}^{\rm{ul}}\left(h\right)\cdot\left(T\_{\rm{ov}}-T\_{\rm{ul}}\left(h\right)\right) + V\_{\rm{ov}}\cdot T\_{\rm{ul}}\left(h\right)}{V\_{\rm{ul}}} + \frac{P\_{\rm{CH}^{\rm{h}}}^{\rm{sh}}\left(h\right) + P\_{\rm{aux}}^{\rm{sh}}\left(h\right)}{V\_{\rm{au}}\cdot C\_{\rm{v}}} \\ &- \left(\frac{A\_{\rm{u}}}{V\_{\rm{u}}\cdot C\_{\rm{v}}\cdot R\_{\rm{u}}}\right)\cdot\left(T\_{\rm{u}}\left(h\right) - T\_{\rm{b}}\left(h\right)\right) \end{split} \tag{28}$$

$$T\_{\rm st,min} \le T\_{\rm st} \left( h \right) \le T\_{\rm st,max} \tag{29}$$

where *Tcw* and *Tb*(*h*) are the entering cold water and environment temperatures at hour *h, Vtot*, and *Vth <sup>D</sup>* are the total tank volume and hourly hot water demand (HWD) in liter, respectively. *Ast* denotes the area of the storage tank covered by a material with insulation level of *Rst*.

#### *5.3.4. Energy storage system (ESS)*

ESSs are becoming an important part of today's smart grid applications where high penetration of renewable energies and reliable power generation is required. The behavior of an ESS which is labeled as battery in this chapter, can be presented based on an energy state update function as:

$$SOC\left(h+1\right) = SOC\left(h\right) + \frac{\left(P\_{\text{Bar}}^{\text{ch}}\left(h\right) - P\_{\text{Bar}}^{\text{ch}}\left(h\right)\right) \cdot \Delta h\_{\text{sap}}}{E\_{\text{Bar}}} \tag{30}$$

$$SOC\_{\min} \le SOC\left(h\right) \le SOC\_{\max} \tag{31}$$

where *SOC*(*h*) stands for the battery state of charge at hour *h*, *SOCmin* (*SOCmax*) is the lower (upper) bound of battery's *SOC*, and *EBatt* is the battery capacity in *kWh*. Likewise, *PchBatt* and *PdchBatt* are the charging and discharging power of the battery which are limited by the following constraints:

$$P\_{\text{Rau}}^{\text{ch}}\left(h\right) \leq P\_{\text{max}}^{\text{ch}} \cdot \eta\_{ch} \cdot u\_{\text{Rau}}\left(h\right) \tag{32}$$

$$P\_{\text{Bar}}^{\text{dcb}}\left(h\right) \leq \left(\frac{P\_{\text{max}}^{\text{dcb}}}{\eta\_{\text{dcb}}}\right) \cdot \left(1 - \mu\_{\text{Bar}}\left(h\right)\right) \tag{33}$$

where *uBatt* is a binary variable denotes the operating status as charging "1" or discharging "0".

## **5.4. Objective functions**

in which *Qst* (*h*) is the energy content of the storage at hour *h*, *Pth*

*st*

æ ö - ×- ç ÷ × × è ø

*tot w st*

*V CR*

1

44 Energy Management of Distributed Generation Systems

*st*

and *Vth*

as:

constraints:

*T h*

*5.3.4. Energy storage system (ESS)*

demand and heat losses at hour *h*, respectively. From the above equation, the temperature

*th th th D cw st tot st CHP aux*

where *Tcw* and *Tb*(*h*) are the entering cold water and environment temperatures at hour *h, Vtot*,

ESSs are becoming an important part of today's smart grid applications where high penetration of renewable energies and reliable power generation is required. The behavior of an ESS which is labeled as battery in this chapter, can be presented based on an energy state update function

where *SOC*(*h*) stands for the battery state of charge at hour *h*, *SOCmin* (*SOCmax*) is the lower (upper) bound of battery's *SOC*, and *EBatt* is the battery capacity in *kWh*. Likewise, *PchBatt* and *PdchBatt* are the charging and discharging power of the battery which are limited by the following

> ( ) max ( ) *ch ch PhP u h Batt* £ ×× h

( ) ( ( )) max 1 *dch*

*Batt Batt dch <sup>P</sup> Ph u h* h

æ ö £ ×- ç ÷

( ) ( ) ( ( ) ( )) <sup>1</sup>

*SOC h SOC h*

*dch*

*Ast* denotes the area of the storage tank covered by a material with insulation level of *Rst*.

*<sup>D</sup>* are the total tank volume and hourly hot water demand (HWD) in liter, respectively.

*ch dch*

*Batt Batt setp Batt*


min ( ) max *SOC SOC h SOC* £ £ (31)

*ch Batt* (32)

è ø (33)

*PhP h h*

*E*

*V h T Th V Th P hPh*

× - +× +

*tot tot w*

*T Th T st st* ,min £ £ ( ) *st*,max (29)

*V V C*

( ) ( ) ( ( )) ( ) ( ) ( )

( ( ) ( ))

+ = <sup>+</sup> <sup>×</sup>

*st b*

*<sup>A</sup> T h Th*

update function of the hot water at each time step can be derived as follow [2]:

*D* (h) and *Pth*

*loss* (h) are the heat

(28)

As shown in **Figure 7**, flowchart diagram, a residential energy scheduling and management problem can be viewed as a multi-criteria decision-making model and an optimization problem with different objectives as follows:

**Figure 7.** Multi-criteria optimization model.

**•** Objective 1: minimizing total operation cost

The total cost of operation in short-term for a typical building includes the energy consumption costs as follows:

$$\min \left\{ \text{Cost} = \sum\_{h=1}^{r} \left( \frac{\rho\_{grid}(h) \cdot P\_{grid}(h) + \rho\_{gas} \cdot \left( G\_{CHP}(h) + G\_{auu}(h) \right)}{+\delta \cdot \left( \rho\_{WT} \cdot P\_{WT}(h) + \rho\_{PV} \cdot P\_{PV}(h) \right)} \right) \right\} \tag{34}$$

where *ρgrid*(*h*) and *Pgrid*(*h*) are the utility bid and the amount of power exchanged with utility at hour *h*, respectively. *ρgas* is the natural gas price and *GCHP*(*h*) and *Gaux*(*h*) are the total amount of gas consumed by the CHP and the auxiliary boiler at hour *h*, respectively. Likewise, *ρWT* and *ρPV* are the bids and the hourly output power of the internal RESs such as WT and PV, respectively. *δ* is the user's subscription rate denotes the energy share of each resident from the SMG according to ratios of investment.

**•** Objective 2: maximization of the user's convenience level (UCL)

As mentioned beforehand, all schedulable tasks in a home have their own utilization and preferred time ranges, which can be used as measurement tools for the UCL and satisfaction degree could be obtained when those tasks are executed at different times. To quantify the user's satisfaction level, the following formulation could be introduced:

$$\max \left\{ UCL = \sum\_{i=1}^{N} \mathbf{w}\_i \cdot CV\_i(h) \right\} \tag{35}$$

where *w*<sup>i</sup> is a significance factor showing the operating priority of task *i*, and *CVi* (h) is the degree of convenience experienced by the user when task *i* is executed at hour *h*:

$$CV\_i(h) = \begin{cases} 1 & \text{; } h \in PTR\_i \\ \left( H\left(h\_{e,i} - h\right) \cdot \left(\alpha\_e \cdot \exp\left(h - h\_{e,i}\right)\right) \right) \\ + H\left(h - h\_{l,i}\right) \cdot \left(\alpha\_l \cdot \exp\left(h\_{l,i} - h\right)\right) \end{cases} \tag{36}$$

where *αe*, *α<sup>l</sup>* ∈ R+ are the leading coefficients of the natural exponential functions used for controlling the penalty values over the optimization process.

**•** Objective 3: maximization of the thermal comfort level (TCL)

Thermal comfort for occupants of a building mainly depends on three factors including the indoor air temperature, relative humidity of the environment, and air motion from which the insider air temperature has the greatest effect on TCL. Based on the surveys done on thermal comfort zone of human, it has been found that majority of clothed people feel comfortable in the operative temperature range of 23–27°C [14]. Regarding this point, one can measure occupant TCL as follow:

$$\max \left\{ TCL = \sum\_{h=1}^{r} CL\_{ih} \left( h \right) \right\} \tag{37}$$

where *CLth*(*h*) could be quantified as:

Coordinated Demand Response and Distributed Generation Management in Residential Smart Microgrids http://dx.doi.org/10.5772/63379 47

$$CL\_{\rm th} \left( h \right) = \begin{cases} \mathcal{B}\_c \cdot \exp \left( T\_{\rm indor} \left( h \right) - T\_{\rm sat} + \Delta T\_{\rm thr} \right) \; ; \; T\_{\rm indor} \left( h \right) - T\_{\rm sat} < -\Delta T\_{\rm thr} \\ 1 & ; \left| T\_{\rm indor} \left( h \right) - T\_{\rm sat} \right| \le \Delta T\_{\rm thr} \\ \mathcal{B}\_h \cdot \exp \left( T\_{\rm sat} + \Delta T\_{\rm thr} - T\_{\rm indor} \left( h \right) \right) \; ; \; T\_{\rm indor} \left( h \right) - T\_{\rm sat} > +\Delta T\_{\rm thr} \end{cases} \tag{38}$$

where *Tset* is the user-specified set-point for indoor temperature and *∆Tther* is the threshold temperature difference. *βc*, *βh* ∈ R<sup>+</sup> are also the leading coefficients of the natural exponential functions used for adjusting the penalty values assigned to the undesirable lower and higher temperature differences, respectively.

#### **5.5. Optimization model for energy and comfort management**

gas consumed by the CHP and the auxiliary boiler at hour *h*, respectively. Likewise, *ρWT* and *ρPV* are the bids and the hourly output power of the internal RESs such as WT and PV, respectively. *δ* is the user's subscription rate denotes the energy share of each resident from

As mentioned beforehand, all schedulable tasks in a home have their own utilization and preferred time ranges, which can be used as measurement tools for the UCL and satisfaction degree could be obtained when those tasks are executed at different times. To quantify the

> 1 *N*

*i max UCL w CV h* = ì ü

is a significance factor showing the operating priority of task *i*, and *CVi*

( ) ( ) ( ( ))

*e i <sup>e</sup> e i <sup>i</sup>*

1 ;

ì Î

*CV h Hh h h h*

ï

ï

controlling the penalty values over the optimization process.

**•** Objective 3: maximization of the thermal comfort level (TCL)

( ) ( ( )) , ,

*Hh h h h*

a

+ - ×× - ïîè ø

a

<sup>=</sup> ïæ ö -× × - íç ÷

exp

exp

, ,

*li l li*

Thermal comfort for occupants of a building mainly depends on three factors including the indoor air temperature, relative humidity of the environment, and air motion from which the insider air temperature has the greatest effect on TCL. Based on the surveys done on thermal comfort zone of human, it has been found that majority of clothed people feel comfortable in the operative temperature range of 23–27°C [14]. Regarding this point, one can measure

( )

*th*

1 *T*

*h max TCL CL h* = ì ü

( )

*i*

are the leading coefficients of the natural exponential functions used for

*h PTR*

í ý = × î þ <sup>å</sup> (35)

; .

*Oth*

í ý <sup>=</sup> î þ <sup>å</sup> (37)

(h) is the degree

(36)

*i i*

the SMG according to ratios of investment.

46 Energy Management of Distributed Generation Systems

where *w*<sup>i</sup>

where *αe*, *α<sup>l</sup>* ∈ R+

occupant TCL as follow:

where *CLth*(*h*) could be quantified as:

**•** Objective 2: maximization of the user's convenience level (UCL)

user's satisfaction level, the following formulation could be introduced:

of convenience experienced by the user when task *i* is executed at hour *h*:

Since optimal energy management of a residential building inherently involves multiple, conflicting and incommensurate objectives as mentioned before, a mixed objective function can be introduced as the model of optimization for coordinated energy and comfort manage‐ ment [13]:

$$\text{Min}\left\{J = \frac{Cost}{\xi\_1 \cdot UCL + \xi\_2 \cdot TCL}\right\}\tag{39}$$

where the weighting coefficients *ζ*1 and *ζ*2 denoting the relative significance of TCL and UCL from the user's prospective. The above mentioned optimization problem must be solved considering the following power balance equation together with all other existing constraints for a REM problem:

$$P\_{grid}\left(h\right) + P\_{CHP}^{\epsilon}\left(h\right) + \delta \cdot \left(P\_{WT}\left(h\right) + P\_{PV}\left(h\right)\right) - P\_{Bar}\left(h\right) = P\_D^{\epsilon}\left(h\right) \tag{40}$$

#### **6. Coordinated DR and DG management in a sample IES**

In this section of the chapter, a number of computer simulations are presented to show the performance of a typical SEMS for coordinated DR and DG management in an integrated building and SMG system as shown in **Figure 8**. It is also worthy of note that the algorithm coding and computer simulations are carried out in MATAB/Simulink and General Algebraic Modeling System (GAMS) with Cplex/Dicopt solvers on a core i5 computer with 2430M processor @ 2.4 GHz.

**Figure 8.** Architecture of a sample IES including building and SMG systems.

**Figure 9.** Structural layers of the floor.

The analyses are conducted for one of the variations of a real single-zone, low-energy building in Sydney (latitude 33.86°S and longitude 151.21°E) [16]. The building unit is oriented north, fully exposed to solar insolation and has a floor area of 201.2 m2 . The North/South and the East/ West facing walls are also 56 and 28.2 m2 , respectively. Double-glazed windows are used on each side of the house with different surface areas. The windows on the North (South) side are 15 m2 (7 m2 ) while the ones on the East/West sides are 4 m2 with no blinds or shading equipment. The house roof and the walls have similar insulation level (*Rvalue* = 6.25). The floor structure for this building unit is also shown in **Figure 9**. All the smart controllable devices and schedulable loads described in the previous section are also included in the examined IES using the parameters tabulated in the following tables. For the mentioned house, the total internal heat gains is calculated from a load profile of typical household electrical loads and occupancy to be 3.5 W/m2 of floor area averaged over a 24-hour period.

To simulate DGs in the proposed IES different realistic models have been used. The windpowered generator is implemented based on a direct-driven, variable-speed, pitch-controlled Morphic SWT20 turbine with a nominal power of 20 kW at a wind speed of 9 m/s. **Table 2** shows the specification of such system. The PV system is also simulated based on a 0.25 kW Hyundai mono-crystalline module whose technical data is tabulated in **Table 3**.


**Table 2.** Wind turbine performance and mechanical data.

**Figure 8.** Architecture of a sample IES including building and SMG systems.

48 Energy Management of Distributed Generation Systems

**Figure 9.** Structural layers of the floor.


**Table 3.** Electrical characteristics of mono-crystalline type solar module.

The FC co-generation system is also a fusion of Viessmann's highly efficient, boiler-based heating technology and the FC technology of Panasonic whose main specifications are introduced in **Table 4**. Likewise, the features of the proposed RFH/CS are shown in **Table 5**.

In our simulation analysis, the ESS is modeled based on a lithium–ion battery pack mounted on a Nissan Leaf electrical vehicle considering the features mentioned in **Table 6**. Other information such as schedulable tasks specifications and user's preferences during different times is expressed in **Table 7**.


**Table 4.** FC-based cogeneration system parameters.


**Table 5.** Under floor heating and cooling system specifications.

Coordinated Demand Response and Distributed Generation Management in Residential Smart Microgrids http://dx.doi.org/10.5772/63379 51


**Table 6.** Energy storage device specifications.

The FC co-generation system is also a fusion of Viessmann's highly efficient, boiler-based heating technology and the FC technology of Panasonic whose main specifications are introduced in **Table 4**. Likewise, the features of the proposed RFH/CS are shown in **Table 5**.

In our simulation analysis, the ESS is modeled based on a lithium–ion battery pack mounted on a Nissan Leaf electrical vehicle considering the features mentioned in **Table 6**. Other information such as schedulable tasks specifications and user's preferences during different

**Element Parameter Value Unit** Fuel Cell unit Electric capacity range 0.3–1.5 kW

Aux. boiler Thermal capacity range 4–19 kW

Domestic hot water (DHW) tank Total capacity 200 liter

**Parameters Value Unit** Maximum heating (cooling) power 2 kW Range of heating COP 100–400 % Range of cooling COP 100–300 % Temperature range of under floor fluid 10, 40 °C Set point temperature 25 °C Comfortable temperature ranges Hot weather 22–28 °C

Ramp capacity 0.9 kWh Natural gas consumption rate for producing 1 kWh energy 92.4 × 10−3 m3

Electrical, thermal efficiency 30, 70 % Weight 125 kg

Efficiency 86 % Weight (boiler and tank unit) 170 kg

Surface area 1.99 m2 Insulation *Rvalue* (0.04 m thickness) 2.818 m2

Hot water temperature range 60–80 °C Inlet water temperature 10 °C

Cold weather 23–27

/h

·°C/W

times is expressed in **Table 7**.

50 Energy Management of Distributed Generation Systems

**Table 4.** FC-based cogeneration system parameters.

**Table 5.** Under floor heating and cooling system specifications.


**Table 7.** Schedulable tasks data and user's preference.

**Figure 10.** Energy trading schemes.

**Figure 11.** Non-schedulable load profile and HWD of the examined house.

**Figure 12.** Outdoor wind speed and solar radiation.

In the performed simulations, total power consumption of the building is limited to 5.5 kW at each time slot. As shown in **Figure 10**, different energy pricing mechanisms such as flat rate pricing (FLR), time of use tariffs (TOU) and RTP are also studied within the examined IES. The natural gas is also priced as 33 ¢/m<sup>3</sup> . To study the effect of heating and cooling cases, we consider different outdoor air temperatures and conduct a number of simulations in the presence of different EMSs and conditions as shown in **Figures 11** and **12**.

**Table 8**, shows a detailed comparison of the performances between the proposed SEMS and a naïve one (NEMS) under different operating conditions.


**Table 8.** Performance comparison between smart and naïve energy management systems under different operating conditions.

**Figure 11.** Non-schedulable load profile and HWD of the examined house.

52 Energy Management of Distributed Generation Systems

**Figure 12.** Outdoor wind speed and solar radiation.

natural gas is also priced as 33 ¢/m<sup>3</sup>

In the performed simulations, total power consumption of the building is limited to 5.5 kW at each time slot. As shown in **Figure 10**, different energy pricing mechanisms such as flat rate pricing (FLR), time of use tariffs (TOU) and RTP are also studied within the examined IES. The

consider different outdoor air temperatures and conduct a number of simulations in the

**Table 8**, shows a detailed comparison of the performances between the proposed SEMS and

presence of different EMSs and conditions as shown in **Figures 11** and **12**.

a naïve one (NEMS) under different operating conditions.

. To study the effect of heating and cooling cases, we

As observed in **Table 8**, economic task scheduling is achieved by using a NEMS, however user's preferences are not considered as another key point. On the contrary, cost-effective operation of in-home devices as well as comfort-aware task scheduling is perfectly done by the SEMS which use advanced controlling features. It is clearly understood from the numerical results that the mixed objective function (*J*) is improved about 26% by the use of RTP-based SEMS in different time frames of a hot weather condition and about 21% in similar condition but with a TOU-based SEMS. The performance of the proposed EMS is also getting better compared to the NEMS in a cold weather condition mainly due to the Sun's effect on the cooling load of the building. SEMS not only reduces energy consumption cost of the residential unit, but also satisfies optimal task scheduling and provides a thermal comfort zone for inhabitants. It can be also observed from the simulation results that the optimal performances of the mentioned EMSs are highly affected by several parameters such as pricing mechanism and time frames. As an example the running cost of the IES decreases once RTP is utilized and it increases when FLR pricing is applied. In a like manner, the operating cost of the IES is higher in a hot season compared to the one in a cold season. The same trend can be observed for weekends and weekdays. Due to the presence of occupants and their pattern of consumption, the energy cost of a building unit is slightly higher in weekends compared to weekdays. As illustrative examples, a number of related computer simulations are also presented to get more insight into the performance of SEMS. **Figure 13** illustrates the performance of the proposed residential SEMS as applied to the heating/cooling scenarios for the given building in different weather conditions [17]. Optimal coordinated DR and DG management for the studied IES by using SEMS is also indicated in **Figure 14**. This figure shows the optimal operation of smart household devices, FC-based micro-CHP unit and battery along with the amount of power exchange between the building and the utility for the given demand profiles in a typical hot weather condition [18].

**Figure 13.** Different heat flows and optimal operations of RFH/CS based on the thermal demand and user's comfort level: (a) hot weather conditions and (b) cold weather conditions.

**Figure 14.** Coordinated DR and DG management using SEMS.

Based on the temperature differences between different nodes in indoor air and outdoor environment, heat can be easily transferred via the building structures and affects the thermal behavior of the residential unit. As can be seen in **Figure 13**, the building captures the heat from both direct and indirect solar radiation on the exposed surfaces (such as walls and the roof on the sunny side) during the hot summer days and releases that heat later in the day. For this reason, RFH/CS operates more in the cooling mode to satisfy the desired body comfort. In a cold winter day the RFH/CS must be operated in the heating mode to keep the indoor temperature within the comfort range, although the internal and external heat gains of the building assist the heating process. Moreover, as observed from the temperature profiles in heating and cooling cases, the thermal constraints are almost respected and the comfort zone chosen by the customer is satisfied in terms of valid temperature ranges.

It is also observed from **Figure 14** that through optimal coordinated management of DR programs and DG units, not only the cost of energy consumption is reduced, but also com‐ fortable thermal and electrical zones are guaranteed. It should be also noted that most of the electrical demand is supplied by the utility during hours when the RTP is relatively low (e.g., 3:00–7:00 and 13:00–15:00). In the same time frames, the batteries are also charged with lower cost. During other times of the day when the energy demand is growing and the electricity prices are higher, distributed generators (such as energy storage devices and co-generation unit) produce more electricity so as to meet the load economically, and make more profits by selling the surplus of energy to the utility. DR programs for optimal task scheduling are also activated in a way to satisfy user's preferences.

## **7. Conclusion**

household devices, FC-based micro-CHP unit and battery along with the amount of power exchange between the building and the utility for the given demand profiles in a typical hot

**Figure 13.** Different heat flows and optimal operations of RFH/CS based on the thermal demand and user's comfort

Based on the temperature differences between different nodes in indoor air and outdoor environment, heat can be easily transferred via the building structures and affects the thermal behavior of the residential unit. As can be seen in **Figure 13**, the building captures the heat from both direct and indirect solar radiation on the exposed surfaces (such as walls and the

level: (a) hot weather conditions and (b) cold weather conditions.

**Figure 14.** Coordinated DR and DG management using SEMS.

weather condition [18].

54 Energy Management of Distributed Generation Systems

In this chapter, a framework was outlined for coordinated DR and DG management in an integrated building and smart micro-grid system. A SEMS for scheduling loads at the demandside and domestic controllable units at the supply-side was also described, mathematically modeled and validated. The proposed SEMS incorporated the conventional energy use management principles represented in DSM and DERs programs and merged them in an integrated framework that simultaneously addressed permanent energy savings, demand reductions, and temporary peak load mitigations. It also captured different key modeling aspects including heat transfer and thermal dynamics of a residential building unit, schedu‐ lable tasks attributes, and DG units' specifications. Moreover, it integrated different RESs, storage systems, and domestic thermo-electrical systems to provide a given cost reduction and comfort levels according to the customer needs.

## **Author details**

Amjad Anvari-Moghaddam1\*, Ghassem Mokhtari2 and Josep M. Guerrero1

\*Address all correspondence to: aam@et.aau.dk

1 Department of Energy Technology, Aalborg University, Aalborg East, Denmark

2 CSIRO, Brisbane, Australia

## **References**


[13] Anvari-Moghaddam A., Rahimi-Kian A., Monsef H. Optimal smart home energy management considering energy saving and a comfortable lifestyle. IEEE Trans. Smart Grid. 2015; 6: 324–332. DOI: 10.1109/TSG.2014.2349352.

**References**

239–250.

10.7572/2167-5880-127.1.28.

56 Energy Management of Distributed Generation Systems

14 p. ID: 1024360.

[1] Tushar M. H. K., Assi C., Maier M., Uddin M. F. Smart microgrids: optimal joint scheduling for electric vehicles and home appliances. IEEE Trans. Smart Grid. 2014; 5:

[2] Anvari-Moghaddam A., Monsef H., Rahimi-Kian A. Cost-effective and comfort-aware residential energy management under different pricing schemes and weather condi‐

[3] Kailas A., Cecchi V., Mukherjee A. A survey of communications and networking technologies for energy management in buildings and home automation. J. Comput.

[4] Anvari-Moghaddam A., Seifi A. R. A comprehensive study on future smart grids: definitions, strategies and recommendations. J. N. C. Acad. Sci.. 2011; 127: 28–34. DOI:

[5] Wang Z., Wang J. Self-healing resilient distribution systems based on sectionalization

[6] Anvari-Moghaddam A. Global Warming Mitigation Using Smart Micro-Grids. Global Warming—Impacts and Future Perspective, Prof. Dr. Bharat Raj Singh (Ed.), ISBN:

[7] Bian D., Pipattanasomporn M., Rahman S. A human expert-based approach to electrical peak demand management. IEEE Trans. Power Delivery. 2015; 30: 1119–1127.

[8] Chowdhury S., Chowdhury S. P., Crossley P. Microgrids and Active Distribution Networks. The Institution of Engineering and Technology, Michael Faraday House, Six Hills Way, Stevenage, Herts., SG1 2AY, UK. 2009. 297p. DOI: 10.1049/PBRN006E. [9] Anvari-Moghaddam A, Seifi A. R., Niknam T., Alizadeh Pahlavani M. R.. Multiobjective operation management of a renewable micro grid with back-up micro turbine/

[10] Ekanayake J., Jenkins N., Liyanage K., Wu J., Yokoyama A. Smart grid: technology and

[11] Guerrero J. M., Vasquez J. C., Matas J., de Vicuña L. G., Castilla M. Hierarchical control of droop-controlled AC and DC microgrids—a general approach toward standardiza‐ tion. IEEE Trans. Ind. Electron. 2011; 58(1): 158–172. DOI: 10.1109/TIE.2010.2066534.

[12] Electric Power Research Institute (EPRI). Integrating smart distributed energy resour‐ ces with distribution management systems. EPRI—Power Delivery & Utilization; 2012.

tions. Energy Build. 2015; 86: 782–793. DOI: 10.1016/j.enbuild.2014.10.017.

Netw. Commun. 2012; 2012: 1–12. DOI: 10.1155/2012/932181.

into microgrids. IEEE Trans. Power Systems. 2015; 30: 3139–3149.

978-953-51-0755-2, InTech, Rijeka, Croatia, 2012. DOI: 10.5772/48204.

fuel cell/battery hybrid power source. Energy. 2011; 36(11): 6490–6507.

applications. Wiley; 2012. 320p. ISBN: 978-1-119-96909-9.


## **Hierarchical Control for DC Microgrids**

## Ahmed Mohamed

Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/63986

#### **Abstract**

In this chapter, the design and control of DC microgrids will be discussed. Depending on the time and bandwidth requirements, microgrid controllers can be categorized to primary local controllers (LC) and secondary microgrid central controllers (MGCC). The functions of the two categories of controllers will be presented and explained, using simulations and hardware experiments. In addition, the design of the power electron‐ ic converters linking the various resources and loads within the DC microgrid to the common DC bus, as well as the converters used to connect the microgrid to the main grid, will be presented. An example of the interaction of the MGCC with the control‐ ler of the main grid will be investigated. This chapter is intended to give a practical overview of the design and control of DC microgrids.

**Keywords:** control, DC microgrids, inverter, primary microgrid control, secondary microgrid control

## **1. Introduction**

Electric power systems are undergoing profound and radical changes triggered by the imperative to fulfill two objectives: (1) increase the power system resilience and (2) combat global warming. Resilience, as articulated by the Presidential Policy Directive 21 [1], refers to "the ability to withstand and recover from deliberate attacks, accidents, or naturally occur‐ ring threats or incidents." In order to approach the *first* objective, consumers must be equipped with generators and storage elements in order to supply their loads locally during black‐ outs. In other words, the bulk power system will be divided into many local energy net‐ works, namely microgrids, which are interconnected through the main power network during

© 2016 The Author(s). Licensee InTech. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

normal operating conditions, but can island themselves and operate independently when a fault occurs. Microgrids increase the overall efficiency of the system by satisfying part of their load locally, reducing the amount of power imported over long transmission lines. The effort to achieve the *second* objective is aided by increasing renewable energy generation. There is a wide consensus that if we are to realize the full environmental, societal, and economic benefits of microgrid deployment, while also improving resilience, microgrids must be based on renewable energy.

According to the U.S. Department of Energy, a microgrid is "a group of interconnected loads and distributed energy resources (DERs) with clearly defined electrical boundaries that acts as a single controllable entity with respect to the electric utility grid." A microgrid can be connected to the grid, in a grid-connected mode, or independent from the grid, in an islanded mode. Operation and control of microgrids have been given genuine attention in the literature. Each of the individual resources and controllable loads needs a controller. These controllers are referred to as local or resource controllers. In addition, a microgrid central controller (MGCC) is needed to act as a coordinator/supervisor to the local controllers (LCs).

The speed and bandwidth requirements significantly vary between LCs and MGCCs. LCs need to be faster since they have to deal with current and voltage commands and measurements, whereas MGCCs take a supervisory role in managing the power flow of the assets and loads within the microgrid and between the microgrid and the main grid. In addition, MGCCs fix any errors, for example, frequency deviation that may result from primary control [2, 3]. Tertiary control of microgrids refers the layer of control that extends beyond the boundaries of a single microgrid. It coordinates the interaction between various microgrids in close vicinity and the main grid. A virtual power plant whether owned by the utility company or a third party, aggregating some microgrids in a given geographic area, can be considered an example of tertiary control. This layer of control is typically considered as a part of the main grid's control [2, 4] and will be out of the scope of this chapter. However, by the end of the chapter, the interaction of the MGCC with the main grid will be highlighted.

DC microgrids offer several advantages over AC microgrids [5, 6]. Electronic devices, such as computers, routers, and electronic lights (either fluorescent or LED), represent a high percent of the electric load in many buildings today. Moreover, variable speed drives (VFD) are increasingly used for electric motors. A DC environment is found to be a more convenient way to deliver power to these loads to assure reliability and redundancy. DC networks do not need AC to DC conversion for every electronic device, which has a significant impact on the efficiency. DC can reduce the losses associated with switch-mode supplies and uninterruptible power supplies. Furthermore, incorporating DC microgrids has the benefit of superior compatibility of the DC power with renewable energy generators, for example, photovoltaics (PV), electric vehicles, and energy storage systems (ESSs) [7–10].

In this chapter, we will focus on the design of primary and secondary control techniques for DC microgrids. Computer simulations and hardware testing will be used to verify the presented techniques. The simulation results were obtained using MATLAB/Simulink and the SimPowerSystems sublibrary.

## **2. Microgrid structure**

normal operating conditions, but can island themselves and operate independently when a fault occurs. Microgrids increase the overall efficiency of the system by satisfying part of their load locally, reducing the amount of power imported over long transmission lines. The effort to achieve the *second* objective is aided by increasing renewable energy generation. There is a wide consensus that if we are to realize the full environmental, societal, and economic benefits of microgrid deployment, while also improving resilience, microgrids must be based on

According to the U.S. Department of Energy, a microgrid is "a group of interconnected loads and distributed energy resources (DERs) with clearly defined electrical boundaries that acts as a single controllable entity with respect to the electric utility grid." A microgrid can be connected to the grid, in a grid-connected mode, or independent from the grid, in an islanded mode. Operation and control of microgrids have been given genuine attention in the literature. Each of the individual resources and controllable loads needs a controller. These controllers are referred to as local or resource controllers. In addition, a microgrid central controller

The speed and bandwidth requirements significantly vary between LCs and MGCCs. LCs need to be faster since they have to deal with current and voltage commands and measurements, whereas MGCCs take a supervisory role in managing the power flow of the assets and loads within the microgrid and between the microgrid and the main grid. In addition, MGCCs fix any errors, for example, frequency deviation that may result from primary control [2, 3]. Tertiary control of microgrids refers the layer of control that extends beyond the boundaries of a single microgrid. It coordinates the interaction between various microgrids in close vicinity and the main grid. A virtual power plant whether owned by the utility company or a third party, aggregating some microgrids in a given geographic area, can be considered an example of tertiary control. This layer of control is typically considered as a part of the main grid's control [2, 4] and will be out of the scope of this chapter. However, by the end of the chapter,

DC microgrids offer several advantages over AC microgrids [5, 6]. Electronic devices, such as computers, routers, and electronic lights (either fluorescent or LED), represent a high percent of the electric load in many buildings today. Moreover, variable speed drives (VFD) are increasingly used for electric motors. A DC environment is found to be a more convenient way to deliver power to these loads to assure reliability and redundancy. DC networks do not need AC to DC conversion for every electronic device, which has a significant impact on the efficiency. DC can reduce the losses associated with switch-mode supplies and uninterruptible power supplies. Furthermore, incorporating DC microgrids has the benefit of superior compatibility of the DC power with renewable energy generators, for example, photovoltaics

In this chapter, we will focus on the design of primary and secondary control techniques for DC microgrids. Computer simulations and hardware testing will be used to verify the presented techniques. The simulation results were obtained using MATLAB/Simulink and the

(MGCC) is needed to act as a coordinator/supervisor to the local controllers (LCs).

the interaction of the MGCC with the main grid will be highlighted.

(PV), electric vehicles, and energy storage systems (ESSs) [7–10].

SimPowerSystems sublibrary.

renewable energy.

60 Energy Management of Distributed Generation Systems

The DC microgrid under study is assumed to be dependent mainly on the sustainable energy sources, as shown in **Figure 1**. The microgrid is connected to the main grid, so that it can operate in a grid-connected mode. Moreover, it includes an ESS, so that it can operate in an islanded mode during blackout/brownout conditions. During the grid-connected mode, power can be drawn either from the main grid or from the ESS in case the locally generated renewable energy is not enough to satisfy the load demand.

**Figure 1.** DC microgrid architecture and control hierarchy.

Since the microgrid is based on renewable energy, certain features had to be maintained to assure efficient integration of the renewable resources, such as efficient and reliable loadfeeding capability and full controllability of voltage and power flow among the various buses in the system. The connectivity of the DC microgrid to the main grid should allow voltage regulation on the DC side. Furthermore, it should allow bidirectional power flow between AC and DC sides, depending on the desired mode of operation.

Specifically, a fully controlled rectifier was used to tie the DC network to the AC grid while working at unity power factor. This rectifier is dedicated to regulating the voltage on the DC bus in the grid-connected mode. Therefore, it enables unidirectional power flow from the main grid to the DC microgrid. Alternatively, one of the other resource converters, for example, the bidirectional battery charger, must be responsible for regulating the DC bus voltage. A fully controlled bidirectional AC–DC converter was used to control the active/reactive power exchange with the main grid. It employs a vector decoupling control technique, which enables independent control of the active and reactive power in both directions. Each converter is controlled via a LC. A MGCC communicates with the LCs and coordinates their operation.

## **3. Energy link integration**

#### **3.1. Converters and control design**

The ESS and PV will be linked to the common DC bus of the microgrid through DC–DC converters. Boost converter is commonly used to interface renewable energy sources yielding DC voltage to the DC microgrid. In case of PV systems, a controlled boost converter shall serve two functionalities: (1) it steps up the output voltage of the PV system to be compatible with the DC bus voltage and (2) it regulates the output voltage or power, for example, corresponding to a predefined maximum power point tracking algorithm. The boost converter topology may be slightly modified when used as an interface for PV systems in a DC microgrid. For instance, since the DC bus may already possess high capacitance (i.e., owing to the other converters connected to the same bus), the boost converter capacitor can be omitted, resulting in a discontinuous instantaneous output current. A solution to maintain continuous output current is to synchronize multiple DC–DC converters (i.e., interleaved converters) [11, 12].

**Figure 2.** The proposed inductively coupled boost converter topology for fuel cells integration into a DC ZEDS.

**Figure 3.** The ON and OFF states of the DC–DC converter with output L-filter: (a) (0 < *t* ≤ *DTs*) and (b) (*DTs* < *t* ≤ *T*).

Another approach to solve the problem of discontinuity in the output current is by adding an L-filter to the output side of the converter, as shown in **Figure 2**. The added inductance assures continuous conduction of the output current. The configurations of the circuit during the ON and OFF states of the switches are shown in **Figure 3**, where the parameter *D* in the caption refers to the duty cycle and *Ts* refers to the switching time.

The small-signal mathematical model of this converter can be obtained using the state-space averaging technique. The state-space model during the interval (0 < *t* ≤ *DTs*) is [11]

$$
\begin{bmatrix} i\_{L1} \\ i\_{L2} \\ \hline \nu\_c \end{bmatrix} = \begin{bmatrix} \frac{-r\_1}{L\_1} & 0 & \frac{-1}{L\_1} \\ 0 & \frac{-r\_2}{L\_2} & \frac{1}{L\_2} \\ 0 & \frac{-r\_2}{L\_2} & \frac{1}{L\_2} \\ 0 & \frac{-1}{C} & 0 \end{bmatrix} \begin{bmatrix} i\_{L1} \\ i\_{L2} \\ \nu\_c \end{bmatrix} + \begin{bmatrix} \frac{1}{L\_1} & 0 \\ 0 & \frac{-1}{L\_2} \\ 0 & 0 \end{bmatrix} \begin{bmatrix} \nu\_{in} \\ e \end{bmatrix} \tag{1}
$$

whereas the state-space model during the interval (*DTs* < *t* ≤ *T*) is

$$
\begin{bmatrix} i\_{L1} \\ i\_{L2} \\ i\_{L3} \\ \end{bmatrix} = \begin{bmatrix} -r\_1 & 0 & 0 \\ \overline{L\_1} & 0 & 0 \\ 0 & \frac{-r\_2}{L\_2} & \frac{1}{L\_2} \\ \frac{1}{C} & \frac{-1}{C} & 0 \\ \end{bmatrix} \begin{bmatrix} i\_{L1} \\ i\_{L2} \\ \end{bmatrix} + \begin{bmatrix} \frac{1}{L\_1} & 0 \\ 0 & \frac{-1}{L\_2} \\ 0 & 0 \\ \end{bmatrix} \begin{bmatrix} v\_{in} \\ e \\ e \\ \end{bmatrix} \tag{2}
$$

$$\mathbf{i}\_0 = \mathbf{i}\_{L2} \tag{3}$$

Using the state-space averaging technique,

**3. Energy link integration**

**3.1. Converters and control design**

62 Energy Management of Distributed Generation Systems

The ESS and PV will be linked to the common DC bus of the microgrid through DC–DC converters. Boost converter is commonly used to interface renewable energy sources yielding DC voltage to the DC microgrid. In case of PV systems, a controlled boost converter shall serve two functionalities: (1) it steps up the output voltage of the PV system to be compatible with the DC bus voltage and (2) it regulates the output voltage or power, for example, corresponding to a predefined maximum power point tracking algorithm. The boost converter topology may be slightly modified when used as an interface for PV systems in a DC microgrid. For instance, since the DC bus may already possess high capacitance (i.e., owing to the other converters connected to the same bus), the boost converter capacitor can be omitted, resulting in a discontinuous instantaneous output current. A solution to maintain continuous output current

is to synchronize multiple DC–DC converters (i.e., interleaved converters) [11, 12].

**Figure 2.** The proposed inductively coupled boost converter topology for fuel cells integration into a DC ZEDS.

**Figure 3.** The ON and OFF states of the DC–DC converter with output L-filter: (a) (0 < *t* ≤ *DTs*) and (b) (*DTs* < *t* ≤ *T*).

Another approach to solve the problem of discontinuity in the output current is by adding an L-filter to the output side of the converter, as shown in **Figure 2**. The added inductance assures

$$
\begin{bmatrix}
\left< \boldsymbol{\iota}\_{L1} \right> \\
\left< \boldsymbol{\iota}\_{L2} \right> \\
\left< \boldsymbol{\iota}\_{L2} \right> \\
\left< \boldsymbol{\iota}\_{C} \right>
\end{bmatrix} = \begin{bmatrix}
\frac{-r\_1}{L\_1} & 0 & \frac{-d}{L\_1} \\
0 & \frac{-r\_2}{L\_2} & \frac{1}{L\_2} \\
\frac{(1-d)}{C} & \frac{-1}{C} & 0
\end{bmatrix} \begin{bmatrix}
\left< \boldsymbol{\iota}\_{L1} \right> \\
\left< \boldsymbol{\iota}\_{L2} \right> \\
\left< \boldsymbol{\iota}\_{C} \right> \\
0 & 0
\end{bmatrix} + \begin{bmatrix}
\frac{1}{L\_1} & 0 \\
0 & \frac{-1}{L\_2} \\
0 & 0
\end{bmatrix} \begin{Bmatrix}
\left< \boldsymbol{\iota}\_{in} \right> \\
\left< \boldsymbol{\iota}\_{C} \right> \\
0 & 0
\end{Bmatrix} \tag{4}
$$

If we consider a small-signal perturbation, the large-signal state-space equations will be

$$
\begin{bmatrix} 0\\ 0\\ 0\\ 0 \end{bmatrix} = \begin{bmatrix} -r\_1 & 0 & \frac{-d}{L\_1} \\\ 0 & \frac{-r\_2}{L\_2} & \frac{1}{L\_2} \\\ 0 & \frac{-r\_2}{L\_2} & \frac{1}{L\_2} \\\ \frac{(1-d)}{C} & \frac{-1}{C} & 0 \end{bmatrix} \begin{bmatrix} I\_{L1} \\ I\_{L2} \\\ V\_c \end{bmatrix} + \begin{bmatrix} 1 & 0 \\ 0 & \frac{-1}{L\_2} \\\ 0 & \frac{-1}{L\_2} \end{bmatrix} \begin{bmatrix} V\_{in} \\ E \end{bmatrix} \tag{5}
$$

whereas the small-signal state-space set of equations will be

$$
\begin{bmatrix}
\hat{i}\_{L1} \\
\hat{i}\_{L2} \\
\hat{i}\_{C}
\end{bmatrix} = \begin{bmatrix}
0 & \frac{-r\_{2}}{L\_{2}} & \frac{1}{L\_{2}} \\
\frac{(1-D)}{C} & \frac{-1}{C} & 0
\end{bmatrix} \begin{bmatrix}
\hat{i}\_{L1} \\
\hat{i}\_{L2} \\
\hat{i}\_{C}
\end{bmatrix} + \begin{bmatrix}
\frac{1}{L\_{1}} & \frac{-V\_{c}}{L\_{1}} \\
0 & 0 \\
0 & \frac{-I\_{L1}}{C}
\end{bmatrix} \begin{bmatrix}
\hat{v}\_{in} \\
\hat{d}
\end{bmatrix} \tag{6}
$$

where

$$\mathbf{i}\_{L1} = I\_{L1} + \hat{i}\_{L1}, \ i\_{L2} = I\_{L2} + \hat{i}\_{L2}, \ \mathbf{v}\_c = V\_c + \hat{\mathbf{v}}\_c, \ \mathbf{v}\_{in} = V\_{in} + \hat{\mathbf{v}}\_{in}, \ \ e = E + \hat{e}, \ d = D + \hat{d}$$

#### **3.2. Energy link integration results and discussion**

A prototype system was designed and implemented in hardware to examine the performance of the inductively coupled boost converter. The set of equations described in Section 3.1 was

**Figure 4.** Bode plots of the developed controller.

used to design a closed-loop proportional-Integral (PI) controller. The digital signal processing board dSPACE 1104 was used to control the converter in real time. The switching frequency for the converter was 5 kHz. The parameters of the implemented converter prototype were as follows: *L*1 is 2.2 mH, *L*2 is 24 mH, *r*1 is 0.06 ohm, *r*2 is 0.84 ohm, and *C* is 4800 μf. The Bode plots of the open-loop and closed-loop responses for the developed controller are given in **Figure 4**.

Results for the inductively coupled boost converter are shown in **Figure 5**. The output current reference changed from 1 to 3 A after 5 s. It can be seen that the output current is continuous, and the ripple is as small as 2%, which means a high power quality injected to the DC microgrid.

**Figure 5.** Results for (inductively coupled boost converter): (a) simulation results and (b) experimental results (the same scale: 1 A/division).

## **4. Microgrid to main grid connectivity**

## **4.1. DC bus voltage regulation**

( )

*d C C*

whereas the small-signal state-space set of equations will be

1

( )

**3.2. Energy link integration results and discussion**

**Figure 4.** Bode plots of the developed controller.


1

0

64 Energy Management of Distributed Generation Systems

0

where

1 1 1

é ù é ù ê ú ê ú

ê ú é ù é ù ê ú ê ú ê ú é ù ê ú ê ú ê ú ê ú ê ú ê úë û ê ú ë û ë û ê ú

*L L L*

<sup>1</sup> <sup>1</sup> 0 0 <sup>0</sup>

ë û ë û

1 1 0 0 <sup>0</sup>


2

1 1

*L L*

*L L*

*i i*

*C C*

<sup>0</sup> <sup>1</sup> .ˆ ˆ


*r D*

é ù

ˆ ˆ <sup>1</sup> <sup>0</sup> <sup>1</sup> <sup>0</sup>

1 1 1 1 2 2 2

*i i L L*

<sup>ˆ</sup> . <sup>1</sup> ˆ ˆ <sup>0</sup> 0 0 <sup>ˆ</sup> .

ê ú ê ú ê úé ù ê ú ê ú ê úê ú ê ú ê ú ê úê ú ë û ê ú ê úê ú ê ú ë û ê úë û ê ú

*<sup>V</sup> L L*

ê ú é ù é ù é ù ê ú


*<sup>D</sup> <sup>C</sup>*

1 1 12 2 2 ˆ ˆ <sup>ˆ</sup> , , , , , ˆ ˆˆ *L L L L L L c c c in in in i I i i I i v V v v V v e E ed D d* = + = + = + = + =+ =+

A prototype system was designed and implemented in hardware to examine the performance of the inductively coupled boost converter. The set of equations described in Section 3.1 was

ê ú ë û ë û


*r v*

*L L d*

2 2

*v v I*

*c c L*

*r d*


1

*in*

1

*in*

*c*

(5)

(6)

ê ú ê ú

*L*

*I r V I LL L E V*

*L c*

<sup>1</sup> <sup>0</sup> <sup>0</sup>

2 2 2 2

## *4.1.1. Converter description and mathematical modeling*

A fully controlled three-phase rectifier will be used for coupling the DC network to the AC grid. In our case study, we designed and implemented the rectifier such that it regulates the voltage of the DC bus, while being able to operate at unity power factor. This was achieved through a vector decoupling control technique and sinusoidal pulse width modulation (SPWM).

Vector decoupling SPWM control is based on converting the voltages and currents from the three-phase abc frame of references to the d–q frame of references. Even though mathematical models for the system have been derived, PI controllers were implemented to control the rectifier rather than model-based control due to its relative simplicity and effectiveness. However, the mathematical models play an important role in decoupling the vectors, which is essential to achieve independent *P*/*Q* control. The three-phase SPWM rectifier circuit and its single-phase equivalent are shown in **Figure 6** [13].

**Figure 6.** The implemented three-phase SPWM rectifier: (a) circuit diagram and (b) single-phase equivalent. The voltage equation is

$$\mathbf{e}\_s = \mathbf{R}\mathbf{i}\_s + L\frac{d\mathbf{i}\_s}{dt} + \mathbf{v}\_r \tag{7}$$

where


*vr* is the converter input voltage

*R*, *L* Resistance and inductance of the boosting inductor, respectively.

$$L\frac{d\dot{\mathbf{i}}\_{dc}}{dt} - \nu L\dot{\mathbf{i}}\_{qa} + R\dot{\mathbf{i}}\_{dc} = \mathbf{e}\_{dc} - \nu\_{dc} \tag{8}$$

$$L\frac{di\_{qs}}{dt} - \nu Li\_{de} + Ri\_{qc} = e\_{qs} - \nu\_{qc} \tag{9}$$

where *w* is the angular frequency of the voltage source in radians.

The rectifier should instantaneously draw enough input power to satisfy the sum of the load demand and the charging rate of the capacitor energy, to maintain fast voltage control. Neglecting the thermal and switching device losses, the power balance between the AC input and the DC output is as follows:

$$P = \frac{3}{2} (e\_{de}i\_{de} + e\_{qe}i\_{qe}) = \nu\_{de}i\_{de} \tag{10}$$

where *vdc* and *idc* are the DC output voltage and current, respectively.

On the DC output side,

**Figure 6.** The implemented three-phase SPWM rectifier: (a) circuit diagram and (b) single-phase equivalent.

*R*, *L* Resistance and inductance of the boosting inductor, respectively.

*de*

*qe*

*dt*

where *w* is the angular frequency of the voltage source in radians.

*di*

*dt*

*s ss r di e Ri L v dt*

*qe de de de*

*de qe qe qe*

The rectifier should instantaneously draw enough input power to satisfy the sum of the load demand and the charging rate of the capacitor energy, to maintain fast voltage control. Neglecting the thermal and switching device losses, the power balance between the AC input

*di L wLi Ri e v*

*L wLi Ri e v*

( ) <sup>3</sup>

=+ + (7)



<sup>2</sup> *dc dc ei ei <sup>P</sup>* = = *de de qe qe* <sup>+</sup> *v i* (10)

The voltage equation is

66 Energy Management of Distributed Generation Systems

*es* is the source voltage

*is* is the source current

*vr* is the converter input voltage

and the DC output is as follows:

where

$$\dot{\mathbf{i}}\_{dc} = -C\frac{d\mathbf{v}\_{dc}}{dt} - \dot{\mathbf{i}}\_{L} \tag{11}$$

where *iL* is the load current. From Eqs. (10) and (11),

$$\frac{3}{2}(e\_{dc}\dot{i}\_{dc} + e\_{qs}\dot{i}\_{qs}) = -C\nu\_{dc}\frac{d\nu\_{dc}}{dt} - \nu\_{dc}\dot{i}\_{L} \tag{12}$$

Inspecting Eq. (12), we can see that the system is nonlinear with regard to *vdc*. From Eqs. (8), (9), and (11), a complete state-space modeling of the system is given by

$$
\begin{bmatrix}
\dot{i}\_{dc} \\
\dot{i}\_{qc} \\
\dot{i}\_{qc} \\
\dot{\mathbf{v}}\_{dc}
\end{bmatrix} = \begin{bmatrix}
\end{bmatrix} + \begin{bmatrix}
\frac{1}{L} & \mathbf{0} \\
0 & \frac{1}{L} \\
0 & \frac{1}{L} \\
0 & 0
\end{bmatrix} \begin{bmatrix}
\mathbf{e}\_{dc} - \mathbf{v}\_{dc} \\
\mathbf{e}\_{qs} - \mathbf{v}\_{qs} \\
\mathbf{e}\_{qs} - \mathbf{v}\_{qs}
\end{bmatrix} \tag{13}
$$

#### *4.1.2. Vector decoupling technique*

Two nested loops including three PI controllers were implemented to achieve DC voltage as well as input current control. The outer loop is for controlling the DC bus voltage, while the inner loop is for current control. Due to the vector transformation from abc to d–q frame of references, the controller deals with three DC signals, which help eliminate steady-state errors in the developed PI controllers.

In order to completely decouple the d and q components and achieve independent *P* and *Q* control, the decoupling terms (*wLide*) and (*wLiqe*) were included while calculating the rectifier's input voltages for *Vrq cont* and, *Vrq cont* respectively. These voltages are the modulation signals for the SPWM technique. The equations used in building the controller are given by Eq. (14):

$$\begin{aligned} \mathbf{v}\_{\text{v}q}^{\text{conv}} &= \mathbf{w}Li\_{\text{dc}} + \mathbf{e}\_{q\epsilon} - Ri\_{q\epsilon} - K\_{\rho} \left[ \mathbf{i}\_{\text{dc}}^{\prime \prime \prime \prime} - \mathbf{i}\_{\text{dc}} \right] - K\_{\text{r}} \left[ \mathbf{i}\_{\text{dc}}^{\prime \prime \prime \prime} - \mathbf{i}\_{\text{dc}} \right] dt \\ \mathbf{v}\_{\text{rd}}^{\text{conv}} &= -\mathbf{w}Li\_{\text{qc}} - Ri\_{q\epsilon} - K\_{\rho} \left[ \mathbf{i}\_{\text{dc}}^{\prime \prime \prime \prime} - \mathbf{i}\_{\text{dc}} \right] - K\_{\text{r}} \left[ \mathbf{i}\_{\text{dc}}^{\prime \prime \prime \prime} - \mathbf{i}\_{\text{dc}} \right] dt \end{aligned} \tag{14}$$

In **Figure 7**, a layout for the developed controller is shown.

**Figure 7.** A block diagram of the vector decoupling control implemented on the controlled rectifier.

The controller has the capability to control the active and reactive power independently, and hence, it can be easily set up to operate at unity power factor by adjusting the desired *ide* to zero. In mathematical terms, this is represented in Eqs. (15) and (16) as follows [13]:

$$P(t) = \frac{3}{2} [e\_{q\*}(t)i\_{q\*}(t) + e\_{dc}(t)i\_{dc}(t)] \tag{15}$$

$$\underline{Q}(t) = \frac{3}{2} [e\_{d\epsilon}(t)i\_{q\epsilon}(t) - e\_{q\epsilon}(t)i\_{d\epsilon}(t)] \tag{16}$$

#### **4.2. Bidirectional energy transfer**

DC microgrids may draw or inject power to the grid, depending on the local generation/ demand ratio. Therefore, a bidirectional converter must be put in place to enable such energy transfer. For instance, during times of surplus energy, that is, when power from the PV system is greater than the local load, the power can be injected to the grid if the price for electricity is high and/or the battery is fully charged. On the other hand, power may be drawn by the DC microgrid to cover load deficiencies. The vector decoupling control technique discussed earlier in this chapter was utilized here to enable independent active and reactive power control. For the bidirectional converter, the topology is modified by adding an L-filter (*L*) on the DC side, as shown in **Figure 8**. Moreover, the DC voltage controller in **Figure 7** is replaced by a current controller, as shown in **Figure 9** [14].

**Figure 8.** Circuit diagram of the implemented three-phase bidirectional AC–DC/DC–AC converter.

**Figure 7.** A block diagram of the vector decoupling control implemented on the controlled rectifier.

**4.2. Bidirectional energy transfer**

68 Energy Management of Distributed Generation Systems

controller, as shown in **Figure 9** [14].

zero. In mathematical terms, this is represented in Eqs. (15) and (16) as follows [13]:

<sup>3</sup> ( ) [ ( ). ( ) ( ). ( )] <sup>2</sup>

DC microgrids may draw or inject power to the grid, depending on the local generation/ demand ratio. Therefore, a bidirectional converter must be put in place to enable such energy transfer. For instance, during times of surplus energy, that is, when power from the PV system is greater than the local load, the power can be injected to the grid if the price for electricity is high and/or the battery is fully charged. On the other hand, power may be drawn by the DC microgrid to cover load deficiencies. The vector decoupling control technique discussed earlier in this chapter was utilized here to enable independent active and reactive power control. For the bidirectional converter, the topology is modified by adding an L-filter (*L*) on the DC side, as shown in **Figure 8**. Moreover, the DC voltage controller in **Figure 7** is replaced by a current

*Pt e t i t e t i t* = + *qe qe de de* (15)

<sup>3</sup> ( ) [ ( ). ( ) ( ) ( )] <sup>2</sup> *Qt e t i t e ti t* <sup>=</sup> *de qe qe de* - (16)

The controller has the capability to control the active and reactive power independently, and hence, it can be easily set up to operate at unity power factor by adjusting the desired *ide* to

**Figure 9.** A block diagram of the vector decoupling control implemented on the bidirectional converter.

This controller may be looked at as a means to control the voltage across the L-filter inductor. Corresponding to any given *i DC ref* value, the controller adjusts the phase of the modulating SPWM signals for the switching devices, until the desired amount of transferred power is achieved. The DC current is positive when the power flows from the main grid to the microgrid, and vice versa. Therefore, the sign of *i qe ref* determines the mode of operation for the bidirectional converter such that it is in the rectifier mode when the sign is positive, and the inverter mode when it is negative. In both modes of operation, the controller allows independent *Q* control, including unity power factor operation by setting *i de ref* , which is responsible for the reactive power, to zero.

## **4.3. Grid connectivity results and discussion**

Both the unidirectional converter (i.e., the controlled rectifier used for DC bus voltage regulation) and the bidirectional converter were implemented in hardware and simulated in MATLAB/Simulink. The switching frequency for both the converters was 8.04 kHz, and the sampling time was 0.3 ms. Voltage and current sensors were deployed to receive feedback from the various nodes of the system [14]. Several experiments were conducted to test the response of the converters under steady state as well as transient operating conditions. The hardware and simulation results will be presented for the various case studies.

## *4.3.1. Steady-state performance*

The first experiment aimed at testing the steady-state response of the rectifier while operating at unity power factor. Results of this experiment are shown in **Figure 10**. As can be seen in the figure, the current and voltage waveforms are in phase, and the DC bus voltage is regulated at 300 V. The DC current is positive, which according to our notation, means that the power is flowing from the main grid to the DC microgrid.

**Figure 10.** Unity power factor operation of the controlled rectifier: (a) experimental results and (b) simulation results (AC current factorized by 10).

#### *4.3.2. Transient performance*

Two experiments were conducted to examine the performance of the developed rectifier under transient operating conditions, namely (1) a step change in the load demand and (2) a step change in the DC microgrid voltage. **Figures 11** and **12** depict the results for these two experiments, respectively.

including unity power factor operation by setting *i*

is flowing from the main grid to the DC microgrid.

**4.3. Grid connectivity results and discussion**

70 Energy Management of Distributed Generation Systems

power, to zero.

*4.3.1. Steady-state performance*

(AC current factorized by 10).

*4.3.2. Transient performance*

experiments, respectively.

*de*

Both the unidirectional converter (i.e., the controlled rectifier used for DC bus voltage regulation) and the bidirectional converter were implemented in hardware and simulated in MATLAB/Simulink. The switching frequency for both the converters was 8.04 kHz, and the sampling time was 0.3 ms. Voltage and current sensors were deployed to receive feedback from the various nodes of the system [14]. Several experiments were conducted to test the response of the converters under steady state as well as transient operating conditions. The

The first experiment aimed at testing the steady-state response of the rectifier while operating at unity power factor. Results of this experiment are shown in **Figure 10**. As can be seen in the figure, the current and voltage waveforms are in phase, and the DC bus voltage is regulated at 300 V. The DC current is positive, which according to our notation, means that the power

**Figure 10.** Unity power factor operation of the controlled rectifier: (a) experimental results and (b) simulation results

Two experiments were conducted to examine the performance of the developed rectifier under transient operating conditions, namely (1) a step change in the load demand and (2) a step change in the DC microgrid voltage. **Figures 11** and **12** depict the results for these two

hardware and simulation results will be presented for the various case studies.

*ref* , which is responsible for the reactive

**Figure 11.** Controlled rectifier's response to a load step change: (a) experimental results and (b) simulation results.

**Figure 12.** Controlled rectifier's response to a change in the output voltage: (a) experimental results and (b) simulation results.

For the first experiment, whose results are shown in **Figure 11**, the DC load was suddenly changed from 0.72 to 1.5 kW. The results show that the converter is capable of responding to the change in the load by increasing the value of *iq*. Moreover, it maintains unity power factor operation, since the value of *id*, which is responsible for reactive power, decays back to zero shortly after the load step change. The DC voltage encounters a small undershoot because of the load change, while the DC current increases to satisfy the load.

In the second experiment, *vDC ref* was increased to represent a sudden change in the DC bus voltage. The rectifier reaches the new voltage set point in ∼200 ms. The value of active power drawn from the grid increases to satisfy the increase in active power demand on the DC microgrid, which is caused by the increased DC voltage. The converter achieves the required voltage by automatically increasing *iq*, as shown in **Figure 12**. Meanwhile, *id* encounters some transient conditions but returns to zero to maintain unity power factor operation.

#### *4.3.3. Bidirectional power flow results*

The bidirectional converter was implemented using an L-filter value of 24 mH. This filter, which encompasses 0.9 ohm internal resistance, was used to improve the overall total harmonic distortion of the converter and achieve smooth current control. Several experiments were conducted to test the response of the converter under several step changes in the desired power and its direction.

**Figure 13.** Controlled bidirectional response to DC current reference change from 1 to 3 A: (a) experimental results and (b) simulation results (AC current factorized by 10).

**Figure 14.** Controlled bidirectional converter response to DC current reference change from 3 to 1 A: (a) experimental results and (b) simulation results (AC current factorized by 10).

The first experiment (see **Figure 13**) involved a step change in the reference current from 1 to 3 A, while operating in the rectifier mode (i.e., the power flows from the main grid to the DC microgrid). Inspecting **Figure 13**, it can be seen that the converter succeeds in corresponding to the step change in the current reference within a few cycles. The results of a reverse experiment, in which the current reference was decreased from 3 to 1 A, are shown in **Figure 14**. Both experiments verify the applicability of the developed converter. It is worth mentioning that the experimental results match the simulation results. This assures the credibility of the simulation model, which can be used for analyses that may not be easily performed experimentally, for example, fault analysis.

drawn from the grid increases to satisfy the increase in active power demand on the DC microgrid, which is caused by the increased DC voltage. The converter achieves the required voltage by automatically increasing *iq*, as shown in **Figure 12**. Meanwhile, *id* encounters some

The bidirectional converter was implemented using an L-filter value of 24 mH. This filter, which encompasses 0.9 ohm internal resistance, was used to improve the overall total harmonic distortion of the converter and achieve smooth current control. Several experiments were conducted to test the response of the converter under several step changes in the desired power

**Figure 13.** Controlled bidirectional response to DC current reference change from 1 to 3 A: (a) experimental results and

**Figure 14.** Controlled bidirectional converter response to DC current reference change from 3 to 1 A: (a) experimental

The first experiment (see **Figure 13**) involved a step change in the reference current from 1 to 3 A, while operating in the rectifier mode (i.e., the power flows from the main grid to the DC

transient conditions but returns to zero to maintain unity power factor operation.

*4.3.3. Bidirectional power flow results*

72 Energy Management of Distributed Generation Systems

(b) simulation results (AC current factorized by 10).

results and (b) simulation results (AC current factorized by 10).

and its direction.

To examine the converter in the inverter mode, the current reference was changed from −3 to −1 A. The negative sign refers to the inverter mode of operation. **Figure 15** shows the results for this experiment. It can be seen that the converter achieves the desired output current, and that the AC current and voltage waveforms are 180° out-of-phase corresponding to the negative active power direction and zero reactive power.

**Figure 15.** Controlled bidirectional converter response to DC current reference change (−3 to −1 A): (a) experimental results and (b) simulation results (AC current factorized by 10).

**Figure 16.** Controlled bidirectional response to DC current reference change (−3 to 3 A): (a) experimental results and (b) simulation results (AC current factorized by 10).

In the developed bidirectional converter, the power can flow in both directions, that is, from AC to DC or from DC to AC. Two experiments were conducted to test the ability of the converter to change the direction of the power instantaneously, while maintaining unity power factor operation. **Figure 16** shows the results of an experiment in which the current reference was changed from −3 to 3 A. This means that the current was flowing from the DC microgrid to the main grid and suddenly reversed its direction. The simulation and experimental results show that the converter was able to control the current and achieve the required step change. **Figure 17** shows the case when the current reference was changed from 3 to −3 A. The results of both experiments show that the converter can smoothly change its mode of operation, from the rectifier to the inverter mode, and vice versa.

**Figure 17.** Controlled bidirectional converter response to DC current reference change (3 to −3 A): (a) experimental re‐ sults and (b) simulation results (AC current factorized by 10).

## **5. Microgrid central control**

The MGCC communicates not only with the LCs to coordinate their operation but also with the controller of the main grid. The main function of the LC is local voltage and current control of the converter that they are associated with. The functions of the secondary controller are optimal microgrid control, for example, energy cost minimization, broadcasting active and reactive power set points, and islanding detection and operation [2, 15, 16].

In order to examine the operation of MGCC, an experiment was conducted. Four AC genera‐ tors were used to form an AC network. The generators were interconnected through trans‐ mission line models. The DC microgrid described earlier within this chapter was connected to the main AC grid at the AC point of common coupling (PCC), as shown in **Figure 18**. The DC microgrid has the ability to draw or inject *P* and *Q* to and from the grid. In this experiment, the DC microgrid was regulating the voltage at the PCC. A unity power factor load of 0.7 kW was initially connected to the PCC, as shown in **Figure 19**. The DC microgrid was commanded to receive 100 W and 0 Vars. The AC grid satisfied both the AC load and DC microgrid demands. The steady-state voltage at PCC was 0.94 pu, while the voltage on the DC bus was 1 pu. After 20 s, following this initial state, the DC microgrid MGCC received a request from the main grid to inject the total amount of demanded power on the AC side [17]. Consequently, the voltage improved to 1.02 pu. The controlled rectifier regulating the voltage on the DC bus maintains a voltage of 1 pu after a transient period of around 6 s with an overshoot of 0.02 pu.

**Figure 18.** MGCC interaction with the main grid's controller.

In the developed bidirectional converter, the power can flow in both directions, that is, from AC to DC or from DC to AC. Two experiments were conducted to test the ability of the converter to change the direction of the power instantaneously, while maintaining unity power factor operation. **Figure 16** shows the results of an experiment in which the current reference was changed from −3 to 3 A. This means that the current was flowing from the DC microgrid to the main grid and suddenly reversed its direction. The simulation and experimental results show that the converter was able to control the current and achieve the required step change. **Figure 17** shows the case when the current reference was changed from 3 to −3 A. The results of both experiments show that the converter can smoothly change its mode of operation, from

**Figure 17.** Controlled bidirectional converter response to DC current reference change (3 to −3 A): (a) experimental re‐

The MGCC communicates not only with the LCs to coordinate their operation but also with the controller of the main grid. The main function of the LC is local voltage and current control of the converter that they are associated with. The functions of the secondary controller are optimal microgrid control, for example, energy cost minimization, broadcasting active and

In order to examine the operation of MGCC, an experiment was conducted. Four AC genera‐ tors were used to form an AC network. The generators were interconnected through trans‐ mission line models. The DC microgrid described earlier within this chapter was connected to the main AC grid at the AC point of common coupling (PCC), as shown in **Figure 18**. The DC microgrid has the ability to draw or inject *P* and *Q* to and from the grid. In this experiment, the DC microgrid was regulating the voltage at the PCC. A unity power factor load of 0.7 kW was initially connected to the PCC, as shown in **Figure 19**. The DC microgrid was commanded to receive 100 W and 0 Vars. The AC grid satisfied both the AC load and DC microgrid

reactive power set points, and islanding detection and operation [2, 15, 16].

the rectifier to the inverter mode, and vice versa.

74 Energy Management of Distributed Generation Systems

sults and (b) simulation results (AC current factorized by 10).

**5. Microgrid central control**

**Figure 19.** Response of the DC microgrid in an integrated hybrid AC/DC system corresponding to step changes in the load demand reference: (a) the load, DC, and AC active power share; (b) the load, DC, and AC reactive power share; (c) the frequency of the AC bus; and (d) the voltage of the AC and DC buses.

When a reactive load of 0.45 kVARs with lagging power factor is added to the PCC after 43 s, the voltage drops to around 0.95 pu. The DC microgrid is then requested by the main grid to inject 0.3 kVARs. Therefore, the voltage at the PCC increases to 0.98 pu. The DC bus voltage is hardly affected by this change in its reactive power reference. A maximum of 0.2 Hz frequency deviation was reported, as shown in **Figure 19**. This experiment highlights the coordination that can be achieved between the main grid's controller and the MGCC to enhance the overall performance of the whole system [18].

## **Author details**

Ahmed Mohamed

Address all correspondence to: amohamed@ccny.cuny.edu

Smart Grid Laboratory, Department of Electrical Engineering, City College of the City University of New York, USA

## **References**


[8] Majumder, R. A hybrid microgrid with DC connection at back to back converters. IEEE Transactions on Smart Grid. 2014;5(1):251–259.

inject 0.3 kVARs. Therefore, the voltage at the PCC increases to 0.98 pu. The DC bus voltage is hardly affected by this change in its reactive power reference. A maximum of 0.2 Hz frequency deviation was reported, as shown in **Figure 19**. This experiment highlights the coordination that can be achieved between the main grid's controller and the MGCC to

Smart Grid Laboratory, Department of Electrical Engineering, City College of the City

critical-infrastructure-security-and-resil [Accessed: Feb. 2016].

[1] The White House, Washington. Presidential Policy Directive 21: Critical Infrastructure Security and Resilience (PPD-21) [Internet]. Feb. 2013. Available from: https:// www.whitehouse.gov/the-press-office/2013/02/12/presidential-policy-directive-

[2] Olivares, D.E.; Mehrizi-Sani, A.; Etemadi, A.H.; Canizares, C.A.; Iravani, R.; Kazerani, M.; Hajimiragha, A.H.; Gomis-Bellmunt, O.; Saeedifard, M.; Palma-Behnke, R.; Jimenez-Estevez, G.A.; Hatziargyriou, N.D. Trends in microgrid control. IEEE Trans‐

[3] Guerrero, J.M.; Vasquez, J.C.; Matas, J.; de Vicuña, L.G.; Castilla, M. Hierarchical control of droop- controlled AC and DC microgrids–A general approach toward synchroni‐

[4] Bidram, A.; Davoudi, A. Hierarchical structure of microgrids control system. IEEE

[5] Dragicevic, T.; Lu, X.; Vasquez, J.C.; Guerrero, J.M. DC microgrids—Part II: A review of power architectures, applications, and standardization issues. IEEE Transactions on

[6] Elsayed, A.; Mohamed, A.; Mohammed, O. DC microgrids and distribution systems:

[7] Balog, R.S.; Krein, P.T. Bus selection in multibus DC microgrids. IEEE Transactions on

sation. IEEE Transactions on Industrial Electronics. 2011;58(1):158–172.

An overview. Electric Power Systems Research. 2015;119:407–417.

enhance the overall performance of the whole system [18].

76 Energy Management of Distributed Generation Systems

Address all correspondence to: amohamed@ccny.cuny.edu

actions on Smart Grid. 2014;5(4):1905–1919.

Transactions on Smart Grid. 2012;3(4):1963–1976.

Power Electronics. 2016;31(5):3528–3549.

Power Electronics. 2011;26(3):860–867.

**Author details**

Ahmed Mohamed

**References**

University of New York, USA


**Development of Control Algorithms, Software Architecture and Simulation Tools for Energy Management Systems**
