Stability Analysis of Cyber Physical Microgrid with Dynamic Demand Control considering Time Delays

Time delays are enforced into the LFC system of microgrid (MG) while transmitting the control signals from the central controller and also aggregating the controllable loads of Demand Side Response (DSR). Due to these delays, the system dynamic performance gets affected leading to system instability. *e time delays may be fixed or time varying. In this paper, a cyber physical microgrid is modeled with Dynamic Demand Control (DDC) loop including time delays, and the stability of the proposed model is analyzed both for fixed and time varying delays. *e impact of fixed time delays on the stability of the proposed microgrid is theoretically evaluated using Frequency Sweeping Technique (FST). To examine the delay dependent stability of the proposed system with time varying delays, including external load perturbations, a matrix stability criterion is formulated and analyzed.*e novelty of the method lies in the modelling of LFC with structured load perturbations and also investigating its impact on the stability of LFC using frequency domain approach. Since the effect of load perturbations is considered for the analysis, a more realistic operating condition can be portrayed in a microgrid system.*e inclusion of DDC load in LFC of the microgrid provides better transient response even with larger time delays.*e accuracy of the proposed method is verified through simulation results.


Introduction
Nowadays, Distributed Generations (DGs) are considered as a better option to meet the power demand in the energy sector. e integration of advanced techniques in renewable energy with DG enhances the overall performance and flexibility of power systems [1][2][3] and thus becomes a significant area of research.
is article examines the delay dependant stability of distributed generation based microgrid (MG). Figure 1 represents the proposed DG based MG that includes PV, wind, microgas turbine, fuel cell, and electrolyser system [4]. e power in PV and wind generator are intermittent in general. Hence for supplying the fundamental load, a 100 KW microgas turbine is used. During large frequency fluctuations, the dynamic control of the microturbine becomes inadequate. In such cases, the fuel cell and electrolyser system compensate the real power imbalance. To balance the demand and supply during peak load conditions, Demand Side Response (DSR) [5] can have a control over Dynamic Demand Control(DDC) loads. Hence the research on DG based microgrid considering DDC loads has become a topic of research in future power system studies [6].
For effective functioning of the power system, frequency stability and controllability should be well maintained. Since the distributed generations and renewable energy in microgrid are intermittent and variable, LFC techniques are employed to provide a steady operation with expected frequency.
Plenty of research work has been dedicated to explore the LFC scheme in microgrid [7]. e increasing penetration of DG's in the microgrid makes the stability of the LFC system some impact on the dynamic performance of the system erefore, there is a strong need to do research on investigating the impact of time delays on system stability by determining the delay margin of the system [21][22][23][24]. e stability of the time delayed system can be analyzed in two ways: (i) frequency domain approach and (ii) time domain approach. Most of the research work in the literature is based on the time domain approach [25,26]. ough the time domain methods are adequate from the perspective of synthesizing robust controllers, they have a drawback in determining the necessary and su cient conditions for system stability. Also in the time domain approach, there exist di culty in computational solving of linear matrix Inequality problem [27,28], whereas in the case of the frequency domain approach [18,19], the computational burden is less because only the reduced set of roots which is having positive real part needs to be determined. Moreover, this approach gives more accurate delay margin values as compared to the time domain approaches.
In the frequency domain approach, Sönmez et al. proposed an exact method based on the frequency domain to provide an accurate delay margin for a multiarea LFC system [29]. In [30] a delay dependent stability criterion for an LFC system considering constant and time varying delays is proposed using the frequency domain approach. But the above stability analysis has not been extended to the inclusion of aggregated DDC loads which commonly introduce more communication delays.
In previous literature, the inclusion of DDC loads in stability analysis of LFC has not received much e ort. Qi et al. [31] suggested a powerful controller for LFC with DDC for a multiarea system considering time delays. In [31], the stability of the LFC system has been analyzed without considering the e ect of load disturbances. If the load disturbances are not considered, there exists only limited scope and restricted applicability. On the other hand, if the load disturbances are considered in the LFC network, the possibility of the system to diverge from the stability point is  International Transactions on Electrical Energy Systems more pronounced. is, in turn, makes the system unable to withstand its stability during larger time delays. Moreover, there is so much of difficulty involved in the mathematical modelling of load disturbances. Hence, the research on the stability of LFC considering load disturbances imposes a challenge to the power system studies.
In [32], a stability criterion for a multiarea Load Frequency Control system with exogenous load disturbances is presented. In [33], Lyapunov-Krasovskii Functional method is presented to examine the stability of the LFC system in the microgrid considering load disturbances. Only a few works in literature have considered the effect of load disturbances in the LFC scheme for stability analysis and moreover, the works were done in a time domain approach. In this context, this paper focuses on the application of the Frequency domain approach for the Delay Dependent Stability Analysis of the microgrid LFC system with DDC considering the load disturbances. us, the major contribution of this research also emphasises on structuring the load disturbances in the LFC system in order to precisely monitor the stability of the power system with time delays. Because the unknown load disturbances in LFC affect the state variable of the power system in stability analysis.
is paper presents the steps to develop a CPS module of microgrid including DDC loads and also frames a novel criterion to evaluate the system stability in the existence of fixed/time varying delays. First, the stability is analyzed for the system with fixed time delays using Frequency Sweeping Technique. And, also an attempt is made to explore the impact of load disturbances on the stability of microgrid with varying time delays using a matrix stability criterion. e novelty of the paper lies in the introduction of the DDC loop to the LFC of microgrid and its stability analysis in the existence of time varying delays and exogenous load perturbations.
ereby the results obtained in this article portray a more realistic situation in real time operation of the microgrid system and the results are validated using MATLAB/SIMULINK. is paper is framed in such a way, where Section 2 depicts the methodology for structuring the proposed Cyber Physical Microgrid system with DDC loads. Section 3 presents the determination of the delay margin of the proposed system for constant time delays. e theoretical results are validated using simulation studies. Section 4 formulates a stability criteria for determining the delay margin of the proposed system for time varying delays in the presence of exogenous load fluctuations. e nomenclature for the Cyber Physical Micro Grid system is listed in Table 1.

