**Design of an Energy Management System for Secure Integration of Renewable Energy Sources into Microgrids**

Luis I. Minchala, Youmin Zhang and Oliver Probst

Additional information is available at the end of the chapter

http://dx.doi.org/10.5772/intechopen.69399

### Abstract

This chapter presents the design and development of an energy management system (EMS), which guarantees a secure operation of an islanded microgrid under possible imbalances between generation capacity and loads demand. The EMS performs an optimal calculation of low priority loads to be shed, as well as charging and discharging cycles of batteries within the microgrid. A nonlinear model-predictive control (NMPC) algorithm is selected for implementing the EMS, which processes a data set composed of loads measurements, generation capacity, batteries state of charge (SOC), and a set of operation constraints. The EMS is designed under the assumption of having an advanced metering infrastructure (AMI) installed in the microgrid. The EMS is tested in a simulation platform that integrates models of the microgrid components, as well as their distributed controllers (DCs). Simulation results show the effectiveness of the proposed approach, since critical variables as the microgrid's frequency and voltage magnitude operate within a secured interval even under the presence of faults in one of the DCs.

Keywords: energy management, microgrid, fault-tolerant control, smart grids, power flow

### 1. Introduction

Many inventions have evolved over time from their initial conception, for example, the telephone. The telephone invention triggered a revolution in communications around the world that led to the powerful technology we have today. Alexander Graham Bell would be proud of his invention because of the impact and evolution of telephone, from landlines to satellite

communications, the Internet, and so on. Another important invention is electricity. According to Ref. [1], electricity is the most important engineering invention of the last century. Electric networks' evolution led to a power system composed of three main systems: generation, transmission, and distribution. The main objective of the electric power system is to guarantee an efficient delivery of energy to end users. In the last 10 years, there has been a continuous search for emerging technologies, which foster green-energy integration into the main grid. In addition, stakeholders of the power grid have also changed their functionality in the system. Today, consumers are no longer just consumers, they can also be generators and their consumption and generation must be carefully regulated. This is the world of the smart grids (SGs) [2], where it is possible to have small isolated power systems operating as standalone islands purposefully. These islands are called microgrids.

A key objective of SGs is to provide reliable power supply through a combination of monitoring, control, and response. Electric utilities are expected to provide continuous and highquality services to their customers at reasonable prices by making economical use of available infrastructure. The most powerful force shaping the future of power industry is economics, but environmental protection is receiving growing attention today. Global warming trend could be damped through energy conservation. Therefore, any new innovations/trends will probably be adopted only if they reduce costs and CO2 emissions.

The development of an intelligent power distribution system requires new approaches. Reference [3] provides a French vision of SGs, which shows that distributed generation (DG) has strongly increased in the last 10 years. By 2020, the European Union targets 20% of the energy consumed to be generated by renewable energy sources (RESs). A technical report on the development of an intelligent distribution automation system in Korea [4] describes the following system features: remote operation, management of low voltage (LV) and medium voltage (MV) networks supported on a geographic information system (GIS), loss minimization, volt/var control for integrated DG, and power quality monitoring. Reference [5] details the features of an automatic power restoration system, which integrates DCs, distributed intelligence, and peer-topeer communication to isolate faults and restore power to unfaulted sections. Further information about active microgrids projects around the world, including details on technical operational aspects and design criteria, can be found in the survey papers [6, 7].

### 2. Smart grids overview

The SG is defined as an electrical network that integrates in a smart way every action of the users plugged into it—generators, consumers, and those that can perform both actions, delivering electricity efficiently, sustainably, economically, and safely.

### 2.1. Distributed generation

A DG unit is a small-scale generation source with its output ranging from 1 KW to several MW and usually installed at the distribution level. A particular characteristic of DG is that the generating sources are near end users. As RESs penetrate the utility systems, the power industry undergoes a paradigm shift that will change the industry to the use of DG systems. Figure 1 illustrates the DG concept by showing three different locations with installed DG units.

Small generators, which transform energy from RES, can be incorporated in the electric distribution network, for example, wind turbine generator (WTG) and photovoltaic (PV) arrays. These energy sources present many challenges to researchers and designers regarding power quality and economic issues. Today's power systems rely on spinning reserve and drooping frequency-load characteristics. Future systems, on the other hand, will rely on RES, which operate at peak power in order to displace as much fuel consumption as possible. This peak power constraint imposed by wind and sun complicates the frequency/load control of the entire system [8]. In order to compensate for this intermittent and changing power, short- and long-term storage devices should be deployed. Storage devices can be charged during periods of low-power demand and can supply power during high-power demand. This concept is shown in Figure 2.

### 2.2. Microgrids

communications, the Internet, and so on. Another important invention is electricity. According to Ref. [1], electricity is the most important engineering invention of the last century. Electric networks' evolution led to a power system composed of three main systems: generation, transmission, and distribution. The main objective of the electric power system is to guarantee an efficient delivery of energy to end users. In the last 10 years, there has been a continuous search for emerging technologies, which foster green-energy integration into the main grid. In addition, stakeholders of the power grid have also changed their functionality in the system. Today, consumers are no longer just consumers, they can also be generators and their consumption and generation must be carefully regulated. This is the world of the smart grids (SGs) [2], where it is possible to have small isolated power systems operating as standalone islands

A key objective of SGs is to provide reliable power supply through a combination of monitoring, control, and response. Electric utilities are expected to provide continuous and highquality services to their customers at reasonable prices by making economical use of available infrastructure. The most powerful force shaping the future of power industry is economics, but environmental protection is receiving growing attention today. Global warming trend could be damped through energy conservation. Therefore, any new innovations/trends will probably be

The development of an intelligent power distribution system requires new approaches. Reference [3] provides a French vision of SGs, which shows that distributed generation (DG) has strongly increased in the last 10 years. By 2020, the European Union targets 20% of the energy consumed to be generated by renewable energy sources (RESs). A technical report on the development of an intelligent distribution automation system in Korea [4] describes the following system features: remote operation, management of low voltage (LV) and medium voltage (MV) networks supported on a geographic information system (GIS), loss minimization, volt/var control for integrated DG, and power quality monitoring. Reference [5] details the features of an automatic power restoration system, which integrates DCs, distributed intelligence, and peer-topeer communication to isolate faults and restore power to unfaulted sections. Further information about active microgrids projects around the world, including details on technical operational

