Optimal Demand Response Management of a Residential Microgrid Using Model Predictive Control

Demand response (DR) is an important factor contributing to achieve a balance between energy production and demand in Smart Grids. DR plays a key role in the use of residential energy allowing to improve the load management, electrical grid reliability, to reduce energy demand during peak hours and to minimize the use of energy in face of increasing energy prices. This article proposes a Model Predictive Control (MPC) strategy to manage the energy resources of a residential microgrid combined with DR techniques, such as load curtailment, that promotes short term reduction of electricity demand in pre-defined hours. In particular, the presented approach encompasses degradation issues of the Energy Storage System (ESS), the cost of the electricity, renewable energy generation, and other operational constraints. The developed control strategy is able to maximize microgrid economical benefit, while minimizing the degradation of the ESS, reducing electricity consumption during the day, and fulfilling the different operational constraints. The proposed strategy is validated in an experimental renewable-energy based microgrid platform for different climatic conditions. The obtained results demonstrate and verify the effectiveness of the proposed control and management strategy.

The fast increase of electrical energy demand due to the technological development of the electrical/electronic equipment in the last years and the constant changes in the price and market structure has caused several problems and challenges for the electrical grid. A considerable part of this demand occurs in the residential area which presents a variable consumption throughout the day with peaks when most homes use the electricity at the same time. Due to this, Demand Side Management (DSM) has assumed vital importance to improve demand management and efficient electricity consumption, seeking to achieve balance between utility and consumers through planning, scheduling, and monitoring activities of electric utilities, encouraging consumers to modify their level and pattern of electricity usage [1]. DR is a technique used in DSM which enables prosumers (consumers who also produce their own energy) to reduce their short term energy demand usually during periods of electric grid high stress in exchange for financial incentives [2], [3]. The use of DR combined with optimization and control techniques allows the development of alternative strategies that reduce the electricity bills [4]. Such strategies provide demand management through load curtailment, shifting or scheduling so that household appliances do not operate during peak periods of consumption looking for economic benefits without affecting the comfort of the prosumer [5], [6]. A successful implementation of DR actions aimed at DSM also improves the reliability of the electricity distribution system, making it less susceptible to fail [7]. Other advantage is that reducing electricity when demand is highest often results in lower wholesale prices. Moreover, as demand for power decreases, the use of low efficient and often more expensive forms of electricity generation can be reduced, which helps to keep energy costs in check.
DR has recently attracted the interest of several researchers and it has been approached from various viewpoints [8], [9]. However, some studies consider the DR approaches only at the simulation level, others highlight only the management of electrical loads or the economic benefits of buying and selling energy to the main grid, not taking into account the degradation of equipment and operational constraints of the entire system that are important challenges to be overcome in real applications. This article seeks to bridge this gap by combining load curtailment with MPC to manage the energy resources of a residential microgrid.
Considering optimization and control techniques, MPC is recognized as a popular control methodology from process industry that has been successful applied in microgrid management and control [10]- [12]. For example, an optimal design of hybrid renewable energy systems (HRES) to fulfill the domestic electricity need for a residential area based on MPC using HOMER tool to accomplish modeling and simulation, has been proposed by [13]. Recently, [14] proposes an MPC strategy for the energy management of a residential microgrid combined with a fault detection and isolation system which guarantees the operation of the system even in the presence of a power supply failure. In [15], an improved MPC scheme is developed and combined with a hybrid energy storage system for optimal power dispatch in a smart grid. In this study, a genetic algorithm (GA) is combined with a state space model (SSM) to achieve the MPC control seeking a minimal energy exchange between the power grid and the hybrid renewable energy storage system. In fact, MPC methodology has great potential for solving open problems in the field of energy management in microgrids by presenting, a simple structure that incorporates a feedback mechanism and allows the system to face uncertainty and disturbances. This control technique is able to handle physical constraints and thus can easily incorporate generation and demand forescast. Finally, MPC is based on future behavior of the system, which is a fundamental issue for developing models that depend on forescating demand and renewable energy generation such as DSM systems [16], [17].
There are several works in the literature using MPC to approach DR problems [18], [19]. In [20], a DR method based on MPC is proposed considering constraints on the peak shift effect and event-triggered mechanisms. Reference [21] presents a strategy based on MPC to achieve economic benefits for a set of houses using DR. In [22], It is proposed an adaptive MPC controller to automatically cover online coordination of DR and ESS facilities in a market-based wind integrated power system while avoiding violation of the network constraints and respecting DR users' preferences. Reference [23] presents a MPC strategy based on Evolutionary Algorithms (EA) for the optimal dispatch of renewable generation units and DR in a grid-tied hybrid system. However, from the authors' knowledge no paper proposes an integrated solution to solve all the challenges involving VOLUME 8, 2020 a real application that are fundamental for an efficient and satisfactory microgrid operation.
In this work, DR is accomplished by reducing electricity consumption through load curtailments in a residential microgrid. Such approach allows the specific removal or reduction of electrical loads for a limited periods of time. These periods are a priori accorded between prosumer and utility, and typically occur when prices are higher, avoiding overloads at peak hours and reducing the purchase of energy [24].
Load curtailment can satisfy both prosumer's needs and programs offered by utility companies. In general, such programs provide reduced electricity rates in exchange for an agreement to reduce energy consumption during periods of high load such as hot summer afternoons. With load curtailment, the prosumer has the ability to reduce consumption by turning off equipment or using alternative energy sources to achieve significant savings in energy purchase [25]. For the prosumer, the clear benefit is a reduced cost of energy in the near term and also in the future, by avoiding cost increases since, at least theoretically, the utility operates in a more efficient way. Moreover, if enough customers reduce their usage, the Distribution Systems Operator (DSO) will not have to add generation or purchase additional supplies on the spot market [26], [27].
In this context, this article presents a single integrated solution based on MPC combined with DSM, in specific DR, to cope with energy management, energy purchase/sale benefits, load management and equipment degradation. Based on the above cited works, the main contributions of this article are summarized as follows: 1) Develop a MPC controller able to optimally allocate energy resources of a residential microgrid, even in the presence of sudden disturbances, due to demand and renewable generation; 2) Propose a DR through load curtailments at pre-defined peak consumption times, providing benefits for prosumers and utilities; 3) Establish a DR integrated to an MPC formulation for calculating on-line optimal reference signals for energy management; 4) Maximize economic benefits of the microgrid ensuring lower energy exchange with the main grid; 5) Establish operational constraints considering manufacturers' parameters taking into account the degradation of the equipment and acquisition costs. The rest of the paper is organized as follows: Section II presents a description of the microgrid used in this study, detailing its components. Section III develops the theoretical formulation of the MPC controller. The experimental results of the proposed energy management system are discussed in Section IV. Finally, Section V outlines the conclusions and addresses future work.

