Closed-Loop Elastic Demand Control under Dynamic Pricing Program in Smart Microgrid Using Super Twisting Sliding Mode Controller

Electricity demand is rising due to industrialisation, population growth and economic development. To meet this rising electricity demand, towns are renovated by smart cities, where the internet of things enabled devices, communication technologies, dynamic pricing servers and renewable energy sources are integrated. Internet of things (IoT) refers to scenarios where network connectivity and computing capability is extended to objects, sensors and other items not normally considered computers. IoT allows these devices to generate, exchange and consume data without or with minimum human intervention. This integrated environment of smart cities maintains a balance between demand and supply. In this work, we proposed a closed-loop super twisting sliding mode controller (STSMC) to handle the uncertain and fluctuating load to maintain the balance between demand and supply persistently. Demand-side load management (DSLM) consists of agents-based demand response (DR) programs that are designed to control, change and shift the load usage pattern according to the price of the energy of a smart grid community. In smart grids, evolved DR programs are implemented which facilitate controlling of consumer demand by effective regulation services. The DSLM under price-based DR programs perform load shifting, peak clipping and valley filling to maintain the balance between demand and supply. We demonstrate a theoretical control approach for persistent demand control by dynamic price-based closed-loop STSMC. A renewable energy integrated microgrid scenario is discussed numerically to show that the demand of consumers can be controlled through STSMC, which regulates the electricity price to the DSLM agents of the smart grid community. The overall demand elasticity of the current study is represented by a first-order dynamic price generation model having a piece-wise linear price-based DR program. The simulation environment for this whole scenario is developed in MATLAB/Simulink. The simulations validate that the closed-loop price-based elastic demand control technique can trace down the generation of a renewable energy integrated microgrid.