The SG is defined as an electrical network that integrates in a smart way every action of the users plugged into it—generators, consumers, and those that can perform both actions, deliv-

A DG unit is a small-scale generation source with its output ranging from 1 KW to several MW and usually installed at the distribution level. A particular characteristic of DG is that the generating sources are near end users. As RESs penetrate the utility systems, the power industry

purposefully. These islands are called microgrids.

152 Development and Integration of Microgrids

adopted only if they reduce costs and CO2 emissions.

aspects and design criteria, can be found in the survey papers [6, 7].

ering electricity efficiently, sustainably, economically, and safely.

2. Smart grids overview

2.1. Distributed generation

Microgrids are small-scale LV/MV power systems with distributed energy resources (DERs), storage devices, and controllable loads, connected to the main power network or islanded, in

Figure 1. DG overview.

Figure 2. Example of an energy dispatch strategy for a microgrid.

a controlled and coordinated way [9]. Microgrids have different operating characteristics than bulk power systems (BPSs). A comparison, between microgrids and BPS, is shown in Table 1. Microgeneration units, typically located at users' sites, have emerged as a promising option to meet growing customer needs for electric power with an emphasis on reliability, power quality, and contribution to different economic, environmental, and technical benefits. However, the impact of microgeneration at LV levels on power balance and grid frequency is still a great challenge.

### 2.3. Advanced metering infrastructure

Smart meters (SMs) are important components of SGs. These devices have the following main features: full-duplex communication, ability to connect or disconnect consumer's loads, and recording capabilities for capturing waveforms for supervising voltage and current. SMs are gradually replacing traditional meters currently in operation and are also being installed in new microgrids. SMs transmit information to different information clients via SCADA systems and other networks.

Among the benefits that SMs offer to consumers, there is the possibility to know in real-time rates and pricing policies, allowing users to decide wisely how to use electric energy. Several research papers are devoted to household scheduling using AMI in order to reduce power consumption during peak consumption hours [10, 11]. Figure 3 shows a possible architecture for an AMI. Due to the large number of SMs that will be available in distribution systems, the potential ability of SMs to provide additional information for outage management is also being investigated [12].

### 2.4. Fault-tolerant control

Critical-safety and operability issues with a defined performance in technological systems, such as electrical, industrial, aircraft control, nuclear generation, and so on, cause them to rely on complex control systems. Classic control schemes are suitable for guaranteeing a desired system performance in a specific operating range. However, these control strategies are unable to maintain the system performance under faulty scenarios. Therefore, there is a necessity of fault-tolerant control (FTC) strategies to improve the reliability and availability of critical-safe systems.

Quick detection of faults avoids serious damages to machines and humans, while allowing online reconfiguration of fault-tolerant controllers. Many books and research papers related to the field of FTC coincide on a two-step methodology for making a system fault-tolerant [13, 14]:


Table 1. Comparison between microgrids and BPS.

Design of an Energy Management System for Secure Integration of Renewable Energy Sources into Microgrids http://dx.doi.org/10.5772/intechopen.69399 155

Figure 3. Remote management system for electricity measurement.

a controlled and coordinated way [9]. Microgrids have different operating characteristics than bulk power systems (BPSs). A comparison, between microgrids and BPS, is shown in Table 1. Microgeneration units, typically located at users' sites, have emerged as a promising option to meet growing customer needs for electric power with an emphasis on reliability, power quality, and contribution to different economic, environmental, and technical benefits. However, the impact of microgeneration at LV levels on power balance and grid fre-

Smart meters (SMs) are important components of SGs. These devices have the following main features: full-duplex communication, ability to connect or disconnect consumer's loads, and recording capabilities for capturing waveforms for supervising voltage and current. SMs are gradually replacing traditional meters currently in operation and are also being installed in new microgrids. SMs transmit information to different information clients via SCADA systems

Among the benefits that SMs offer to consumers, there is the possibility to know in real-time rates and pricing policies, allowing users to decide wisely how to use electric energy. Several research papers are devoted to household scheduling using AMI in order to reduce power consumption during peak consumption hours [10, 11]. Figure 3 shows a possible architecture for an AMI. Due to the large number of SMs that will be available in distribution systems, the potential ability of SMs to provide additional information for outage management is also being investigated [12].

Critical-safety and operability issues with a defined performance in technological systems, such as electrical, industrial, aircraft control, nuclear generation, and so on, cause them to rely on complex control systems. Classic control schemes are suitable for guaranteeing a desired system performance in a specific operating range. However, these control strategies are unable to maintain the system performance under faulty scenarios. Therefore, there is a necessity of fault-tolerant control

Quick detection of faults avoids serious damages to machines and humans, while allowing online reconfiguration of fault-tolerant controllers. Many books and research papers related to the field of FTC coincide on a two-step methodology for making a system fault-tolerant [13, 14]:

RES penetration Energy storage Voltage levels Dispatch objects Operation mode

BPS Low Negligible HV Controllable generators Independent operation

and loads

Grid-connected and autonomous

(FTC) strategies to improve the reliability and availability of critical-safe systems.

Microgrid High Yes LV and MV Controllable generators

Table 1. Comparison between microgrids and BPS.

quency is still a great challenge.

154 Development and Integration of Microgrids

and other networks.

2.4. Fault-tolerant control

2.3. Advanced metering infrastructure


This methodology is an active research field, mainly due to the variety of possibilities for executing the abovementioned steps. Fault diagnosis is performed by a fault detection and diagnosis (FDD) module, while control reconfiguration could be done by many different control approaches, such as model-based, intelligent, gain scheduling, and so on. Such an FTC system, which relies on the fault information obtained from the FDD module, is called an active faulttolerant control system (AFTCS). Figure 4 shows an architecture of an AFTCS [14].

Figure 4. A general structure of an AFTCS [14].

### 3. Microgrid modeling

Control engineering most of the times is model dependent. Understanding the process, system, or plant to be controlled is fundamental for proposing proper control strategies. This section presents modeling procedures of the microgrid components used throughout this research: diesel engine generator (DEG), WTG, PV array, battery storage system (BSS), and power converters. At the end of this section, a microgrid benchmark model is presented, which integrates the microgrid components in one single simulation environment. Figure 5 shows the aforementioned elements in a microgrid configuration.

