New real-time demand-side management approach for energy management systems

This study proposes a new demand-side management (DSM) technique, which is characterised by low computational requirements. The proposed technique relies on developing an operational matrix by the device local controller based on the device characteristics and the customer preferences. This matrix is sent to the energy management system (EMS) without the need to send any further information about the device or the customer preferences; then, the EMS chooses the optimal schedule for the device. To demonstrate the effectiveness of the proposed DSM technique, it is incorporated in an EMS that consists of three units controlled by a centralised microgrid controller (MGC). The three units managed by the MGC are the data collection and storage engine, the forecasting engine, and the optimisation engine. The EMS utilises the rolling horizon concept to manage real-time information and to provide the plug-and-play option for all controllable devices. Simulation results on a typical microgrid system show that the proposed DSM technique outperforms conventional DSM approaches in terms of the computational time.


Introduction
The recent advances in smart grids encouraged electric system operators to involve more renewable resources in the generation and to introduce the concept of managing the demand profile.This development in smart grid technologies will authorise consumers to participate in the decision making of their electricity consumption.This participation in decision making is the called demand-side management (DSM).DSM is the delineation, realisation, and control by grid operators in the form of strategies.The aim is to impact the use of electricity and advance or reconstruct the load curve by flattening the demand curve or optimise it for a specific desired pattern.DSM helps maintain a balance between supply and load to achieve reliable operation of the power grid.This provides a mean for the end user and appliances to realise the high cost and peak demand times and then, take actions in responses to that.Different load shaping objectives include peak clipping, valley filling, load shifting, strategic conservation, strategic load growth, and flexible load shape [1].From the consumer perspective, DSM allows the customers to optimally manage their loads and hence reduce their energy bills and overall consumption.This reflects on the demand profile, where the demand is reduced during peak hours, which benefit both the customers and utility.
DSM via controlling customers' equipment or direct load control is already implemented with many grid operators in North America, such as New York independent system operator (NYSO) [2] and Ontario independent electricity system operator (IESO) [3].However, in these cases, the DSM strategies have been adopted only during peak demands or in cases where the power system reliability is jeopardised.On the other hand, several DSM techniques have been proposed in the literature.Lujano-Rojas et al.
[4] propose a load management scheme that takes into account the purchase of energy from customers in a real-time pricing demand response (DR) program by optimising the benefits of the consumer and the retailer.The work in [5] introduces a scheme for the control of energy streams of a large group of residential customers using global and local controllers.
Authors in [6,7] introduce approaches that manage loads according to their priority, where the customers specify their priorities for different loads according to their preferences.
Different DR approaches are proposed in [8,9] to compensate the renewable resources variability and increase their integration.Zhang et al. [10] propose a multi-objective DR approach that utilises the non-dominated sorting genetic algorithm (GA) to develop the set of optimal solutions.Another approach is proposed in [11], which focuses on managing the household owned energy storage systems (ESSs).The approach proposed in [12] assumes 24 h scheduling of the next day with the objective of minimising the operation cost and the emission.A DSM approach is introduced in [13] focusing on the residential buildings with three different price schemes.Another strategy is proposed in [14] to manage ESS and load curtailments.The work presented in [15,16] proposes a dynamic pricing strategy to shift the loads with fixed demand profile.The work in [17] implemented a DR algorithm to minimise the cost of energy usage taking into account the load divergence limits, hourly load, and price forecast uncertainty.The work in [18] suggested a methodology for DR that considered the customers' preferences for the operation of specific appliances during peak hours by means of the analytic hierarchy process.
In all the work proposed in the DSM, the centralised controller, decentralised controllers, or aggregators have detailed information about the characteristics of the controlled equipment.These approaches have two limitations: i.Each equipment must have different datasets to be exchanged with the energy management system (EMS) performing the DSM, which also means that the DSM must introduce different characteristics of the controlled devices in the scheduling problem.To reduce the number of introduced parameters, grouping the loads based on their characteristics is a good solution, as in [7].However, a large set of groups is required to consider all controllable devices.ii.For a practical system with thousands of devices to be controlled, with few decision variables for each device, e.g. when to turn on or off, the EMS computational time will be significantly high, which limit the scalability of such systems.
To address these drawbacks, this work introduces a new DSM approach that limits the number of decision variables handled by the EMS.In addition, utilising the proposed DSM approach, the individual devices characteristics are stored in the local controller of the device rather the EMS database.
In addition, some of the proposed work, as in [19][20][21][22][23][24], assumed a day-ahead knowledge of the customers' requirements.However, in practice customer's preferences can change in real time.In addition, day-ahead-based approaches are not tailored to deal with the intermittent nature of renewable energy resources; whereas online measurements and calculations are more accurate resulting in more applicable strategies [25,26].Therefore, either the dayahead proposed approaches can be followed by a tuning stage in real time or they can be replaced with real-time approaches as in [27,28].
Thus, for the ease of practical implementation and real-time information management, a rolling time horizon (RTH) is utilised in this work to control the grid and customers' assets.In the proposed work, to demonstrate the new DSM technique, it is incorporated in an EMS of an islanded MG.
The contributions of this research work can be summarised as: • Develop a new generalised approach for DSM that takes into consideration the interaction between the customers and their appliances.The proposed DSM approach can be applied to any controllable device, where the possible operational schedules are generated locally.• Incorporate the proposed DSM in a centralised control scheme for optimal energy management in smart MGs based on RTH concept.• Provide analysis and comparison between exact solving and metaheuristic techniques for the optimisation unit.
The rest of the paper is organised as follows.Section 2 introduces the proposed generalised DSM approach and Section 3 presents the overall EMS architecture.Section 4 explains the problem formulation and Section 5 presents the test system.Section 6 discusses the optimisation unit solver and Section 7 summarises the performance evaluation of the simulation results.Finally, Section 8 concludes the proposed work.