II. DESCRIPTION OF THE MICROGRID
An experimental renewable-energy based microgrid platform is used to evaluate and test the proposed control strategy for residential energy management. This platform is installed at the University of Seville, Spain [28]. The microgrid is based on Renewable Energy Sources (RES), energy storage systems and electrical loads and allows to validate models in conditions similar to real world. Figure 1 illustrates the microgrid platform used at this study, highlighting its main components.
The renewable energy sources are photovoltaic panels and/or wind turbines that are replicated by a programmable power supply able to emulate the dynamic behavior of such systems. The storage units consist of two types of batteries (lead-acid and lithium-ion) and the demand is composed of electrical loads typically found in households. The loads profile is emulated by an electronic load. Additionally, the microgrid is connected to a main grid allowing energy purchase and sale. A schematic representation of the complete microgrid with the respective components is shown in Figure 2.
From Figure 2, all microgrid components are connected to a 48Vdc bus. This voltage is the same as the battery system and also the power electronic source, simplifying the topology since the lead-acid batteries are connected directly to the bus without a converter. According to [29], this strategy is common in DC microgrids since the batteries act to compensate system unbalancing, benefiting the installation by reducing costs and increasing availability. Note that the power exchange with the main grid is also electronically emulated. In this topology, the microgrid can operate either connected to the utility grid or as an isolated system. All components' technical specification is given in Table 1.
The adopted residential demand profile describes the consumption of a home located in southern region from Brazil. This profile contains the residential appliances (loads) described in Table 2. This consumption profile curve has been provided by Eletrobrás/Procel (state-owned energy company in Brazil) and It is a fundamental information for the orientation and planning of the actions of the Brazilian electric system [30], [31]. The total home consumption is given by the sum of all loads operating in a 24-hour period that under normal conditions (without load   curtailment) results in the demand profile illustrated by Figure 3. The considered tariff system is given by Copel Distribution S.A., a Brazilian electric energy company at Paraná State. There are several tariff modalities divided into groups according to the contracted voltage level. As this study addresses a residential microgrid, the considered regulation is the white tariff [32]. This tariff is characterized by different tariffs for electricity consumption according to the hours of use during the day and it is divided into three tariff ranges, according to the net metering policies established by the Brazilian Electric Energy Agency [33].
In this article, the MPC design and performance analysis take into account different climatic conditions to verify the