Introduction
With industrialisation, population growth and economic development, the dependence on electricity is ever so increasing, and consequently, electricity consumption is on the hike. This increased electricity consumption causes a problem of energy scarcity and environmental degradation. The conventional grid is unable to solve such problems. Thus, smart grid is stimulated as a smart solution. The smart grid introduces novel ways of electricity generation, namely renewable energy. The smart cities in the smart grid accommodate renewable energy sources, the internet of things enabled devices, communication technologies and dynamic pricing servers to meet this rising electricity demand [1].
The electricity generation from renewable energy sources in smart cities employing internet of things enabled devices is drawing a lot of attention from researchers nowadays due to their environment-friendliness and sustainability. Moreover, due to the high electricity consumption of conventional devices and high operational costs of conventional generators, the internet of things enabled devices, and renewable energy generation is preferred [2]. Keeping in mind the advantages of renewable energy over fossil and radioactive fuel-based generation, renewable energy is integrated into microgrids to reduce dependence on the fossil fuel-based power grid, thereby, increasing energy efficiency. Carbon emissions (CO 2 ) are expected to reduce due to renewable energy integrated microgrids [3]. The energy balance of the system becomes more challenging due to wind and solar energy unavailability throughout the year. Therefore, a lot of work is required to address the dependability on fluctuating renewable energy integrated microgrids. In order to meet the demand of the consumers, balance has to be maintained or consequently consumers will face short term outages. To optimally balance the demand with supply, electric load forecasting is mandatory [4]. By installing demand-side load management (DSLM) in smart meters at consumers' premises, the system will get the demand response (DR) of a consumer which will help to adjust the energy demand with the fluctuating generation [5]. Researchers have also developed new techniques for two-way communication between consumer and supplier end in recent publications signifying closed-loop demand and generation control schemes.
By installing agents-based DSLM systems at the consumer end, consumer demand will become more predictable and deterministic in future smart grids [6,7]. Authors used classical controllers with heuristic approaches to control the frequency regulations for two area power systems [8]. However, the DR of the system is not considered. A sliding mode controller (SMC) is proposed for controlling of automatic generation of interconnected multi-area power systems for the deregulated scenario [9]. Multiple one inputs and outputs data-driven SMC problem of nonlinear discrete systems are presented [10], where authors used the non-parametric dynamic linearization technique and second-order sliding mode control law based on the proportional integration differential (PID) sliding surface to obtain much faster transient response and smaller steady-state tracking error. The chattering phenomenon is slightly reduced and also compared with other methods. Chattering is the phenomenon of finite frequency and finite amplitude oscillations found in the response of implementing sliding mode algorithm. Chattering is caused by the high frequency switching of the sliding mode controller exciting un-modulated dynamics in a closed-loop system. In addition, the optimal gains of SMC are determined through the gravitational search algorithm (GSA) [11]. Various literature are discussed on automatic generation control, however, demand control is not discussed by the authors [12]. An approach for tuning a feedback control system is presented [13], with a linear plant consisting of super twisting sliding mode controller (STSMC), which shows that chattering motion occurs when the linear plant is having greater than one degree. A closed-loop elastic demand control strategy based on dynamic pricing by proportional-integral (PI) controller was proposed [14], although the elastic demand is controlled after 5.5 h but the demand overshoots in the first 5.5 h after the start of simulations. This work contributes to the literature based on the identified research gaps, which is elaborated in the subsequent text.
In this study, we aim to control the elastic demand for future smart grids. For this, we discussed the problem of the elastic demand control and its automation through dynamic pricing and regulating it to the DR programs at the consumer's end. Then, a brief discussion is conducted on opportunities of closed-loop elastic demand control by employing a dynamic price of demand response programs. In addition, the STSMC is employed to control a closed-loop elastic demand to minimise energy balance error using dynamic energy price of demand response programs. The operation of the proposed model is briefly explained as dependence on a mismatch between demand and supply called closed-loop feedback error (balance error) where STSMC creates the pricing signal and drives the feedback error towards 0 in time. According to the control theory, a closed-loop control system is stable, if its balance error approaches to 0. Thus, in our case, closed-loop elastic demand control based on STSMC obtains energy balance by persistently broadcasting energy prices.
For simulations, we have developed a model in MATLAB/Simulink environment, which is composed of STMC and a dynamic pricing demand response model with feedback. The demand response model developed in Simulink is based on a first-order dynamic system with variable gain. The developed model has applied on an example smart microgrid integrated with renewable energy to control closed-loop elastic demand control for demand-side management. The efficacy of the proposed STMC-based model is validated by comparing it to the benchmark models based on PI controller, FOPI controller, FOPID controller and FOPD controller in terms of objectives. Simulation results illustrate that our proposed STSMC based closed demand control is affective to maintain energy balance while generation fluctuating in smart microgrids.
The structure of the paper is as follows: Section 2 describes related work and in Section 3 existing and proposed methods are discussed. Section 4 discussed proposed architecture. In Section 5, simulation results and formulation of scenarios are demonstrated. Finally, the paper is concluded in Section 6.