The rationale for the SGs lies in the integrative analysis of DERs, many of which will be intermittently operating, with the deployment of short-term and long-term storage systems. Current strategies on load sharing will not work to integrate RES due to its peak-power and intermittent operation. Therefore, new control strategies for voltage/reactive-power and loadsharing/frequency need to be developed; microgrid modeling is the first step prior to advanced controllers design.

#### 3.1. DG units modeling

A DG unit is conformed mainly of three components:


Design of an Energy Management System for Secure Integration of Renewable Energy Sources into Microgrids http://dx.doi.org/10.5772/intechopen.69399 157

Figure 5. Microgrid control and management system architecture.

#### 3.1.1. Power electronic converters

3. Microgrid modeling

156 Development and Integration of Microgrids

Figure 4. A general structure of an AFTCS [14].

controllers design.

on.

3.1. DG units modeling

with the network.

aforementioned elements in a microgrid configuration.

A DG unit is conformed mainly of three components:

AC, and its control techniques.

Control engineering most of the times is model dependent. Understanding the process, system, or plant to be controlled is fundamental for proposing proper control strategies. This section presents modeling procedures of the microgrid components used throughout this research: diesel engine generator (DEG), WTG, PV array, battery storage system (BSS), and power converters. At the end of this section, a microgrid benchmark model is presented, which integrates the microgrid components in one single simulation environment. Figure 5 shows the

The rationale for the SGs lies in the integrative analysis of DERs, many of which will be intermittently operating, with the deployment of short-term and long-term storage systems. Current strategies on load sharing will not work to integrate RES due to its peak-power and intermittent operation. Therefore, new control strategies for voltage/reactive-power and loadsharing/frequency need to be developed; microgrid modeling is the first step prior to advanced

1. Microgeneration unit. Typical choices are batteries, PV, WTG, flywheels, fuel cells, and so

2. Power conditioning system (PCS). PCS is related with power conversion, AC/DC or DC/

3. Coupling circuit. Interface elements, most of the times a filter, for coupling the DG unit

Proper integration technology has to be developed for using DG units in a microgrid configuration. The majority of DG units is integrated to the grid through the use of power electronicsbased interfaces, which convert the power, firstly, to DC and then puts the energy into the grid by using an inverter. Adequate control strategies of the PCS allow maximum extraction of the energy from RES.

Power electronic converters performing conditioning have to be highly efficient, flexible, and reliable. It is well known that improving the performance of power converters increases system's efficiency. According to Figure 5, there are mainly three power electronic circuits that need to be implemented to control voltage, power, and frequency of a DG unit: AC/DC converter, DC/DC converter, and voltage source inverter (VSI).

#### 3.1.2. Diesel engine generator

Diesel generating sets are typically used in power systems without connection to the power grid, as emergency power supply if the grid fails, as well as for more complex applications such as peak-shaving, grid support, and energy export to the power grid. This section presents models for the diesel engine (DE) components: synchronous generator and diesel engine.

#### 3.1.2.1. Synchronous machine model

The synchronous generator has two circuits magnetically coupled: the first one is static and has the shape of a hollow cylinder with longitudinal slots and an armature winding; the second component is the rotor whose winding is supplied with DC current. The DC current is supplied to the field winding by an exciter, which may be a generator mounted on the same shaft or a separate DC source connected to the field winding through brushes bearing on slip rings [15].

As a prime mover drives the machine shaft, the magnetic field generated by the field winding links the stator coils to induce voltage in the armature windings.

As presented in Ref. [16], a state-space model, which uses the dq dynamic equations of the electrical circuit of a synchronous generator with a pure resistive load (RL) connected to its terminals, can be represented as follows:

$$\mathbf{L}\frac{d\mathbf{x}}{dt} = \mathbf{A}\mathbf{x} + \mathbf{B}v\_F$$

$$\mathbf{x} = \begin{bmatrix} i\_d & i\_q & i\_F \end{bmatrix}^T \tag{1}$$

$$\mathbf{A} = \begin{bmatrix} -(R\_s + R\_L) & \omega L\_s & 0\\ -\omega L\_s & -(R\_s + R\_L) & -\omega L\_m\\ 0 & 0 & -R\_F \end{bmatrix} \qquad \mathbf{L} = \begin{bmatrix} L\_s & 0 & L\_m\\ 0 & L\_s & 0\\ L\_m & 0 & L\_F \end{bmatrix} \qquad \mathbf{B} = \begin{bmatrix} 0\\ 0\\ 1 \end{bmatrix}$$

where ½id iq iF� <sup>T</sup> are the dq stator and field currents, respectively; Rs and RF are the stator and field resistances; Ls, Lm, and LF are the stator, magnetizing, and field inductances; ω is the electrical speed; vd and vq are the dq stator voltages; and vF is the field voltage which will be used as a control input.

#### 3.1.2.2. Diesel engine model

The DE contains the combustion system and is responsible for the movement of the pistons, consequently the movement of the crankshaft that generates the output torque T(s). Figure 6 shows a block diagram of a DE. A first-order system models the actuator dynamics of the DE. The time delay e -<sup>τ</sup> <sup>s</sup> and a torque constant Kb model the combustion system. The flywheel block

Figure 6. DE block diagram [6].

Design of an Energy Management System for Secure Integration of Renewable Energy Sources into Microgrids http://dx.doi.org/10.5772/intechopen.69399 159


Table 2. System parameters of a typical DE.

3.1.2.1. Synchronous machine model

158 Development and Integration of Microgrids

terminals, can be represented as follows:

where ½id iq iF�

The time delay e

used as a control input.

3.1.2.2. Diesel engine model

Figure 6. DE block diagram [6].

The synchronous generator has two circuits magnetically coupled: the first one is static and has the shape of a hollow cylinder with longitudinal slots and an armature winding; the second component is the rotor whose winding is supplied with DC current. The DC current is supplied to the field winding by an exciter, which may be a generator mounted on the same shaft or a separate DC source connected to the field winding through brushes bearing on slip rings [15]. As a prime mover drives the machine shaft, the magnetic field generated by the field winding