Proposed generalised DSM approach
The home appliances consumption depends on the consumer's habits, which can be accommodated as explained in the following process.In this work, the uncontrollable appliances are supplied once initiated, while the controllable devices are the focus of the proposed DSM approach.Each controllable device has a local controller that stores the device information.The process of the proposed DSM is shown in Fig. 1 and can be explained as follows: Step 1: The device owner sends the preferred settings of operation to the local controller of the device.This is usually performed via a smart app.This step can be performed at any time of the day.Some examples of these settings can be the preferred starting and ending times of a washing machine or the preferred temperature range for an air-conditioned.
Step 2: All the local controllers in the system receive the RTH settings: the time step Δt and the operational horizon T w from the EMS.This step is essential to ensure that all controllable devices have the same general operational time settings.
Step 3: The local controller uses the RTH settings to set the size of the operational matrix (OM), which is (T W /Δt) × n o , where n o is the number of all possible schedules allowed to this device.
Step 4: In each time step Δt, the local controller uses the customer preferred settings to develop n o possible schedules for the corresponding smart appliance.These possible scenarios are translated to power consumption from the grid and are integrated in the OM.
Step 5: The EMS receives only the OMs from all local controllers of the smart appliance under its jurisdiction.
Step 6: The EMS decides the optimal schedule to be implemented for each device as described in the problem formulation in Section 4.
Step 7: Once this decision is made, the optimal operational matrix (OOM) is sent back to the local controller.The OOM has the same size as the OM; however, instead of n o schedules in the OM, the OOM contains only the optimal schedule while other options are cleared to zero to prevent any inconvenience or false operations.Note that, once the appliance local controller started applying the optimal schedule sent in the OMM, the OM is cleared in the next time steps and the device is assumed to be uncontrolled.
For example, assume a smart appliance has the following specifications: duration of operation 2 h, earliest start time set by user 7:00 pm, latest end time set by user 10:30 pm, T w = 3.5 h, Δt = 10 min, and n o = 10.Examples of the OM and OMM are shown in Table 1.Based on the different settings set by the customer and the EMS, the OM (on the left side in Table 1) for this appliance contains ten different options, shown as italic values in Table 1, which are sent to the EMS.
The EMS chooses only one option for the OOM, shown as bold values on the right side of Table 1.Then, the developed OOM is sent to local controllers of devices and stored.At anytime, the device can receive another OOM from the EMS that overwrites the stored one in case the EMS needs to tune the decision based on forecast or new requests.The OOM cannot be changed once the device starts operation, in this case on or after 7:30 pm (as shown in the chosen schedule in the OOM), where the device is treated as an uncontrolled device.

Overall EMS architecture
To demonstrate the effectiveness of the proposed DSM approach, it is incorporated in a centralised EMS of an islanded MG.In centralised control, the central controller is responsible for all decision making as in [29][30][31][32].This scheme increases the system security [33].While in the decentralised control, the decisions are taken via distributed local controllers as in [34][35][36], which improve system reliability.In this work, we focus on centralised EMS.The centralised EMS system consists of three units and the central MG controller (MGC) that in charge of managing the three units.The real-time operation process of the EMS is illustrated by six consequent phases that are shown in Fig. 2 and explained in the next subsections.The RTH with the structure and arrangement shown in Fig. 3 is employed to handle real-time data.As mentioned before, the RTH settings are the step size Δt and window width T w .In each time step, the six phases are carried out by the MGC.To be able to encompass future data about generation and demand, the MGC takes into consideration the window width T w as basis for future information and for developing operational schedules with a resolution Δt.In the final phase to complete a successful loop of the MGC, the optimal decisions are sent to the local controllers and the information is sent to the users.These decisions and information are stored in the local database (DB) of the equipment.This data is updated after every complete process, i.e. every time step Δt.In the cases of delays by the MGC units, communication delays, or failures, the local controllers will utilise the latest information stored in their local DB pending the MGC update their status again, which allow seamless operation.The three units of the EMS are explained as follows.