Related Work
In the literature, various techniques are implemented by researchers in recent years to control the demand of consumers on price-based demand models. Price-based DR models are presented [15,16]. A robust optimisation approach is presented for setting the short-term dynamic retail rates for an 22 asset-light retail energy providers. With this approach, the REP can decide how to participate in forward contracts and call options. In addition, REP can determine the optimal operation of the self-generation DG units [17]. DR for the consumers can be easily implemented through smart meters to solve the unbalance in generation and demand [18]. Flexible load control is developed which is based on the consumer DR for regulations in generation [19]. The efficiency of DR increased [20] by dividing it into three DR programs, i.e., natural DR (nDR), mandatory DR (mDR) and emergency DR (eDR). In literature [21], the author used a binary backtracking search algorithm with ZigBee, smart sockets and binary particle swarm optimisation to reduce energy consumption and electricity cost in peak hours. Authors proposed a model to minimise 10.25% cost by shifting and scheduling of different loads based on price [22]. In addition, by multi-objective particle swarm optimisation (MOPSO), emissions are reduced by charging penalties based on time. By using the model predictive control with pseudocode (M) [23], authors use a battery storage system with solar panels to reduce cost during peak hours. Authors provide a solution which is based on load scheduling and hybrid switch controlling to provide sustainable energy to consumers [24]. It also increased system efficiency and reduced cost of electricity concerning the demand of the customers. Using real-time pricing the consumers are forced to shift its loads towards the wind energy generation to reduce operational cost and per unit electricity cost [25]. An EV user behaviour simulator is introduced, which works in combination with an innovative smart distribution, locational and marginal price based on operation, to understand the influence of the dynamic energy pricing on both demand and supply side. The purpose of doing so is to understand the affect of dynamic pricing on the operation of the smart grid and the electric vehicle (EV) charging cost [26]. Consumer inconvenience caused by DR programs is reduced by mixed-integer linear programming (MILP) algorithm [27]. Using DSLM with the concept of load shifting technique, the author reduced overall peak load demand [28]. By shifting and load scheduling using a fuzzy logic controller with energy management algorithm (EMA), renewable energy generation from wind is increased by 2.5% and solar is increased by 2%. In addition, the fuel cell fuel consumption is reduced up to 4% annually [29]. Based on the operational history of industrial air separation units, the author in [30] presents a dynamic optimisation-based DR scheduling framework. The authors in [31] minimise heating ventilation air conditioning (HVAC) power intake using model-predictive-control (MPC) in peak hours without causing thermal convenience to the consumer and optimise the scheduling of battery which results in the decrease of monthly electricity bill. In generation uncertainty, flexible demand plays an essential role in the improvement of energy demand following generation and thus balancing the energy to some extent [32]. The response of load from DSLM will make the demand of the consumers more predictable and deterministic in near time for smart grids which is based on closed-loop systems with techniques like mild modified intrusive genetic algorithm (MMIGA) and cloud based infrastructure (CBI) [33][34][35]. In smart meters, the agents of the DSLM system can decrease the electricity bills of consumers at peak hours [36]. Authors with the help of a home energy management system, optimise the energy consumed by the appliances in a smart home [37]. Appliances are classified based on its operation priority to the consumer as elastic, inelastic, controllable, uncontrollable, interruptible, uninterruptible, delayable, etc. [38][39][40][41][42]. The related work in terms of techniques, models, objectives, results, and limitations is summerized in Table 1.

Existing Work and Proposed System Model
The performance of the integral controller (I), PI controller, PID controller and integral derivative controller (ID) are discussed whose parameters are tuned through the genetic algorithm (GA) through which generation is controlled [9]. The results are taken separately and then compared in terms of undershooting, overshooting and settling time of the deviations. Results have been taken with SMC for the same scenario which is better than the classical controllers. The generation from multiple source generation and DR of the consumer are discussed [43]. Here, the fractional-order classical PI and PID controllers are used for tracing the generation by demand of consumers under uncertain conditions. Although the demand traced the generation, there is a clear gap between both of them. In addition, a PI controller [14] is used for balancing the error or the mismatch between the generation and the consumers' demand. Consumers' demand is adjusted according to generation. The gap between the demand and generation [43] has become narrower [14] but the demand traced the generation after an overshoot for the first 5.5 h. The STSMC is unquestionably robust and accurate when deployed for stabilising nonlinear-systems. The STSMC has attracted the researcher community and gained a considerable research interest in the area of control. The results of various types of SMC are discussed in detail in the literature [44]. The Lyapunov function is proposed for SMC for the case when it is affected by bounded external perturbations and estimated the global finite time of stability [45,46]. Additionally, a global non-smooth Lyapunov function is proposed for SMC which is based on the combination of global exponential and finite-time stability of switched systems [47]. Related discussions for the SMC on the similar topics can also be found [48][49][50]. A step by step SMC is used for an application in robotics and aerospace [51,52].

Overview of Fractional Order Proportional Integral (FOPI) Controller
The replacement of the integral and derivative operators of the classical PI controller leads to a controller called fractional order PI controller. The application of real order for the integral and derivative operators is the significant foundation of fractional calculus. Numerous descriptions exist in the literature for the FO derivative, but an FOPI controller proposed for the closed-loop elastic demand control is employed [43]. In addition, for the other versions of classical controllers, replacing the operators for the integrals and derivative will lead to the formation of fractional order controller for the respective controller. Block diagram of using FOPI controller in simulations for closed-loop demand control is illustrated in Figure 1.
The transfer function for the version of FOPI controller commonly written as: where, K p is the proportional gain coefficient, K i is the integral gain coefficient and the parameter λ is the fractional integrator order. A fourth order integer order (FOIO) approximation of FO integration by adopting the well known Continued Fractional Expansion (CFE) method [43].