III. MODEL PREDICTIVE CONTROLLER FOR DSM
This section presents the problem statement and control objectives within the MPC formulation. The proposed energy management model must apply DSM techniques, specifically load curtailment, that results in benefits for utility. Thus the focus of the control strategy is ensuring the stable energy supply to prosumers even during demand variations due to load curtailment. Additionally, the control strategy encompasses VOLUME 8, 2020  constraints optimization methods to avoid damage to the ESS. The developed models are coded in MatLab R /Simulink and they describe the dynamic behaviors of storage systems, power main grid, renewable energy sources and loads.

A. CONTROL OBJECTIVE
Basically, the proposed MPC strategy aims to fulfill the following objectives: 1) Keep the power supply while ensuring operational stability of the residential microgrid during load curtailment. 2) Maximize prosumer's economic benefits by making more use of RES and batteries. 3) Perform demand reduction through load curtailment at pre-defined times, without compromising prosumer activities. 4) Prevent ESS against State of Charge (SOC) large fluctuation by avoiding deep discharging and overcharging. 5) Ensure lower energy exchange with the power main grid providing more operational autonomy to microgrid. Due to several microgrid operational constraints, some above cited objectives may be conflicting and other are complementary. Thus, to encompass such objectives while achieving the optimal allocation of energy resources, the MPC strategy aims mainly to manage sudden changes in energy supply and rapid variations in demand and also to avoid the intensive use of ESS.

B. CONTROL ARCHITECTURE
In this section, the control architecture is developed through three manipulated variables managing the system: the power exchange with the main grid P grid , the lithium-ion battery power PB li and P loads denoting the electrical power that fulfills the residential demand Pdem. The main control objective is to calculate the reference signals for such manipulated variables in order to deal with the difference between demand and generated energy by RES. The control architecture herein proposed is illustrated by Figure 6.
It is worthwhile to note that the addition of renewable energy sources through Pgen introduces disturbances to the control scheme, since power generated by such sources are depend on variable climatic conditions. Consequently, during operation, the MPC controller also maintains the desired outputs around a certain level of stored energy [SOCpb ref , SOCli ref ], thus guaranteeing charge/discharge availability. Notice that in order to implement the load curtailment procedure, variable P loads has been added to the MPC formulation. This new manipulated variable is associated to DR and it will be optimally calculated by the controller ensuring load curtailment when needed.

C. MICROGRID LINEAR MODEL
The use of linear MPC techniques requires obtaining a linear model of the system to be controlled around a working point (x * , y * ). A linear time-invariant (LTI) system described by the following state space representation is addressed where x(k) ∈ R n represent the system states, u(k) ∈ R m are the control actions, y(k) ∈ R p are the controlled variables, d(k) ∈ R nd is the disturbance and k represents the sampling times.
The dynamic model is obtained from the balance equations that model the evolution of the SOC of the batteries during the charge/discharge process, as described in [12]. The model parameters have been identified performing a set of experiments on the microgrid as shown in [34]. The continuous linear system is discretized using Tustin's method with a sampling time of Ts = 30 seconds.
, P loads (k)] T corresponds to the manipulated variables vector and d(k) = P gen (k) represents the system disturbance. Moreover, the model includes an additional variable related to the power of the lead-acid battery PB pb (k), which is not directly controlled since there is no dedicated power converter for this. Its control occurs indirectly through a balance equation that manages the energy excess or deficit at the DC bus. The equation fulfilling the energy balance in the DC bus can be expressed as where the renewable energy P gen (k) is given, the power exchanged by the lithium-ion battery PB li (k), the power main grid P grid (k) and the consumed power P loads (k) are resulted from the minimization of a cost function J , as it will be explained in the next sections.