Cyber Physical Microgrid Model with DDC Load
A group of loads and sources functioning like a unique manageable system in order to deliver energy to a local area is termed as a microgrid. e major threat in the microgrid power system is the incorporation of computing followed by communication and control known as cyber physical system (CPS). e CPS is considered as an alternative approach for modelling the microgrid system considering the drawbacks of communication infrastructure. Time delay is one of the major limitations imposed in the process of communication that arises during the transmission of cyber signals from the central controller and in an aggregation of DDC loads. is section describes the step-by-step approach to frame the cyber physical microgrid model considering time delays and to derive its state-space equation. e model of Cyber Physical Microgrid is shown in Figure 2. In that, U c and frequency deviation ∆f denote the cyber input and cyber output, respectively, and ΔP L ′ is the physical signal. e Cyber Physical MG model includes the following basic components: a microturbine, distributed synchronous generator, microgrid centralized controller (MGCC), an extended Load demand model (ΔP L ′ ) with the inclusion of DDC load, FC, and ES. Even though, the components of the MG system are nonlinear, for stability analysis, it is linearized as the system is imposed to small disturbances like uctuations in demand, variations in solar, and wind power.
Steps used for framing the Cyber physical MG model are as follows: (i) Developing a CPS module of all the components by identifying its input (ii) Establishment of a physical link between the CPS components e modelling of the CPS module of all the components of the proposed microgrid are presented as follows.

CPS Module of PFC.
Initially, the CPS module of PFC is obtained as shown in Figure 3. e transfer function of MT is obtained from the relationship between f and P.
e transfer function of the Local Controller is de ned as, which is a simple PI controller. is controller compensates for the uctuations in demand and generation. FC and ES counteract the real power imbalance during huge load uctuations when microturbine control is not e ective. e fuel cells play a major role in facing the energy crisis and it is highly e cient compared to IC engines. e rst-order transfer function of FC dynamics is written as follows:  e hydrogen for the Fuel Cell is generated by sending a fraction of wind power to the aqua electrolyser. e rstorder transfer function of Electrolyser dynamics is written as follows: e modelling of the CPS module of SFC is followed in the next section.