Overview of Proportional Integral Derivative (PID) Controller
The PID control loop mechanism is the best possible solution for minimising the online and unknown faults in real time operations. Applications of the PID controller in industry is to access the single fine grained measurements for the improvement of the closed-loop operations. Tuning of the coefficients of PID controller is a challenging step for the researcher and in itself has a wide area of research. For simplicity of the controller, we used the coefficients' values used for tuning the coefficients of the PID controller [43]. Block diagram of using PID controller in simulations for closed-loop demand control is illustrated in Figure 2. PIDs have 3 coefficients; K p , K i and K d . Where K p is the proportional gain constant, K i is the integral gain constant, K d is the derivative gain constant and e is the error defined as the difference between the set-point and the process variable value. The relation of I/O of an ideal relation for the PID controller in s domain is given as:

Overview of Proportional Integral (PI) Controller
In closed-loop industrial processes, the combination of proportional and integral gains is the most widely used classical controller which plays vital role in balancing of level, flow, pressure and other such like industrial process variables that do not involve too much delays. While balancing the industrial plant problems, the PI controller still has problems that inherit with the controller actions. Usually there is high overshoot, initial value and a greater response time of using PI controller for a larger load demand. The author used a PI controller for elastic demand control [14]. There is an overshoot for the first 5.5 h in consumers' demand which results in the lack of supply of energy at the consumers' end. PI controller takes long stabilisation time with overshoot while dealing high variations in the system which effects the system stability at the start of process. A conventional PI controller has 2 gain coefficients, K p and K i . K p is known as the proportional coefficient while K i is the integral coefficient of the PI controller. The relation of I/O of a PI controller can be written as: where e is the error signal in negative feedback closed-loop system. Block diagram of using PI controller in simulations for closed-loop demand control is illustrated in Figure 3.

Overview of Fractional Order Proportional Derivative (FOPD) Controller
A specific form of the most common fractional order PID control where I and fractional operator of I is equal to zero which forms a fractional order proportional derivative controller. The relation of I/O for the FOPD controller is commonly written as; where K p is the proportional coefficient and K d is derivative coefficient value of FOPD controller having α as fractional operator. Block diagram of using FOPD controller in simulations for closed-loop demand control is illustrated in Figure 4.

Super Twisting Sliding Mode Controller Proposed for Closed-Loop Elastic Demand Control
The STSMC algorithm is used for the control of the uncertainty of the linear plants to determine the robustness [53,54]. STSMC u(t) is given as follows: where, e is the error signal, K 1 , K 2 , K 3 are the parameters of the STSMC and sign is a function used to reduce the chattering phenomenon in STSMC. These parameters are tuned for the purpose to obtain optimal results. One of the applications of STSMC is controlling nonlinear uncertain systems. STSMC has 3 coefficients; K 1 is the proportional control design constant, K 2 should be ranging between [0 1] and K 3 is the integral control design constant. As in this case, there is an inverse relationship between the price and demand of the system that is why the values of K 1 and K 3 should be negative, to gain energy balance.

Proposed System Model
The purpose of this work is to set up tuning rules for achieving an a priori nominative settling time for planar systems. The feedback of the system is formed by using the STSMC to estimate one of the states. States which are estimated and measured, are then used by the STSMC for tuning in the presence of external disruption. We propose STSMC in this work because of its robustness and accuracy. The proposed STSMC technique narrows down the gap and the demand traces the generation profile in an optimal manner. This work is the continuation of our earlier conference paper [55]. With the increase in population, the energy demand has drastically increased. To cope with this increased electricity demand, the distribution system operator provides DR programs. In literature, various DR programs exist like price-based DR programs, and incentives-based DR programs to motivate consumers to take part in demand side management [5]. In this work, we use dynamic energy pricing which is one of the price-based DR programs. Energy must be supplied for operations in real-time in case there is a change in generation from the supply side. Therefore, we have to control the demand of consumers according to generation to ensure the supply of energy in intermittent conditions. The proposed model is shown in Figure 5. It comprises of the supply side, dynamic price generation server and DSLM. The supply for the proposed model is fluctuating renewable energy that will be supplied from a local renewable energy grid station with a utility bulk power supply which is used as a backup source. This bulk electricity from utility will be supplied when the generation from renewable energy is deficient. The renewable energy supply profile values are taken from [56] as shown in Figure 6, which is increased from kWh to MWh because the smart microgrid considered in this work is serving highly dense residential, commercial and industrial sector, where consumers demand is high and required more energy. In addition, generation values were increased to MWh level for fair evaluation of our proposed model and scenario built for the simulation purpose. Wind and solar energies have taken for the production of renewable energy at the local microgrid along with bulk utility supply from transmission lines. The dynamic price generation server comprises of the following main components; • A power system that consists of generation, transmission lines and distribution system. • A communication system between the supply side and the demand side. This communication is done through power lines, modems, routers, wireless technologies, etc.

