1. Introduction
Electric energy consumption has shown accelerated growth in recent years. Simultaneously, there has been a constant development of technologies to ensure efficient generation and distribution. As a consequence, the conventional centralized energy system architecture has evolved to a distributed architecture involving localized generation based on microgrids [
1,
2]. Microgrids are structures capable of supplying energy to local loads with or without a connection to a main grid. Among their multiple applications, microgrids can solve the energy availability problem in rural or remote zones and contribute to the increased use of renewable resources in urban zones [
3,
4,
5,
6]. Microgrids use renewable resources to supply the energy demanded by the loads, and they require storage technologies to provide autonomy due to the intermittence of solar and wind energy. Considering their advantages, microgrids permanently attract the interest of researchers and industrialists around the world [
7,
8,
9].
The nature of the voltage in the points of common connection of a microgrid named as nodes or buses allow the classification of microgrids as either DC, AC, or hybrid DC–AC, i.e., having DC or AC coupling capability. Hybrid microgrids have become popular in recent years because they provide the flexibility and modularity that AC and DC microgrids cannot provide separately [
10,
11,
12,
13,
14]. Therefore, several research efforts are devoted to solving the challenges related to the development of these kinds of systems.
Microgrids have been simulated to facilitate their study in both academic and research environments. The vast majority of research on the modelling and control of microgrids, whether DC or AC, has been carried out using MATLAB/Simulink as a simulation tool. For instance, in [
15], the power management system for a microgrid consisting of a wind turbine farm, a solar PV farm, and AC loads is validated for various operating conditions. Additionally, in [
16], modelling and control of a hybrid microgrid is developed using simulations to validate the correct operation of the system under transient and stationary conditions. In [
17], the Stateflow toolbox of Simulink is used to validate a power balance control strategy developed using the Petri Nets formalism. Moreover, there are other simulation tools that have been successfully used in the study of microgrids, such as PSCAD [
18,
19,
20] and DigSILENT Power Factory [
21,
22]. It is also relevant to mention the existence of software such as HOMER, which allows the economic study of microgrids beyond technical aspects [
23,
24]. In general, researchers develop simulations focused on a particular case study, and only some works are devoted to study generalized or flexible architectures. Another important approach regarding microgrid simulation is the use of hardware in the loop (HIL) techniques, which advantageously utilize a dedicated platform, enabling a real-time simulation. For this, hardware systems such as Typhoon, OPAL-RT, or RTDS are necessary, unbalancing the cost–benefit ratio when the object of the simulation is validated for academic purposes [
25,
26,
27,
28,
29,
30]. As a particular case, in [
31], a behavioral simulator modelling several types of power loads is presented, demonstrating that good results (regarding precision and time of simulation) can be obtained in simulation of operation scenarios of microgrids without the need for complex physical models of loads. Although this work is focused on a shipboard microgrid, its use can be extended to other kind of microgrids.
A potential solution to facilitate understanding of the fundamentals of microgrid operation is the use of simplified models capable of supporting the configuration of real parameters (environmental conditions), real scenarios (generation and consumption), and accurate modelling of conversion devices. In [
32], authors introduce a modular simulation which can be used as testbed in the study of management strategies of hybrid microgrids regarding the formalism of the energetic macroscopic representation. One of the notable features of this development is the use of MATLAB/Simulink without the requirement of additional toolboxes, which allows accessibility to a wider community. In this work, models for PV modules, batteries, fuel cells, ultracapacitors, generators, and power converters are developed, and control loops are implemented. In [
33], a simulation of a DC-coupled AC/DC hybrid microgrid is implemented in MATLAB, providing various possible configurations. In this case, the connection of three microgrids is tested based on the 14-bus bar IEEE standard. A relevant feature of this work is the simulated interconnection of multiple microgrids with AC and DC nature. This simulation allows the study of power quality indexes into the AC side, such as THD, and power factor, which is advantageous, although it adds complexity. A system-level simulation is developed in [
34], proposing alternative models for different components of the microgrid. In this work, the models proposed for converters are very accurate with respect to experimental results. This is possibly due to the inclusion of accurate models of the efficiency behavior of the converters, which increased the accuracy of the simulation. In [
35], a simplified modelling approach is developed to study the behavior of microgrids in islanding operations. The authors demonstrated that the complexity of the proposed models is reduced and the corresponding algorithms are easy to implement in any general-purpose software. A comparison with simulations developed in PSCAD-EMTDC is provided, confirming the validity of the approach. On the contrary, modelling presented in [
36] proposes a complex representation of the microgrid using neural networks, which integrates different components treated separately as autonomous systems. Although this approach showed a good performance, it is far from simple or flexible. To summarize, an interesting comparison of microgrid simulators is performed in [
37], where simulators are classified according to two groups: deterministic and probabilistic. In this work, different comparison features are evaluated, such as demand response, generator efficiency, tariffs and incomes, life-cycle costing, rule-based dispatch, separate energy manager model, economic dispatch, and the possibility to kink with MATLAB. The HOMER simulator seems to be ideal for simulations involving economic aspects, while GridLAB-D is a good option to analyze power flow between nodes at the distribution level. However, similar to the development proposed in this paper, the approach developed in [
38] proposes a small-scale microgrid simulation implemented in LabVIEW software involving photovoltaic generation, wind generation, and energy storage integrated into a bus feeding power loads.
Diverging from the previously published approaches, this paper describes the development of a model for continuous simulation of a flexible architecture of hybrid microgrids integrating two DC buses and AC distribution. The main feature distinguishing the proposed simulation from those previously described is the simplicity of the used models, which are standardized to share power values as input and output variables. The programming of the block-based definition of the models allows the integration of multiple generators, energy storage units (ESU), and loads, configuring a control plant with a multiple-input multiple-output (MIMO) model able to apply different control approaches and validate its behavior. Additionally, because the model is focused on the real power flow, efficiency analysis of the microgrid can be easily derived.
The rest of the paper is organized as follows:
Section 2 presents a description of the hybrid microgrid architecture selected as a case study.
Section 3 details the modelling of the elements comprising the microgrid, and a detailed implementation description is presented in
Section 4. Simulation results for different operation scenarios are provided, validating the correctness of the computation and the usefulness of the simulation application, in
Section 5. Finally, conclusions and future work are summarized in
Section 6.
3. Modelling
The proposed model was built considering each component of the microgrid as a module with a mathematic model representing a power source or a power load. These modules were integrated through a generalized mathematic model of the microgrid buses and the control algorithms. For example, a battery module has a source behavior during the discharge process and a load behavior during the charging process, requiring that their model can consider bidirectional flow and different modes of operations. Similarly, although generators have a unidirectional power flow, they are composed of a chain of modules involving power production, efficiency profiles of the power converters, and the maximum power point tracking algorithms.
Mathematical expressions modelling different modules use numerical variables (taking values 0 and 1), allowing the configuration of different modes of operation. The sub-indexes and define the type of unit (PV: photovoltaic, WT: Wind, ES: Energy Storage), while denotes the bus in which a unit is connected (1, 2 or 3), defines the index if more than one unit of the same nature is connected to the same bus (1, 2, …), and allows the differentiation of functions for each unit (, , and , if required). Using these signals, an external decision algorithm can control the power given or absorbed by each module. Similarly, the power variables are defined using the same convention with an added sub-index to identify the power in a conversion chain (1, 2 and 3).
The block diagrams used within the paper consider the results of computations at the right side of the blocks from the values available at the left side and the parameters selecting the operation modes. If computations consider the output value also as an input, the value corresponding to the previous sampling period is used as an input. The modelling for all modules used in the simulation is presented below.
3.1. Modelling of the PVG
The power delivered by a PV generator depends on a chain composed by three modules: the solar panel, the maximum power point tracking (MPPT) algorithm, and one unidirectional DC–DC power converter. Integrated to a DC bus in the microgrid, each generator can operate in the three modes listed in
Table 1. In the modes 0 and 3, the generator is deactivated and its power contribution is zero. Operating in the mode 1, the PV module delivers the maximum available power, which is affected by the MPPT efficiency and the DC–DC converter efficiency. Contrarily, operating in the mode 2, the solar panel delivers a fraction of the available power, tracking an external power reference given by a superior level of the control hierarchy of the microgrid. In mode 2, the power delivered by the solar panels is affected only by the efficiency of the DC–DC converter, as the MPPT algorithm does not operate (in this mode the MPPT efficiency is settled to 100%).
3.1.1. Solar Panel Model
A general but simple model of a photovoltaic panel calculating the maximum output power for specific irradiance and temperature values is given by the following expression:
where
is the rated power of the PV module,
is the instantaneous irradiance,
is the irradiance reference (1000 W/m
2),
is the instantaneous temperature,
is the temperature reference (25 °C), and
is the maximum power correction factor for temperature, which takes values around −0.005, depending on the material employed to build the panel [
39].
is the nominal power of the generator applied for both the PV module and power converter. Then, for a set of environmental conditions, this model provides the value of the maximum allowable power which can be extracted either totally or partially.
3.1.2. MPPT Algorithm
Conventionally, the efficiency of the MPPT algorithms used in PV applications depends on the irradiance level or consequently on the extracted power. This efficiency value can range from 80% to 99.9% in the more active MPPT algorithms [
40,
41]. Then, the efficiency of the MPPT is represented as a function of the maximum allowable power provided by the model of the PV module. As mentioned previously, the efficiency of the MPPT is settled to 100% when operating in the limited power mode. The MPPT efficiency profile of the PV generators can be loaded separately for each generator or unified for all generators integrated to a DC bus. The efficiency profile is defined by means of the coefficients
and
of the first order polynomial in (2), which depends on the relationship between the available power
and the nominal power
.
3.1.3. DC–DC Converter
To integrate PV generators into a DC bus of the microgrid, at least one DC–DC conversion stage is required. Regardless of the studied bus, the efficiency profiles of the converters are represented using static gains defined by first-order polynomials depending on the converted power. These profiles can be obtained from the results of laboratory tests measuring the efficiency of the converter for different output power values. The efficiency profile is defined by means of the coefficients
and
of the expression in (3), which depends on the relationship between the extracted power
and the nominal power
.
At this point, it is also possible to compute the maximum power that can be provided by a PV generator in the mode 2 which corresponds to the maximum power at a defined operation point directly affected by the efficiency of the converter
. It is important to mention that the generator may be unable to provide the power defined by the external reference, in which case it will provide a power near to the maximum allowable.
The complete modelling of the PV generators is synthesized in Expressions (6)–(8) computing the output of each block.
is a power reference given by an outer loop regulating the bus voltage or by a superior layer in the hierarchical architecture of the microgrid control.
The resulting assembly of blocks conforming PV generators is depicted in
Figure 2, showing the causal flow of the required computations.
3.2. Modelling of the WTG
The power delivered by a wind generator depends on the chain composed of the following three modules: the wind turbine, the MPPT algorithm, and the power converter which is composed of an AC–DC stage and a DC–DC stage. The wind generator can operate in the modes listed in
Table 2. In the modes 0 and 3, the generator is deactivated and its power contribution is zero. In the MPPT mode (namely mode 1), the generator delivers the maximum available power, which is affected by the MPPT efficiency and the AC–DC–DC converter efficiency. Operating in the mode 2, the wind generator delivers a fraction of the available power, tracking an external power reference. In this mode, the power delivered is affected only by the efficiency of the AC–DC–DC converter.
3.2.1. Wind Turbine
The wind turbine static behavior can be modelled by the piece-wise function in Expression (9) defining the produced power as a function of the wind speed besides some parameters from the geometry and size of the turbine. The conventional model defining this curve requires the cut-in speed
, the nominal speed
and the cut-out speed
of the turbine as follows:
where
is the wind speed,
the air density,
the area swept by the rotor blades,
the power coefficient of the turbine, and
the nominal power [
42]. A simplified version of this model is obtained following the shape of the saturation function as follows:
where the resulting piecewise model is defined by the coordinates
and
.
3.2.2. MPPT Algorithm
The efficiency of the MPPT algorithms for wind generators depends on the wind speed or consequently depends on the extracted power. In a practical sense, the same algorithms used for PV generators can be used for wind turbines. The first order expression in (11) models the efficiency of that algorithm as a function of the rated power.
3.2.3. AC–DC–DC Converter
Low-power wind generators are commonly built integrating a Permanent Magnet Synchronous Generator (PMSG) to provide the conversion of mechanical energy into electrical energy. These generators have a three-phase AC output whose voltage and power depend on the wind speed and the connected load. Therefore, to integrate a wind generator into a DC bus of the microgrid, an AC–DC converter is required. The simpler topology is a two-stage power conversion chain composed by a three-phase diode bridge rectifier and a boost-type DC–DC converter, the second allowing the control of the extracted power. The efficiency profile is defined by means of the coefficients
and
of the first order polynomial in (12), which depends on the relationship between the extracted power
and the nominal power
.
At this point, it is possible also to compute the maximum power that can be provided by the WT generator in the mode 2, which corresponds to the maximum power at a defined operation point directly affected by the efficiency of the converter
. It is important to mention that the generator may be unable to provide the power defined by the external reference, in which case it will provide a power near to the maximum allowable.
The complete modelling of the WT generators can be synthesized in Expressions (15)–(17), computing the output of each block.
is a power reference given by an outer control loop.
By assembling the three described modules, the wind generators (WTG) are modelled as depicted in the block diagram presented in
Figure 3. Equivalent to the PV generators, the
x sub-index defines the bus in which the generator is connected, and the
n sub-index differentiates the generators connected to the same bus.
3.3. Modelling of the ESU
An Energy Storage Unit (ESU) is composed of a battery array and a bidirectional DC–DC converter which controls its charge/discharge regimes. An ESU can operate in the modes listed in
Table 3. In the modes 0 and 3, ESU is deactivated. In the mode 1, batteries are charging according to the external power reference given by control. The maximum power injected is normally defined as a percentage of the nominal capacity given in Amperes multiplied by the charging voltage. This mode can remain active until the battery is charged to a desired level. In the mode 2, batteries are discharged, injecting power into the bus in which the ESU is connected. In this mode, the amount of power delivered by the ESU is defined by an outer reference which can be used to establish the power balance on the bus.
3.3.1. Batteries
To model the ESU, the State of Energy (SoE) indicator is selected [
43]. As it can be shown in (18), the battery power is affected by the efficiency factor
into the integral term, which allows the establishment of the similitude with the previously defined models of the simulation. The SoE can be defined as:
3.3.2. Bidirectional DC–DC Converter
The bidirectional DC–DC converter used in the ESU can transfer power from the bus to the battery and from the battery to the bus. Normally, the charging process requires a predefined amount of power established by the charge regime (constant current or constant power), but it can also be made using a different amount of power if the ESU regulates the voltage of the bus. The efficiency profile of the converter is separately defined for each power flow direction, as normally the voltage level of the buses differs from the voltage level of the battery array. Then, simulation differentiates the efficiency profiles
and
for charging and discharging modes, respectively, using expressions with the form of (3). The complete modelling of the ESU can be synthesized in Expressions (19) and (20) computing the output of each block.
is a power reference given by an outer loop regulating charge and discharge processes.
By assembling the two described modules, an ESU is modelled as it is depicted in the block diagram presented in
Figure 4.
3.4. Modelling of the Power Consumption
The DC loads can be classified into three types: constant resistive load (CRL [
44]), constant current load (CCL [
45]), and constant power load (CPL [
46]). The AC loads are classified into resistive, inductive, capacitive, or nonlinear groups [
47]. The simulation considers the real power consumption of the loads in both DC and AC buses as a constant value that can suffer changes representing connection or disconnection of loads. The convention used by the model is
.
3.5. Modelling of the ILCs
The DC buses 1 and 2 can exchange power through the ILCs. Therefore, these converters are able to operate with bidirectional power flow. Considering voltage levels of the DC buses are regulated, the efficiency profile of these converters are defined by two curves with the form defined by (3). The possible modes of operation of this converter are listed in
Table 4. When the IFC is operating in mode 0, the DC buses of the microgrid are disconnected, which in fact decouples their operation. In the modes 1 and 2, the converter transfers power from one DC bus to the other.
The simulation differentiates the efficiency profiles
and
for different modes, respectively. The following set of expressions allows the computation of the power at both ports of one ILC.
where
and
are the power references given by an outer control loop to define the amount of power transferred by one ILC. Parameters
and
define the priority of the ILCs, indicating which of the two ports fixes the required or demanded power and allowing the computation of the power in the other port. A block diagram of the model of the ILCs is depicted in
Figure 5.
3.6. Modelling of the IFCs
The DC buses are connected to the AC side of the microgrid through the IFCs. These converters are able to operate with bidirectional power flow. However, when they operate connected to the auxiliary generator, the flow is limited to transfer power from the generator to the microgrid. As shown in
Table 5, these converters have four operation modes. When the converter is OFF, the AC loads can only be fed directly from the grid or the generator. When the IFCs are operating in stand-alone mode (mode 1), they feed the AC loads. In modes 2 and 3, the IFCs are connected to the auxiliary generator or to the grid, and they establish the power balance of the DC buses.
A conditional logic was designed to avoid other possible modes resulting from undesired combinations of the
values. The efficiency profiles of the IFCs are defined separately for operation in the two possible power directions. The efficiency profiles
and
have the form defined by Expression (3). The following set of expressions allows for the computation of the power at both ports of the IFCs.
where
is the power reference given by the control to define the amount of power transferred by the IFCs to or from a DC port and
is the power load fed at the AC side (see Expressions (25) and (26)). Parameter
indicates if one IFC is operating in SAC mode while parameters
and
define the priority of the ILCs, indicating which of the two ports fixes the demanded or delivered power. A block diagram of the model of the IFCs is depicted in
Figure 6.
3.7. Modelling of the DC Buses
The DC buses allow the interconnection of the generation, storage, and consumption units. Each DC bus also integrates the power injected or extracted by one IFC and two ILCs. The model of each bus computes the instantaneous power balance defined by the variable
providing information to define the references of the control. A block diagram of the model corresponding to the DC bus 1 is depicted in
Figure 7.
3.8. Modelling of the AC Side Interconnection
In the studied microgrid architecture, it is possible to feed the AC power consumption from three sources: the AC grid, an auxiliary fuel generator, and the DC buses through the IFCs operating in SAC mode. The presence of the AC grid and the auxiliary generator will determine if the AC load consumption
will be covered directly from them or indirectly through one or both of the IFCs. The following expressions allow modelling of the AC side of the microgrid:
The parameter
is defined as the sharing index taking values between zero and one and defines the percentage of contribution of the IFCs operating as SAC feeding the loads.
is an integer variable taking values into the set
and defining the operation of the IFC in SAC mode. The power of the AC sources is defined by:
Parameter
defines which AC source fed the loads.
Table 6 summarizes the connection/disconnection logic of the AC side.
A block diagram of the model of the AC side is depicted in
Figure 8.
3.9. Modes of Operation and Special Features of the Simulated Microgrid
By considering the multiple modes of operation of the different units of the microgrid, the whole operation can be configured, but is not limited to operate in the following modes:
Islanded/DC (ISL-DCO): There is no AC source and the microgrid cannot produce enough energy to feed the AC loads, feeding the DC loads as priority.
Islanded/SAC (ISL-SAC): There is no AC source but the local generation is enough to feed both the DC and AC loads.
Grid/Grid (GRD/GRD): In this case, the grid has good quality and shares power consumption with the microgrid, which transfers power through the IFC.
6. Conclusions
A flexible and simple model was proposed in this paper, allowing for the easy simulation of the power flow behavior for hybrid microgrids. The use of simplified models of solar panels, wind turbines, batteries, and loads and a binary logic to configure the operation of the microgrid allowed us to considerably reduce the computational cost of the simulation. Complementarily, the use of efficiency profiles to accurately model power-processing stages and MPPT algorithms increased the accuracy of the simulation without increasing its complexity, and allowed us to evaluate the efficiency of the entire microgrid for the studied scenarios and cases, providing elements to analyze how to improve the whole performance of the system. Simulated models were implemented in LabVIEW software.
Simple control rules ensuring power balances in DC and AC buses were used to test the functionality of the model in examples for three different scenarios (night and day operation having grid connection and islanding mode feeding AC loads) and three different cases in each of them, in which differences were introduced for power production and consumption. The power flow of the microgrid was analyzed from the power transferred by the IFC and ILC bidirectional converters.
As a relevant contribution to the study of microgrids, this simulation can operate as a model with input parameters and variables and output variables able to interact with other algorithms performing control functions. Moreover, the results showed the potentiality of the proposed model to serve as a plant to study the application of control algorithms in both educational and research environments.