CPS Module of SFC.
e reference real power to the controller of the microturbine is set by the microgrid central controller.
e operation of the local controller and the microsources is synchronized by MGCC. Figure 4 shows the CPS module of SFC. e input given to the microgrid central controller is the frequency di erence Δf and U c is the output.

Dynamic Load Model.
e extended load comprises of housing load, wind power generation, and PV as represented in the diagram as shown in Figure 5.
e housing load based on their characteristics gets widely divided into uncontrolled loads and controlled loads in which the thermostatically controlled loads can be considered as DDC loads since they have a direct impact over frequency variations. e remaining loads are treated as uncontrolled loads. e power uctuations of controlled and uncontrolled loads are termed as ΔP ddc and ΔP ucl , respectively.
Domestic electric appliances are used as controllable loads. Since domestic load is of small capacity, to facilitate participation in the LFC scheme numerous small domestic loads can be aggregated as a DDC load. e loads such as air conditioners, refrigerators, water heaters, and domestic wet appliances with induction motors or heaters (for example driers and washing machine) are leading to the system frequency deviation. Based on this, using the DDC scheme the controllable loads participate in frequency regulation by regulating their consumption. e frequency dependent characteristic of the thermostatically controlled load is represented by the following expression: where D ac,i is the damping coe cient and ΔP LC,i is the change in load depending on the corresponding load characteristics. ΔP LC,i which depends upon (ΔT st,i ) can be written as follows: where c p,i is the speci c heat capacity of air, m i -air ow mass and EER is the Energy E ciency Ratio. e smart thermostat is regulated through an integral controller with frequency deviation (∆f ) as input and temperature set point (ΔT st,i ) as output.
e set point ΔT st,i is represented as follows: where k 10; and α 0.5 Rs/Hz and ΔT st,i di ers. e variations are neglected and ΔT st,i is simply bounded between (24°C, 29°C). Hence, the model of an air conditioner is presented as follows: where k i m i c p,i K/EER is the integral gain. During the modelling of ΔP L′ , the generation of solar and wind power is considered as a negative load. Because of variations in solar radiation and wind speed, there may be some mismatch between the actual output and forecasted output. Hence in short term operation, it is considered as a negative load. e uctuations of solar and wind are simulated using the functions given in the following equation: To get the simulated variations in PV and wind, the uctuations in the output power are multiplied with the respective standard deviations in MATLAB/Simulink.

State Space Modelling of Microgrid.
After developing the model of cyber physical microgrid, the state-space form is as follows: where A and A d are system matrix. e disturbance variable is ω(t) ΔP ucl . International Transactions on Electrical Energy Systems 5 e elements of the A and A d matrices are as follows:  International Transactions on Electrical Energy Systems e MGCC has a simple PI controller to control the frequency error and its output is given by, where, U i (s) (K IC /s)Δf. U c (s) is the control input that is given to the Local controller of the microturbine from MGCC. e control signals from the MGCC are transmitted through an open communication network which imposes a time delay. In addition to this, the load model contributes to another time delay. is time delay is added with the delay of transmitting the control signals in the central controller and represented as a single delay τ either a constant/time varying one which a ects the stability of microgrid. e e ect of xed time delays on the microgrid system stability is discussed in the following section.

Stability Analysis of Proposed Microgrid with Constant Time Delays
In this chapter, a method for analyzing the microgrid system stability in the presence of constant time delays is explained. e determination of the delay margin which ensures the system stability is the main objective of the analysis.
e MG system (11) with constant time delay is represented as follows: where x ∈R n is State variable; τ ≥ 0 is constant time delay; A, A d ∈R n×n -Constant system matrix and delay matrix, respectively. e characteristics equation of the system presented in equation (15) can be expressed as follows: Since the characteristic equation has an exponential term, it has many roots whose variation with respect to the time delay is determined for stability analysis as shown in Figure 6.
e system is assumed to be stable exactly at τ 0 As τ progressively increases shifting of roots takes place from Left Half Plane to Right Half Plane. At one exact value τ d , roots cross the jω axis.