D. OPERATIONAL CONSTRAINTS
A microgrid contains different components which have specific constraints that must be taken into account during its operation. The operating range for the energy storage system is limited by a conservative values for SOC pb and SOC li . This assumption, according to the manufacturers, avoids overcharging and undercharging that drastically reduce the useful life of the batteries. These bounds are given by The maximum and minimum consumption power of the set of residential loads are known, they are given in Table 2. Thus, their operational limits must comply with the values required by the demand. The lower value respects the operation of devices that are always turned on, such as refrigerator and freezer, i.e., Pload min = 0.06kW ≤ Pload ≤ 1.50kW = Pload max (6) For the grid main power, the amplitudes are set by the maximum allowed limit by the distribution company for residential supply, that is 75kW, according to [35]. Already the maximum and minimum limits to battery power are taken from manufacturer recommendations, they are given by Eq. 8. P grid,min ≤ P grid ≤ P grid,max PB li,min ≤ PB li ≤ PB li,max Regarding the power variations for loads, utility grid and battery power, we assume that they are electrically able to respond fast enough for problem requirements. Thus, the constraints are set as P grid,min ≤ P grid ≤ P grid,max (9) PB li,min ≤ PB li ≤ PB li,max (10) Pload min ≤ Pload ≤ Pload max (11) E. STATE OF CHARGE ESTIMATION As seen in Figure 6, the SOC of the batteries are the controlled variables of the system, which cannot be directly measured. However, there are some offline and online techniques that make possible to infer SOC values through some other measurable variables. In this work, an online estimation technique known as current integration is used, which calculates the SOC by measuring the battery current and integrating it in time, that results in the battery capacity (Ah), expressed by According to [12], the SOC can be computed through the relation between the battery capacity given by Eq. 12 and its maximum capacity C max,bat provided by the manufacturer: The Eq. 13 is used to calculate the SOC for the two types of batteries composing the microgrid herein addressed.

F. LOAD CURTAILMENT
In this work, the management of residential loads through DR is carried out by load curtailment, which pursues the reduction of electricity consumption during peak demand and/or other time period. These time periods are usually agreed between utility owner and consumers.
In this work, two limited time periods are considered for the load curtailment. They correspond to daily consumption peaks, which are for 5-8 hour AM and 5-9 hour PM. The choice of the loads for each curtail period assumes that load switching does not compromise the daily activities of the prosumer.
Two binary variables θ and σ are associated with each electrical appliance to be turned on or off by the curtail method: where t 1 init to t 1 end corresponds to the morning curtail interval and t 2 init to t 2 end is the curtail period in the evening. The equation describing the total residential demand is given by P dem (t) = Np t=1 P fdg (t) + P fzr (t) + P lgt (t) + θP a shw (t) VOLUME 8, 2020 Thus from Eq.14 and Eq. 15, when θ and/or σ assume the value ''0'', the electrical appliance is ''off'' and it does not impact the total demand, otherwise if the value is ''1'', the electrical appliance is ''on'' and its consumption is summed up in the residential demand. Figure 7 illustrates the residential demand with and without load curtailment, highlighting the pre-defined periods of action of θ and σ , respectively.

G. COST FUNCTION
As discussed in section III-A, the optimization problem aims to satisfy different objectives in a weighted manner to meet a common goal. How it is usually done, this problem is simplified to a monobjective equation through a weighted cost function. In this work, the objective function is given by the economic benefits of buying and selling energy avoiding the intensive use of ESS. As a result, the cost function J can be written as Thus, the optimization problem that must be solved by our MPC strategy corresponds to calculate the control signal u(k) = [P grid (k), PB li (k), P loads (k)] T minimizing the objective function presented in Eq. 17 at each time instant k, while fulfilling all operational constraints, i.e., Minimize P grid ,PB li ,P loads J (18) subject to ( 4) − (11).
For this, according to the MPC approach, the objective function J minimizes the quadratic norm of the error between the system output and the desired optimal profile while introducing the constraints on system states, control actions and controlled variables. As a result, considering the MPC formulation, a quadratic cost function can be written as, where, y is the system output sequence, u is the future control signal sequence, w is the sequence of the reference trajectory, and δ and λ are the weighting factors. In the following, each term of the cost function in Eq. 17 will be rewritten assuming the MPC formulation in Eq. 20, according to the control architecture presented in Fig. 6.

