**2. Microgrid and Energy Management System configuration**

## **2.1. Architecture of the AC/DC microgrid**

**1. Introduction**

46 Smart Microgrids

Evolution Roadmap, respectively:

For the last couple of years, a new solution suitable to local energy distribution within existing

The two microgrid definitions, which are currently in use, are provided by the US Department of Energy Microgrid Exchange Group and by CIGRÉ C6.22 Working Group, Microgrid

*"A microgrid is a group of interconnected loads and distributed energy resources within clearly defined electrical boundaries that acts as a single controllable entity with respect to the grid. A microgrid can connect and disconnect from the grid to enable it to operate in both grid-connected or island-mode"* [2, 3]. *"Microgrids are electricity distribution systems containing loads and distributed energy resources, (such as distributed generators, storage devices, or controllable loads) that can be operated in a controlled, coordinated way either while connected to the main power network or while islanded"* [2, 3]. The microgrid concept supports an alternative approach to the integration of distributed energy resources characterized by low installed capacity to distribution grids [4]. When compared to conventional power systems, the main advantage of microgrids consists of the controllable unit feature. Microgrids can be operated as a single load, ensuring easy control and compliance to rules and regulations without impacting the reliability and safety of the user's power supply. Microgrids are designed to operate semi-independently, usually in grid-connected mode, providing options for isolated or islanded operation, either for economic, reliability, or

power systems has been proposed and developed: microgrids [1].

**Figure 1.** The conceptual model of a typical microgrid configuration [6].

The special operating conditions of the power systems require new solutions in order to ensure the continuity of the power supply. Therefore, the chapter proposes and analyzes the integration of renewable energy sources (RESs) (photovoltaic panels and wind turbines) into a mixed microgrid by using the LabVIEW software. Also, the MATLAB environment was used by introducing MATLAB scripts within the developed visual instruments (VI) diagrams.

The designed microgrid takes into account the following requirements:


The developed microgrid model, **Figure 2**, includes the following components: distributed energy sources, distributed storage, backup sources for the generated power, critical or priority energy users (which do not allow any interruptions in the power supply) as well as standard users (which allow power supply interruptions) and one control unit that communicates to all the other components. The standard energy consumers, which can be considered by the

• *UT*

• *I*

• *I* 0

• *RS*

theoretical cell current) (A);

—saturation current (A);

by the scientific literature [1, 8].

increases the efficiency in power generation [9].

purpose of the microgrid simulator.

the evaluation of the components interconnection mode.

**Figure 3.** The diagram developed for the photovoltaic panel [1].

—thermal voltage of the semiconductor (for a 300 K voltage, resulting as *UT* = 0.026 V) (V);

Energy Management System Designed for the Interconnected or Islanded Operation…

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

49

*ph*—electric current generated according to the values of irradiance and temperature (the

The model related to the external characteristic *I(V)* for a photovoltaic panel has been implemented by using the LabVIEW environment based on Eq. (1). Thus, **Figure 3** shows the diagram developed for a Kyocera photovoltaic panel. The diagram uses the electrical parameters from the technical specification supplied by the producer as well as the parameters suggested

The photovoltaic panel model was then completed by modeling and implementing a maximum power point tracking (MPPT) controller circuit designed for solar power applications. This additional simulation was necessary given that photovoltaic panels are characterized by an optimization point which provides maximum power. This point generally varies according to the ambient environmental conditions. When adjusting the output voltage of the solar cells in a variable environment, permanent maximum power generation becomes a problem. Under these conditions, tracking the maximum power point for existing photovoltaic systems

The MPPT algorithm was implemented by measuring the electrical current for several voltage values at the required time interval. This method removes any possibility for the system to enter an unstable oscillation mode (sometimes affecting other types of algorithms). Also, the algorithm involves the constant pitch scanning of the foreseen operating range. The mentioned MPPT controller model represents a component of the AC/DC microgrid, suitable for

In order to simulate the operation of the photovoltaic cell, the single-diode model with ideal *p-n* junction was used, as suggested by Eq. (1), which avoids complex calculations and leads to increasing the simulator running speed without introducing significant errors to the overall

—series resistor which models the equipment power losses (Ω).

**Figure 2.** The developed model of mixed microgrid [6].

conceptual microgrid model, include, but are not limited to general lighting, local electrical heating and general electrical outlets. The critical consumers include the following essential services and equipment: technological processes that induce unacceptable interruption costs, safety lighting, or alarm and safety systems [7].

The microgrid model has been implemented by developing LabVIEW models for each component: photovoltaic panels, wind turbine, lead-acid batteries, and end users, all based on load curves and characteristics derived from the client's database.

#### *2.1.1. Mathematical modeling of photovoltaic panels*

The description and modeling of the PV panels was achieved by considering the simplified mathematical model based on the single-diode photovoltaic cell which gives the output power *P* as in Eq. (1):

$$P = \downarrow \mathcal{U} \cdot I = \downarrow \mathcal{U}\_r \cdot I \cdot \ln\left(\frac{I\_{\rm in} - I + l\_b}{I\_o}\right) - I^2 \cdot R\_s \tag{1}$$

where


conceptual microgrid model, include, but are not limited to general lighting, local electrical heating and general electrical outlets. The critical consumers include the following essential services and equipment: technological processes that induce unacceptable interruption costs,

The microgrid model has been implemented by developing LabVIEW models for each component: photovoltaic panels, wind turbine, lead-acid batteries, and end users, all based on

The description and modeling of the PV panels was achieved by considering the simplified mathematical model based on the single-diode photovoltaic cell which gives the output

> *I ph* <sup>−</sup> *<sup>I</sup>* <sup>+</sup> *<sup>I</sup>* \_\_\_\_\_\_0 *I*

<sup>0</sup> ) <sup>−</sup> *<sup>I</sup>*<sup>2</sup> <sup>⋅</sup> *Rs* (1)