As presented in Ref. [16], a state-space model, which uses the dq dynamic equations of the electrical circuit of a synchronous generator with a pure resistive load (RL) connected to its

<sup>T</sup> are the dq stator and field currents, respectively; Rs and RF are the stator and


field resistances; Ls, Lm, and LF are the stator, magnetizing, and field inductances; ω is the electrical speed; vd and vq are the dq stator voltages; and vF is the field voltage which will be

The DE contains the combustion system and is responsible for the movement of the pistons, consequently the movement of the crankshaft that generates the output torque T(s). Figure 6 shows a block diagram of a DE. A first-order system models the actuator dynamics of the DE.

ð1Þ

links the stator coils to induce voltage in the armature windings.

models the inertia generated inside the machine, η represents the flywheel acceleration constant, and the coefficient δ represents friction. The fuel injected to the DE is represented by x1(t), whereas x2(t) represents the angular velocity of the engine's shaft. d(s) models load changes in the rotor's shaft.

$$\begin{aligned} \dot{\chi}\_1(t) &= -\frac{1}{T\_a} \chi\_1(t) + \frac{K\_a}{T\_a} u(t) \\\\ \dot{\chi}\_2(t) &= \eta K\_b \chi\_1(t-\tau) - \eta \chi\_2(t) \end{aligned} \tag{2}$$

Table 2 shows the characteristic values of the DE constants of model (2).

#### 3.1.3. Wind-driven generation system

This section presents details on the modeling of a wind-driven electricity generation system (WEGS). A horizontal axis wind turbine (WT) is chosen as prime mover, while an induction generator performs the energy conversion. The wind turbine induction generator is an attractive DG unit in a deregulated electric energy market since wind energy is a non-polluting source.

Wind energy is air in motion whose energy is derived from sun, because about 2% of the solar flux falling on earth's surface is transformed into wind due to uneven heating of the atmosphere. Wind energy has some limiting characteristics such as non-schedulability, uncontrollable, and so on.

#### 3.1.3.1. Wind turbine model

The WT model used throughout this chapter is a lumped mass model. The WT is pitch controlled through the blade pitch angle, β. The power coefficient, Cp as shown in Eq. (3), characterizes the WT and depends on the tip speed ratio, <sup>λ</sup> <sup>¼</sup> <sup>Ω</sup>R/Vw, and <sup>β</sup>, where <sup>R</sup> is the WT rotor radius, Ω is the mechanical angular velocity of the WT rotor, and Vw is the wind velocity. The pitch angle β is only varied to limit the over-speed of the generator

$$C\_p(\lambda, \beta) = 0.5716(116\kappa \cdot 0.4\beta - 5)e^{-21\kappa} + 0.0068\lambda$$

$$\kappa = \left(\frac{1}{\lambda + 0.08\beta} - \frac{0.035}{\beta^3 + 1}\right) \tag{3}$$

The dynamic output mechanical torque of the WT, Tm, is expressed as

$$T\_m = \frac{\rho A R C\_p V\_w^3}{2\lambda} \tag{4}$$

where ρ is the air density and A represents the swept area of the blades.

#### 3.1.3.2. Induction generator model

The electrical equations of the induction generator model in the dq reference frame can be expressed in pu as

$$\begin{aligned} v\_{qs} &= r\_s i\_{qs} + \frac{\omega}{\omega\_b} \psi\_{ds} + \frac{p}{\omega\_b} \psi\_{qs} \\ v\_{ds} &= r\_s i\_{ds} - \frac{\omega}{\omega\_b} \psi\_{qs} + \frac{p}{\omega\_b} \psi\_{ds} \\ v\_{qr} &= r\_r^{\cdot} i\_{qr} + \left(\frac{\omega \omega\_{qr}}{\omega\_b}\right) \psi\_{dr} + \frac{p}{\omega\_b} \psi\_{qr} \\ v\_{dr} &= r\_r^{\cdot\cdot} i\_{dr} + \left(\frac{\omega \omega\_{qr}}{\omega\_b}\right) \psi\_{qr}^{\cdot} + \frac{p}{\omega\_b} \psi\_{dr} \\ \frac{p}{\omega\_b} \alpha\_r &= \frac{1}{2H} \left(T\_e \cdot T\_0\right) \\ T\_e &= \psi\_{qr}^{\cdot} i\_{dr} \cdot \psi\_{dr} i\_{qr} \end{aligned} \tag{5}$$

where vs, vr, is, ir, Ψs, and Ψ<sup>r</sup> represent the voltage, current, and flux (subscript s stands for stator and subscript r for rotor); rs and rr are stator and rotor resistance, respectively; ω<sup>r</sup> is the rotor angular speed; ω<sup>b</sup> is the base electrical angular velocity; H represents inertia moment, T0 is load torque, and p denotes a time derivative operation.

#### 3.1.4. Photovoltaic generation system

A PV cell is represented as a single-diode mathematic model, which is composed of a current source Iph, a nonlinear diode, and internal resistances, Rs and Rsh. Figure 7 shows the PV cell model.

A PV array is composed of the combination of Np parallel and Ns serial PV cells. The total current produced by a PV array is expressed as follows:

Design of an Energy Management System for Secure Integration of Renewable Energy Sources into Microgrids http://dx.doi.org/10.5772/intechopen.69399 161

$$i(t) = N\_p i\_{ph} \cdot N\_p l\_s \left( e^{\frac{q}{AkT} \left( \frac{V}{N\_s} + \frac{iR\_s}{N\_p} \right)} - 1 \right) - \frac{N\_p}{R\_{sh}} \left( \frac{V}{N\_s} + \frac{iR\_s}{N\_p} \right) \tag{6}$$

Figure 7. Single diode PV model.

#### 3.1.5. Battery model

ð3Þ

ð4Þ

ð5Þ

The dynamic output mechanical torque of the WT, Tm, is expressed as

where ρ is the air density and A represents the swept area of the blades.

The electrical equations of the induction generator model in the dq reference frame can be


where vs, vr, is, ir, Ψs, and Ψ<sup>r</sup> represent the voltage, current, and flux (subscript s stands for stator and subscript r for rotor); rs and rr are stator and rotor resistance, respectively; ω<sup>r</sup> is the rotor angular speed; ω<sup>b</sup> is the base electrical angular velocity; H represents inertia moment, T0

