1. Introduction
One of the great advantages of some renewable energies is the possibility of generating energy directly in the region where it is consumed, with great emphasis on solar photovoltaic and small wind generation. Thus, this context enables the use of renewable energy in a distributed way, where each consuming unit is able to produce energy for self-sustenance. Considering this new scenario, the concept of the microgrid (MG) appears as a key solution, enabling the guarantee of operational reliability of electrical systems and, at the same time, presenting cost economies to the consumer units [
1]. Microgrids are defined as “a cluster of loads and microsources operating as a single controllable system that provides energy and heat to their local area” [
2].
The energy management problem of microgrids is carried by units which have been progressively called microgrid central controllers (MGCCs), which are responsible for implementing different control strategies that ensure the adequate energy generation efficiency and also enhances economic concerns. Many different approaches of algorithms for MGCCs, especially the ones based on model predictive control (MPC) [
3] and its variants, are available in the literature [
4,
5,
6,
7,
8,
9,
10,
11,
12].
Recently, [
4] depicted the main state-of-the-art techniques of MPC applied to energy management in microgrids. In [
5], the development of an optimal control for renewable energy microgrids with hybrid energy storage system (ESS) is presented using a hybrid MPC [
6] aiming to maximize the economic benefit of the microgrid and to minimize the degradation causes of the storage systems. In other hand, the optimal load sharing of a renewable MG with hybrid ESS through an advanced optimization-based control technique is the research object in [
7]. A hierarchical MPC structure acting in different time scales aiming to optimize the economic profit and the electric vehicles charging procedure while ensuring the MG energy balance is discussed in [
8]. The formulation of a MPC controller for the optimal economical schedule of a MG system considering the combined heat and hydrogen has been presented in [
9]. In [
10], a comparison among three stochastic MPC techniques is of interest and effectiveness, performance, pros and cons are completely and strenuously discussed. The assurance of the closed-loop stability and recursive feasibility of a MG controlled by hybrid MPC using ellipsoidal terminal constraints and the Lyapunov decreasing condition is the main contribution of [
11]. Regarding the Brazilian energy scenario, many works related to sugarcane-based (ethanol and sugar producing) MGs have been published in the last years by the authors, with emphasis to [
12,
13]. In [
14], a MPC-based approach for grid-forming inverters in an islanded MG was proposed in order to define the optimal control actions that contemporarily track the desired reference signals and accounts for equality and inequality constraints. A hierarchical scheme consisting of two levels, voltage reference generation loop and voltage tracking loop, using finite control set-model predictive control (FCS-MPC) and applied for paralleled voltage source inverters (VSIs), was proposed in [
15].
In this work, the Brazilian energy market rules are taken into account. Recent modifications were proposed in order to modernize and give flexibility to the market rules in which two main topics are of most interest from the energy management point of view: (1) the white tariff and (2) the energy compensation trade. The white tariff was conceived as a way to stimulate consumption outside peak hours, allowing consumption profile planning. Through use of that tariff, some demand response programs can be used in order to optimize the consumer’s energy costs and flatten the consumption peaks. This tariff is divided into three well-known different fixed spots (off-peak, intermediate and peak) as described in the RN 414 of ANEEL [
16]. The energy compensation rule allows the units with energy production capacity to inject energy into the main grid in order to generate credits that can be consumed later. Thus, the grid can be used as a virtual stock (VS) of energy. In accordance with the new rules, the energy virtually stored in the main grid can be consumed in up to 36 months [
16]. Thus, the white tariff and compensation rules can be added to the algorithm of the MGCC in order to perform accurate economic energy management that explores all possibilities available in the market.
The proposed MGCC is based on a hybrid model predictive control (HMPC) strategy, once the microgrid and market operational rules were modeled using the mixed logical dynamical (MLD) framework. To the authors’ knowledge, a solution to this problem does not exist in the literature, as the type of compensation rules considered here have not been studied before, which characterizes this work as a key landmark in the Brazilian context. However, the solution is also applicable to other energy markets with compensation rules and fixed spot prices like the Brazilian market presented in the paper. Moreover, simulation tests with a high-fidelity model of a microgrid of the μGridLab of Federal University of Santa Catarina (Brazil) were carried out in order to illustrate the advantages of the MGCC using different scenarios—that is, to show how the MGCC can take benefits from the modeled rules and provide more suitable energy management actions.
Therefore, the main contributions of this work are: (i) the proposal of a new MGCC that takes into account the compensation rules in its optimization problem through the virtual stocks modeling framework; (ii) simulation tests with a high-fidelity model of a microgrid; (iii) a methodology that can be used to analyze and design MGCC in other energy markets with similar rules than the Brazilian ones. This work differs from the existing references in the sense that it is proposed a novel formulation for the spot market based in compensation rules. As explained above, it is a new market model applied in the Brazilian spot market, and there is no solution for this problem proposed in the existing literature. Note that this type of compensation energy system is not used in other countries, and classical solutions cannot be applied to optimize the operation of the microgrid.
The rest of this document is organized as follows: the Brazilian spot market rules, as well as the main ideas of the proposed solution and a description of the μGridLab microgrid, are given in
Section 2.
Section 3 presents the MG modeling and control algorithm.
Section 4 discusses the simulation results, and the paper ends with conclusions in
Section 5.
2. Spot Market Rules and Proposed Solution
This section presents the Brazilian spot market rules, as well as the main ideas of the proposed solution and a description of the μGridLab microgrid where the simulation study is developed.
2.1. Spot Market Rules
Recently, the Brazilian market rules changed and the so-called “white tariff”, which varies according to the time of day and penalizes the cost at peak times, became an interesting option for the users that produce and consume energy, the prosumers. Another important mechanism that has been created is the compensation rule, which allows the units with production capacity to inject energy to the main grid and use it with no purchase costs in other time periods when the load demand is bigger than the energy generation. These conditions allow small consumers, including those operating in low voltage networks, to generate their own energy and dispatch into the main grid autonomously, which creates an energy credit (compensation) that can be used (compensated) in up to 36 months [
16].
At this point, it is important for the reader to understand the concept of energy injection and compensation. On one hand, the first concept is, in essence, the excess of energy generated—in other words, the amount of energy that is not instantaneously consumed, but is dispatched/supplied/injected to the main grid. According to the market rules, this energy will result in a credit that can be consumed in the future. On the other hand, the energy compensation concept resides in the usage of this energy credit—for example, in periods where the consumption is greater than the energy production capacity.
We also stress that for one to take benefit out of this energy market scheme, the price of the produced energy should be equal or lower than the price of the credit in each tariff spot. Another characteristic of these rules is that in peak periods, the energy price is bigger than in the other spots, which adds a degree of freedom to produce more energy than needed and inject the excess into the grid in peak periods. Thus, this allows one to generate credits with high values that can be translated in a bigger amount of energy in off-peaks and intermediate spots because of the credit conversion factors.
However, the energy credits are computed by the electricity provider, and to take them into account in the MGCC, it is necessary to model the market rules in the form that they can be dealt in the optimization problem. To solve this issue, the concept of virtual stocks (VS) proposed in this work arises as a powerful tool that can represent with accuracy the market operation, adding better possibilities of decision to the MGCC.
It is important to note here that, as the Brazilian market is different from other markets (e.g., European markets), the Brazilian prosumer cannot have economic benefits by selling energy to the DSO (there is no possibility to sell the energy to the DSO); the only possibility is to convert the injected energy into credits to be used in the future. Another important difference is that energy prices do not oscillate daily and remain constant for weeks or months, thanks to most of the electricity generated coming from large-scale hydroelectric power plants that, in most of the cases, have storage capacities that guarantee the fixed spot prices.
The main contribution of this work is the proposal of a new MGCC that takes the compensation rules in its optimization problem into account through the virtual stocks modeling framework. This concept allows the MGCC take the advantage of deciding the optimal solution for the energy management over the prediction horizon using the rules of energy injection/compensation and the different conversion factors among the three tariff spots. The solution presented hereafter uses the Brazilian energy market as a use case, but it is important to bear in mind that the methodology discussed here can be applied to every energy market with similar rules.
2.1.1. White Tariff
According to [
17], in order to use the white tariff, a consumer unit must have the sum of the nominal powers of the transformers equal to or less than 112.5 kVA, which is the case of the μGridLab MG used as a case study in this paper. The white tariff is composed by 3 different spots, off-peak, intermediate and peak, and its costs are presented in
Table 1. These prices will be used as weights in the main grid cost function, as well as converter factors in the virtual stocks modeling, as explained in following sections.
2.1.2. Compensation Rules
Hereafter, the modeling of the compensation rules and its integration in the MGCC, which is the novel contribution of this paper, will be discussed. For such, the concept of the virtual stocks (VS) is introduced. The control objectives, the dynamic models and the operational constraints are proposed under the following assumptions:
Since there are three spots within the white tariff, three different VSs were proposed, one for each spot.
The energy stored in the VSs has a minimum value of zero and no maximum value constraint.
The energy injected to the grid at each tariff spot is stored in its respective VS.
The energy compensation occurs primarily in the respective tariff spot. In cases where the VS is depleted in its respective tariff spot, it is possible to use the energy of other VS. In this case, a conversion factor
given by the relation among the tariff spot prices is applied. This modeling approach is compatible with the energy compensation rules [
19].
The cost function to be minimized ponders the energy exchanged with the grid—this way, the main objective is to meet the produced energy with the demand as much as possible using the MG renewable sources.
The compensated power is the sum of all powers extracted from the VSs.
When the MG is using the compensated power, in other words, the energy from the VSs, it is not allowed to inject energy in the main grid.
The MG is only allowed to buy energy from the grid if there is no more energy available in the VSs.
The following sections aims to detail how the previous assumptions were implemented in the optimization problem.
2.2. Proposed Control Solution
In order to solve the presented problem, a MGCC composed of two hierarchical MPC levels is proposed. The high-level MGCC is responsible for the economic management of the micro-network and it is the focus of this work. It operates on a time scale of hours and determines the operation points for the lower level. The low level is responsible to ensure the energy balance of the MG following the targets defined by the high-level MGCC and it is out of the scope of this work. It operates on a time scale of minutes and guarantees the operation of the MG as close as possible to the economic optimum but allows eventual deviations from this point when necessary. For the design and tuning of the high-level MGCC, correct operation of the low-level MGCC is assumed. A schematic of how this strategy works is shown in
Figure 1.
The main objective of the high-level MGCC is to operate the MG attending the demands and obtaining the minimum operation cost. Note that the efficient operation of the microgrid has to consider not only direct costs associated to the energy consumption, but also other indirect costs related to the several equipment operations, as will be detailed in the formulation of the cost functions of each one of the MG components in
Section 3.
The manipulated (decision) variables of the high-level MGCC are the desired values (set-points/references) at each sample time of 15 min of the generated power, startup and shutdown of the dispatchable sources, the charge/discharge power of the storage systems, the power extracted/injected from/to the grid, and a set of variables related to the market rules and virtual stocks modeling, as depicted in
Section 3. Moreover, some of these variables can be continuous such as the generated power of a dispatchable source or the grid power, as well as binary—for example, the startup or shutdown operations of a dispatchable energy source.
The high-level MGCC is based on a hybrid model predictive control (HMPC) framework, which is an optimization-based control technique where the main goal is to minimize an objective function though a prediction horizon subjected to dynamic models and operational constraints. The term hybrid is used because the optimization problem has real and binary decision variables; in other words, it is a mixed integer optimization problem (MIOP). As in other MPC approaches, a receding horizon strategy is used, and only the first control action of the horizon is applied to the plant, recalculating the optimal solution at the next sample time with the new information available from the process [
4]. In a general form, the optimization problem proposed in this work is presented in Equation (1), where the objective function is the sum of dispatchable sources, external grid and storage systems cost functions expressed over the prediction horizon (
) and subjected to the dynamic models of the storage systems and virtual stocks
, to the dispatchable sources and storage systems operational constraints, and to the energy market rules and to the energy balance constraints (respectively,
and
). In this problem,
is the vector of all decision continuous and binary variables related to each equipment operation,
is the vector of state variables,
in Equations (1) and (2) represents the time and
represents the instant in the prediction horizon
. The detailed descriptions of all parts of the optimization problem are provided in
Section 3.
The general energy balance is presented in the following equation and aims to ensure that all produced energy at each time instant of the prediction horizon will be used by the loads, stored in the storage systems or injected in the grid. This is an equality constraint where the sum of the power of all network components must equal to zero:
where
is the number of loads,
is the number of non-dispatchable energy sources,
is the number of storage systems, and
is the number of dispatchable energy sources. The nomenclature
means the power of each MG component expressed by the sub-indices
.
Remark 1. The studied system has both AC and DC loads, but here, it was considered with a power factor near 1, and only the active power was used in the energy balance. Although this assumption simplifies the equations, it does not conceptually affect the results of the study.
2.3. GridLab Microgrid
The microgrid (MG) studied in this work is located in the μGridLab at the Federal University of Santa Catarina (Brazil) and is compound by a battery bank, a gas microturbine emulator, photovoltaic panels, a wind turbine emulator, DC loads and connection with the main grid, as can be seen in
Figure 2.
The battery bank consists of 10 lithium-ion battery modules (model Beckett 8224S) [
20] with approximately 3000 life cycles. The total capacity of the bank is 10 kWh and the charge and discharge powers are 5 kW and 10 kW, respectively. In order to simulate the behavior of a gas microturbine, the model Capstone C3 [
21] was developed, which is an emulator based on power electronics converters with an apparent power of 30 kVA.
The photovoltaic array consists of 10 panels (2 kW each), resulting in a maximum power of 20 kW. The wind turbine is emulated through the coupling of an electric motor and a generator with a capacity of 11 kW. The motor receives a profile to simulate the mechanical torque generated by the wind and the generator transforms the mechanical torque in an electric energy profile. The adjustable DC loads allow the reception of a power reference and can then vary between 0 and 35.5 kWh. The microgrid also has a connection to the main grid, which can be switched on and off, thus allowing operation in grid-connected and island modes.
4. Simulation Results
The simulations were developed in MATLAB software [
28], where the controllers were described using the YALMIP modeling language [
29] and the solver Gurobi [
30] was used. Real data referring to the year 2019 were used to generate the vectors of solar incidence, temperature and wind speed. The sampling time used for the MPC was 15 min and the prediction horizon adopted was 24 samples (equivalent to 6 h). The control horizon is equal to the prediction horizon since the optimization problem does not have severe temporal and processing constraints, considering the computation time of the solution (less than 1 s).
In this section, three different simulation scenarios are evaluated. The first scenario seeks to represent the nominal operating conditions of the μGridLab microgrid, while the second scenario analyses the results if there is a 50% increase in expected demand. Finally, in the third scenario, an island operation of the MG in nominal conditions is studied and compared to scenario 1.
4.1. Scenario 1
In this scenario, a one-day period simulation is performed to observe the results graphically and a complete month simulation (period of 30 days) is simulated with the intention of performing the monthly economic analysis.
Figure 5,
Figure 6,
Figure 7 and
Figure 8 show all the interesting variables during one day of operation. From
Figure 5, where the generated and demanded power (kW) are shown, it can be observed that in many periods, the MGCC chooses to use the microturbine to generate power. This is due to the low cost of the microturbine use (compared to the grid power exposed in
Figure 7b), thus, the controller prioritizes the energy generation through the microturbine instead of consuming power from the network. The microgrid also uses all generated power by the wind turbine and the PV (photovoltaic) panels. It is important to point out that in some periods of the day, the load demand is bigger than the generated power, but in these moments, as can be seen in
Figure 7b, the compensated power from grid helps to feed the loads.
Figure 6 shows the SOC (state of charge) and power in the batteries. As can be seen, the battery power presents some oscillations near the operating point, as the battery plays the role of aiding the system in damping the effect of the renewable energy variations and load changes so that the energy balance is guaranteed and the variation of the energy exchanged with the external grid is minimized. It is important to note that in the period between approximately 12 and 19 h, these oscillations are large, and are in accordance with the ones observed in the solar generation due to the strong presence of clouds, which causes abrupt variations of irradiation. On sunny days, it is not possible to observe this phenomenon. The constraints imposed in the controller ensure that the SOC is between 100% and 20% as recommended for the correct operation of the batteries.
Figure 7a shows the energy of the virtual stocks for the three tariff spots. Initially, the stocks have zero energy, so, it is assumed that in this scenario, there is no previous energy credit from previous months. This would be the case for the MG first month operation in the compensation system. It should be noted that in this scenario, there are several moments that happens the injection of energy for subsequent use. The energy injection at peak hours is the one that generates more offset credits.
The relationship between the compensated power, the grid power and the injected power in this scenario is shown in
Figure 7b. It can be seen that the controller does not choose to purchase power from the grid, but only compensates for credits obtained, since grid power is always negative, which means that the power is being injected into the grid. This fact can be explained by the high price of energy in relation to the energy generated by microturbine and renewable sources.
Figure 8 shows the value of the objective function during the first day of the scenario 1. As expected, the minimum values of the objective function occur in the period between 11 h and 19 h, where the microturbine is not operating most of the time and there is a peak in the photovoltaic generation as well as in the wind turbine.
With respect to economic costs, the one-day period of the obtained operating data is presented in the second column of
Table 3. It is noted that at the end of the day, there was an excess balance of compensated energy. The total operating cost of the microgrid during this day was R
$ 221.84, but a credit of R
$ 18.78 was generated for later use; this credit is calculated as the sum of the products between the power stored in each virtual store by its respective tariff (see
Table 1).
In order to analyze the monthly economic operation of this scenario, a simulation is performed for a period of 30 days under the same conditions, and the data referring to the first 30 days of the month of January 2019 were used. In this case, the operation data are presented in the third column of
Table 3.
Note that in this period, there was more energy injection than compensation; in addition, the MGCC has never decided to purchase energy once the compensated energy has zero cost. At the end of 30 days, there was R$ 19.57 of credit to be compensated in the upcoming months. The total cost of operation during the month considering the use of the battery and the turbine is R$ 8116.78.
For comparison purposes, the energy cost is calculated if all demand is supplied by the grid. In this case, the total operation cost is obtained by applying the cost of the conventional tariff to the energy demand (R$ 8755.27). This gives a 7.86% increasing in the energy bill with respect the distributed generators plus white tariff compensation system. Of course, the comparison with the use of the grid power only serves to give the reader a better perception of the values, since a rigorous economic analysis would have to take into account the purchase cost of the turbine, the wind generator and the PV panels. This analysis is disregarded in this work since the studied MG already has these components.
4.2. Scenario 2
As a second scenario to be analyzed, a 50% increase in energy demand is proposed. The curves obtained for this case have profiles similar to those obtained in the first scenario—this way, they will not be presented. In this case, simulating again the periods of 1 (one) day and 30 days give the operation data shown in
Table 4.
In fact, the MGCC behaves in an expected way as well in this more severe scenario, using all the power of the compensation system and virtual stocks in order to take advantage of the conversion factors among the spots and achieve a good economic efficiency. For comparative purposes, the equivalent cost of purchasing grid power for the 30 days’ case with a conventional tariff is R$ 12845.85. Thus, in this case, the proposed control strategy gives a 3.72 % reduction in the energy bill.
4.3. Scenario 3
Finally, in order to validate the controller and the sizing of the microgrid, a third scenario is simulated with the MG operating in islanded mode, which means without the connection to the power grid. The 1 (one) day and 30 days’ results are given in
Table 5 for the same loads as in scenario 1.
Here, it is possible to compare scenarios 1 and 3, and as expected, the MG is capable of operating in both modes. Analyzing
Table 3 and
Table 5, is it possible to conclude that the controller works more efficiently in the connected mode with a 4.76% reduction in the energy bill compared with the islanded mode. This happens because there is an extra economic element, the virtual stocks and compensation system, allowing more freedom in the optimization. The cost of battery use was lower in the island mode because the MGCC opted for the use of the turbine to assist in damping short-term oscillations.
5. Conclusions
This work proposed a MGCC strategy for simulation and control of microgrids considering the Brazilian energy compensation system. The Brazilian energy compensation rules are different from the ones used in other countries; thus, it is necessary to develop specific control strategies to take advantages of the particular processes and reduce the electricity bill. Therefore, the proposed MGCC considers in its formulation all the particularities of the local market and allows the user to take more profit of the installed EMS. The considered microgrids include renewable energy sources and conventional ones. The proposed strategy consisted of a MPC using mixed-integer programming, being the main contribution and innovation, the modeling and implementation of a set of virtual stocks that allow one to optimally manage the power consumption considering the Brazilian energy compensation rules. Through the analysis of the results, it is possible to conclude that the behavior of the proposed MGCC is in agreement with the expected one, taking management decisions that allow the operation of the microgrid in a more efficient way, reducing the energy bill in the studied scenarios. Although the obtained results were obtained in a particular microgrid, the methodology is general and can be applied to other microgrids and could also be simply adapted to other energy compensation systems. Regarding applicability, for companies selling EMS systems, the use of an advanced control system such as the one proposed here gives a competitive edge without increasing costs too much. On the other hand, users can reduce their energy bills and have faster payback. As for future works, the authors plan on implementation of a demand management layer and stochastic energy management techniques can be taken into account.