•
An STSMC which originates a price signal based on the mismatch between the instant demand and generation.
The error signal feeding in to STSMC can be expressed through Equation (8); where G(t) is the instant generation and Do(t) is the instant demand of the consumer which feedback to the system again numerically given by the mismatch between the instant demand and the instant generation known as error (e) into the STSMC.
The following equation is taken as elastic DR model function with time constant τ of consumer load response [14].
In Equation (9), Do(t) refers to the demand of consumers at any instant of time and D(p) refers to the price DR function of a market which is taken here as piece-wise-linear function. There is also a delay L P in broadcasting the price signal to the DSLM system's agents at the demand side and its response to the price signal. Dynamic electricity pricing and the DR to it will make the demand of consumer easy to predict in smart grid for the short term. It is the basic principle of the market that when the price of something increases automatically, the demand of it decreases drastically. Based on this principle of the market, this whole system is designed for elastic demand control. The price demand model is designed in such a way that it has a high demand D H of a consumer which has to be provided and low demand D L that is provided from the utility bulk energy system. Price-based demand model consists of the following properties; 1.
There are always limited consumers to which the electricity has to be supplied. We assume that for a low price P L of electricity there must be D H of the consumer. Therefore, DSLM shifts all the load of consumers to that point where electricity price is low. At (P L , D H ) the demand elasticity deteriorates as defined in Figure 7.

2.
As there are critical loads, electricity must be supplied to them even at a high price P H . Therefore, the demand of consumers will be low at this point (P H , D L ) and demand elasticity also deteriorates at this point.

3.
In the range between P H and P L , demand condition is elastic. When the pricing signal is between these two points, the demand of consumers will depend upon the pricing signal. The elasticity of demand in this region is determined as shown in Equation (10); In Equation (10), the elastic demand value ranges between 0 and 1. Value close to zero indicates that there is elasticity in the demand. Values close to 1 means that there is no elasticity in consumer demand. In [14], the following piece-wise-linear function for price-based DR is estimated by considering Figure 7; By taking Laplace transform of Equation (9), we obtain Equation (12) for the instant demand of the consumers which is composed of the elastic demand function and transfer function; The price varying first-order dynamic equation for the overall demand of consumers' response of electricity market models is the above equation. There are uncertain conditions sometimes at the demand side where the demand increases or decreases abruptly. In these cases, the grid can reduce uncertainty and make the DR of consumer easy to predict. In simulations, this uncertainty factor was added through generating random numbers in the overall DR to make the simulation more realistic and similar to operations taking place in smart grids. Figure 13 shows overall renewable energy generation profile.

Simulations and Discussion
For simulations, MATLAB/Simulink is used for creating the overall environment for the proposed model and to implement the closed-loop elastic demand control. The block diagram of the simulations is shown in Figure 8. STSMC is used to adjust the prices of electricity in the local market. This controller has 3 control design coefficients and is configured to get the DR of the consumer. There are 3 gains of STSMC: K1, K2 and K3. K1 is the proportional control design, K2 should be between 0 and 1 and K3 is the integral control design constant.