A PV cell is represented as a single-diode mathematic model, which is composed of a current source Iph, a nonlinear diode, and internal resistances, Rs and Rsh. Figure 7 shows the PV cell

A PV array is composed of the combination of Np parallel and Ns serial PV cells. The total

is load torque, and p denotes a time derivative operation.

current produced by a PV array is expressed as follows:

3.1.4. Photovoltaic generation system

model.

3.1.3.2. Induction generator model

160 Development and Integration of Microgrids

expressed in pu as

An electrical battery is one or more electrochemical cells that convert stored chemical energy into electrical energy. The lead-acid battery is the oldest type of rechargeable battery with a low energy-to-weight ratio. Lead-acid batteries are fully charged if it is possible to measure an open-circuit voltage of fully discharged battery cell(s). The term discharged means that all free charges are zero and the only voltage source is the cell(s) voltage, V<sup>0</sup> [17].

References [18, 19] present a simple nonlinear Thevenin model for the lead-acid battery. This model considers the dynamic response of the battery, which is influenced by the capacitive effects of the battery plates and also by the charge-transfer resistance. Figure 8 shows the equivalent circuit of a lead-acid battery

$$V\_0 = R\_d C \frac{d V\_p(t)}{dt} + \frac{1}{C} i\_B(t) + \frac{1}{R\_d C} V\_0$$

$$\frac{d V\_p(t)}{dt} = -\frac{1}{R\_d C} V\_p(t) - \frac{1}{C} i\_B(t) + \frac{1}{R\_d C} V\_0 \tag{7}$$

$$V\_B(t) = V\_p(t) - R\_B i\_B(t)$$

Figure 8. Nonlinear lead-acid battery equivalent circuit.

#### 3.2. Microgrid model

Operating a microgrid within the limits of the established operation standards requires the development of novel control strategies. According to the standard ANSI C84.1, utilities are required to maintain voltage at the customer's service panel between 114 and 126 V (5%)

Figure 9. Microgrid MV benchmark model CIGRE TF C6.04.02.

based on a 120-V nominal secondary voltage. Standard IEEE 1547-2-2011 [20] recommends that for interconnecting DERs with electric power systems, the total time should be less than 0.15 s when the magnitude of the frequency variation exceeds 0.5 Hz and the magnitude of the voltage variation exceeds 5%.

Figure 9 shows the microgrid benchmark model configuration, consisting of two feeders supplied by a distribution substation. A grid of DG units is connected to the left-side feeder, including four PV array units, one WTG, two BSS, and one DEG. Every DG unit has a DC. The rated voltage level of the network is 20 KV, which is supplied from a 110 KV transformer station. The parameters of the network, the load and the DG units (in pu), were taken from Ref. [21] and are summarized in Tables 3 and 4.

Although maximum values for active and reactive power loads are considered in the network parameters shown in Table 3, variable load profiles have been generated for loads L1, L2, L6, L7, and L9.

The features of DG units are as follows

3.2. Microgrid model

162 Development and Integration of Microgrids

Figure 9. Microgrid MV benchmark model CIGRE TF C6.04.02.

Operating a microgrid within the limits of the established operation standards requires the development of novel control strategies. According to the standard ANSI C84.1, utilities are required to maintain voltage at the customer's service panel between 114 and 126 V (5%)

> • DEG: As previously described, a DE is used as the prime mover of a synchronous generator. The system frequency is determined by the DE mechanical speed ωm, and the synchronous


Table 3. Load parameters of the microgrid model.


Table 4. Transmission line parameters.

generator field current sets the voltage magnitude. The rated output power of the DEG is 0.3125 pu over a Pbase of 5 MW.


DERs do not provide system frequency regulation. Therefore, for power flow calculations, the DG units (except for the DEG) are considered as load nodes with negative power consumption. During grid-connected operation, the main grid controls voltage and frequency. Islanded operation demands that local microgrid generation controls voltage and frequency.

### 4. Energy management system

generator field current sets the voltage magnitude. The rated output power of the DEG is

• WTG: The characteristics of WTG are assumed in Section 3.1.3. The maximum output

12 13 0.337 0.358 162.88 4.89 13 14 0.202 0.122 4784 2.99

From To RXC L

Node Node (Ω/km) (Ω/km) (nF/km) (km)

 2 0.579 0.367 158.88 2.82 3 0.164 0.113 6608 4.42 4 0.262 0.121 6480 0.61 5 0.354 0.129 4560 0.56 6 0.336 0.126 5488 1.54 7 0.256 0.130 3760 0.24 8 0.294 0.123 5600 1.67 9 0.339 0.130 4368 0.32 10 0.399 0.133 4832 0.77 11 0.367 0.133 4560 0.33 4 0.423 0.134 4960 0.49 8 0.172 0.115 6576 1.3

• PV array: The features of the PV modules 330 SunPower (SPR-305) are used. PV1 array consists of 66 strings of five series-connected modules connected in parallel, providing 0.02 pu. PV2, PV3, and PV4 have 0.02, 4 10-3, and 5 10-3 pu of power generation capacity, respectively. The PCS of every PV array is composed of a boost converter and a

• BSS: The lead-acid batteries are combined with bidirectional DC/AC converters with a maximum output power of 0.02 pu for BSS1 and 0.015 pu for BSS2. The charging power

DERs do not provide system frequency regulation. Therefore, for power flow calculations, the DG units (except for the DEG) are considered as load nodes with negative power consumption. During grid-connected operation, the main grid controls voltage and frequency. Islanded operation demands that local microgrid generation controls voltage and

0.3125 pu over a Pbase of 5 MW.

Table 4. Transmission line parameters.

power of the WTG is 0.2 pu.

for every BSS is 0.01 pu.

VSC.

0 1

164 Development and Integration of Microgrids

0 12

frequency.

The system states for the islanded section (left-side feeder) of the distribution system in Figure 9 are defined as