Delay Margin Computation.
e stability of the proposed microgrid system is studied and the delay margin of the system is estimated using Frequency Sweeping Technique (FST).
is is one of the exible techniques with higher accuracy, simplicity, and computational ease in comparison with other existing techniques. e system will remain stable only for the subset of positive delays. e necessary and su cient condition for analyzing the system stability is explained by the following theorem [34]. Let τ d represents the delay margin. e system is assumed to remain stable at exactly τ 0 and let k be the rank of matrix A d . e delay margin is de ned as follows: where From the above-given statement, it is clear that the system remains stable for all values of τ in the range [0, τ d ] and the system moves to unstable exactly at τ τ d . e theorem is explained as follows: (i) e generalized eigenvalues of matrix λ (j ω I−A, A d ) are determined for a di erent set of frequencies. (ii) e generalized eigenvalues of matrix λ (j ω I−A, A d ) reaches 1 at ω ω i q . In that condition, there will be a pair (ω i q θ i q ) where the absolute value of the variation of eigenvalue becomes 1 in order to determine the delay margin τ d (θ i q /ω i q ) (iii) For any values of time delay τ < τ d , the det (j ω I−A−A d e −sτ ) ≠ 0 and λ (j ω I−A, A d ) ≠ 1. en, the system is in stable condition. (iv) Otherwise, at τ τ d the det (j ω I−A−A d e −sτ ) 0 and λ(j ω I−A, A d ) 1. en, the system moves to Unstable condition.

Results and Discussions.
To analyze the microgrid system stability in the presence of fixed time delays, the proposed microgrid system is structured in MATLAB/Simulink. e system specifications used for the stability analysis are listed as follows Table 2.

eoretical Results.
e theoretical results are calculated for various values of controller gains (K PC , K IC ) using the Frequency Sweeping Technique and presented in Table 3 and verified using MATLAB/Simulink and Figure 7 shows the variations of delay margin results with respect to controller parameters.
To demonstrate the theoretical computations of delay margin using FST for a particular controller gain, the values K IC � 0.1 and K PC � 1 are considered. e computation process involved in the analysis is explained as follows.
Step 1. Obtain the matrices A and A d .
e system and delay matrices (A, A d ) are obtained for K PC � 1 and K IC � 0.1.
Step 2. Determine the peak value of the real parts of all the eigen values of the A + A d. matrix.
Since the value obtained is lesser than 0, the Frequency Sweeping Algorithm can be proceeded with the further steps.
Step 3. Determine the rank of the matrix A d . e rank of the delay matrix A d is 1, which indicates that the roots cross the imaginary axis only once.
Step 4. Fix the range of frequency and its step size.
To decide the frequency range and size, a trial-and-error method is used. Starting with a wide range of frequency and then gradually narrowed down to obtain the accurate result.
Step 5. Obtain absolute values of all the eigen values of the matrix λ(jωI − A, A d ) e absolute values are obtained for different frequencies chosen in Step 4.
Step 6. Determine the angle and frequency for which the absolute value of an eigen value is one.
Within the selected frequency range mentioned in Step 4, the absolute value of an eigen value variation is checked and if it reaches one, the corresponding frequency and angle is determined. Other * wise, vary the frequency range and proceed with steps 4 and 5. For this case, the absolute value of an eigen value reaches one at frequency ω c � 0.05 and the corresponding angle is 1.1127.
Step 7. Obtain the delay margin.
Delay margin, τ d � angle/frequency. e delay margin obtained is 22.2547 s.
Similarly, τ d values are determined for other values of gains. From which, it is evident that (i) for one particular value of integral controller gain, the τ d increases for smaller values of proportional controller gain and decreases for larger values of proportional controller gain.
(ii) In the same way, for a constant value of K PC , τ d decreases as the integral controller gain increases. For example, when K PC � 1, τ d of the system is 22.2547 s for K IC � 0.1 whereas it is 11.2496 s for K IC � 0.2. From the above results, it is concluded that the performance of the proposed microgrid with constant time delays can be improved by reducing the values of K IC.