Step Response Analysis
The step response of the closed-loop elastic demand control for energy market simulation is demonstrated in Figure 9 using various coefficients.
Step response of the system is considered for the sharp rise and fall in the generation. For getting the DR of the system, whenever, there is a sharp rise or sharp fall in the generation which is due to fluctuating renewable energy, we have to get DR of the proposed model in the form of a step generation signal. For this purpose, the step generation signal is passed through the STSMC and we get the demand and price response through various coefficients of the STSMC. Figures 10 and 11 show the block diagram of the simulation formulated for getting demand and price response from the various generation input to the closed-loop system. The MATLAB/Simulink simulation model consists of a delay L P = 36 s, piece-wise-linear price demand function, and time constant as τ = 1 h.
As a result of the inverse relationship between demand and price, the coefficients K1 and K3 of the STSMC are tuned negative. K2 will be between 0 and 1. Figure 9 shows the result of demand and price response of the system using various coefficient values of STSMC. Demand and price response, which we get through changing the coefficients of STSMC, which are according to our desired output, are used later on in the simulation environment which is created for the whole scenario shown in Figure 5. In Table 2, coefficient values used for PI, FOPI, PID, FOPD and STSMC controllers are presented. The coefficients' values of PI, FOPI and PID controllers were taken from [14,43] and for STSMC, we have selected those coefficients' values which give better response as shown in Figure 9.
For the response of demand and price to a step generation signal as an input using the STSMC, classical and fractional order controllers are shown in Figure 10. PI controller, which has gain coefficients K P and K I , where K P is the proportional gain and K I is the integral gain of the PI controller. The coefficient values for PI controller are taken negatively because of the inverse proportion between demand and price of electricity [14]. Thus, values of K P = −1 and K I = −2 are taken. The results from the STSMC, classical and fractional order controllers mapped to a step generation signal validate that STSMC is more robust and accurate having lesser transient response, whereas other controllers overshoot at the start of the simulations.

Scenario: Demand and Price Response of the System
In this section, there is a scenario created for closed-loop elastic demand control for which the MATLAB/Simulink model is formulated. The block diagram for the simulations is shown in Figure 11. In the simulation scenario, the energy generation profile is composed of wind and solar energy from renewable energy generation local grid Do MAX as well as bulk utility supply from the transmission system (T S ) of the grid. Energy from (T R ) and (T S ) can be written as Equation (13); where Do is the local demand and is considered the elastic demand. There is also a high demand (D H ) and a low demand (D L ) in a scenario for which the price response and DR are approximated through the piecewise linear function as mentioned in the Equation (11). The supply from the grid and renewable energy generation can be conceived as to make up for the electricity shortages when the demand of consumers is low. However, there will also be critical loads to which the electricity has to be supplied even in the inefficient hours when there is zero renewable energy generation from the local grid. Therefore, the minimum local demand can be planned as shown in Equation (14); To avoid the excessive energy generation and to cut down the expenses of the production of energy, there is a limit which is equivalent to the maximum demand of the consumer that cannot be exceeded during the supply of energy. This can be represented as shown in Equation (15); For the maximum efficiency and reliable utilisation of the renewable energy generation, the overall generation and minimum and maximum local demand of the consumer can be planned as shown in Equation (16); In Equation (11), for the piece-wise linear-demand function, the upper bound is denoted by Do MAX and the lower bound of the demand is considered as Do MI N , respectively. Now, for the low demand or critical loads when there is no supply from renewable energy local grid, then the supply to the consumer can be planned as Do MI N = (T S ), to ensure uninterrupted supply to the consumer. For the continuous supply from the renewable energy local grid, the Do MAX of the consumer is planned as Do MAX = (T R ) +(T S ). Now, to meet the requirement of the consumer and to cut down the additional expenses of the operational costs, the renewable energy generation for this scenario can be planned as in Equation (17); Equation (17) refers to the renewable energy generation for the closed-loop elastic demand control.
For the formulation of piece-wise-linear function for the closed-loop elastic demand model, the price of the electricity and demand of the consumer for 24 h is taken from [53] and has been scaled to MWh level and shown in Figure 12. The price and demand data are combined time independently and a data set was formed (P i , D i ) for i = 1, 2, 3, ... , 24. When this data set is formed in [54], the values which are not in accordance with our piece-wise linear-demand function are excluded through Equation (18): The elastic demand control of the system is estimated to price using a piece-wise-linear function. The demand function of the system is as follows in Equation (19): In Equation (12), for the high price of energy there will be low demand of the consumer and also for the low price the consumer will try to use much energy and the demand will be high. This piece-wise-linear function is formulated keeping in mind the general principle of energy market. This piece-wise demand function is designed for the closed-loop elastic DR and states that when the price of electricity is low, then there will be high demand of consumers and when the price of the electricity is high, then the demand of the consumer is low, depending on the price signal coming from the STSMC. The piece-wise-linear function formed for the price DR is shown in Figure 13.
Equation (19) is used as the price demand model in the overall simulation of the system. In Equation (19), the Do MAX = 90, which will be supplied to the consumer when the price signal P L is below or equal to 0.35 and for the price signal P H higher than 4, then the demand of the consumer will be Do MI N = 72 according to the piece-wise linear-demand function. The T R can be planned as T R = 90 MWh−72 MWh. As 72 MWh of energy is supplied from the transmission lines and the overall demand is 90 MWh, so the T R can be planned as 18 MWh which is produced at local microgrid and numerically shown in Equation (15). The overall DR of the system is represented numerically in Equation (12).