$$\mathbf{x} = \begin{bmatrix} \mathbf{x}\_1 \\ \mathbf{x}\_2 \end{bmatrix} \qquad \begin{array}{l} \mathbf{x}\_1 \in \mathbb{R}^{10} \quad \mathbf{x}\_1 = [\mathcal{V}\_l]^T \quad i = 1, 2, \dots, 10 \\\ \mathbf{x}\_2 \in \mathbb{R}^{10} \quad \mathbf{x}\_2 = [\delta\_l]^T \quad i = 1, 2, \dots, 10 \end{array} \tag{8}$$

where Vi and δ<sup>i</sup> are node's voltage and angle of the bus i.

Additionally, more variables and vectors are needed for the controller formulation, such as power at the nodes Si ¼ Pi þ jQi, admittance matrix Y, and power generated by the DG units, PDGi:

$$Y = \begin{bmatrix} Y\_{i,j} \end{bmatrix}$$

$$S = \begin{bmatrix} \mathbf{P}\_{\text{load}} \\ \mathbf{Q}\_{\text{load}} \end{bmatrix} \qquad \begin{array}{l} \mathbf{P}\_{\text{load}} \in \mathbb{R}^{10} \quad \mathbf{P}\_{\text{load}} = [P\_{Li}]^{\mathbb{T}} \quad i = 1, 2, \dots, 10 \\ \mathbf{Q}\_{\text{load}} \in \mathbb{R}^{10} \quad \mathbf{Q}\_{\text{load}} = [Q\_{Li}]^{\mathbb{T}} \quad i = 1, 2, \dots, 10 \end{array} \tag{9}$$

$$\mathbf{P}\_{DG} = \begin{pmatrix} P\_{DG\_i} \end{pmatrix}^T \qquad \qquad i = 1, 2, \dots \\ \text{Wind number power } \begin{pmatrix} P\_{DG} \end{pmatrix} \\ i = 2, \text{Wind number power } \begin{pmatrix} P\_{WT} \end{pmatrix} \\ i = 3, PV \text{ power array } \mathbf{1} \begin{pmatrix} P\_{PV\_1} \end{pmatrix} \\ i = 4, PV \text{ power array } \mathbf{2} \begin{pmatrix} P\_{PV\_2} \end{pmatrix} \\ i = 5, PV \text{ power array } \mathbf{3} \begin{pmatrix} P\_{PV\_2} \end{pmatrix} \\ i = 6, PV \text{ power array } \mathbf{4} \begin{pmatrix} P\_{PV\_4} \end{pmatrix} \\ i = 7, Power \text{ in } BBSS \mathbf{1} \begin{pmatrix} P\_{DSS\_1} \end{pmatrix} \\ i = 8, Power \text{ in } BBSS \mathbf{2} \begin{pmatrix} P\_{DSS\_2} \end{pmatrix} \end{pmatrix} \end{pmatrix}^T$$

ð11Þ

Equation (11) is solved iteratively through the Newton-Raphson (NR) power flow algorithm, with prior knowledge of PDGi, and current load consumption of every power system node. PDE is estimated in a prediction horizon of length N. An important modification of Eq. (11) is the inclusion of the reactive power consumed by the WTG at bus 7, which is calculated as follows [22]:

$$\begin{aligned} Q\_{WT} &= -\frac{V\_{\gamma}^{2}}{\mathbf{z}\_{p}} + \frac{-V\_{\gamma}^{2} + \sqrt{V\_{\gamma}^{4} - 4P\_{\gamma}\mathbf{z}^{2}}}{2\mathbf{z}}\\ \mathbf{z} &= \mathbf{z}\mathbf{1} + \mathbf{z}\mathbf{2} \qquad &\mathbf{z}\_{p} = \frac{\mathbf{z}\_{c}\mathbf{z}\_{m}}{\mathbf{z}\_{c}\mathbf{z}\_{m}}\end{aligned} \tag{12}$$

where the negative sign of Eq. (12) represents reactive power consumption of the WTG induction generator from the network; zm, zc, z1, and z2 represent the excitation reactance, reactance of a capacitor bank installed at the terminal of the induction generator, and the stator and rotor reactance, respectively.

The control objectives of the proposed strategy are as follows:


A microgrid-centralized controller (MGCC) implements an NMPC algorithm. Loads management as well as batteries connecting and disconnecting events are performed by a control vector, u, defined by Eq. (13). The control vector is calculated in real time by the MGCC, and transmitted to the DCs in the microgrid. Table 5 presents the relationship between each bit of u and its corresponding load controller for switching purposes, that is, for ui ¼ 1 ! Li load is connected, and for ui ¼ 0 ! Li load is disconnected

$$\mathbf{u} = [u\_i] \qquad i = 1, 2, \dots, 13 \qquad u\_i \text{ is a binary signal} \tag{13}$$

An important requirement in the design of NMPC is the availability of a model for predicting the output variables. The NMPC algorithm requires predicted values of the power generated by the DEG to optimally decide which load has to be shed. Trip commands are sent from the MGCC to proper loads. Figure 10 shows the EMS architecture. This control architecture is deeply analyzed in Ref. [23].


Table 5. Control vector correspondence with loads and BSS.

The NR power flow algorithm is used to predict the microgrid's system states, and consequently the PDE in a specific prediction horizon N. To find the optimal steady-state operation of the microgrid, the connection and disconnection commands of the control vector u are accounted within the NR algorithm. An initial data set Z<sup>k</sup> composed of the batteries' SOC, load demand, and the active power generated by every DER is required prior to the execution of the NR calculation. The data set Z<sup>k</sup> does not consider load variations within the prediction horizon. This fact is considered, and two approaches were tested for the initial iterative load values of the NR algorithm in order to predict PDE:

The control objectives of the proposed strategy are as follows:

deeply analyzed in Ref. [23].

166 Development and Integration of Microgrids

Table 5. Control vector correspondence with loads and BSS.

• To manage the connection and disconnection events of batteries;

predicting model, which predicts potential load imbalances;

• To keep the voltage magnitude with a maximum variation of �5%.

is, for ui ¼ 1 ! Li load is connected, and for ui ¼ 0 ! Li load is disconnected

• To shed low priority loads every time the load demand is greater than the generation capacity. This control action anticipates any harmful operation of the system through the

A microgrid-centralized controller (MGCC) implements an NMPC algorithm. Loads management as well as batteries connecting and disconnecting events are performed by a control vector, u, defined by Eq. (13). The control vector is calculated in real time by the MGCC, and transmitted to the DCs in the microgrid. Table 5 presents the relationship between each bit of u and its corresponding load controller for switching purposes, that