Simulation Results.
Simulation is performed to check the efficacy of the proposed method (FST) in finding τ d . is is carried out by raising the time delay in the simulation model from 0 secs till the system reaches an unstable condition. e results shown in Figure 8 is the microgrid time response for constant delays with the controller gain K IC � 0.1 and K PC � 1.
In Figure 8 the red dotted lines represent increasing oscillations for the time delay τ � 24s. e blue dashed lines represent decreasing oscillations for the time delay τ � 20s. From the above-given observations, it is clear that the delay margin τ d is in the range of 20-24 s. e black solid lines represent the sustained oscillations for the time delay 22.26s indicating the marginal stability of the system which is very nearer to the theoretical value τ d � 22.2547s. e percentage error between the theoretically calculated τ d and the simulation result is found to be 0.0269%. is lower value of error percentage shows the proposed FST method is more precise in determining the τ d of the system with constant time delays. Also it shows that the MG system remains in stable condition for all values of time delays lesser than the determined delay margin and it reaches unstable once the delay exceeds the delay margin.

Comparison of Proposed Microgrid System With and Without DDC Load.
e performance of the proposed system gets improved due to the inclusion of DDC load as they have a direct impact over the frequency regulation. e time response of the microgrid comparing the result of this paper (including DDC) with paper [34] (not including DDC) for the same controller gain and at time delay � 18.79 s is shown in Figure 9.
In Figure 9, the system without DDC shows marginal stability (blue dotted lines) at a time delay of 18.79 s, whereas at the same time delay the system with a DDC load is more stable which is denoted in red solid lines in the graph. From the graph, it is proved the inclusion of Dynamic Demand Control improves the dynamic performance and frequency regulation. It is also noted that the settling time and peak overshoot is reduced in the system with DDC when compared to the response obtained without considering DDC. e value of the delay margin τ d of the system with DDC is determined to be 22.26 s. Hence with DDC load can maintain its system stability for a larger time delay. From this, it is evident that the delay margin increases with the consideration of DDC in modelling of the microgrid.    International Transactions on Electrical Energy Systems Table 3, the impact of the central controller gains on τ d of the system is noted. e dynamic performance of the MG gets enhanced by choosing low values of integral controller gain. ese findings are used to set as a reference for setting the controller gain of the microgrid along with DDC to hold the system in stable condition even in the midst of a certain time delay in the communication network. e next chapter presents the impact of time varying lags on the proposed microgrid system stability.

Stability Analysis of Proposed
where x ∈ R n -state variable, τ (t) ≥ 0 time-varying delay, and A and A d ∈ R n × n are constant matrices. Let τ m -delay margin. Assuming the system is stable at τ � 0. e unknown exogenous load fluctuation is structured as nonlinear time changing perturbation as represented as follows: e fluctuations on the proposed system are now highly structured. [32].
whereF > 0 and G > 0, (21) where the functions F and G are constant matrices of appropriate size representing the level of uncertainty in load perturbations. e necessary, sufficient condition for stability is given by the following theorem [36].