1) MAIN GRID COST FUNCTION
The cost function of the main grid is given by the economic benefits of buying and selling energy, i.e., thus, if ESS and renewable energy generation is not sufficient to fulfill the energy balance, the main grid is used. (t + k) represents the tariff system, which considers as regulation the white tariff [32].

2) ENERGY STORAGE SYSTEM (ESS) COST FUNCTION
The batteries degradation issues should be taken into account in the cost function since they reduce both batteries useful life. This useful life is extended as soon as the number of charge and discharge cycles of the batteries are minimized. Since the two batteries are different technology devices, the corresponding cost parcels at cost function must be different. Initially, the cost function parcels aiming to keep the energy storage at a desired levels and also to avoid intensive use of the batteries, are given by However, Eq. 22 and 23 do not take into account the operating cost of each battery. For this, two cost function parcels are introduced based on parameters provided by the manufacturers. The acquisition costs are also considered in these parcels. The parcel associated to the cost operation of lead-acid battery is taken from [36]. It corresponds to Eq. 24  [37]. and this parcel must be minimized. According to [37], [38], the cost function parcel corresponding to the operating cost of ion lithium batteries is given by where, CC bat refers to the acquisition cost, Cycles bat is the number of life cycles provided by the manufacturer, Vdc bus is the bus voltage, and η bat is the charging and discharging process efficiency. The PB pb and PB li are the power exchange with the Vdc bus . Finally, Cost degr is a factor penalizing the battery degradation process due to high stress in the charging and discharging process. Table 3 shows the parameter values used for each battery.

3) RESIDENTIAL LOADS COST FUNCTION
The cost function parcel corresponding to residential loads fulfills the required demand according to Eq. 16. This parcel is given by Eq. 26 allows to satisfy the residential demand of the prosumer and also to control the increment of the tracking power with a fast response without sudden changes.
The proposed strategy corresponds to the minimization of the cost function in Eq. 17 composed by all parcels detailed above. Each parcel contributes to the achievement of one of objectives presented in Subsection III-A. As discussed above, this minimization is carried out through a MPC approach in which each term of the cost function is rewritten as in Eq. 20 and summed up to compose the final cost function J must be minimized. For this, the controller must fulfill the energy balance, keeping the energy storage levels for both batteries and also preventing the components from intensive use. From Eq. 21 to Eq. 23 and Eq. 26, there are three sets of weights for each parcel of the final objective function: • δ− penalizes the error in reference tracking given flexibility to the microgrid operation; • α− weights the use of manipulated variables that directly affect the microgrid management by determining the priority of use of equipment; • λ− is a set of weights that protects the component from intensive use. Table 4 presents the values of each group of weight used in this work which were empirically obtained through various computational tests. The weights' choice defines the priority among the objectives.
As can be seen in the Table 4, the weights associated to the P grid are higher penalizing the power exchange with the main grid. A high weight has been also assigned to the SOC pb if compared with SOC li . It is necessary to set this variable to zero, in concordance with the physical constraints, since the lead-acid battery bank is not directly controlled due to the lack of a dedicated converter. Consequently, the weight δ associated with the lithium-ion batteries has a very low value giving more flexibility in power supply and α and λ are higher to protect the component against sudden changes thus preventing its degradation. Finally, higher values are chosen for electric loads weights giving a large penalty in the reference tracking while ensuring the required load supply and avoiding that sudden disturbances can affect the household appliances.
Finally, the values of the prediction horizon (Np), control horizon (Nu), and sampling time (Ts) from MPC approach are set based on the analysis of several experiments. It is worthwhile to note that increasing the control horizon or the prediction horizon does not result in improved outcomes. Thus, the chosen values for these variable are: Np = 6, Nu = 2 and Ts = 30s.