safety lighting, or alarm and safety systems [7].

**Figure 2.** The developed model of mixed microgrid [6].

*2.1.1. Mathematical modeling of photovoltaic panels*

*P* = *U* ⋅ *I* = *UT* ⋅ *I* ⋅ ln(

• *I*—electric current generated by the solar cell (A);

power *P* as in Eq. (1):

• *U*—voltage output (V);

where

48 Smart Microgrids

load curves and characteristics derived from the client's database.

• *RS* —series resistor which models the equipment power losses (Ω).

The model related to the external characteristic *I(V)* for a photovoltaic panel has been implemented by using the LabVIEW environment based on Eq. (1). Thus, **Figure 3** shows the diagram developed for a Kyocera photovoltaic panel. The diagram uses the electrical parameters from the technical specification supplied by the producer as well as the parameters suggested by the scientific literature [1, 8].

The photovoltaic panel model was then completed by modeling and implementing a maximum power point tracking (MPPT) controller circuit designed for solar power applications. This additional simulation was necessary given that photovoltaic panels are characterized by an optimization point which provides maximum power. This point generally varies according to the ambient environmental conditions. When adjusting the output voltage of the solar cells in a variable environment, permanent maximum power generation becomes a problem. Under these conditions, tracking the maximum power point for existing photovoltaic systems increases the efficiency in power generation [9].

The MPPT algorithm was implemented by measuring the electrical current for several voltage values at the required time interval. This method removes any possibility for the system to enter an unstable oscillation mode (sometimes affecting other types of algorithms). Also, the algorithm involves the constant pitch scanning of the foreseen operating range. The mentioned MPPT controller model represents a component of the AC/DC microgrid, suitable for the evaluation of the components interconnection mode.

In order to simulate the operation of the photovoltaic cell, the single-diode model with ideal *p-n* junction was used, as suggested by Eq. (1), which avoids complex calculations and leads to increasing the simulator running speed without introducing significant errors to the overall purpose of the microgrid simulator.

**Figure 3.** The diagram developed for the photovoltaic panel [1].

The MPPT simulator, initialized with the photocell parameters provided by the PV manufacturer, estimates the parameters required for the calculation model, receives from the rest of the microgrid simulator the irradiation and temperature values according to the climatic scenario, and performs a constant coverage scanning in order to determine the maximum power point. For further reducing the scaled range, the simulator starts from the maximum possible value of solar irradiation and reaches the null value of the electric current, calculating the value of generated power for each iteration. In a memory cell, only the maximum instantaneous current - power set of values is registered (which at the start of the determination is initialized and starts from 0), respectively, the power and intensity of the electric current. For each new measurement, the value of the regulated current is decremented, and the resulting power is compared to the maximum registered value. The pair of values represented by the electric current—power, which meets the condition of the highest power value, becomes the current stored value. When the instant measured power drops below 70% of the last determined maximum point, the scanning stops and the control value becomes the maximum power value.

The output current was computed by considering the wind turbine's operating voltage equal to the microgrid's voltage *Un* = 24 V. Also, the theoretical power of the wind turbine, *P* (W),

• *A*—area of the surface described by the turbine rotor, which is perpendicular to the wind

Most power systems with insulated operation, which are designed for consumers' continuous supply, require battery storage systems in order to equalize the irregular nature of meteorological parameters. Currently, the most used batteries for renewable energy sources applica-

The mathematical models related to battery storage systems are targeting the simulation of real operation characteristics and are used for the behavior estimation related to variable charging and discharging conditions. The mentioned models are also suitable for storage batteries design due to the fact that they allow the analysis of charging and discharging modes

The developed AC/DC microgrid is based on the Shepherd model which describes the electrochemical processes depending on the voltage and electric current values. The Shepherd model also considers the Peukert law, Eq. (3), in order to determine the battery voltage and

—open-circuit voltage at the battery terminals when the battery is completely discharged (V);

\_\_\_1

<sup>1</sup> <sup>−</sup> *<sup>f</sup>*)*<sup>I</sup>* (3)