Theorem 1. If the real parts of the eigenvalues of matrix M � (A + A d ) * + F + G + τ m [| A d A| + | A d A d | + | A d |(F + G)
are negative,, then the system in equation (16) is asymptotically stable. Moreover, if matrix M is irreducible, then |x (t)|≤ k.e −c t for t ≥ τ m , where k and c are determined as follows: where c is the positive real solution of λ(P c ), and k is the positive eigenvector of P c .
As xi(t)sgn(x i (t)) � |x i (t)| and as |sgn(x i (t))| � 1, an upperbound of (d + |xi|/dt) (t) is easily calculated (see the valuations done in [3,7] for more detail, Since the o -diagonal elements of (A + A d ) * + F and all elements of are non-negative. e theorem is proved and explained as follows: (1) e system remains asymptotically stable at τ m 0 (2) e system loses its stability, when τ d increases and reaches a particular value, the real part of eigen value of matrix M becomes positive □

Results and Discussions.
e proposed stability criteria are demonstrated on a cyber physical microgrid system subjected to exogenous load disturbance. e MG system parameters are listed in Table 2. In the study of the LFC system for the proposed microgrid with time varying delays, the exogenous load disturbance e ect Fw(t) of the system is assumed to meet the norm-bounded condition presented in equation (21). e matrices F and G together with nonnegative scalar α and β represents the measure of load disturbances to the microgrid system, where the F matrix is assumed as 0.1 αI n , G is taken as 0.1 βI n ., α and β are the levels of uncertainties in load disturbances and n is the system state vector size.

eoretical Results.
With the help of eorem 1, the stability of the proposed microgrid with time varying delays is analyzed considering the impact of load disturbances. e varying load disturbances ultimately a ect the state variables of the system. Hence it is structured mathematically as a norm-bounded nonlinear time varying functions. α and β are the values of uncertainties in load perturbations. For various values of uncertainties in load perturbations, the delay margin is computed with the value of integral controller gain K IC 0.1 and proportional controller gain K PC 1 and the corresponding results are shown in Table 4.
From the above-given results, it is observed that when load disturbances are not considered, i.e., if the value of α and β is zero, the delay margin of the system is high. (18.327 s). When the value of α and β increases it is meant that the e ect of load perturbations is more distinct in the proposed MG system. When the load perturbations are considered with the value of α 0 and β 2.5. the delay margin slightly decreases to 17.433 s. If the uncertainties in the load disturbances is further increased (the value of α and β 2.5) the delay margin further decreases to 9.383 s which shows the system is prone to instability even for smaller time delays. If the values of uncertainties both equal 1.5 then the delay margin increases to 16.639 s which shows that the system is less prone to instability since the values of perturbations are less. ese observations clearly reveal that the uncertainties in the load perturbations have an impact on the stability of the microgrid. A highly perturbed system condition results in less marginal stability of the system. Hence in this proposed method, a more realistic system operating condition can be portrayed by structuring the load perturbations when compared to [30].

Simulation Results.
e simulation studies were done on the microgrid system with varying time delays to observe the frequency deviation Δf when the system is disturbed from its equilibrium values. e controller parameters used for the simulation studies are K p 1 and K i 0.1. From the simulation results as shown in Figure 10, the time response at τ 18.4 s, system shows marginal stability which is shown as black solid lines. As the time delay is reduced from 18.4 s, frequency deviation becomes closer to the stability point showing an asymptotically stable system represented as blue dotted lines for a time delay of 16 s. Otherwise, if the time delay is increased beyond 18.4 s, the frequency deviation diverges from its equilibrium point which is represented as red dotted lines for τ 20 s.

Discussions.
From the simulation studies, at time delay τ 18.4 s system shows marginal stable whereas the value of delay margin determined from the proposed stability criteria is 18.234 s. e deviation between the theoretical results and results of delay margin is attributed to the e ectiveness of the proposed method.

Conclusion
In this paper, the Cyber Physical MG model is built including DDC load and its stability is veri ed in the presence of both constant and time varying communication delays. For constant time delays, the performance index called delay margin is computed using Frequency Sweeping Technique. A matrix stability criterion is developed to address the problem of exogenous load disturbance for the MG with varying time delays. In which, the exogenous load disturbance is structured as variations in terms of the delayed and  Simulation studies are performed to justify the accuracy of the proposed method. From the results, it is inferred that there is a link between the controller gain and the delay margin. For a fixed K PC, as the value of K IC increases delay margin decreases. For a fixed K IC, the delay margin is larger for smaller values of K PC and vice versa. ese observations can act as a guiding factor for tuning controller gain and maintaining the stability, even during large time delays. From the results, it is observed that when the communication delays in the microgrid are fixed, the delay margin is slightly higher in value in comparison to the system having time varying delays. e results also bring out the impact of load perturbations on the stability of the microgrid. When the effect of load perturbations is less pronounced, the marginal stability of the delay dependent system increases, and the dynamic performance of the system gets improved. From the research, it is also concluded that the introduction of the DDC loop in the modelling of the microgrid system provides a better transient response and larger delay margin.

Data Availability
No data were used for this research article.

Conflicts of Interest
e authors declare that they have no conflicts of interest.