Forecasting unit
The EMS relies on RTH scheme to manage the real-time decision making in the EMS.This unit is fed by the generation and demand data from the DB; this is indicated as phase 2 in Fig. 2.Then, based on the RTH parameters that are sent by the MGC, the forecasting unit predicts the generation and demand for the period T w .The forecasting unit can use any traditional time series based technique or advanced forecasting technique.Phase 3 includes sending the forecasted information back to the data collection and storage unit to be stored in the DB.

Optimisation unit
The optimisation unit receives the current and forecasted information from the data collection and storage unit as phase 4. Thereafter, with the goal of decreasing the overall operating costs and increasing the customers' satisfaction by changing the droop parameters of DER, charging/discharging the BESS, and DSM.The unit solves the optimisation scheduling problem for the next T W /Δt time steps based on the RTH, as shown in Fig. 3.Then, the optimisation unit releases the optimal decisions to the data collection and storage unit in phase 5.

Problem formulation for the optimisation unit
The proposed scheduling problem is formulated as a mixed-integer non-linear programming, which is solved by the optimisation unit in Fig. 2. The objective function and the constraints are presented in the next subsections.All the notations used in this section are shown in Table 2.

Objective function
The objective function of the EMS is to minimise the total sum of the operating costs shown in (1).Since the MG is islanded, i.e. without grid connection, the operating costs for this system are the costs of energy from the dispatchable DGs operation as illustrated in (2).The array of the decision variables Z in (3) includes decisions related to the capacitor banks switching, curtailment power from PV units, BESS charging/discharging actions, the binary decision to select optimum schedule, and the no-load characteristics that decide the amount of the active and reactive powers from the generation units in the droop control

Constraints
Two sets of constraints can be defined as follows.

Equality constraints:
The near-optimal developed decisions must satisfy the active and reactive power balance constraints in (4) and (5).Moreover, the capacitor bank injected reactive power is proportional to the squared voltage magnitude as in (6), where the decision variable X i, t CAP controls the capacitor switching.The injected active power from the PV units can be curtailed according to (7), where X i, t PV represents the allowed fraction of the maximum generated active power to be injected to the grid.For the BESS, the decision variable for charging/discharging is X i, t BAT .The stored energy in the BESS is updated as in (8), while the charging/ discharging power is represented in terms of the kW capacity as in (9).The possible schedules of the controlled equipment in the OM are multiplied by a binary variable to select a single option.Hence, this binary variable should sum to one for each appliance e at each bus i as shown in ( 10) and (11).

P i, t
PV + P i, t DG + P i, t BAT − P i, t Two equality constraints of droop controlled characteristics are shown in (12) and (13).The two equations control the admissible frequency and voltage ranges.Values of the droop gains and frequency are selected according to the power sharing among different units.
4.2.2Inequality constraints: These constraints are used to limit the active, reactive, and apparent powers for the diesel generator and BESS as in ( 14) and (15).To avoid excessive thermal stress, output power is adjusted at a limited rate as given in (20).It is assumed that the local controller of the DG unit has the ability to follow the reference signal sent from the EMS while respecting the allowable ramp rates of the DG.The stored energy in the BESS is limited to the maximum allowable storage energy as in ( 16) and the amount of power transferred to or from the battery is limited by ( 17) Different sets of inequality constraints are required to limit the voltage, thermal limit, and system frequency, as in ( 18)-( 20).Moreover, limits on the no-load characteristics are added in ( 21) and ( 22), those values are decided from experience to be able to output the maximum generation from the units