Closed-Loop Elastic Demand Control Using PI Controller
PI controllers have 2 control coefficients K p and K i . The values for the coefficients were given manually and both the values were kept negative because of the inverse relation between demand and price of energy. Figure 14a shows 60 h of simulation result, in which generation is being traced by the demand of consumer. Figure 14b shows the price of energy which is regulated to the smart meters at the consumer end through which DSLM adjust the load of consumer and increases and decreases the demand according to the pricing signal regulated by the PI controller. Getting response for the system by using PI controller, there is a strong tendency of getting an overshoot at the start [14]. Although the demand traced the generation effectively, the tracing time is greater as compared to the STSMC. There is an overshoot at the start of the simulation before generation was traced by the demand. This overshoot at the start can blackout at the consumer end, because of the unavailability of the energy at the start. The DR of the system using the PI controller before the tracing of demand is as high as 90 MWh and the generation in this region is not this much, which means lack of power at the consumer end during the overshoot time which is 5.5 h [14].

Closed-Loop Elastic Demand Control Using Fractional Order PI (FOPI) Controller
A PI controller with additional fraction order operator called λ makes a fractional order PI controller. This FOPI controller is presented for a closed-loop elastic demand control which was a model based system [43]. The DR of the current system by using FOPI gives an overshoot at the start of the simulation even more than the demand controlled by PI controller. Demand of consumer takes longer tracing time which also results in blackout or load-shedding at the consumer end. Figure 15a demonstrates the generation being traced by demand of consumer using FOPI controller. The demand traced down generation after overshoot for the first 7 h. Figure 15b shows the pricing signal which is regulated to the smart meters at the consumers' end for elastic demand control by FOPI.
Same as the PI controller, the coefficient values for the FOPI are kept negative because of inverse relation between demand and price, whereas the value for λ is taken as 0.8.

Closed-Loop Elastic Demand Control Using PID Controller
Proportional integral derivative (PID) is the widely used classical controller. PID controllers have 3 control coefficients K p , K i and K d , the values of which are kept negative. PID is presented for the closed-loop elastic demand control which is effectively controlled by the PID but with an overshoot and large error between the generation and demand of consumer [43]. The demand followed the generation but with an extra large tracing time as compared with demand controlled by PI and FOPI. Both FOPI and PI outperform the PID controller in tracing the generation. Closed-loop elastic demand control using PID controller having coefficients is shown in Figure 16.

Closed-Loop Elastic Demand Control Using FOPD Controller
When the simulation of the closed-loop elastic demand using the FOPD controller starts, the demand starts tracing the generation with overshooting at the start of the simulation. Although generation started to trace generation, the gap between the generation and demand of consumer can be clearly seen in Figure 17. In Figure 17b, the pricing signal provided by FOPD controller to the demand model is demonstrated. The pricing signal provided by the FOPD controller is less than all the controllers but the error in tracing the generation by demand is very high as compared to other controllers (STSMC, PI, PID and FOPI), which were deployed in the same system for elastic demand control.