An important requirement in the design of NMPC is the availability of a model for predicting the output variables. The NMPC algorithm requires predicted values of the power generated by the DEG to optimally decide which load has to be shed. Trip commands are sent from the MGCC to proper loads. Figure 10 shows the EMS architecture. This control architecture is

Control signal Load Observations u1 L1\* ¼ {L1 U L2} Variable loads u2 L3 U L4 Constant loads u3 L5 Constant load u4 L6 Variable load u5 L7 Variable load u6 L8 Constant load u7 L9 Constant load u8 L10 Constant load u9 L11 Constant load u10 BSS1 Charge mode u11 BSS1 Discharge mode u12 BSS2 Charge mode u13 BSS2 Discharge mode

ð13Þ

Figure 10. NMPC architecture for a centralized load shedding strategy.


Another approach for predicting the PDE was developed with an autoregressive model with external input (ARX) through a data-based modeling using an adaptive neuro-fuzzy inference system (ANFIS). As in the case of the ANN training algorithm, 20 different generation profiles of the DEG for different days of the week were used as training set for the ANFIS. The ARX configuration developed is the one detailed in Ref. [24]. This modeling procedure does not imply an NR calculation, therefore reducing the computing time of the control algorithm.

Since the voltage magnitude of the microgrid is to be kept within a 5% range of variation, a static voltage stability index, presented in Ref. [22], is used for defining a secure range of operation of the

Figure 11. Simulation results of the EMS combining an NMPC algorithm running at the MGCC, and an FTMPC installed at the DEG. (a) Voltage magnitude response comparison between the FTMPC and the MPC systems. (b) Power output of the DEG comparison. (c) ARX model parameters adaptation of the DEG. (d) Residue calculated by the FDD module.

DEG. Consider average generation values of DERs: PWT ¼ 0.15, ΣPP V1,2,3,4 ¼ 0.049 and PBSS1,2 ¼ 0.035 in discharge mode and PBSS1,2 ¼ -0.02 in charge mode, and that the voltage magnitude limits are 0.95 ≤ |V| ≤ 1.05, an optimization procedure in which a sweep of the values of PL, QL, and |V| within allowable ranges is performed in order to obtain a secure margin of operation of the microgrid. The secure range of operation for the DE, estimated by the optimization process, is

1. Consider the load measurements as constants during the entire prediction horizon N;

were used as training set for configuring a three-layer ANN.

V − FTMPC V − MPC

0 4 8 12 16 20 24

Voltage magnitude of the microgrid

Time (h) (a)

k−2 = b1

u

k−1 + b2

a 1 a 2 b 1 b 2

uk−2

y

k−1 − a2

0 4 8 12 16 20 24

Time (h) (c)

algorithm.

168 Development and Integration of Microgrids

0.9

y k − a1 y

−1.5 −1 −0.5 0 0.5 1

DE ARX model

0.95

1

pu

1.05

1.1

2. Use a load predictor based on an artificial neural network (ANN). For this purpose, 20 load profiles from different days of the week for every variable loads in the microgrid

Another approach for predicting the PDE was developed with an autoregressive model with external input (ARX) through a data-based modeling using an adaptive neuro-fuzzy inference system (ANFIS). As in the case of the ANN training algorithm, 20 different generation profiles of the DEG for different days of the week were used as training set for the ANFIS. The ARX configuration developed is the one detailed in Ref. [24]. This modeling procedure does not imply an NR calculation, therefore reducing the computing time of the control

Since the voltage magnitude of the microgrid is to be kept within a 5% range of variation, a static voltage stability index, presented in Ref. [22], is used for defining a secure range of operation of the

> 0 0.05 0.1 0.15 0.2 0.25 0.3

> > 0

Figure 11. Simulation results of the EMS combining an NMPC algorithm running at the MGCC, and an FTMPC installed at the DEG. (a) Voltage magnitude response comparison between the FTMPC and the MPC systems. (b) Power output of the DEG comparison. (c) ARX model parameters adaptation of the DEG. (d) Residue calculated by the FDD module.

0.5

1

1.5

2

pu

0 4 8 12 16 20 24

DEG generated power

PDEG − FTMPC PDEG − MPC PDEG max constraint

Time (h) (b)

Residual response of the FDD module

Residual Alarm indicator

0 4 8 12 16 20 24

Time (h) (d)

$$P\_{DE} \le P\_{DE}^+ = 0.2 \tag{14}$$

The control vector u calculated by the NMPC algorithm is restricted to be binary. Optimization problems of this type are called mixed-integer nonlinear programming (MINLP) problems. The MINLP package of TOMLAB for MATLAB was used for solving this optimal control problem.

Figure 11 shows the transient response of the voltage magnitude of node-1 of the microgrid in islanded operation. Near 04h00 AM, the DE presents a loss of effectiveness in the servomechanism used for fuel injection. Based on the detection of the fault and estimation of the post-fault model of the DE by using a combination of the parity space and Kalman filter methods, a fault-tolerant model-predictive control (FTMPC) has been implemented (see Ref.

Figure 12. Profiles of RES generated power and load power consumption.

[25] for further details). A simple MPC has also been tested, which causes microgrid instability due to its lack of adaptability to faulty situations.

Figure 12 provides additional information on the NMPC performance by showing the voltage and frequency of the microgrid, and the loads and batteries switching due to the NMPC calculation. Voltage magnitude maintains within the 5% band (in the weaker bus/node 1) when the microgrid operates in islanded mode. In this operation mode, when no control action is performed, the voltage magnitude constraint is violated. On the other hand, constraints included in the NMPC algorithm are not violated. From Figure 12, it is seen that high priority loads L1, L7, and L8 were not disconnected, and at least one load of the low priority loads group kept connected, as it was programmed in the NMPC algorithm. Batteries charge at off-peak times, when there is availability of power from the generation units (Pgen > Pload). Batteries deliver power to the grid when there is a power deficit due to peak consumption. The inclusion of load shedding and battery management in the NMPC algorithm improves the microgrid's overall performance by guaranteeing a reliable and secure operation.