Case study description
In this paper, three scenarios are presented.The first scenario represents the base case with no control.The second scenario is the day-ahead scheduling problem adopted in literature, where the forecasted generation/demand is assumed to be known day-ahead.
In addition, the energy prices are assumed to be known day-ahead, which is a reasonable assumption from the energy market perspective.The third scenario represents the proposed real-time EMS.The EMS and the proposed DSM approach are tested on the 38-bus system in [37].Fig. 4 shows the tested system.List of devices attached to this system is shown in Table 3.Two BESS units of 1 MW and 3 MWh ratings are located on buses 25 and 33.Five diesel DGs are located on buses 8, 12, 22, 25, and 29 with ratings and operating costs details in Table 3.Two 1 MW PV units are located on buses 10 and 37. Finally, 1 MVAR nominal rated capacitor bank is located on bus 18.
Droop control technique is used to control the DGs output power (droop-controlled units), in order to have stable frequency and voltage.The frequency allowed having only 1% tolerance of the nominal frequency.The voltage has limits of 0.9-1.1 p.u. range.
The BESS is a critical part of such a system.Batteries help preserve the power balance in the system with the renewable resources.It can absorb the excess power in the system and also recompense the generation shortage.Settings of the droop gain values used in this work are shown in Table 4. Values of droop gains are chosen and affected as a trade-off between power sharing and the system stability.However, the detailed calculations of these gains are not within the scope of this work and values are chosen such that to have a notable effect on the cost of each generator and the control system response to these prices.

Optimisation unit solver
For the optimisation unit to solve the scheduling problem every time step Δt, it can utilise two types of solvers.

Exact solver
The solver is this case relies on exact methods to find the optimal or near optimal solution.In this work, KNITRO Solver under GAMS environment is used.KNITRO performs both state-of-theart interior-point and active-set methods in solving non-linear optimisation problems [38].The simulation parameters are provided in Table 5.
The interior method or the barrier method replaces the nonlinear programming problem by a series of barrier sub-problems determined by a barrier parameter.The approach employs trust regions and a merit function to enhance the convergence.The algorithm carries out one or more minimisation steps on each barrier problem, then reduces the barrier parameter, and iterates the operation until the original problem has been solved to the desired accuracy.
In the active-set sequential linear-quadratic programming, the algorithm uses linear programming subproblems to estimate the active-set at each iteration.This active-set code may be preferable when a good initial point can be provided, for example, when solving a sequence of related problems [38,39].

Metaheuristic solver
Another option for the optimisation unit is to use a metaheuristic solver, which in this case is the well-known GA.The GA starts by generating a random population of initial solutions.Then, in each stage, the GA uses the existing generation to develop a new solution.The production of new solutions is done in different steps.The fitness values of each existing population are calculated and those values are then transformed into more applicable values.After that, some members are chosen as parents based on their fitness values, other individuals with the highest fitness are taken to the next population and those are called elite individuals.Offsprings are generated by mutation and crossover, where the new offsprings replace the existing population.The process is repeated until the stop criterion is met [40].The simulation parameters of the GA are provided in Table 5.

Results and discussions
This section presents and discusses the simulation results achieved by the implementation of the proposed control scheme on the case study described in the previous sections.We also evaluate the performance of the three scenarios.
The proposed control scheme is implemented using GAMS and MATLAB environments on a computer with 3.00 GHz Intel Xeon E3-1220V5 processor and 16 GB RAM.In this work, GAMS was used as the optimisation unit for the exact solver, while MATLAB optimisation toolbox has been used as the metaheuristic solver.In addition, MATLAB is used to host the database unit and the forecasting unit.MATLAB also hosts the MGC that controls the optimisation unit and then send the desired data to GAMS.

Exact solver results
For the exact solver, three cases are presented as follows.

Base case without control:
In this case, batteries are not controlled; thus, the sources of energy are the DGs and the PV only.Also, no scheduling is involved for smart appliances, i.e. all the appliances require an immediate operation.Therefore, one option only is provided by the local controller.The DGs are working according to the droop control parameters, which are set for equal power sharing and for keeping the voltage and frequency levels.The total cost of the energy consumption in this case per day is $2674.299.

Day-ahead case:
This case represents the day-ahead scheduling, which is adopted widely in the literature.The injected active powers from dispatchable DG and PV units are shown in Fig. 5.As shown in the figure, the DG units' droop parameters are controlled by the MGC, a way such that the cheapest DG injects first; then, the next cheapest is turned on when the cheaper DG injects up to full capacity.As shown in Table 3, DG1 and DG5 have the lowest operational cost followed by DG4.These three units with the PV units are enough to cover the demand till 10:10 am when the demand starts the peak period.Then, DG4 has to be turned on and DG2 has to be turned on during the peak time at 6:00 pm.
Fig. 6 shows the charging/discharging actions of the BESS.As shown, the BESS is charged during off-peak periods at a low rate to avoid turning on expensive DG units.Then, the BESS is discharged during peak times at around 12:00 pm and 8:00 pm.The total operational cost for one day is $2127.152for the day-ahead case, as shown in Table 6.The MG frequency for the day under study is shown in Fig. 7, which is mainly affected by the droop parameters, generation variations, and load variations.As shown in Fig. 7, the frequency successfully stayed within the specified limits.

