Fuzzy-Based Distributed Cooperative Secondary Control with Stability Analysis for Microgrids

: This research suggests a novel distributed cooperative control methodology for a secondary controller in islanded microgrids (MGs). The proposed control technique not only brings back the frequency/voltage to its reference values, but also maintains precise active and reactive power-sharing among distributed generation (DG) units by means of a sparse communication system. Due to the dynamic behaviour of distributed secondary control (DSC), stability issues are a great concern for a networked MG. To address this issue, the stability analysis is undertaken systematically, utilizing the small-signal state-space linearized model of considering DSC loops and parameters. As the dynamic behaviour of DSC creates new oscillatory modes, an intelligent fuzzy logic-based parameter-tuner is proposed for enhancing the system stability. Accurate tuning of the DSC parameters can develop the functioning of the control system, which increases MG stability to a greater extent. Moreover, the performance of the offered control method is proved by conducting a widespread simulation considering several case scenarios in MATLAB/Simscape platform. The proposed control method addresses the dynamic nature of the MG by supporting the plug-and-play functionality, and working even in fault conditions. Finally, the convergence and comparison study of the offered control system is shown.


Introduction
A microgrid (MG) (containing of small-scale developing generators, loads, batteries and a regulatory element) is defined as a regulated small-scale power network, which can be functioned in an islanded and/or grid-connected operation mode assisting the requirement of complementary power and/or preserve a usual service [1]. Like the traditional power system, MG systems also follow the hierarchical control strategy for standardization of the MG operation and overall function. Generally, this hierarchical control system incorporates three levels, namely, primary, secondary and tertiary control layers. The traditional droop control technique considered as the most commonly used control at the primary control level because of its decentralized nature, which lessens the communication requirements [2]. However, the primary droop control shows some other shortcomings, including its frequency/voltage deviations according to load characteristics, inaccurate reactive power-sharing, and poor performance with nonlinear loads [3,4]. The secondary control level is thus introduced as a complement of primary control [2,5]. Limitations of centralized (single-point of failure) and decentralized (poor dynamic and steady-state response) control strategies have led to distributed control structures [3,6]. Recently, multiagent structures or consensus algorithms [7,8] have received increased attention for their simple control structure utilizing sparse communication systems, improved reliability and acceptable dynamic/steady-state performance [6,[8][9][10]. Nevertheless, the dynamic response of the MG considering distributed secondary control (DSC) could be unexpected in regard to the system oscillation, reaction time, stability margins [10] and steady-state behaviour. Despite several advantages of distributed control, the limitations mentioned above are taken as key challenges for an islanded MG with DSC. The MG control system design should address these drawbacks in a proper way to maintain the stability and resilience of the whole network. In this light, the following issues should be considered in the design process.
There are many methods, studied for the development of the stability of the primary control [11][12][13]. Small-signal stability is now a significant issue in the reliable operation of an MG due to low-inertia and intermittent renewables [14]. Small-signal modelling is considered for the stability analysis for MGs with the decentralized droop control techniques at the primary level in most research works [11]. Authors in [15] succeeded in precise power sharing considering a consensus-based droop constant controller. Small-signal stability analysis considering DSC is studied in some recent works [7,8,10,13,16,17]. Additionally, the impact assessment of DSC parameters based on the dynamic model, the requirement of fine tuning of DSC parameters for stability enhancement, and the corresponding suitable solution (i.e., fuzzy-based controller) for that are not considered. Authors in [8] study the above issue of DSC for stability analysis but the detailed mechanism of choosing the DSC parameters for stability enhancement is not discussed. A detailed mechanism study for undesired dynamic behaviour and the probable oscillations introduced by DSC is reported in [10]. However, the use of an optimal controller for stability enhancement of the DSC leads to the system being more complex for control system design. Besides, in the majority of works, the power lines are considered to be purely inductive, which makes the models and proposed solutions inaccurate and impractical for a networked MG [18]. References [19][20][21] assume purely inductive grids used for dynamic studies of distributed secondary frequency controller (DSFC) [20] and the distributed secondary voltage controller (DSVC) [19,21]. Virtual impedance is mostly implemented into the droop control for converting the feeder impedance inductive, which will decouple the active and reactive power regulation [22][23][24][25][26][27]. Some researchers have suggested applying the virtual impedance as a means of employing precise reactive power in MGs [24,27]. Another approach in [24,28] proposed an adaptive virtual impedance for eliminating the impedance incompatibility in the feeders. Still the stability study is unresolved, and the DG units are taken into account by means of equal rating.
Apart from this, the conventional voltage-reactive power droop control results in inaccuracy in reactive power sharing with small feeder line impedances [18,29]. An improved droop control was suggested in [30], where incorrect reactive power sharing is yet noticed under clearly non-uniform line impedances. In addition, current secondary control approaches are categorized as centralized [31], decentralized [32][33][34] and distributed control [6,8,9,21,35]. This is somewhat motivated by the cooperative control concept for multiagent structures [6,8,9,32,33], letting all distributed energy resources (DERs) connect through their neighbours across local communication systems. Maximum distributed reactive power control (DRPC) techniques apply the voltage sensitivity analysis-based scheme [33,36] as per the literature for calculating the exact amount of reactive power, which each DER requires to add for confirming the system voltage maintained within allowable boundaries. Nevertheless, the sensitivity technique necessitates linearization of the power flow equations around the usual operating point, which can cause the wrong re-estimation of the necessary reactive power specifically for MG networks with low X/R ratio and high penetration of DERs. Therefore, the overall system losses are increased, which introduces a probable inconvenience on the primary distribution network including extreme requirement of reactive power.
However, another work, introduced in [37], applies predefined equal local voltage regulator functions designed for every DER in the network. This kind of method greatly suffers from one requirement, which necessitates a thorough procedure for finding optimal Electronics 2021, 10, 399 3 of 25 parameters by tuning and describing these functions. The voltage regulation may be useless or can affect an excessive quantity of reactive power flow in the scheme without accurate tuning [36]. To resolve this issue, suitable and efficient tuning is a prerequisite is significant to accomplish the system stability and have reliable operation against load change and large disturbance. Computational intelligence algorithms such as fuzzy logic (FL) [4,38,39], genetic algorithm (GA) [40,41] and particle swarm optimization (PSO) [13,42] have been commonly used to resolve difficulty of the power system. However, some deficiencies in GA performance such as the premature convergence have been recorded. On the other hand, PSO is a population based search technique deriving from models of insect swarm. In the existing works [43], intelligent techniques such as FL, PSO and GA are used to obtain optimal controller parameters. Authors proposed in [41] a non-linear and nonconvex optimization problem, which too contains eigenvalues constraints. Thus, PSO is adopted to solve this problem to obtain the optimal distributed control parameters. When associated with more stochastic algorithms it has been realized that PSO necessitates less computational effort. Even though PSO has presented its potential on many aspects for resolving diverse optimization problems, it still needs significant execution time to get solutions for large-scale engineering problems [41].
Alternatively, the fuzzy logic controllers (FLCs) algorithms can tune the system constraints and outputs based on the information feed automatically to the system, which enhances the system's simplicity and flexibility, and FLC can handle problems with imprecise and incomplete data and FLCs are cheaper to build. To reduce the complexity and enhance the controller flexibility, this paper proposed the FLC tuner for DSC. The authors in [44] introduce a DSC framework of islanded MGs. An intelligent FL based scheme is suggested for proper tuning of the consensus parameters, but only voltage regulation and reactive power sharing are taken into account [44]. Authors in [45] considered both voltage and frequency regulation of an islanded MG relied on a FLC structure. Dynamics of the scheme, i.e., plug-and-play capability, and fault occurrence, are not included. Authors in [4] proposed a novel scheme to control the reactive power nominal value of distributed generation (DG) components consistent with their involvement in reactive power sharing in islanded MG. According to the recommended method, FL is implemented to design the X/R ratio of the connecting power lines into the consensus signals in order for proper participation of DG units for precise active and reactive power sharing irrespective of the nature of feeder impedance. Although the proposed control can share the power accurately, the control level was studied for the primary control level only. In addition, the point of common coupling (PCC) bus voltage, reliant on the DSVC, essentially is being re-established to confirm nonstop action of sensitive loads. Authors in [46] offer critical bus voltage reestablishment; though, it does not concurrently preserve precise reactive power sharing among DG units. The conventional droop control technique exhibits some other limitations such as steady-state frequency deviation from the rated value, poor dynamic behaviour and high sensitivity to measurement noises [5,18,29]. Thus, conventional droop control cannot assure high accuracy of frequency control and power sharing. As a result, a secondary regulation system has been introduced to guarantee a steady frequency profile in the MG [5]. In the existing literature for frequency control and active power sharing, secondary control systems of MGs are generally classified into three groups: centralized [47], decentralized [32,48,49] and distributed [8,9,21,35,36,50,51]. The central controller for frequency restoration also faces the possibility of a single point of failure and could have trustworthiness and scalability concerns [2,8,25,31,49]. Recently, numerous DSC strategies have been stated in the literature. Most methods are based on consensus practice [4,8,9,[50][51][52][53], where the agents achieve consensus by means of exchanging information over a sparse communication system. The control method described in [51] reports simply frequency restoration through a distributed averaging proportional-integral controller but requires a centralized communication configuration regardless of its decentralized execution. In [54], a DSFC scheme using linear input and output feedback was offered. The communication among neighbouring DG units is straightforward but power sharing is less focused. The authors in [21,49,52] proposed a DSC for frequency control and accurate active power sharing in islanded MGs where the voltage regulation is not taken into account. The distributed control methodologies referred to in [46,55] deal with both voltage and frequency restoration, but a comprehensive model of the MG system is a prerequisite. Authors in [56] addressed the issue of frequency restoration and active power sharing, but methods of choosing DSC parameters make the system more complex. On the other hand, DGs line, loads and MG structures are unfamiliar in reality, and the selection of controller gains are relied on the algebraic connectivity of the communication system. However, centralized or DSC requires assistance from communication networks. Communication delay is an unavoidable and intrinsic matter for the period of the signal transmission procedure. A large communication delay can worsen the system's dynamic behaviour, reduces the system stability margin and even causes an unstable structure [57]. Hence, it is essential to analyse the effect of communication delay on system stability, also examine the relating delay compensation technique to get a stable system [16,35]. Furthermore, inevitable noise disruptions from communication channels and the external surroundings (i.e., produced by environmental reasons, for example rain, etc.) could disturb MG's dynamic behaviour [58]. Thus, to study the DSC problem for AC autonomous MG considering communication delay, communication link failure and noise is required. This has not been significantly or accurately reflected in a single control approach in prior research [8,21,33,35,45]. Extensive time-domain simulations considering different case studies like communication restriction, fault occurrence and plug-and-play capability considered at the same time are not taken into account in the previous research works to verify the robustness of the DSC (see all the references mentioned in this paper).
According to the literature review, it can be realized that DSC is more effective than the centralized one [3]. Due to the limited research undertaken so far, as mentioned in the literature review, a proper DSC is still needed that considers all the drawbacks in a single control strategy. To this end, motivated by the existing limitations, this paper proposes a new DSC, which has contributions from the following viewpoints: • A novel DSC is proposed for lossy MGs to restore frequency and voltage simultaneously while accurate active and reactive power sharing are preserved.

•
Unlike the existing consensus methods, the proposed method utilizes a proportionalintegral (PI) controller at the output voltage of the inverter. Thus, voltage mismatches are reduced to a great extent.

•
The small-signal stability analysis under the proposed DSC for the networked MG model is carried out in detail. Note that eigenvalue analysis for parallel-connected DGs in the MG was previously studied in many studies, but very few studies have addressed the small-signal stability analysis for a networked MG model considering DSC.

•
In most of the previous related works, other tuning methods/optimal controllers are used for finding DSC parameters. Utilizing the intelligent FL parameter-tuner in accordance with small-signal stability analysis for the networked MG model has been presented as a new solution. The FLC not only enhances the performance of the proposed DSC but also reduces the complexity of the DSC design.
The rest of this paper is structured as follows. Section 2 represents the specifics of the suggested DSC design. Section 3 introduces the small-signal dynamic model of MG. Section 4 shows the small-signal stability analysis, and Section 5 discusses the time-domain simulation results. Conclusions along with future works are presented in Section 6.

The Proposed Distributed Secondary Controller
An autonomous MG consists of DG units, the power network, and local loads as depicted in Figure 1. In the test MG model, there are several nodes where some are associated with DG units and loads, and some are associated with only loads. The gridforming voltage source inverters (VSIs) are essential in the islanded operation mode to form voltage and frequency within the MG. The control system of a droop controlled VSI, including inner voltage and current loops, is illustrated in Figure 1.

Traditional Droop Controller
The following equations represent the traditional droop controller of the i th DG for frequency control and voltage control to accomplish active and reactive power sharing, correspondingly: where P i and Q i are the active and reactive powers of the i th DG units respectively, k fi and k vi are the frequency and voltage droop gains respectively, f n and v n are the nominal frequency and voltage respectively, and are the reference values for the direct-quadratic (d-q) components of voltage magnitude in the synchronous reference frame, denotes the nominal angular frequency, and are embedded to model the virtual resistance and virtual inductance, respectively, are the dq components of the inverters output voltage and and are the d-q components of the inverters output current. Based on Equations (1) and (2), the frequency and voltage excursions would be established in the autonomous MG due to load variations.

Consensus-Based Distributed Secondary Control
The basics of the consensus algorithm and graph theory are described in [13] and thus not included here. In this research, a DSC system was applied locally by selecting the suitable control inputs and ℎ to adjust the frequency and voltage magnitude so that the frequency and voltage magnitude at MG nodes converge to the reference values and , respectively, while active and reactive power sharing are established. In the proposed DSC, as explained later, is related to frequency restoration and active power-sharing, ℎ and are correlated to voltage restoration and reactive power-sharing respectively. Therefore, the proposed DSC signals, which give the reference values for the i th DG (synchronously including all the agents acting as a cluster) can be derived by the following equations.

Traditional Droop Controller
The following equations represent the traditional droop controller of the ith DG for frequency control and voltage control to accomplish active and reactive power sharing, correspondingly: where P i and Q i are the active and reactive powers of the ith DG units respectively, k f i and k vi are the frequency and voltage droop gains respectively, f n and v n are the nominal frequency and voltage respectively, v dre f i and v qre f i are the reference values for the directquadratic (d-q) components of voltage magnitude in the synchronous reference frame, ω n denotes the nominal angular frequency, R vir and L vir are embedded to model the virtual resistance and virtual inductance, respectively, v odi and v oqi are the d-q components of the inverters output voltage and i odi and i oqi are the d-q components of the inverters output current. Based on Equations (1) and (2), the frequency and voltage excursions would be established in the autonomous MG due to load variations.

Consensus-Based Distributed Secondary Control
The basics of the consensus algorithm and graph theory are described in [13] and thus not included here. In this research, a DSC system was applied locally by selecting the suitable control inputs g i and h i to adjust the frequency f re f i and voltage magnitude v re f i so that the frequency and voltage magnitude at MG nodes converge to the reference values f n and v n , respectively, while active and reactive power sharing are established. In the proposed DSC, as explained later, g i is related to frequency restoration and active power-sharing, h i and τ i are correlated to voltage restoration and reactive power-sharing respectively. Therefore, the proposed DSC signals, which give the reference values for the ith DG (synchronously including all the agents acting as a cluster) can be derived by the following equations.
Frequency restoration and active power-sharing: DSFC is used to re-establish the frequency and active power-sharing like this: here D f i and D Pi are all positive control gains and b i is the communication link indicator explained later. N i represents neighbouring nodes of node i and an adjacency matrix is defined as A G = a ij ≥ 0 ∈ R N×N where a ij = 1 if the ith node is coupled to the jth node and a ij = 0 otherwise [14].
Voltage restoration and reactive power-sharing: DSVC, which includes both the voltage controller and reactive power sharing controller, is chosen for the voltage regulation and reactive power sharing respectively, and can be designated by the following equations: where D vi and D Qi are all positive control gains and Q imax is the maximum reactive power of ith DG unit. v di f f i and v di f f pcc are designed through a PI controller such that both can restore to their reference values (v n ), where v di f f pcc is calculated at the point of common coupling (PCC). v di f f i and v di f f pcc can be expressed by the following equations: here, K P and K I are the proportional and integral control coefficients for the secondary

Small-Signal Modelling
The small-signal state-space model for networked MG is obtained considering the small-signal modelling of VSIs, the power network and load dynamics. A systematic approach to obtaining the state-space equations of the network and loads is presented and combined with the inverters' state-space equations. The reference frame of a given DG unit, preferably the biggest one (which has the smallest droop gain and thus less frequency variation to follow the slack bus concept in bulk power systems), is taken as a common reference frame. All other inverters were converted to this common reference frame utilizing the corresponding transformation, which is described in the following part. Here, the axis set (D − Q) is the common reference frame rotating at a frequency ω com , whereas the axes (d − q) i and (d − q) j are the reference frame of the ith and jth inverters rotating at ω re f i and ω re f j , respectively. The transformation from the local reference frame to the common one is given as where δ i represents the phase angle difference of the ith inverter reference frame from the common reference frame. The details of the internal modelling of all these modules can be retrieved in [14] taking primary control into account. In this paper, the three-phase voltage and current are vector quantities presented in D − Q frame while the other variables like frequency and power are scalar quantities.

Individual Inverter Modelling
Now, to derive the state-space model, in Equation (8) we had by defining Considering virtual impedances, the linearized inverter output voltage equations become In reference to our proposed control strategy, the modelling of an individual inverter unit after linearization in the common reference frame considering only the primary control (droop control) can be written as follows: where T represents the deviation of inverter output current in the DQ frame. Consequently, the state-space model of an individual DG with DSC is obtained after linearization (around an operating point) and a combination of Equations (1)- (15) as follows: where In Equation (16), A 1invi , A 2invi , A 3invi , A 4invij , A 5invi , C invωi , M invi and N invi are all the parameter matrices of the ith DG and given in Appendix A. A 4invij represents the correlations between DG i and the neighbor DG j provided by the DSC. ∆ω re f i and ∆ω com are the frequency deviations of the individual and common reference frame. ∆v 0DQi = ∆v 0Di , ∆v 0Qi T represents the deviations of inverter output voltage in the DQ frame.

Combined Model of All the Inverters
In this paper, four DGs were considered in the proposed MG model ( Figure 2). Thus, by merging Equation (16) for four inverters, the combined model of all inverters in the linearized form can be written as: Electronics 2021, 10, 399 In this modelling technique, all the individual DG inverters are modelled separately and then combined, which will be finally integrated with the network and load models.

Network and Load Model
The network and load models were obtained by linearizing the node voltage equations considering Figure 2. There were no incoming currents in the network or load nodes. From the linearized node voltage equations, we got the following: where ∆ 0 represents ∆ 0 of all the DG units, ∆ 0 represents ∆ of all the inverters and the voltage deviations of all the network and load nodes are represented by ∆ . 1 , 2 , 3 and 4 are the submatrices of the nodal admittance matrix Y, i.e., = [ 1 2 3 4 ]. By eliminating ∆ , we had Substituting Equation (19) into Equation (17), we can write In this modelling technique, all the individual DG inverters are modelled separately and then combined, which will be finally integrated with the network and load models.

Network and Load Model
The network and load models were obtained by linearizing the node voltage equations considering Figure 2. There were no incoming currents in the network or load nodes. From the linearized node voltage equations, we got the following: where ∆i 0DQ represents ∆i 0DQi of all the DG units, ∆v 0DQ represents ∆v oDQi of all the inverters and the voltage deviations of all the network and load nodes are represented by ∆v netloadDQ . Y 1 , Y 2 , Y 3 and Y 4 are the submatrices of the nodal admittance matrix Y, i.e., Substituting Equation (19) into Equation (17), we can write ∆v di f f is defined in terms of ∆i 0DQ as follows: ∆v di f f DQ = I MP pcc ∆i 0DQ (20) where I MP pcc is the impedance matrix and can be calculated from the nodal admittance matrix Y of node voltage equations.

Complete Small-Signal Model
Similarly to define v pcc considering Equation (9) and letting ∈= v re f − v pcc dt, we had The complete MG dynamic model in the linearized form can be formulated by combining Equations (17)-(22) as follows.
The detailed stability analysis includes the mechanism of the unwanted dynamic behaviour, along with the oscillations can be accomplished utilizing the eigen-arrangement of the system's state matrix, A system as given in the next section.

Stability Analysis
Single line drawing of the experimental MG model including four inverter-based DG units, local loads and feeder lines is shown in Figure 2. The MG considered here was a 311 V and 50 Hz system and was simulated in MATLAB. The MG functioned in the autonomous mode. Here, every load was considered as a 3-phase series RL load and every feeder line was a 3-phase series RL branch. Figure 2 also shows the sparse communication link (blue dashed lines) of the MG system, and its related adjacency matrix was A G = [a ij ], where the DG2 outputs were considered as the nominal values and the pinning gain b 2 in Equations (3) and (5) was set as b 2 = 1.

Eigenvalue Analysis
System dynamic behaviour and the outcomes from the stability analysis for the test MG under the suggested DSC were discussed in this section. In line with the stated linearized model in the prior section, the subsequent eigenvalues including DSC were presented in Figure 3 for stable operation. As the eigenvalues of high and intermediate frequency modes had insignificant influences on system stability [14], this paper mainly put an emphasis on the analysis of the low-frequency modes. There were nine less damped modes, among which four were introduced by the proposed DSC, i.e., modes 6-9. It was assumed that the communications among the DG units are followed by the directed graph as in Figure 2 (blue dashed line). Participation Factor : The participation factor was employed to find the relationship between the state variables and the modes and is the multiplication of corresponding quantity in the right and left eigenvectors of the state matrix [14]. For the primary droop control, the low-frequency modes are primarily affected by the states of the active power droop controller (1), i.e., Δδi and ΔPi recommended by participation factors in [4]. Figure  4 shows the relation of the participation factors of the system state variables associated with the modes 6-9 considering the proposed DSC in action. Participation factors related to modes 1-5 were mainly for the primary droop control, and this was the same as the case when only primary droop control was functional to the system, which was not the main concern in this paper. Thus, only the effects of proposed DSC in the modal analysis were discussed and those of modes 1-5 are not shown. A brief description of the outcomes (Figure 4) is given as follows.   Figure 4a indicates that ∆ , ∆ and ∆ of every DG unit actively participated in the oscillation caused by mode 6, revealing the direct participation of these states of all the DG units in the stability. As ∆ is the state variable for the DSC as in Equation (3) it Participation Factor: The participation factor was employed to find the relationship between the state variables and the modes and is the multiplication of corresponding quantity in the right and left eigenvectors of the state matrix [14]. For the primary droop control, the low-frequency modes are primarily affected by the states of the active power droop controller (1), i.e., ∆δ i and ∆P i recommended by participation factors in [4]. Figure 4 shows the relation of the participation factors of the system state variables associated with the modes 6-9 considering the proposed DSC in action. Participation factors related to modes 1-5 were mainly for the primary droop control, and this was the same as the case when only primary droop control was functional to the system, which was not the main concern in this paper. Thus, only the effects of proposed DSC in the modal analysis were discussed and those of modes 1-5 are not shown. A brief description of the outcomes (Figure 4) is given as follows.  Participation Factor : The participation factor was employed to find the relationship between the state variables and the modes and is the multiplication of corresponding quantity in the right and left eigenvectors of the state matrix [14]. For the primary droop control, the low-frequency modes are primarily affected by the states of the active power droop controller (1), i.e., Δδi and ΔPi recommended by participation factors in [4]. Figure  4 shows the relation of the participation factors of the system state variables associated with the modes 6-9 considering the proposed DSC in action. Participation factors related to modes 1-5 were mainly for the primary droop control, and this was the same as the case when only primary droop control was functional to the system, which was not the main concern in this paper. Thus, only the effects of proposed DSC in the modal analysis were discussed and those of modes 1-5 are not shown. A brief description of the outcomes (Figure 4) is given as follows.   Figure 4a indicates that ∆ , ∆ and ∆ of every DG unit actively participated in the oscillation caused by mode 6, revealing the direct participation of these states of all the DG units in the stability. As ∆ is the state variable for the DSC as in Equation (3) it  Figure 4a indicates that ∆δ i , ∆P i and ∆g i of every DG unit actively participated in the oscillation caused by mode 6, revealing the direct participation of these states of all the DG units in the stability. As ∆g i is the state variable for the DSC as in Equation (3) it is remarkably affected by the secondary controller gains D f i and D Pi and thus affects the stability of the system. Figure 4b illustrates that the states ∆Q i , ∆h i and ∆τ i of the proposed DSC for voltage control and reactive power-sharing considerably contributed to creating modes 7 and 8 and were strongly affected by the controller gain D Qi . DSC gain D vi had less of an effect on stability. Figure 4c revealed that mode 9 was caused by the states ∆Q i and ∆ ∈. The states ∆ ∈ and ∆Q i were strongly associated with DSC proportional control gain (K P ), integral control gain (K I ) and virtual reactance (X viri ), respectively.
The detailed effects of the controller parameters K P , K I , D f i , D vi , D Pi , D Qi and virtual impedance values Z viri on the less damped modes were analysed in detail in the following section.

Relationship between System Stability and DSC Parameters
Sensitivity of the system stability to the distributed control parameters was analysed with the help of stability margin. The traces of low-frequency modes of the system as functions of K I , K P , D f i , D Pi , D Qi and Z viri (which includes R viri and X viri ) were taken into account to determine the effect on stability. Figure 5 presents the traces of less damped modes as the function of X viri , K I , K P , D Qi , D f i and D Pi . The traces of low-frequency modes as functions of R viri were similar to X viri , and those of K P were similar to K I , which are not shown here. Note that the variation of D vi had comparatively less effect on system stability, and thus it is not shown here. Figure 5a shows the changes in the damping of mode 9 when K I varied from 5 to 40. These variations mainly affected the least damped mode 9. is remarkably affected by the secondary controller gains and and thus affects the stability of the system. Figure 4b illustrates that the states ∆ , ∆ℎ and ∆ of the proposed DSC for voltage control and reactive power-sharing considerably contributed to creating modes 7 and 8 and were strongly affected by the controller gain . DSC gain had less of an effect on stability. Figure 4c revealed that mode 9 was caused by the states ∆ and ∆∈. The states ∆∈ and ∆ were strongly associated with DSC proportional control gain ( ), integral control gain ( ) and virtual reactance ( ), respectively. The detailed effects of the controller parameters , , , , , and virtual impedance values on the less damped modes were analysed in detail in the following section.

Relationship between System Stability and DSC Parameters
Sensitivity of the system stability to the distributed control parameters was analysed with the help of stability margin. The traces of low-frequency modes of the system as functions of , , , , and (which includes and ) were taken into account to determine the effect on stability. Figure 5 presents the traces of less damped modes as the function of , , , , and . The traces of low-frequency modes as functions of were similar to , and those of were similar to , which are not shown here. Note that the variation of had comparatively less effect on system stability, and thus it is not shown here. Figure 5a shows the changes in the damping of mode 9 when varied from 5 to 40. These variations mainly affected the least damped mode 9.  Figure 5b shows variation in the damping of the modes 7 and 8 when X viri varied from 0.01 to 0.1 Ω, and D Qi varied from 10 to 40, respectively. From this, it is clear that increasing the value of X viri and D Qi had the opposite effects on system stability. Figure 5c shows that D f i and D Pi also had reverse effects on the oscillation. Table 1 gives a summary of the above analysis. On the other hand, finding suitable values for DSC parameters was difficult by traditional approaches, e.g., trial and error scheme and from the traces of low-frequency modes for stability improvement. Accordingly, intelligent fuzzy logic was used for proper tuning of controller parameters for stability improvement in terms of fast response, appropriate damping and satisfactory stability margin. Table 1. System dynamics and stability analysis result.

Tuning the DSC Parameters Based on Fuzzy-Logic
This paper presents a fuzzy logic-based tuner for regulating the DSC parameters and virtual impedance used in the consensus-based DSC framework. Membership function, fuzzy logic operators and if-then rules are the usual elements of a fuzzy inference system. These elements were used to calculate the mapping from the input values to the output values, and it involved three subprocesses: fuzzification, aggregation and defuzzification. Here, the Mamdani fuzzy inference scheme was applied. The goal was to determine the DSC parameters K I , K P , D f i , D Pi , D Qi and virtual impedance values R viri and X viri related to the fuzzy logic system as in Figure 6. A set of fuzzy rules containing 16 rules was taken for tuning the controller parameters. The triangular membership function (MF) was employed for arranging the fuzzy rules, which is the most popular one. The input rules were collected by using the AND operator. The training arrangement is presented as follows. Based on the above rules, the estimated values for DSC parameters and virtual impedance were determined and given in Table 3. In this study, we assumed that the DSC is activated from the beginning with the droop control (primary control). The importance of parameters and was designated in accordance with voltage and reactive power. The value of was less than 0.22 Ω, which indicates that, for values bigger than 0.22 Ω, the system might be unstable. Similarly, the suitable values of  ,  ,  , , and were found to utilize the fuzzy logic tuner. These values were also verified by the time-domain simulation results. The following sections give detailed explanations with the simulation results. Figure 8 shows the 3-dimensional representations of outputs Dfi and with inputs. The eigenvalue spectrum of dominant modes is presented in Figure 9, which confirms the usefulness of the fuzzy logic tuner for system stability improvement.  Fuzzifier: The inputs, outputs and their ranges were identified in this step. The membership functions for inputs and outputs were organized as: not stable (NOTS), very low stability (VLS), low stability (LS) and normal stability (NS). Figure 7 displays the MFs for input and output constraints of every input and output. In this paper, frequency stability margin and voltage stability margin were considered as inputs, while DSC parameters and virtual impedance were considered as outputs.  Aggregation: The knowledge base for the fuzzy logic system is a group of fuzzy if-then rules as expressed in the following formula, e.g., rule 10 from Table 2 describes the following: and v re f is v re f (VLS) , then D pi is D pi (LS) , • D vi is D vi (LS) , D Qi is D Qi (LS), R viri is R viri (LS), and X viri is X vir (LS) . According to this rule, if the degree of MFs (¥) for frequency stability region is LS and for voltage stability region is VLS, the outcomes for all outputs are LS. The rules are summarized in Table A1 (Appendix A).
Defuzzifier: The fuzzy outputs were transformed to non-fuzzy values in this step. Thus, the centre average defuzzification principle based on triangular was applied to measure the crisp outputs, i.e., DSC parameters.
Based on the above rules, the estimated values for DSC parameters and virtual impedance were determined and given in Table 3. In this study, we assumed that the DSC is activated from the beginning with the droop control (primary control). The importance of parameters X viri and D Qi was designated in accordance with voltage and reactive power. The value of X viri was less than 0.22 Ω, which indicates that, for values bigger than 0.22 Ω, the system might be unstable. Similarly, the suitable values of K I , K P , D f i , D Pi , D Qi and R viri were found to utilize the fuzzy logic tuner. These values were also verified by the time-domain simulation results. The following sections give detailed explanations with the simulation results. Figure 8 shows the 3-dimensional representations of outputs D fi and X viri with inputs. The eigenvalue spectrum of dominant modes is presented in Figure 9, which confirms the usefulness of the fuzzy logic tuner for system stability improvement.

Time-Domain Simulation Results+
An MG test model as in Figure 2 was considered to validate the effectiveness of the offered DSC scheme. Matlab/Simscape software was used for simulation of the test MG model. The MG, load and line parameters used in the simulations are given in Tables A2-A4 (Appendix A). All the DSC gains were considered to be the same for all the DGs.

Case Studies
First, the simulation results could be categorized into the following two groups:


Group 1: Results with proposed DSC with initial parameters (without tuning).  Group2: Results with proposed DSC with the tuned parameters by the fuzzy logic

Time-Domain Simulation Results+
An MG test model as in Figure 2 was considered to validate the effectiveness of the offered DSC scheme. Matlab/Simscape software was used for simulation of the test MG model. The MG, load and line parameters used in the simulations are given in Tables A2-A4 (Appendix A). All the DSC gains were considered to be the same for all the DGs.

Case Studies
First, the simulation results could be categorized into the following two groups:


Group 1: Results with proposed DSC with initial parameters (without tuning).  Group2: Results with proposed DSC with the tuned parameters by the fuzzy logic

Time-Domain Simulation Results
An MG test model as in Figure 2 was considered to validate the effectiveness of the offered DSC scheme. Matlab/Simscape software was used for simulation of the test MG model. The MG, load and line parameters used in the simulations are given in Tables A2-A4 (Appendix A). All the DSC gains were considered to be the same for all the DGs.

Case Studies
First, the simulation results could be categorized into the following two groups:

•
Group 1: Results with proposed DSC with initial parameters (without tuning). • Group 2: Results with proposed DSC with the tuned parameters by the fuzzy logic tuner.
In group 1, the proposed DSC performs with not-tuned parameter values as shown in Figure 10. The simulation results of the frequency and voltage restoration are shown in Figure 10. From the results, it can be seen that the initial DSC parameters produced transient oscillations, which was also verified by the eigenvalue analysis. For group 1, convergence time for frequencies were 1.1 s and for voltages were 1.2-1.5 s. As we want to verify several case studies (case 1-case 7) to show the robustness of our proposed DSC, we considered the tuned parameters for those case studies due to space limit. However, to get better performance, the fuzzy-logic tuner was used for tuning the DSC parameters and virtual impedance values. The simulations from group 2 ere conducted with the following six case studies.

Case 1: Voltage and Frequency Restoration
The simulation outcomes of case 1 are given in Figure 11.

Case 1: Voltage and Frequency Restoration
The simulation outcomes of case 1 are given in Figure 11. When our proposed DSC was employed, the restoration process of both voltage and frequency to their reference values respectively (v re f = 311 V, f re f = 50 Hz) was very fast with less oscillation as compared with Figure 10. Thus, the fuzzy tuner could improve (convergence time improved for frequencies from 1.1 to 0.6 s and for voltages from 1.2-1.5 s to 0.7-0.8 s) the performance of DSC.

Case 2: Load Changing after Reaching the Steady State
In this case, several scenarios were analysed in the simulations according to the power flow and loading condition at each DG after reaching the steady-state ( Figure 12) as follows.
According to our proposed DSC, power sharing was in proportion to the capacities of DGs (ratio of capacities is DG1:DG2:DG3:DG4 = 2:2:1:1) as shown in Figure 12. At t = 3 s, Load #3 was disconnected from DG3, and at t = 5 s, Load #3 was again connected to DG3. At t = 6 s, Load #2 was increased by including an additional load equivalent to Load #5 and at t = 8 s, the additional load was removed from Load #2.
The simulation results from Figure 12 for load change show that the proposed DSC could accurately share active and reactive powers according to their capacities under the load disturbances.

Case 1: Voltage and Frequency Restoration
The simulation outcomes of case 1 are given in Figure 11. with less oscillation as compared with Figure 10. Thus, the fuzzy tuner could improve (convergence time improved for frequencies from 1.1 to 0.6 s and for voltages from 1.2-1.5 s to 0.7-0.8 s) the performance of DSC.

Case 2: Load Changing after Reaching the Steady State
In this case, several scenarios were analysed in the simulations according to the power flow and loading condition at each DG after reaching the steady-state ( Figure 12) as follows.
According to our proposed DSC, power sharing was in proportion to the capacities of DGs (ratio of capacities is DG1:DG2:DG3:DG4 = 2:2:1:1) as shown in Figure 12. At t = 3 s, Load #3 was disconnected from DG3, and at t = 5 s, Load #3 was again connected to DG3. At t = 6 s, Load #2 was increased by including an additional load equivalent to Load #5 and at t = 8 s, the additional load was removed from Load #2.
The simulation results from Figure 12 for load change show that the proposed DSC could accurately share active and reactive powers according to their capacities under the load disturbances.

Case 3: Occurrence of Communication Delay
In this case study, communication delay on the proposed DSC scheme was conducted with four scenarios, i.e., fixed communication delay of 0.1 s, 0.5 s, 1 s and 2 s in the MG. The proposed DSC was commenced from the beginning. For easiness, simply the voltage responses for the DG units were given for the four scenarios as shown in Figure  13. It can be realized from Figure 13a,b that the controller performed properly with small The proposed DSC was commenced from the beginning. For easiness, simply the voltage responses for the DG units were given for the four scenarios as shown in Figure 13. It can be realized from Figure 13a,b that the controller performed properly with small time delays of 0.1 s and 0.5 s. Figure 13c,d shows that, with the increase of the time delay to 1-2 s, the voltage was restored with minor deviations, but with increased convergence times. Thus, it could be concluded that the proposed DSC can still help the system with restoration under the communication latency.

Case 4: Loss of the Communication Link
Communication link failure is a common phenomenon in real-world applications. The MG system still needs to be stable in such conditions. In this case study, the simulation is done with the following scenarios.


Stage 1: There is no loss of communication link when t ≤ 2.6 s, and the MG system rapidly reaches the steady state.  Stage 2: The MG system experiences a loss of communication link from DG4 to DG1 when t > 2.6 s.
The simulation results are given in Figure 14, showing that the proposed DSC technique could deal well with the conditions of communication link failure, though there was transient oscillation that occurred for the loss of the communication link.

Case 4: Loss of the Communication Link
Communication link failure is a common phenomenon in real-world applications. The MG system still needs to be stable in such conditions. In this case study, the simulation is done with the following scenarios.

•
Stage 1: There is no loss of communication link when t ≤ 2.6 s, and the MG system rapidly reaches the steady state. • Stage 2: The MG system experiences a loss of communication link from DG4 to DG1 when t > 2.6 s.
The simulation results are given in Figure 14, showing that the proposed DSC technique could deal well with the conditions of communication link failure, though there was transient oscillation that occurred for the loss of the communication link.

Case 5: Effects on Different Communication Topologies
The effects of diverse communication topologies (line, ring and mesh) as shown in Figure 15 on the proposed model were analysed in this case. Convergence time with different topologies is summarized in Table 3. Table 3   Once synchronizing and reaching steady-state condition by the DSC, the plug-andplay capability of the controllers was assessed in this case study by disconnecting DG3 at t = 10 s and connecting it at t = 14 s. The following observations were made from the simulation results, (i) disconnection of a DG unit indicates the failure of all the communication links associated with that DG unit, (ii) the lost communication links are retrieved after reconnecting the DG unit and (iii) a synchronization procedure was required to coordinate

Case 5: Effects on Different Communication Topologies
The effects of diverse communication topologies (line, ring and mesh) as shown in Figure 15 on the proposed model were analysed in this case. Convergence time with different topologies is summarized in Table 3. Table 3

Case 5: Effects on Different Communication Topologies
The effects of diverse communication topologies (line, ring and mesh) as shown in Figure 15 on the proposed model were analysed in this case. Convergence time with different topologies is summarized in Table 3. Table 3   Once synchronizing and reaching steady-state condition by the DSC, the plug-andplay capability of the controllers was assessed in this case study by disconnecting DG3 at t = 10 s and connecting it at t = 14 s. The following observations were made from the simulation results, (i) disconnection of a DG unit indicates the failure of all the communication links associated with that DG unit, (ii) the lost communication links are retrieved after reconnecting the DG unit and (iii) a synchronization procedure was required to coordinate  Once synchronizing and reaching steady-state condition by the DSC, the plug-andplay capability of the controllers was assessed in this case study by disconnecting DG3 at t = 10 s and connecting it at t = 14 s. The following observations were made from the simulation results, (i) disconnection of a DG unit indicates the failure of all the communication links associated with that DG unit, (ii) the lost communication links are retrieved after reconnecting the DG unit and (iii) a synchronization procedure was required to coordinate DG3 with the remaining MG before reconnection. Figure 16 shows the performance of DSC with plug-and-play operation. According to Figure 16, it could be concluded that reconnection (at t = 14 s) of DG produced more oscillation than the disconnection/sudden loss (t = 10 s) of any DG unit. DG3 with the remaining MG before reconnection. Figure 16 shows the performance of DSC with plug-and-play operation. According to Figure 16, it could be concluded that reconnection (at t = 14 s) of DG produced more oscillation than the disconnection/sudden loss (t = 10 s) of any DG unit.

Case 7: MG with Fault Conditions
To study the dynamic performance of the MG model with the proposed DSC, performances of voltage and frequency and power-sharing are observed under the maximum fault condition. After reaching the steady-state condition, a three-phase to ground fault occurred at bus 1 at t = 3 s and the fault was cleared at t = 4 s. Figure 17 shows the controller performance under that fault condition, and it can be understood that the voltage and frequency controllers had the ability of preserving the system stability afterwards the fault clearance. Moreover, accurate power-sharing was achieved within a very short time after the fault clearance. It can be said that the proposed DSC was robust in maintaining the system stability under the sudden fault condition.

Case 7: MG with Fault Conditions
To study the dynamic performance of the MG model with the proposed DSC, performances of voltage and frequency and power-sharing are observed under the maximum fault condition. After reaching the steady-state condition, a three-phase to ground fault occurred at bus 1 at t = 3 s and the fault was cleared at t = 4 s. Figure 17 shows the controller performance under that fault condition, and it can be understood that the voltage and frequency controllers had the ability of preserving the system stability afterwards the fault clearance. Moreover, accurate power-sharing was achieved within a very short time after the fault clearance. It can be said that the proposed DSC was robust in maintaining the system stability under the sudden fault condition.

Convergence Time
As stated in the literature review, inadequate studies were stated that consider both the voltage and frequency restoration problems in a distributed way. In comparison with the most relevant works, as in [59], Table 3 reveals that the proposed control approach required less time to drive the frequencies to the steady-state values, which were 0.56 s, compared to 1.9 s in [59]. Additionally, the proposed control strategy performed well even though changes occurred in load, communication topology and loss of DG and even in fault conditions, which means by the proposed DSC the dynamics of the underlying system could quickly converge to the reference values under different disturbing conditions.

Conclusions
A noble cooperative DSC for islanded AC MG has been established taking the lossyline network into account, which similarly preserves the precise active and reactive power-sharing while keeping PCC bus voltage at its reference value at the same time. State-space modelling and small-signal stability analysis for the networked MG have shown that new less-damped modes are the consequences of the DSC. Intelligent fuzzybased parameter-tuner is applied to improve system stability. One of the main advantages of using a fuzzy-logic tuner is its low computational complexity in comparison to other existing methods. Theoretical analysis and time-domain simulation case scenarios of a test MG system have been explained to show the robust performance of the suggested DSC scheme. Under the proposed control method, the networked MG model can reach a steady state after different disturbances (even after fault condition) without significant transients in the system frequency, voltage and active and reactive power-sharing. The proposed DSC shows a fast response to achieve consensus and indicates better robust characteristics in terms of controller establishment, structure design and the variation of loads compared with most related existing work on DSC, which is also discussed in the simulation section.
However, as communication is the major part of the secondary control level, cyber security is of primary importance to the assurance safe task of cyber-physical systems,

Convergence Time
As stated in the literature review, inadequate studies were stated that consider both the voltage and frequency restoration problems in a distributed way. In comparison with the most relevant works, as in [59], Table 3 reveals that the proposed control approach required less time to drive the frequencies to the steady-state values, which were 0.56 s, compared to 1.9 s in [59]. Additionally, the proposed control strategy performed well even though changes occurred in load, communication topology and loss of DG and even in fault conditions, which means by the proposed DSC the dynamics of the underlying system could quickly converge to the reference values under different disturbing conditions.

Conclusions
A noble cooperative DSC for islanded AC MG has been established taking the lossyline network into account, which similarly preserves the precise active and reactive powersharing while keeping PCC bus voltage at its reference value at the same time. State-space modelling and small-signal stability analysis for the networked MG have shown that new less-damped modes are the consequences of the DSC. Intelligent fuzzy-based parametertuner is applied to improve system stability. One of the main advantages of using a fuzzy-logic tuner is its low computational complexity in comparison to other existing methods. Theoretical analysis and time-domain simulation case scenarios of a test MG system have been explained to show the robust performance of the suggested DSC scheme. Under the proposed control method, the networked MG model can reach a steady state after different disturbances (even after fault condition) without significant transients in the system frequency, voltage and active and reactive power-sharing. The proposed DSC shows a fast response to achieve consensus and indicates better robust characteristics in terms of controller establishment, structure design and the variation of loads compared with most related existing work on DSC, which is also discussed in the simulation section.
However, as communication is the major part of the secondary control level, cyber security is of primary importance to the assurance safe task of cyber-physical systems, which has obtained growing attention in the control community. To prevent our presented scheme in Figure 2 from malicious activities like "Replay Attack" or "False Data Injection" [60,61], we will consider it as a future work of this paper. Funding: This research received no external funding.

Data Availability Statement:
No new data were created or analyzed in this study. Data sharing is not applicable to this article.

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

Appendix A
0 0 −ω c I od R viri + ω c I od X viri − ω c V od −ω c I od R viri + ω c I od X viri − ω c V od −ω c I oq R viri − ω c I od X viri + ω c V oq −ω c I od R viri + ω c I od X viri − ω c V od 0 0 −2D vi K p n di R viri + n qi X viri −2D vi K p n qi R viri − n di X viri 0 0 n di R viri + n qi X viri n qi R viri − n di X viri