IV. EXPERIMENTAL RESULTS
In order to validate the proposed management and control strategy, some experiments are carried out using the experimental microgrid platform shown in Fig.1, to verify the performance of the MPC controller acting in conjunction with DR by monitoring the microgrid behavior during a period of 24h. The experiments are implemented in MatLab R /Simulink on a Core TM i7-4500U (2.40GHz) computer, 8GB of RAM with Windows 10 Professional, in which all operational parameters of microgrid components are described, as well as, the MPC controller. The controller is connected to the Programmable Logic Controller (PLC) of the microgrid.
The three presented experiments consider the same demand and two load curtailment periods during the day,  the renewable generation corresponds to power profile gathered from photovoltaic panels for a sunny (first experiment) and a cloudy (second experiment) day and from a wind turbine (third experiment). The reference value for the SOC of the batteries is 60%.
For all analyzed conditions, the MPC controller in conjunction with DR has effectively managed the energy in the residential microgrid using both storage systems, main grid power, renewable energy generation under different climate conditions, even in the presence of load curtailments. Figures 8 and 9 refer to the residential microgrid under MPC control but operating without curtailment, this scenario is used as a reference for comparative analysis.
The MPC controller satisfactorily performs the home energy management, respecting the limits established by the operational constraints. However, a considerable variation in the SOC of the ESSs occurs due to the consumption peaks and the large irradiation of a sunny day, mainly at midday. This variation is shown in Figure 8 and the used energy for all microgrids elements are seen Figure 9. It is possible to verify that overall required demand is satisfied. This demand is fulfilled by the combination of all microgrid energy sources, with the ESSs being responsible for the most of this supply, minimizing the use of the main grid. It is also worthwhile to note that during peak consumption, lead-acid batteries have presented a fast response that is complemented by the lithium-ion batteries so that it is not necessary to purchase energy. This microgrid behavior highlights the good controller performance which acts according to its designed purpose.

A. EXPERIMENTAL RESULTS FOR A SUNNY DAY
The evolution of the batteries SOC during a sunny day with load curtailment is illustrated by Fig. 10. A greater variation in the SOC of the lithium-ion batteries is observed due to the weight values in Eq. 23. These values give more freedom for charge/discharge operations allowing to store most of the photovoltaic power and almost reaching lithium-ion batteries operational constraints given by SOC li,max limit.
On the other hand, the SOC of the lead-acid batteries remains close to the reference value guided by the adjusted weights in the cost function given by Eq. 4. As expected, the lead-acid batteries present a fast response to the sudden change in consumption caused by DR.
Through Fig. 11, it is possible to verify that most of the power required by the demand is supplied by the lithium-ion batteries combined with main grid. Due to this excessive use of the ESS, most of the energy generated by photovoltaic panels is used to charge the lithium-ion battery. However with the increase of the renewable energy resulting from a sunny day, the controller decides to take advantage of the energy  peak and to sell the surplus power to main grid, assuming that the lead-acid batteries can supply the required demand. It is important to note that the reduction in electricity consumption occurs in the a priori defined hours, i.e. 5h-8h AM and 5h-9h PM through load curtailments thus the use of the main grid is diminished in these moments.
For all situations, the MPC controller has presented satisfactory performance, managing the energy balance in several points of operation during the day.

B. EXPERIMENTAL RESULTS FOR A CLOUDY DAY
The experiment using photovoltaic generation during a cloudy day sets up an energy deficit that directly impacts on microgrid behavior. Fig. 12 shows that the renewable power deficit affects the SOC of the batteries, forcing the ESSs to operate with low levels of storage. In fact, the MPC controller recognizes that the cost of purchasing energy from the main grid is very expensive and it drives the ESSs to be dependent on renewable sources.
As a result, even in presence of load curtailments the energy purchase from the main grid is reduced since the two ESSs are able to meet the required demand at the expense of low levels of storage and despite insufficient renewable generation. However, when photovoltaic panels provide higher power peaks in the mid-day, the controller charges the batteries in a balanced way, also selling power to main grid. This behavior is illustrated in Fig. 13. From this figure, it is possible to see that the power on a cloudy day presents large fluctuations (see Fig. 15) which are absorbed in great majority by the acid lead batteries. As a result, the lithium-ion batteries that are responsible for satisfying most of the required demand, do not perceive the sudden fluctuations.
These results show that even under severe conditions, the MPC controller acts to satisfy the objectives a priori defined by the cost function, exactly as it is designed for.