Real-time control:
In the real-time case, the RTH is utilised.As in the previous case, the cheapest DG serves as a base for the generation, as shown in Fig. 8.The total daily operating cost is $2090.92,which is lower than the day-ahead case, as shown in Table 6.In Fig. 9, charging and discharging actions are much faster than the day-ahead case.This is due to the RTH, where the scheduling problem lacks the generation and load information beyond the moving window width.A longer time window would result in smoother BESS pattern, as the future generation and load profiles will be known for a longer horizon.However, this could be on the expenses of a longer time step (less resolution) as the number of variables in the scheduling problem would increase and the optimisation unit may not be able to solve it in the span of Δt.In the presented case, the BESS profile is based on the 3 h window, which slides and gives more information for the MGC to tune the BESS profile to achieve the lowest costs.The charging is performed at off-peak load periods and discharging is performed at peak-load periods, as shown in Fig. 9.The frequency variations in Fig. 10 for the real-time case are much faster compared to the smooth variation of the day-ahead case in Fig. 7.This is also due to the RTH and the fast changes by all DERs.
The computational time for a single step was found to be about 52 s on average, as shown in Table 7, which is suitable for implementing a time step of 2 min and above.
For the sake of comparison, the same case is repeated for the same number of devices and solved using the conventional approach in [41].The computational time for one step was found to be on average 152.3 s, which is almost three times the computational time of the proposed approach for the same system and the same number of devices.The reduction is due to the number of variables used in the problem to deal with the controllable devices.While the proposed approach utilises one integer variable for each device, the conventional approach utilises two variables: the start time and the consumed power, which lies between a minimum and a maximum.

Metaheuristic solver results
These results are obtained by utilising GA as a solver for the optimisation unit.As shown in Table 6 and Fig. 11, two aspects are affected, the obtained minimum cost and the computational time.Both the day-ahead and real-time cases have higher costs using the GA.The increases in the costs are in the range 3.2% for the dayahead and 4% for the real-time case.
On the other hand, there are significant reductions in the computational times, where it is reduced by 91% for the day-ahead case and 92% for the real-time case.In conclusion, the heuristic techniques have superiority in terms of the computational time, which is a very important aspect in realtime EMS.On the other hand, the exact solvers can generate an optimal solution and guarantee the optimality of the solution within a range.Similar conclusions are proven in [42].Thus, for a practical system, if the computational time of the exact solver is less than the required time step and communication delays with a safe margin, the exact solver should be implemented.However, if the exact solver computational time is close to or larger than the required time step, the heuristic solver can be used and provide a near optimal solution.

Conclusion
This paper proposes a new generalised DSM scheme that efficiently schedules the customers' devices to reduce the overall costs.The proposed DSM scheme relies on developing the possible operational schedules by the device local controller to reduce data exchange with the EMS; hence, reducing the number of decision variables and the computational time.
The proposed DSM approach is incorporated in an EMS for MG, where RTH is used to manage real-time data exchange and to update the control decisions based on the real-time and forecasted information.The EMS relies on three units: data storage unit, forecasting unit, and optimisation unit.
Simulation results on a typical smart microgrid prove the effectiveness of the proposed approach in reducing the computational time significantly compared to conventional DSM.The parameters of the time step and moving horizon are decided depending on how often the loads are plugged, required accuracy, hardware used by the EMS, and the maximum delay for new connected devices.The EMS operator must compromise between high accuracy and computational time when selecting the time window duration and the time step duration.
The metaheuristic solution is characterised by low computational time, which is useful for large systems and low time step.On the other hand, the exact solvers can provide a better solution with higher computational time.

Fig. 1
Fig. 1 Flow chart of the proposed approach

Fig. 5
Fig. 5 Generation from different sources for the day-ahead case

Fig. 6
Fig. 6 BESS and load profiles for the day-ahead case

Table 1
Sample of OM and OOM in kW OM developed by the local controller of the smart appliance OOM developed by the EMS

Table 4
Active and reactive droop gain settings DG number Active droop gain mp i, t , kW/Hz Reactive droop gain nq i, t , kVAR/Hz

Table 6
Exact and heuristic solutions Exact solver GA solver Day-ahead Real-time Day-ahead Real-time

Table 7
Comparison of the daily costs with the base case Base case Day-ahead Real-time IET Smart Grid, 2019, Vol. 2 Iss. 2, pp.183-191 This is an open access article published by the IET under the Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0/)