tions consist of lead-acid (PbA), lithium-ion (Li-ion) or nickel-cadmium batteries [10].

<sup>2</sup> *ρ ACp v*<sup>3</sup> (2)

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

51

Energy Management System Designed for the Interconnected or Islanded Operation…

was taken into account, expressed in Eq. (2):

**Figure 5.** The wind turbine diagram implemented in LabVIEW [1].

*P* = \_\_1

);

• *v*—wind velocity at the turbine entrance (m/s) [1].

*2.1.3. Mathematical modeling of battery storage systems*

*Eb* = *E*<sup>0</sup> − *Ri I* − *Ki*(

where

• *Cp*

• *ρ*—air density (kg/m<sup>3</sup>

);

independently of the supplied system.

—battery terminals voltage (V);

—power coefficient;

direction (m2

state of charge.

where

• *Eb*

• *<sup>E</sup>*<sup>0</sup>

The simulation shown in **Figure 4** is provided with a memory for the solar irradiance and temperature indicated by the last iteration climatic scenario. If the new values are different, the determination is resumed.

#### *2.1.2. Mathematical modeling of wind turbines*

**Figure 5** shows the diagram developed for the evaluation of voltage and current outputs characteristic to a wind turbine. The determination of the wind turbine's output power was achieved by linear interpolation of the power characteristic in relation to the wind velocity.

**Figure 4.** Simulation and modeling of the maximum power point for variable environmental conditions (G, Tamb).

Energy Management System Designed for the Interconnected or Islanded Operation… http://dx.doi.org/10.5772/intechopen.74856 51

**Figure 5.** The wind turbine diagram implemented in LabVIEW [1].

The output current was computed by considering the wind turbine's operating voltage equal to the microgrid's voltage *Un* = 24 V. Also, the theoretical power of the wind turbine, *P* (W), was taken into account, expressed in Eq. (2):

$$P = \frac{1}{2}\rho \, A \mathbb{C}\_p v^3 \tag{2}$$

where

The MPPT simulator, initialized with the photocell parameters provided by the PV manufacturer, estimates the parameters required for the calculation model, receives from the rest of the microgrid simulator the irradiation and temperature values according to the climatic scenario, and performs a constant coverage scanning in order to determine the maximum power point. For further reducing the scaled range, the simulator starts from the maximum possible value of solar irradiation and reaches the null value of the electric current, calculating the value of generated power for each iteration. In a memory cell, only the maximum instantaneous current - power set of values is registered (which at the start of the determination is initialized and starts from 0), respectively, the power and intensity of the electric current. For each new measurement, the value of the regulated current is decremented, and the resulting power is compared to the maximum registered value. The pair of values represented by the electric current—power, which meets the condition of the highest power value, becomes the current stored value. When the instant measured power drops below 70% of the last determined maximum point, the scanning stops and the control value becomes the maximum power value.

The simulation shown in **Figure 4** is provided with a memory for the solar irradiance and temperature indicated by the last iteration climatic scenario. If the new values are different,

**Figure 5** shows the diagram developed for the evaluation of voltage and current outputs characteristic to a wind turbine. The determination of the wind turbine's output power was achieved by linear interpolation of the power characteristic in relation to the wind velocity.

**Figure 4.** Simulation and modeling of the maximum power point for variable environmental conditions (G, Tamb).

the determination is resumed.

50 Smart Microgrids

*2.1.2. Mathematical modeling of wind turbines*


#### *2.1.3. Mathematical modeling of battery storage systems*

Most power systems with insulated operation, which are designed for consumers' continuous supply, require battery storage systems in order to equalize the irregular nature of meteorological parameters. Currently, the most used batteries for renewable energy sources applications consist of lead-acid (PbA), lithium-ion (Li-ion) or nickel-cadmium batteries [10].

The mathematical models related to battery storage systems are targeting the simulation of real operation characteristics and are used for the behavior estimation related to variable charging and discharging conditions. The mentioned models are also suitable for storage batteries design due to the fact that they allow the analysis of charging and discharging modes independently of the supplied system.

The developed AC/DC microgrid is based on the Shepherd model which describes the electrochemical processes depending on the voltage and electric current values. The Shepherd model also considers the Peukert law, Eq. (3), in order to determine the battery voltage and state of charge.

$$E\_b = E\_0 - R\_\gamma I - K\_\gamma \left(\frac{1}{1-f}\right) I \tag{3}$$

where


$$f = \int\_{\bullet} \frac{I \cdot dt}{Q\_0} \tag{4}$$

**2.2. Configuration and structure of the Energy Management System**

equipment. Also, this involves risks in critical users power supplying.

possibility of adapting to the needs of each beneficiary.

• Ensuring and maintaining energy backup.

about the components must be inserted as follows:

The *end users* require the following information:

The *energy generation sources* require the following information:

• port—parameter assigned to communication/monitoring/control;

• port—parameter assigned to communication/monitoring/control;

• dependent size and conversion factor—for the estimation of energy generation;

• priority—parameter which allows the end users selection for different operating scenarios;

following:

and sun.

• installed power;

• available power;

• installed power;

• the production cost/kWh.

The main characteristics of the designed Energy Management System (EMS) consist of the

Energy Management System Designed for the Interconnected or Islanded Operation…

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

53

• The option of computing for any practical configuration of the microgrid, providing the

• The option of implementing energy storage during low-cost periods and injecting it into the electric public grid during high-cost periods; even though this strategy is commonly used, EMS can still not be economically efficient due to limitations imposed by the storage

• The option of connecting or disconnecting backup sources that are not generally represented by RES and therefore dispose of limited available power and/or at an inconvenient price cost. In this case, EMS disconnects users according to their associated priority.

• The option of estimating the available power, which, in the absence of storage equipment, is achieved by monitoring and registering the primary energy sources like wind

• The option of implementing the electric public grid within the developed model of AC/DC microgrid as follows: either backup energy source, dump-load consumer or both [6, 11].

The algorithm covers the energy management functions and is based on the developed microgrid model which includes the control unit. Thus, for initializing it, the information

**Figures 6** and **7** show an example simulation model of a PbA battery storage system operation when considering a discharging and afterwards a charging current rate of 0.8 A.

**Figure 6.** Voltage variation at the battery terminals during a discharging cycle for a discharge current rate of 0.8 A.

**Figure 7.** Voltage variation at the battery terminals during a charging cycle for a charge current rate of 0.8 A.

#### **2.2. Configuration and structure of the Energy Management System**

The main characteristics of the designed Energy Management System (EMS) consist of the following:


The algorithm covers the energy management functions and is based on the developed microgrid model which includes the control unit. Thus, for initializing it, the information about the components must be inserted as follows:

The *energy generation sources* require the following information:


• *Ri*

52 Smart Microgrids

• *Ki*

—internal resistance of the battery (Ω);

• *Q*—capacity of the battery (Ah);

fully charged battery's capacity *Q0*

*f* =

• *I*—electric current (A);

—polarization resistance of the battery (Ω);

• *f*—fraction extracted from the battery (the capacity extracted from the battery rated to the

∫

0 *t* \_\_\_\_\_ *I* ⋅ *dt Q*0

**Figures 6** and **7** show an example simulation model of a PbA battery storage system operation

**Figure 6.** Voltage variation at the battery terminals during a discharging cycle for a discharge current rate of 0.8 A.

**Figure 7.** Voltage variation at the battery terminals during a charging cycle for a charge current rate of 0.8 A.

when considering a discharging and afterwards a charging current rate of 0.8 A.

) as suggested by Eq. (4)

(4)


The *end users* require the following information:


• operation mode (without any interruptions, permanent or continuous, dump load—connection for injecting the production excess of electric power);

**Figure 8** shows the graphical interface of the developed Energy Management System. This highlights the connection state (connected or disconnected) related to the considered distributed energy generation sources, battery storage systems, end users as well as the islanded or interconnected operation of the microgrid to the national power system. Also, the connection state regarding the "ports" vector has been envisaged, which has resulted in using the BUILD ARRAY function and thus connecting the communication/command parameters of each element in series [12]. The dependence between the connection state of each component (Boolean

Energy Management System Designed for the Interconnected or Islanded Operation…

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

55

and "ports" elements) is shown.

**Figure 9.** The block diagram of the Energy Management System concept [6, 11].

• sale price—electricity pricing for the energy which is sold to the end user (if applicable).

The *battery storage systems* require the following information:


The *Energy Management System* parameters consist of the following:


**Figure 8.** The graphical interface of the developed Energy Management System. The ON/OFF state for the microgrid components and activation/deactivation of the Energy Management System.

**Figure 8** shows the graphical interface of the developed Energy Management System. This highlights the connection state (connected or disconnected) related to the considered distributed energy generation sources, battery storage systems, end users as well as the islanded or interconnected operation of the microgrid to the national power system. Also, the connection state regarding the "ports" vector has been envisaged, which has resulted in using the BUILD ARRAY function and thus connecting the communication/command parameters of each element in series [12]. The dependence between the connection state of each component (Boolean and "ports" elements) is shown.

• operation mode (without any interruptions, permanent or continuous, dump load—con-

• sale price—electricity pricing for the energy which is sold to the end user (if applicable).

• storage cost—estimated cost/kWh depending on the limitations of the storage equipment.

• LIM\_SOC\_SOURCES—the limit of storage devices for which the backup sources are

• LIM\_SOC\_SAFETY—the limit of storage devices for which standard end users are

• INCOME\_THRESHOLD—the price threshold for which the energy injection into the pub-

• T\_AVERAGING—the averaging time of the measurements. This parameter influences the

**Figure 8.** The graphical interface of the developed Energy Management System. The ON/OFF state for the microgrid

components and activation/deactivation of the Energy Management System.

• LIM\_COST\_SOURCES— the high-priced sources are connected only if necessary;

• ALLOW\_EMPTY\_BAT—it allows the use of the stored energy for a maximum profit;

nection for injecting the production excess of electric power);

• port—parameter assigned to communication/monitoring/control;

The *Energy Management System* parameters consist of the following:

The *battery storage systems* require the following information:

• storage capacity;

54 Smart Microgrids

connected;

disconnected;

lic grid begins;

values of the reaction time [6, 11].

**Figure 9.** The block diagram of the Energy Management System concept [6, 11].

**3. Experiments and simulation results of the Energy Management** 

The Energy Management System implies independent automatic decisions from a potential user's decisions. The developed microgrid is operational even without an Energy Management System, but it is not provided with automatic decisions which aim the control of the energy flows or connection/disconnection actions of the component elements. Consequently, it results in the energy management for the optimization of both the microgrid operation and beneficiary's income/benefit. Moreover, in order to demonstrate the functionality of this system, the following operating scenarios, available for the "Enable management—ON" state,

Energy Management System Designed for the Interconnected or Islanded Operation…

*Operating scenario number I.* The distributed energy generation sources (wind energy conversion system, photovoltaic system), the battery storage systems as well as the connection to the low-voltage distribution grid are available. This operating scenario involves the variation of the meteorological parameters during the microgrid functioning. Also, a calculation step

The first operating scenario, represented in **Figure 12**, considers two time moments when

**Figure 12.** The graphical interface of the developed application for the modeling and simulation of a small-scale

1

—the moment when the solar irradiation increases. These two time moments are

—the moment when the solar irradiation

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

57

Δ*t* = 40 s is used, during which all the parameter values are maintained constant.

the meteorological parameters vary, respectively, *t*

microgrid and the related EMS. Operating scenario number I.

established randomly by the user of the LabVIEW application.

**System: operation scenarios**

are suggested.

drops and *t*<sup>2</sup>

**Figure 10.** The graphical interface of the developed application for the modeling and simulation of a small-scale microgrid and the related Energy Management System.

**Figure 9** contains the block diagram of the Energy Management System concept designed for the islanded or interconnected operation of the microgrid with the national power system while **Figure 10** shows the graphical interface of the developed application related to the microgrid design and simulation.

In addition to the LabVIEW environment, MATLAB was used as well by introducing a MATLAB script within the developed VI related to the Energy Management System. **Figure 11** shows a section of the main loop management, presenting a MATLAB residue code which was then implemented in the general LabVIEW diagram.

**Figure 11.** Section of the MATLAB script related to the LabVIEW Energy Management System.