Figure 13. (Upper) PDE when the load shedding NMPC strategy is used (islanding event at 12h00). (Lower left) Voltage magnitude variation; (lower right) frequency variation.

In addition to the previous results, Figure 13 shows the operation of the microgrid under similar conditions of Figures 11 and 12. The islanding event occurs at 12h00, and as expected the voltage magnitude variation does not overpass the 5% variation when the EMS takes decisions on the batteries energy management, and low priority loads to be shed. A similar situation is observed with the frequency deviation from 1 pu, which remains in an acceptable range of variation of maximum 0.05%. By contrast, the simulation of the microgrid operating without the EMS shows an unsecure behavior of the system, violating the |ΔV| < 5% operation constraint, and also presenting a much larger frequency variation, as also shown in Figure 13.

### 5. Conclusions

[25] for further details). A simple MPC has also been tested, which causes microgrid instability

Figure 12 provides additional information on the NMPC performance by showing the voltage and frequency of the microgrid, and the loads and batteries switching due to the NMPC calculation. Voltage magnitude maintains within the 5% band (in the weaker bus/node 1) when the microgrid operates in islanded mode. In this operation mode, when no control action is performed, the voltage magnitude constraint is violated. On the other hand, constraints included in the NMPC algorithm are not violated. From Figure 12, it is seen that high priority loads L1, L7, and L8 were not disconnected, and at least one load of the low priority loads group kept connected, as it was programmed in the NMPC algorithm. Batteries charge at off-peak times, when there is availability of power from the generation units (Pgen > Pload). Batteries deliver power to the grid when there is a power deficit due to peak consumption. The inclusion of load shedding and battery management in the NMPC algorithm improves the microgrid's

0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23

Time (h)

0.97

Figure 13. (Upper) PDE when the load shedding NMPC strategy is used (islanding event at 12h00). (Lower left) Voltage

0.98

0.99

1.01

1

0 4 8 12 16 20

Time (h)

Frequency (pu)

Open loop NMPC+ANFIS

DEG generated power (pu)

due to its lack of adaptability to faulty situations.

170 Development and Integration of Microgrids

0

0.94

0.96

0.98

1.02

1

0.1

0.2

0.3

Open loop NMPC+ANFIS

0 4 8 12 16 20

magnitude variation; (lower right) frequency variation.

Time (h)

Voltage amplitude (pu)

Open loop NMPC+ANFIS

overall performance by guaranteeing a reliable and secure operation.

A predictive control scheme that prevents from unbalances between the load demand and the capacity of generation installed in an islanded microgrid is analyzed in this chapter. The NMPC calculates, within an optimization framework, load shedding when necessary as well as the energy management from the batteries in the microgrid. Therefore, an optimal control problem is established, where all the operating conditions of the microgrid are integrated, that is, load priorities for disconnection and batteries charging and discharging cycles. A comparison of some simulation results of the microgrid working with and without the MGCC shows improvements in the reliability of the microgrid when it operates in islanded mode, since simulation results showed the capability of the control strategy of maintaining within safe limits voltage and frequency of the microgrid, as well as a correct balance of generated power and load demand.

### Author details

Luis I. Minchala1,2\*, Youmin Zhang3 and Oliver Probst<sup>1</sup>


### References


[18] Chiasson J, Vairamohan B. Estimating the state of charge of a battery. IEEE Transactions on Control Systems Technology. 2005;13(3):465–470

[3] Mamo X, Mallet S, Coste T, Grenard S. Distribution automation: The cornerstone for smart grid development strategy. 2009 IEEE Power & Energy Society General Meeting,

[4] Ha B, Lee S, Shin C, Kwon S, Park S, Park M. Development of intelligent distribution automation system, 2009 Transmission & Distribution Conference & Exposition: Asia and

[5] Craig D, Befus C. Implementation of a Distributed Control System for Electric Distribution Circuit Reconfiguration, 2005/2006 IEEE/PES Transmission and Distribution Confer-

[6] Hossain E, Kabalci E, Bayindir R, Perez R. Microgrid testbeds around the world: State of

[7] Haritza C, Octavian C, Aitor E, Alvaro L, Amélie HP. Research experimental platforms to study microgrids issues. International Journal on Interactive Design and Manufacturing.

[8] Masoum M, Dehbonei H, Fuchs E. Theoretical and experimental analyses of photovoltaic systems with voltage and current-based maximum power-point tracking. IEEE Trans-

[9] Paire D, Miraoui A. Power management strategies for microgrid—A short review, 2013 IEEE Industry Applications Society Annual Meeting, Lake Buena Vista, FL, 2013, pp. 1–9

[10] Minchala-Avila LI, Armijos J, Pesántez D, Zhang Y. Design and implementation of a smart meter with demand response capabilities. Energy Procedia. 2016;103:195–200 [11] Chen X, Wei T, Hu S. Uncertainty-aware household appliance scheduling considering dynamic electricity pricing in smart home. IEEE Transactions on Smart Grid. 2013;4:932–

[12] He Y, Jenkins N, Wu J. Smart metering for outage management of electric power distri-

[13] Blanke M. Diagnosis and Fault-Tolerant Control. Berlin, Heidelberg: Springer-Verlag

[14] Zhang Y, Jiang J. Bibliographical review on reconfigurable fault-tolerant control systems.

[15] Grainger JJ, Stevenson WD. Power System Analysis. New York, NY: McGraw-Hill; 1994 [16] Munoz-Aguilar RS, Doria-Cerezo A, Fossas E, Cardoner R. Sliding Mode Control of a Stand-Alone Wound Rotor Synchronous Generator, in IEEE Transactions on Industrial

[17] Fuchs EF, Masoum MA. Power Conversion of Renewable Energy Systems. Boulder: Springer;

Calgary, AB, 2009, pp. 1–6

172 Development and Integration of Microgrids

Pacific, Seoul, 2009, pp. 1–4

2016;10(1):59–71

941

GmbH; 2003

2011.

ence and Exhibition, Dallas, TX, 2006, pp. 342–347

actions on Energy Conversion. 2002;17(12):514–522

bution networks. Energy Procedia. 2016;103:159–164

Annual Reviews in Control. 2008;32(2):229–252

Electronics, 2011;58(10):4888–4897

art. Energy Conversion and Management. 2014;86:132–153