Closed-Loop Elastic Demand Control Using STSMC Controller
When the simulation starts, the demand of the consumer is controlled successfully with STSMC by continuously providing a price signal to the elastic demand model. The demand started tracing the renewable energy generation at about 1.8 h after starting the simulation. The tracing time of generation by demand is the lowest among the controllers. i.e., PI, FOPI, PID and FOPD. The demand of consumer traced the renewable energy generation to the end of the simulation. The results of the simulation show that closed-loop elastic demand control with STSMC can successfully trace renewable energy generation without overshooting at the start of the simulation. The demand of the system also does not overshoot at the start of the simulation as in [14,43] by using the classical and fractional order controllers. In order to reduce price volatility, a price limiter function is added next to STSMC which reduces the dynamic price volatility due to uncertainty in the DR. Equation (20) shows the function for price limiter. The upper bound in Equation (20) limits the pricing signal to not feed a pricing signal lower than 0 or negative pricing signal. In addition, the lower bound is for controlling the price to not exceed a specified limit.
The results of the simulation show that closed-loop elastic demand control in conjunction with STSMC can successfully trace the renewable energy generation without overshooting at the start of the simulation.
This whole scenario is discussed in [14], where the closed-loop elastic demand of the consumer is controlled by the PI controller. Moreover, the demand started tracing generation after 5.5 h which is a long time as compared to the tracing time of the STSMC. In our paper, we have deployed STSMC, which is a more robust, accurate and advanced algorithm/controller than the classical controllers and fractional order controllers. Figure 18 shows the DR of the elastic demand control by STSMC. In Figure 19, a clear difference can be seen in the graph where the classical and fractional order controllers overshoots at the start of the simulations, but STSMC started tracing the generation 1.8 h after the start of the simulations. The demand starts from the zero initial value and takes 1.8 h to reach generation, after that the demand does not overshoot and starts tracing generation. Whereas by using PI, FOPI and PID controllers, demand sharply increases, which results in demand overshoot at the beginning of simulations for 6 h. Although the FOPD does not overshoot at the start unlike the other controllers, error in tracing the generation is very high among these controllers. Moreover, the difference between the pricing signal provided by the classical and fractional order controllers can also be seen in Figure 19b. The STSMC provides pricing signal directly at 1.8 h after the start of simulations to quickly control the demand of consumers but the classical and fractional order controller lags in providing the pricing signal, thus results in overshooting of demand.  Table 3, which shows the DR of closed-loop elastic demand controllers for 60 h. Table 4 shows the data of error in tracing the generation for every two hours of simulations for classical, fractional order and STSMC. It can be clearly seen from Table 4 that STSMC outperforms classical as well as fractional order controllers. The coefficient values of the PI controller were kept the same which are used for demand control in [14]. In addition, the coefficient values for the FOPI and PID controller were kept the same as in [43]. The error between the generation and the DR of the deployed controllers in closed-loop elastic demand control simulations is shown in Table 3.
The demand and price response of the closed-loop elastic demand-control model for the triangular waveform as input is shown in Figure 20.   [14], FOPI [43], PID [43] and FOPI demand response in tracing the generation.

Conclusions
This paper employs elastic demand control of a renewable generation integrated microgrid by a closed−loop STSMC. This STSMC regulates the price signal of the DSLM system which plays a major role in the automation of demand control and also making demand more predictable and deterministic. Price signal from STSMC feeds into the DSLM installed in smart meters at consumers' premises through which the balance of generation and demand of the microgrid is accomplished via closed-loop STSMC. In this paper, the renewable energy integrated microgrid scenario is discussed through which the closed-loop elastic demand of the system is controlled by tuning the coefficients of the STSMC. For simulations, the whole scenario environment is simulated in MATLAB/Simulink. The price-based demand model for the current scenario is obtained from the hourly price and demand data. In addition, conditions of high demand and low demand of the consumer were discussed for electricity import from the bulk utility supply. This was added in simulations to cut down the additional expenses and operational cost in the smart grid. The process of broadcasting the price to the DSLM agents takes time, in order to show effectiveness of the method in the cases of demand uncertainty and system delays. We used price signal-broadcast delay for making simulations for scenario more realistic. System delay was added after STSMC in the system which is equal to 36 s. We observed from the simulations that price-based elastic demand control by STSMC can exhibit the outstanding performance of tracing of renewable energy integrated microgrid generation. Dynamic energy pricing is a key figure in the smart grid to control the demand of consumers in renewable energy market management. Our findings shows that the STSMC, very quickly after just 1.8 h, starts tracing the generation. The classical and fractional order controller overshoots and follows to trace the generation after 6 h which is significantly higher as compared with STSMC. Thus, our proposed method outperforms the existing methods.

Conflicts of Interest:
The authors declare no conflict of interest.