C. EXPERIMENTAL RESULTS FOR A WINDY DAY
In this experiment, the used renewable source is a wind turbine whose daily power profile is given in Fig. 5. Despite the presence of strong power fluctuations, the wind turbine supplies an average power value almost during all day. This fact is reflected in the SOC of the batteries that remains close to the established references during the whole experiment as can be noted at Fig. 14. A significant SOC variation only occurs at near the day end when the consumption is highest. This reduction in SOC variation may not be remarkable for a one-day analysis but, it can represent a big difference throughout the batteries useful life.
From Fig. 15, it can be seen that most of the required demand is fulfilled by the energy generated by the wind turbine, which contributes to minimize the use of ESSs and the power exchange with the main grid. The strong fluctuation of wind power is perceived by the lithium-ion batteries although  the lead-acid batteries compensate the sudden changes while supplying the demand.
Consequently, the effects of load curtailments are most evident on a windy day by reducing the purchase of the main grid in DR periods, which is a directly benefit to the prosumer.
In fact, the microgrid behavior during a windy day is successful. The MPC controller keeps the ESSs with small variations and ensures lower power exchange with main grid while fulfilling the required demand in accordance with the cost function optimization.
In this work, the analysis of the experimental results does not intend to evaluate the financial payback versus the investment cost, but only to show the economic advantages that could be achieved if the proposed solution is adopted. For all analyzed scenarios, with or without load curtailments and under different climatic conditions, the MPC controller combined with DR has satisfactorily performed, fulfilling the proposed objectives enclosed in the cost function and respecting the limits established by the operational constraints. Consequently, most of the energy supplied to satisfy the required demand in the various scenarios comes from the ESSs since the energy exchange with the main grid is minimized. Moreover, during all experiments the batteries have operated by minimizing intensive use in order to extend their useful life.
The DR strategy has demonstrated to be effective. A reduction of 20.4% at the electricity consumption during the pre-established periods has been attained for the residential loads given by the Eq. 16. Furthermore, this DR strategy proved to be applicable, allowing the prosumer to choose when the load curtailment will occur, the duration of curtailment periods and which electrical loads will participate benefiting prosumers and utilities. Moreover, this strategy has low complexity and it is easy to implement. Table 5 presents the economic results obtained for the four analyzed scenarios, highlighting the profit that can be achieved with the proposed control strategy.
For the same scenario, the reduction in consumption would provide greater benefits, however, it is evident that such economic benefits are dependent on climatic conditions, since a sunny day without load curtailment is more economically advantageous than a cloudy day with load curtailment. On the other hand, the greatest economic incentives for DSM are offered by utilities during summer, a period with high solar irradiation. It is precisely for these scenarios that the strategy of the management and control based on MPC combined with DR has achieved the greatest economic benefits to prosumers and utilities.
Finally, it is important to point out that the MPC controller has managed the microgrid in a wide range of operating points with only one set of weights, not being necessary to adapt these weights for the different addressed scenarios as it occurs in other works.

V. CONCLUSION
This article has proposed a MPC combined with DR for managing the energy resources of a residential microgrid, as well as, managing the operation of electrical loads. The model established a single integrated solution for the following issues: managing the different energy resources present in the microgrid in order to maximize the economic benefits; establishing load curtailments at pre-defined times and, minimizing intensive use of batteries increasing their useful life. The results were validated in an experimental renewable-energy based microgrid platform that provides conditions similar to the real world, which increased the challenge since a microgrid is composed of different components with distinct behaviors.
In this article, the management and control strategy was applied in a residential microgrid, however, this approach has the attractiveness of not depending on parameters such as the operational power of a component, consequently, this model can be applied in microgrids of different sizes.
The proposed MPC controller demonstrated to be able to effectively manage the energy in the residential microgrid. The required demand has been fulfilled while maximizing the economical benefits, minimizing the degradation and intensive use of ESSs by extending their useful life, reducing the energy exchange with the main grid, and respecting the operational constraints of the entire system. The DR contributed significantly to electricity consumption reduction, around 20.4% during peak hours, and also proved to be a profitable alternative for both prosumers and utilities. Thus, it can be concluded that the proposed management and control strategy combined with DR, in particular the load curtailment, can contribute to improving the energy management of microgrids including several components and electrical loads.
Future work will be focused on the integration of new strategies that can be combined with curtailment, such as shifting, to contribute to DR. We also intend to include other energy sources as hydrogen or other storage system such as super capacitor. Another open question is to analyze the possibility to include probabilistic constraints into MPC approach since microgrids operate with uncertainties in demand and renewable energy supply.