# Consensus-Based Intelligent Distributed Secondary Control for Multiagent Islanded Microgrid

Authors: Ali M. Jasim; Basil H. Jasim; Flah Aymen; Hossam Kotb; Ahmed Althobaiti
Journal: International Transactions on Electrical Energy Systems
 (2023)

---

## Abstract

Isolated microgrids (MGs) face challenges in performance stability and active/reactive power sharing as a result of frequency/voltage deviations and mismatched line impedance issues. In this paper, a consensus-based multiagent system (MAS) is proposed as a solution to restore voltage/frequency deviations and enable true power sharing. The invention of an Intelligent Distributed Secondary Control Scheme (IDSCS) can efficiently achieve hoped-for outcomes. The proposed IDSCS features estimation and compensation sublayers. For the estimation sublayer, discrete dynamic consensus algorithm-based state estimators are presented to collect average information of frequency, voltage, and reactive power. Each DG is viewed as an agent sharing information with its immediate neighbors through a sparse cyber communication network. In the compensation sublayer, online tuned proportional integral (PI) controllers using artificial neural networks (ANNs) are proposed as an intelligent voltage and frequency compensators. This combination uses the simplicity of the PI controller mathematical formula and ANN’s ability to deal with parameter variations and nonlinearity. Due to the global nature of the frequency parameter, the active power-sharing compensator is unnecessary. For compensating reactive power deviations, ANNs-based reactive power controllers are proposed. Furthermore, at the primary control level, the proposed strategy employs discrete-time proportional resonant (PR) controllers in a stationary reference frame, eliminating the need for anyαβ/dq or dq/αβ transformations. Distributed implementation of the proposed method guarantees system scalability without MG topology or demand pattern expertise. The control scheme was validated using hypothetical MAS in MATLAB Simulink platform. The simulation findings indicate the proposed MG system can effectively distribute power among the DGs while maintaining voltage and frequency stable.


---

## Body

## 1. Introduction

MGs can be operated on a grid-connected or islanded basis. Islanding capability enhances MG reliability in terms of supplying load demands during utility outages. In islanded operation, MG control is more difficult, and efficient voltage and frequency control strategies are essential for achieving stable operation. Consequently, the system’s frequency and voltage are always controlled by DGs. Conventional active power-frequency (P-f) and reactive power-voltage (Q-V) droop methods have seen extensive use for controlling frequency/active power and voltage/reactive power, respectively. Since the frequency is a global system quantity, P-f droop allows for real power to be shared among DGs based on their individual power ratings. Reactive power sharing is disrupted by the Q-V method because: (1) voltage parameter is local, unlike frequency [1]; (2) the network’s reactive power requirement depends on loads, network configuration, and transmission line parameters [1]; and (3) the resistive nature of the transmission lines in the network makes the active power and reactive power mutually dependent [2]. Improper sharing of the reactive power among DGs can result in voltage and frequency deviations, unanticipated load curtailment, degraded power quality, and protection failures of DGs, all of which impact the MG stability. Accordingly, it is crucial to improve upon traditional droop techniques in order to fairly distribute reactive power among DG units [3]. A variety of power electronics components, including static compensators and switched capacitors, have historically been responsible for distributing reactive power. However, in MGs based on power electronics, reactive power management objectives can be met via control of distributed power electronic converters. The P-V and Q-f droop control schemes are viable for smaller networks with a predominantly resistive nature. The network impedance is inductive for larger networks, and relationships of P-f and Q-V are more advantageous [4]. Using a virtual impedance control in conjunction with the traditional droop method improves the control performance by rendering the network virtually more inductive [5]. Additionally, the virtual impedance approach can be used in primary control to efficiently address the power sharing issue in case that DGs are connected in purely parallel like mode to the loads (in a bus or star-connected MG, not a ring or mesh MG configuration).Due to the aforementioned issues, the primary control cannot resolve the voltage and frequency variations. Also, using the virtual impedance method-based primary control to solve active and reactive power sharing problems in the presence of line impedances connecting DGs with each other like in ring or mesh network topology is also inefficient. A secondary tracking and corrective control layer is necessary for properly reducing the deviations between nominal frequency/voltage and their actual values, as well as for sharing active/reactive powers. To minimize errors, corrective terms are routed through PI controllers. Secondary Control Units (SCUs) can typically be centralized or distributed, as shown in Figure1. The grid’s voltage and frequency are typically estimated and compared to corresponding reference values in a centralized control strategy. A controller processes the error signals before sending corrective signals to all DG units (see Figure 1(a)). A typical distributed control system is shown in Figure 1(b), where each DG unit has a secondary control unit to remedy voltage and frequency deviations individually. In distributed secondary control, every DG can communicate with its neighbors.Figure 1
Secondary control strategies: (a) centralized control and (b) distributed control.
(a)(b)The main objective of the distributed controller is to bypass the drawbacks of centralized control strategies. The complex nature of the information transfer network affects the centralized controllers [6]. Consequently, the controller’s reliability decreases and its sensitivity to failure increases. The distributed control method is utilized to eliminate the aforementioned central controller drawbacks. Through a graph-based communication network, it can utilize the information and data of its neighbors. It increases system reliability, reduces system failure sensitivity, and reduces the need for a central control unit [7]. The system’s distributed secondary controller makes it easy to add new components, increases security, facilitates smooth data and information exchange between nodes, and makes decisions quickly [8].Sharing power proportionally can be achieved by merging the droop control and secondary control into one, and then using a sparsely connected network to coordinate and communicate with other control systems. In order to generate frequency and voltage references, PI controllers and consensus estimators must exclude active, reactive power, frequency, and voltage mismatches. Reactive power in an island grid can be efficiently controlled by MAS. The MAS is comprised of a group of agents, each of which possesses some levels of intelligence and makes decisions with a degree of autonomy. Nonetheless, a significant drawback of PI controllers is their limited performance, which is largely dependent on the correct tuning of their gain coefficients. Using soft computing techniques, these coefficients can be made static or dynamic throughout the process. Adaptive or “trial and error” methods [9, 10] or the alternative Ziegler–Nichols (ZN) method [11–13] are utilized to calculate static gains in PI controllers. Consequently, they may result in a delay when trying to enter a stable operation region. In order to improve power quality and system performance throughout load changes, it is crucial to properly online tune PI gains.Distributed algorithms are used to implement the secondary controllers of the MG, as described in [14]. For voltage/frequency recovering [5], sharing of power [15], and compensation for imbalanced voltage, distributed cooperative control is primarily employed for secondary control [16]. In addition, the conflict between reactive power sharing and voltage regulation is described in reference [17]. By changing the proportionality of the control gain, a proposed distributed average proportional controller can bring about a decrease in voltage deviation and an increase in precisely shared reactive power. Moreover, the authors of reference [18] proposed a method for islanded MG to equitably distribute reactive power using a combination of consensus and adaptive virtual impedance control. The proposed method restores the lowered voltage of every DG to address the mismatch in sharing of reactive power due to lines mismatched. For the purpose of sharing reactive power [19], demonstrates distributed methods adopting average PIs, which are comprised of graph theory. Despite the tuning of controllers, it is not possible to address both realizing voltage and reactive power regulation at the same time [20]. However, the active power sharing, frequency restoration, and online tuning control gains of PI controllers were not addressed in the aforementioned references [17–20]. While eliminating frequency deviations and guaranteeing accurate power sharing was proposed in [21], voltage restoration was not taken into account. However, some of the distributed secondary control-based current literature such as the ones mentioned in [22–24], offer solutions for frequency/voltage recovery as well as active power sharing with global asymptotic convergence speed. An intelligent method using fuzzy logic and PSO techniques were suggested in references [25, 26] as a means of controlling the MG frequency only using centralized control. In [27], a secondary control strategy for restoring voltage and distributing reactive power is proposed where the PI control gains are selected empirically, and no learning or optimization techniques are incorporated into the design process. Recent research has focused on distributed consensus algorithms for secondary control. A bounded, distributed, and convergent consistency control protocol for the exact allocation of active power and frequency recovery has been proposed in [28]. In [29, 30], a finite time convergence protocol enables frequency recovery and precise active power distribution. In contrast, the reactive power sharing, voltage restoration, and online tuning control gains of PI controllers were not addressed in references [29, 30]. Uneven sharing of reactive power caused by a mismatch in line impedance is addressed in [31] by proposing a virtual impedance controller with consensus-based adaptation. To adjust the reactive power mismatch, a consensus algorithm is employed, and a term to correct impedance virtualization is produced via a PI controller to eliminate a mismatch in line impedance. In order to maintain proper control of the frequency and voltage of fully DGs-based islanded MGs, the authors of paper [32] proposed a new distributed consensus-based control approach. The approach generalizes some secondary voltage and frequency control methods as a result of enhancing the accuracy of reactive power distribution and incorporating active power sharing into voltage regulation. First, secondary frequency control is implemented on a decentralized basis. Second, the voltage is not controlled by a centralized entity but rather by a network of decentralized, average voltage regulators and self-contained, portable voltage regulators. In this reference, conventional PI controllers are used as system regulators. In the paper [33], the authors provided a distributed secondary controller for voltage signals only. In the meantime, an accurately reactive distribution of power has been accomplished. Table 1 summarizes related studies and compares them to current work.Table 1
Summary of previous related studies and comparison with current work.
Reference no.Voltage restorationFrequency restorationActive power sharingReactive power sharingOnline control parameters optimization[9–13]YESYESNONONO[14, 21–24]YESYESYESNONO[5]YESYESNONONO[15]YESNOYESNONO[16, 32]YESYESYESYESNO[17–20]YESNOYESNONO[25]YESNONONOYES[26, 27]YESNONOYESNO[28, 29]NOYESYESNONO[30, 31, 33]YESNONOYESNOCurrent workYESYESYESYESYESAccording to the authors’ knowledge, there is no prior study that retrieves both nominal values of frequency and voltage and shares active and reactive energy utilizing PR-controllers, virtual impedance-based primary control, and distributed consensus secondary control with online tuning parameters using ANNs. We propose an intelligent secondary control system uses consensus estimators, ANNs-based frequency and voltage PI compensators as well as ANNs-based reactive power compensator as a means of overcoming the challenges of frequency/voltage restoration and active/reactive power sharing. Intelligent compensation method-based voltage and frequency PI controllers can make online adjustments for the control parameters using ANNs. In addition, ANNs-based reactive power compensators have been proposed to compensate any power deviations. For globally averaged voltage/frequency restoration and shared active/reactive power, it is presented to collect the average information of voltage, frequency, and reactive power using state estimators based on a consensus algorithm. The following points are the foremost contributions made by this paper:(1)
In this paper, an effective voltage and frequency control process with inner loops, virtual impedance control, droop control, and IDSCS is proposed to enhance the performance of adopted islanded multiagents MG and equally share power among DGs. In the proposed MAS, each DG is interpreted as an agent sharing data with its neighbors via a sparse cyber-layer communication network. The distributed implementation of the proposed method ensures scalability without requiring expert knowledge of the MG topology or demand patterns.(2)
We develop an online strategy for fine-tuning control parameters of PI compensators-based IDSCS using ANN learning features. The learning ability of the ANN controller enhances the proposed control mechanism’s extensibility, resulting in an independent online controller.(3)
For the proposed control strategy, a consensus algorithm-based IDSCS is used to meet the power-sharing requirements with adopting ANNs-based reactive power compensators, as well as ANNs-based tuned frequency and voltage PI compensators.(4)
By adopting a stationary reference frame (αβ-frame), the proposed mathematical models of the inverters, voltage, and current inner control loops require less processing capability. Inner controllers of each DG are implemented using proportional resonant (PR) controllers to further regulate system state variables, reduce steady-state errors, and accurately share the power of each DG. This work does not necessitate any αβ/dq or dq/αβ transformations, unlike conventional control methods based on the synchronous reference frame (dq-frame).(5)
By instantaneously responding to load changes in secondary control to achieve real-time power distribution, voltage and frequency stability and accurate active and reactive power distribution can be achieved.As for the rest of this paper, it is structured as follows. The proposed MG system is discussed in detail in Section2. Section 3 describes the modeling of the system generation resources. The cyber-physical model is developed in Section 4. Section 5 includes the details of the ANNS-based proposed control method. Section 6 performs extensive simulation studies to evaluate the proposed controller’s performance. The paper’s conclusion is presented in Section 7.


## 2. Proposed MG System

Consider the adopted, islanded MG illustrated in Figure2. This MG is comprised of five DGs (three solar photovoltaics and two storage devices), nine AC transmission line impedances shown in Table 2, and three load banks. The specified power filter parameters and droop coefficients for each DG are shown in Table 3.Figure 2
The adopted MG.Table 2
The MG line impedances.
AC line impedanceValues (Ω)R11 + jX110.03 +j0.1R22 + jX220.04 +j0.14R33 + jX330.03 +j0.125R44 + jX440.02 +j0.094R55 + jX550.025 +j0.1R12 + jX120.23 +j0.1R23 + jX230.35 + 0.58R34 + jX340.23 +j0.1R45 + jX450.35 +j0.58Table 3
The selected power filter parameters and droop coefficients.
VSI NoParameter nameValuesVSI 1 and VSI 2The coefficients for frequency droop9.5 × 10−5The coefficients for voltage droop1.3 × 10−3Power filter resistance0.1 ΩPower filter inductance1.35 mHPower filter capacitance500µfVSI 3, VSI 4, and VSI 5The coefficients for frequency droop12.5 × 10−5The coefficients for voltage droop1.5 × 10−3Power filter resistance0.1 ΩPower filter inductance1.35 mHPower filter capacitance500µfThe hierarchy of controls for a single DG is shown in Figure3. There are two levels of control in this setup: the primary and the secondary. The signals measured are all in the αβ-frame. Voltage and current inner control loops, as well as inverter mathematical models, require less processing capabilities by using αβ-frame. Each local primary control scheme composed for three components: power controller, current and voltage controllers. Based on Q-V and P-f droop control, the power control loop adjusts the frequency and voltage at nominal points. The coefficients for droop control of the frequency and voltage are mp and nq, respectively. Large droop controller slopes can be used to accelerate the process of load sharing; however, this impacts the system’s stability negatively. Figures 3 and4 illustrate the ideas behind the droop controller. To remove transient fluctuations from the power calculations, 10π cutoff frequency low-pass filters are decided to apply for the instantaneous signals of active and reactive powers (P and Q).Figure 3
DG control structures.Figure 4
P-f and Q-V characteristics of droop control.Loops of virtual impedance (virtual resistor = 0.1 and virtual inductor = 0.1) are used to enhance control performance (see Figure3). Reference inverter voltages in the αβ-frame are derived from the voltage produced by the power controller and virtual impedance loops, as well as the voltage drops caused by the line impedance. Current and voltage controllers are implemented in the discrete domain using PR controllers to eliminate high-frequency disturbances and dampen the responses, respectively.High-level controllers like SCUs are required to bring the system’s frequency and voltage back to their nominal values and improve upon the droop controller method [34]. This is due to the fact that droop controller-based low-level control is incapable of restoring their set points. The secondary controller’s main job is to fix any steady-state errors caused by the droop controller. In this paper, the distributed secondary intelligent controllers for frequency and voltage parameters are implemented using ANNs-based PI controllers. ANNs are proposed for online tuning parameters of PI controllers to minimize frequency and voltage fluctuations under load changing conditions. Also, other ANNs are proposed to create reactive power compensators with minimal deviations. Finally, voltage and reactive power compensators are combined to compensate any secondary-to-primary voltage deviation, while global frequency-based compensator is adopted to compensate secondary-to-primary frequency deviation. These deviation values are applied to the primary control layer for the restoration of nominal values of volt-age and frequency.


## 3. Modeling System-Generation Resources

### 3.1. Solar Photovoltaic

To model the operation of a PV cell, an equation defining the I-V relationship between the cell’s one diode and two resistors is provided in in the following equation [35, 36]:(1)I=Is−IOUTeVSE/αVT−1−VSERsh,where IS represents the photocurrent, IOUT the diode’s saturation reverse current, VSE the series voltage (which includes the voltage drop across the PV series resistor), Rsh is the shunt resistor responsible for current loss through highly conductive shunts across the p-n junction, and the ideality factor (α) characterizes the degree to which the diodes diverge from their ideal state. The diode’s thermal voltage, denoted by VT, depends on the temperature (T), the number of series cells (n), the Boltzmann constant (k), the charge on an electron (q).(2)VT=nkTq.The photocurrent, denoted by the following equation, depends on both the amount of solar irradiance reaching the module and the temperature of the PV cells.(3)IPHO=GkiΔT+IPHO,nGref,where ΔT is the deviation in temperature from the nominal temperature, Gref is the reference irradiance, and IPHO,n is the photocurrent measured under the reference conditions (temperature = 25°C and irradiance = 1000 Watt/m2). Both the solar irradiance (G) and the temperature coefficient (ki) are given in terms of watts per square meter.The cell’s open-circuit voltage (Voc) varies with temperature, as shown by the following equation:(4)Voc=Voc,n+kvΔT,where Voc,n is the V oc at nominal temperature and kv is the temperature coefficient for this voltage. The saturation current through the diode can be determined by solving for Io.(5)Io=kiΔT+ISC,NeVoc,n+kvΔT/αVT−1,where ISC,N is the normal short circuit current.


### 3.2. Battery Energy Storage System (BESS)

Two important factors representing the battery state in a BESS are the terminal voltage and the SOC, which are depicted as follows [37, 38]:(6)Vo=Vb+Rbib−KQQ+∫ibdt+A.eB∫ibdtSOC=1001+∫ibdtQ,where Rb represents the battery’s internal resistance; Vo is the open-circuit voltage; ib is the charging current from the BESS; K denotes the polarization voltage; Q represents the battery’s capacity; A denotes the exponential voltage; and B is the battery’s total storage capacity.


## 3.1. Solar Photovoltaic

To model the operation of a PV cell, an equation defining the I-V relationship between the cell’s one diode and two resistors is provided in in the following equation [35, 36]:(1)I=Is−IOUTeVSE/αVT−1−VSERsh,where IS represents the photocurrent, IOUT the diode’s saturation reverse current, VSE the series voltage (which includes the voltage drop across the PV series resistor), Rsh is the shunt resistor responsible for current loss through highly conductive shunts across the p-n junction, and the ideality factor (α) characterizes the degree to which the diodes diverge from their ideal state. The diode’s thermal voltage, denoted by VT, depends on the temperature (T), the number of series cells (n), the Boltzmann constant (k), the charge on an electron (q).(2)VT=nkTq.The photocurrent, denoted by the following equation, depends on both the amount of solar irradiance reaching the module and the temperature of the PV cells.(3)IPHO=GkiΔT+IPHO,nGref,where ΔT is the deviation in temperature from the nominal temperature, Gref is the reference irradiance, and IPHO,n is the photocurrent measured under the reference conditions (temperature = 25°C and irradiance = 1000 Watt/m2). Both the solar irradiance (G) and the temperature coefficient (ki) are given in terms of watts per square meter.The cell’s open-circuit voltage (Voc) varies with temperature, as shown by the following equation:(4)Voc=Voc,n+kvΔT,where Voc,n is the V oc at nominal temperature and kv is the temperature coefficient for this voltage. The saturation current through the diode can be determined by solving for Io.(5)Io=kiΔT+ISC,NeVoc,n+kvΔT/αVT−1,where ISC,N is the normal short circuit current.


## 3.2. Battery Energy Storage System (BESS)

Two important factors representing the battery state in a BESS are the terminal voltage and the SOC, which are depicted as follows [37, 38]:(6)Vo=Vb+Rbib−KQQ+∫ibdt+A.eB∫ibdtSOC=1001+∫ibdtQ,where Rb represents the battery’s internal resistance; Vo is the open-circuit voltage; ib is the charging current from the BESS; K denotes the polarization voltage; Q represents the battery’s capacity; A denotes the exponential voltage; and B is the battery’s total storage capacity.


## 4. Islanded MG Cyber-Physical Model

### 4.1. Cyber Layer

DGs are treated as agents in the cyber layer. DGs communicate with each other via a sparse communication network. To describe the communication network, we useG=V,E, where V=1,…,M is the set of nodes relating to each DG and E⊂V×V is the set of edges relating to the communication link.Noded is indeed a neighbor of node r if an edge defined as exists r,d∈E. W=wrd∈RM×M represents the adjacency matrix where wrr=0 for all r, and wrd=1 if and only if r,d∈E, otherwise wrd=0. Mr=d|r,d∈E denotes the neighbors of node r, and the definition of degree of node r is Dr=∑d∈Mrwrd. The symbol L stands for the Laplacian matrix of the graph G, L=DI−W, where DI=diagD1,D2,….DM is the graph’s degree matrix. A path in a graph is defined as a connected edge, and the graph G is linked if there is a path connecting any two nodes. Figure 5 illustrates the proposed cyber-layer communication system. In the adopted communication system, the adjacency matrix is given by the following equation:(7)W=w11w12w13w14w15w21w22w23w24w25w31w32w33w34w35w41w42w43w44w45w51w52w53w54w55=0100110101010100010111011.Figure 5
Exchange of information among agents.


### 4.2. Proposed Primary Control

A VSI, a power LC filter, and an output connector are adopted to connect a 3ϕ inverter-based DGrr=1,2,…M to the MG at the physical layer. The inductances, capacitances, and resistances of the LC filter are denoted by Lrs, Rrs, and Crs, respectively, while the inductances and resistances of the output connector are denoted by Lrr and Rrr, respectively. Lrd and Rrd represent the inductances and resistances, respectively, between pairs of DGs.The primary control ofDGr consists of the droop-based power controller, the PI current and voltage controllers, as shown in Figure 3. Power controllers for DGr uses to regulate angular frequency (ωr) and voltage (Vr), which can be found in references [39, 40].(8)Vr=Vr∗−nrqQr,ωr=ωr∗−mrpPr,where mrp and nrq are the coefficients for frequency and voltage droop. Active and reactive power are made up of Pr and Qr, which can be calculated and filtered using two low-pass filters. In this paper, the primary control reference signals are ωr∗ and Vr∗ which are created by the secondary control.In order to improve the control performance by virtually increasing the network’s inductance, virtual impedance loops inαβ-frame have been applied in primary control using the following equations:(9)Vαver=−ωrefLvIβinv+RvIαinv,(10)Vβver=−ωrefLvIαinv+RvIβinv,where Rv and Lv are the virtual resistance and inductance, Iαinv and Iβinv are inverter’s currents in αβ-frame, Vαver and Vβver are the drop voltages compensation due to line impedances.The PI controller of an inverter has well-known disadvantages, including steady-state errors in magnitude and phase responses and restricted capability for disturbance rejection [41]. The proposed αβ-frame-based voltage and current control loops adopt PR controllers. Current harmonic tracking is used in the current control loop to provide nonlinear currents to nonlinear loads, and voltage harmonic suppression is applied in the voltage control loop to reduce voltage harmonics [42]. The voltage and current controllers use generalized integrators (GI) to eliminate steady-state error. The transfer function of the PR controller is described by the following equation [43, 44].(11)GPRs=KP+KRss2+ω2,where the resonant constant (KR) is responsible for eliminating steady-state error [42]. The bandwidth, centered on the resonance frequency, is defined by the parameter KR. The proportional gain KP of the PR controller, like that of the classical PI controller, defines the operating range and the margin of stability [45].The GI in equation (11) is decomposed into two easy integrators as follows to facilitate the discretization:(12)ysFs=ss2+ω2↔,ys=1sFs−Bs,Bs=1sω2ys.Figure6(a) is a schematic representation of the GI equivalent form. It is recommended that the forward method be used to discretize the direct integrator and the backwards method be used to discretize the feedback integrator, resulting in(13)yk=yk−1+TsFk−Bk−2,Bk=Bk−1+Tsω2yk.Figure 6
(a) Generalized integrator decomposed into two simple integrators; (b) PR controller implementation control diagram.
(a)(b)This leads to the following expression for the transfer function of the PR controller(14)U∗s=esKP+KRss2+ω2,and can be expressed as follows in discrete form:(15)yk=yk−1+TsKRek−1−TsBk−1,UC∗k=KPek+yk,Bk=Bk−1+Tsω2yk,yk=yk−1,Bk=Bk−1,ek=ek−1,where UC∗k is the control input signal to the plant transfer function (G(s))Figure6(b) illustrates the block diagram of the implementation of the PR control. The antiwindup function (A) described as(16)A=−y+Maxy,y>Maxy,−y−Maxy,y<−Maxy,and has been included to avoid the well-known winding up issues.The outer voltage PR controller is adopted for providing the referenceαβ-frame currents (Iα and Iβ) to the inner current PR controller using the following equations:(17)yα,Ik=yα,Ik−1+TsKRVVαrefk−1−Vαinvk−1−Vαverk−1−TsBα,Ik−1,(18)Bα,Ik=Bα,Ik−1+Tsω2yα,Ik,(19)Iα=KPVVαrefk−Vαinvk−Vαverk+yα,Ik+Iαinv,(20)yβ,Ik=yβ,Ik−1+TsKRVVβrefk−1−Vβinvk−1−Vβverk−1−TsBβ,Ik−1,(21)Bβ,Ik=Bβ,Ik−1+Tsω2yβ,Ik,(22)Iβ=KPVVβrefk−Vβinvk−Vβverk+yβ,Ik+Iβinv,where Vαinv and Vβinv are the αβ-frame inverter voltages, KPV and KRV are the control parameters of the voltage PR controller.The inner current controller generates the reference voltage for the VSI inαβ-frame (Vα and Vβ) using the following equations:(23)yα,Vk=yα,Vk−1+TsKRIIαk−Iαinvk−TsBα,Vk−1,(24)Bα,Vk=Bα,Vk−1+Tsω2yα,Vk,(25)Vα=KPIIαk−Iαinvk+yα,Vk,(26)yβ,Vk=yβ,Vk−1+TsKRIIβk−Iβinvk−TsBβ,Vk−1,(27)Bβ,Vk=Bβ,Vk−1+Tsω2yβ,Vk,(28)Vβ=KPIIβk−Iβinvk+yβ,Vk,where KPI and KRI are the control parameters of PR current controller.Using the inverse of Clarke transform, the inverter’s voltage reference signals inαβ-frame are then transformed into abc-frame as follows:(29)VaVbVc=1012−0.53212−0.5−3212VαVβ0.Then, these three phase voltage signals are applied to the pulse width modulation (PWM) generator in order to turn on/off the power electronics switches of the corresponding VSI.Table4 illustrates the main control parameters for the voltage and current PI controllers.Table 4
Control parameters of primary control.
DescriptionsSymbolsNominal valuesSampling timeTs100μsecNominal frequencyωref2π(50) HzPI current regulator proportional gainKPV0.01PI current regulator integral gainKRV400PI voltage regulator proportional gainKPI0.7PI voltage regulator integral gainKRI200


### 4.3. Framework of Proposed Consensus-Based IDSCS

Voltage and frequency of DGs depart from nominal values due to droop control. Moreover, it is impossible to achieve equitable power distribution among DGs in the case of mismatching line impedances. In this paper, the objective of the IDSCS is to restore voltage/frequency to its nominal values while keeping active/reactive power sharing among DGs. This is achievable by consensus, where each DG is treated as an agent and its neighboring members exchange information via a distributed cyber-layer network. Figure7 demonstrates the framework of the presented IDSCS for frequency/voltage and active/reactive power control, which includes compensation and estimation sublayers. In a distributed fashion, the estimation sublayer collects data on the average frequency, voltage, active power, and reactive power, and then transmits it to the compensation sublayer. The second sublayer computes the reference signals (ωr∗ and Vr∗) and transmits it to the primary control in order to regulate the frequency and voltage of each DG.Figure 7
The proposed IDSCS.


#### 4.3.1. Estimation Sublayer

A state estimator called average frequency estimator (AFE), average voltage estimator (AVE), and average reactive power estimator (ARPE) based on the average information about frequency, voltage, and reactive power is found using discrete consensus algorithms.x¯rp=ω¯r,V¯r,Q¯r represents the average estimation signal of frequency, voltage, and reactive power, respectively, at each iteration p. DGr receives the neighboring estimates x¯dp=ω¯d,V¯d,Q¯d,∀d∈Mr via the communication network.Through the communication network,DGr receives the neighboring estimates x¯dp=ω¯d,V¯d,Q¯d, ∀d∈Mr, and the state estimators are modified as shown in the following equation:(30)ω¯rp=ω¯rp+1−ɛ∑d∈Mrwrdω¯dp−ω¯rp+ωrp+1−ωrp,V¯rp=V¯rp+1−ɛ∑d∈MrwrdV¯dp−V¯rp+Vrp+1−Vrp,Q¯rp=Q¯rp+1−ɛ∑d∈MrwrdQ¯dp−Q¯rp+Qrp+1−Qrp,where the step-size that should satisfy 0<ɛ<1/Maxr=1,2,…MDr to ensure algorithm convergence.x¯rp eventually approaches the average value of frequency, voltage, and reactive power, which can be written as the following expression:(31)limp⟶∞x¯rp=limp⟶∞∑r∈VxrpM.The consensus-based state estimators allow DGs to evaluate the average frequency, voltage, and reactive power in a fully distributed manner, as opposed to the conventional centralized method.


#### 4.3.2. Compensation Sublayer

To obtain frequency and voltage regulation, each DG must measure the frequency and voltage errors and compensate for the primary control-caused deviations. In the meantime, the estimated average reactive power serves as a benchmark for each DG to eventually realize power sharing. ForDGr, two compensation terms are computed:(32)Δωrp=KpfANN×ωref−ω¯rp+KifANN×∑z=0pωref−ω¯rz,(33)ΔVrp=KpVANN×Vref−V¯rp+KiVANN×∑z=0pVref−V¯rz,where KpfANNandKifANN denote the ANNs-based tuned proportional and integral gains of PI frequency controller, while the proportional and integral parameter gains KpVANNandKiVANN for the PI voltage controller.The ANNs are used to develop the reactive power compensators which produce output signals (ΔQrp) correspond to the minimum deviations in reactive power (next section for details). For all DGs, ωref and Vref stand for the universal reference frequency and voltage, respectively. Once the compensation terms are added to ωref and Vref, the secondary-to-primary frequency and voltage signals (ωr∗ and Vr∗) are applied to the primary control of DGr and they can be calculated as follows:(34)ωr∗=ωref+Δωrp,Vr∗=Vref+ΔVrp+ΔQrp.


## 4.1. Cyber Layer

DGs are treated as agents in the cyber layer. DGs communicate with each other via a sparse communication network. To describe the communication network, we useG=V,E, where V=1,…,M is the set of nodes relating to each DG and E⊂V×V is the set of edges relating to the communication link.Noded is indeed a neighbor of node r if an edge defined as exists r,d∈E. W=wrd∈RM×M represents the adjacency matrix where wrr=0 for all r, and wrd=1 if and only if r,d∈E, otherwise wrd=0. Mr=d|r,d∈E denotes the neighbors of node r, and the definition of degree of node r is Dr=∑d∈Mrwrd. The symbol L stands for the Laplacian matrix of the graph G, L=DI−W, where DI=diagD1,D2,….DM is the graph’s degree matrix. A path in a graph is defined as a connected edge, and the graph G is linked if there is a path connecting any two nodes. Figure 5 illustrates the proposed cyber-layer communication system. In the adopted communication system, the adjacency matrix is given by the following equation:(7)W=w11w12w13w14w15w21w22w23w24w25w31w32w33w34w35w41w42w43w44w45w51w52w53w54w55=0100110101010100010111011.Figure 5
Exchange of information among agents.


## 4.2. Proposed Primary Control

A VSI, a power LC filter, and an output connector are adopted to connect a 3ϕ inverter-based DGrr=1,2,…M to the MG at the physical layer. The inductances, capacitances, and resistances of the LC filter are denoted by Lrs, Rrs, and Crs, respectively, while the inductances and resistances of the output connector are denoted by Lrr and Rrr, respectively. Lrd and Rrd represent the inductances and resistances, respectively, between pairs of DGs.The primary control ofDGr consists of the droop-based power controller, the PI current and voltage controllers, as shown in Figure 3. Power controllers for DGr uses to regulate angular frequency (ωr) and voltage (Vr), which can be found in references [39, 40].(8)Vr=Vr∗−nrqQr,ωr=ωr∗−mrpPr,where mrp and nrq are the coefficients for frequency and voltage droop. Active and reactive power are made up of Pr and Qr, which can be calculated and filtered using two low-pass filters. In this paper, the primary control reference signals are ωr∗ and Vr∗ which are created by the secondary control.In order to improve the control performance by virtually increasing the network’s inductance, virtual impedance loops inαβ-frame have been applied in primary control using the following equations:(9)Vαver=−ωrefLvIβinv+RvIαinv,(10)Vβver=−ωrefLvIαinv+RvIβinv,where Rv and Lv are the virtual resistance and inductance, Iαinv and Iβinv are inverter’s currents in αβ-frame, Vαver and Vβver are the drop voltages compensation due to line impedances.The PI controller of an inverter has well-known disadvantages, including steady-state errors in magnitude and phase responses and restricted capability for disturbance rejection [41]. The proposed αβ-frame-based voltage and current control loops adopt PR controllers. Current harmonic tracking is used in the current control loop to provide nonlinear currents to nonlinear loads, and voltage harmonic suppression is applied in the voltage control loop to reduce voltage harmonics [42]. The voltage and current controllers use generalized integrators (GI) to eliminate steady-state error. The transfer function of the PR controller is described by the following equation [43, 44].(11)GPRs=KP+KRss2+ω2,where the resonant constant (KR) is responsible for eliminating steady-state error [42]. The bandwidth, centered on the resonance frequency, is defined by the parameter KR. The proportional gain KP of the PR controller, like that of the classical PI controller, defines the operating range and the margin of stability [45].The GI in equation (11) is decomposed into two easy integrators as follows to facilitate the discretization:(12)ysFs=ss2+ω2↔,ys=1sFs−Bs,Bs=1sω2ys.Figure6(a) is a schematic representation of the GI equivalent form. It is recommended that the forward method be used to discretize the direct integrator and the backwards method be used to discretize the feedback integrator, resulting in(13)yk=yk−1+TsFk−Bk−2,Bk=Bk−1+Tsω2yk.Figure 6
(a) Generalized integrator decomposed into two simple integrators; (b) PR controller implementation control diagram.
(a)(b)This leads to the following expression for the transfer function of the PR controller(14)U∗s=esKP+KRss2+ω2,and can be expressed as follows in discrete form:(15)yk=yk−1+TsKRek−1−TsBk−1,UC∗k=KPek+yk,Bk=Bk−1+Tsω2yk,yk=yk−1,Bk=Bk−1,ek=ek−1,where UC∗k is the control input signal to the plant transfer function (G(s))Figure6(b) illustrates the block diagram of the implementation of the PR control. The antiwindup function (A) described as(16)A=−y+Maxy,y>Maxy,−y−Maxy,y<−Maxy,and has been included to avoid the well-known winding up issues.The outer voltage PR controller is adopted for providing the referenceαβ-frame currents (Iα and Iβ) to the inner current PR controller using the following equations:(17)yα,Ik=yα,Ik−1+TsKRVVαrefk−1−Vαinvk−1−Vαverk−1−TsBα,Ik−1,(18)Bα,Ik=Bα,Ik−1+Tsω2yα,Ik,(19)Iα=KPVVαrefk−Vαinvk−Vαverk+yα,Ik+Iαinv,(20)yβ,Ik=yβ,Ik−1+TsKRVVβrefk−1−Vβinvk−1−Vβverk−1−TsBβ,Ik−1,(21)Bβ,Ik=Bβ,Ik−1+Tsω2yβ,Ik,(22)Iβ=KPVVβrefk−Vβinvk−Vβverk+yβ,Ik+Iβinv,where Vαinv and Vβinv are the αβ-frame inverter voltages, KPV and KRV are the control parameters of the voltage PR controller.The inner current controller generates the reference voltage for the VSI inαβ-frame (Vα and Vβ) using the following equations:(23)yα,Vk=yα,Vk−1+TsKRIIαk−Iαinvk−TsBα,Vk−1,(24)Bα,Vk=Bα,Vk−1+Tsω2yα,Vk,(25)Vα=KPIIαk−Iαinvk+yα,Vk,(26)yβ,Vk=yβ,Vk−1+TsKRIIβk−Iβinvk−TsBβ,Vk−1,(27)Bβ,Vk=Bβ,Vk−1+Tsω2yβ,Vk,(28)Vβ=KPIIβk−Iβinvk+yβ,Vk,where KPI and KRI are the control parameters of PR current controller.Using the inverse of Clarke transform, the inverter’s voltage reference signals inαβ-frame are then transformed into abc-frame as follows:(29)VaVbVc=1012−0.53212−0.5−3212VαVβ0.Then, these three phase voltage signals are applied to the pulse width modulation (PWM) generator in order to turn on/off the power electronics switches of the corresponding VSI.Table4 illustrates the main control parameters for the voltage and current PI controllers.Table 4
Control parameters of primary control.
DescriptionsSymbolsNominal valuesSampling timeTs100μsecNominal frequencyωref2π(50) HzPI current regulator proportional gainKPV0.01PI current regulator integral gainKRV400PI voltage regulator proportional gainKPI0.7PI voltage regulator integral gainKRI200


## 4.3. Framework of Proposed Consensus-Based IDSCS

Voltage and frequency of DGs depart from nominal values due to droop control. Moreover, it is impossible to achieve equitable power distribution among DGs in the case of mismatching line impedances. In this paper, the objective of the IDSCS is to restore voltage/frequency to its nominal values while keeping active/reactive power sharing among DGs. This is achievable by consensus, where each DG is treated as an agent and its neighboring members exchange information via a distributed cyber-layer network. Figure7 demonstrates the framework of the presented IDSCS for frequency/voltage and active/reactive power control, which includes compensation and estimation sublayers. In a distributed fashion, the estimation sublayer collects data on the average frequency, voltage, active power, and reactive power, and then transmits it to the compensation sublayer. The second sublayer computes the reference signals (ωr∗ and Vr∗) and transmits it to the primary control in order to regulate the frequency and voltage of each DG.Figure 7
The proposed IDSCS.


### 4.3.1. Estimation Sublayer

A state estimator called average frequency estimator (AFE), average voltage estimator (AVE), and average reactive power estimator (ARPE) based on the average information about frequency, voltage, and reactive power is found using discrete consensus algorithms.x¯rp=ω¯r,V¯r,Q¯r represents the average estimation signal of frequency, voltage, and reactive power, respectively, at each iteration p. DGr receives the neighboring estimates x¯dp=ω¯d,V¯d,Q¯d,∀d∈Mr via the communication network.Through the communication network,DGr receives the neighboring estimates x¯dp=ω¯d,V¯d,Q¯d, ∀d∈Mr, and the state estimators are modified as shown in the following equation:(30)ω¯rp=ω¯rp+1−ɛ∑d∈Mrwrdω¯dp−ω¯rp+ωrp+1−ωrp,V¯rp=V¯rp+1−ɛ∑d∈MrwrdV¯dp−V¯rp+Vrp+1−Vrp,Q¯rp=Q¯rp+1−ɛ∑d∈MrwrdQ¯dp−Q¯rp+Qrp+1−Qrp,where the step-size that should satisfy 0<ɛ<1/Maxr=1,2,…MDr to ensure algorithm convergence.x¯rp eventually approaches the average value of frequency, voltage, and reactive power, which can be written as the following expression:(31)limp⟶∞x¯rp=limp⟶∞∑r∈VxrpM.The consensus-based state estimators allow DGs to evaluate the average frequency, voltage, and reactive power in a fully distributed manner, as opposed to the conventional centralized method.


### 4.3.2. Compensation Sublayer

To obtain frequency and voltage regulation, each DG must measure the frequency and voltage errors and compensate for the primary control-caused deviations. In the meantime, the estimated average reactive power serves as a benchmark for each DG to eventually realize power sharing. ForDGr, two compensation terms are computed:(32)Δωrp=KpfANN×ωref−ω¯rp+KifANN×∑z=0pωref−ω¯rz,(33)ΔVrp=KpVANN×Vref−V¯rp+KiVANN×∑z=0pVref−V¯rz,where KpfANNandKifANN denote the ANNs-based tuned proportional and integral gains of PI frequency controller, while the proportional and integral parameter gains KpVANNandKiVANN for the PI voltage controller.The ANNs are used to develop the reactive power compensators which produce output signals (ΔQrp) correspond to the minimum deviations in reactive power (next section for details). For all DGs, ωref and Vref stand for the universal reference frequency and voltage, respectively. Once the compensation terms are added to ωref and Vref, the secondary-to-primary frequency and voltage signals (ωr∗ and Vr∗) are applied to the primary control of DGr and they can be calculated as follows:(34)ωr∗=ωref+Δωrp,Vr∗=Vref+ΔVrp+ΔQrp.


## 4.3.1. Estimation Sublayer

A state estimator called average frequency estimator (AFE), average voltage estimator (AVE), and average reactive power estimator (ARPE) based on the average information about frequency, voltage, and reactive power is found using discrete consensus algorithms.x¯rp=ω¯r,V¯r,Q¯r represents the average estimation signal of frequency, voltage, and reactive power, respectively, at each iteration p. DGr receives the neighboring estimates x¯dp=ω¯d,V¯d,Q¯d,∀d∈Mr via the communication network.Through the communication network,DGr receives the neighboring estimates x¯dp=ω¯d,V¯d,Q¯d, ∀d∈Mr, and the state estimators are modified as shown in the following equation:(30)ω¯rp=ω¯rp+1−ɛ∑d∈Mrwrdω¯dp−ω¯rp+ωrp+1−ωrp,V¯rp=V¯rp+1−ɛ∑d∈MrwrdV¯dp−V¯rp+Vrp+1−Vrp,Q¯rp=Q¯rp+1−ɛ∑d∈MrwrdQ¯dp−Q¯rp+Qrp+1−Qrp,where the step-size that should satisfy 0<ɛ<1/Maxr=1,2,…MDr to ensure algorithm convergence.x¯rp eventually approaches the average value of frequency, voltage, and reactive power, which can be written as the following expression:(31)limp⟶∞x¯rp=limp⟶∞∑r∈VxrpM.The consensus-based state estimators allow DGs to evaluate the average frequency, voltage, and reactive power in a fully distributed manner, as opposed to the conventional centralized method.


## 4.3.2. Compensation Sublayer

To obtain frequency and voltage regulation, each DG must measure the frequency and voltage errors and compensate for the primary control-caused deviations. In the meantime, the estimated average reactive power serves as a benchmark for each DG to eventually realize power sharing. ForDGr, two compensation terms are computed:(32)Δωrp=KpfANN×ωref−ω¯rp+KifANN×∑z=0pωref−ω¯rz,(33)ΔVrp=KpVANN×Vref−V¯rp+KiVANN×∑z=0pVref−V¯rz,where KpfANNandKifANN denote the ANNs-based tuned proportional and integral gains of PI frequency controller, while the proportional and integral parameter gains KpVANNandKiVANN for the PI voltage controller.The ANNs are used to develop the reactive power compensators which produce output signals (ΔQrp) correspond to the minimum deviations in reactive power (next section for details). For all DGs, ωref and Vref stand for the universal reference frequency and voltage, respectively. Once the compensation terms are added to ωref and Vref, the secondary-to-primary frequency and voltage signals (ωr∗ and Vr∗) are applied to the primary control of DGr and they can be calculated as follows:(34)ωr∗=ωref+Δωrp,Vr∗=Vref+ΔVrp+ΔQrp.


## 5. ANNs-Based Proposed IDSCS

### 5.1. ANNs-Based Online Tuning PI Controller

We use an intelligent algorithm to fine-tune the control parameters in real-time in order to improve the capabilities of secondary controllers. Voltage and frequency control must be controlled simultaneously for the efficient and reliable operation of the MG. Therefore, we develop IDSCS based on ANNs. In particular, the ANN is a parallel processing tool comprised of numerous processing components. To accomplish a specific goal, these components are organized in a particular manner. Its benefits include parallel processing, extensibility, and tolerable mechanisms for noisy and uncertain processes. In general, feedforward and feedback processes are applied to the training process and weight adjustment.The operating point of the MG changes as a result of changing load conditions. Thus, noticeable variations can be seen to occur in both frequency and voltage signals. It is necessary to make online adjustments to the control parameters of frequency and voltage compensators using ANNs to prevent this issue. This broadens the range of operational conditions. The proposed IDSCS is shown pictorially in Figure3. First, both the frequency and voltage deviations are being collected. These data are processed and used as the inputs to the ANN, and the appropriate learning rules are applied in order to make adjustments for the weights of the nodes. As a direct consequence of this, accurate set-points are produced in each DG. By carrying out the control procedure, a risk-free outcome is achieved, which in turn ensures that the MG voltage and frequency will continue to be stable.An ANN-based PI controller is composed of three layers: the input, output, and hidden layers. We have decided to utilize five neurons for the input layer based on the information supplied by the system expert. Twenty neurons are located in the hidden layer. In the input layer, the neurons are of the linear type, while in the hidden layer, they are of the nonlinear type. The number of controlling variables determines how many neurons comprise the output layer. As shown in Figure2, the investigated MG is composed of a total of five DGs. Each DG has two SCUs, one for voltage signal and other for frequency. Each of these controllers possesses a proportional gain parameter in addition to an integral gain. Consequently, the output layer contains two linear neurons per SCU. The feed-forward mechanism activates the hidden and output layers when the input date is considered. A neuron is the fundamental building block of an ANN, and it consists of three primary components: weights, biases, and activation functions. The labels xi indicate the incoming data. The equation (35) depicts the relationship between these variables.(35)yjp=netjp=f∑i=1nxipwijp−θi,where n is the total number of input layer neurons, θi stands for bias, fnet is the activation function, wijp is the weights of the hidden layer at iteration p, and indices i and j are the input layer and output layer neurons, respectively. fnet may indeed be sign, logsigmoid, tansigmoid, etc. For learning algorithms such as the back-propagation algorithm, activation function derivative (f′net) are required. Because the control parameters (Kp and Ki) cannot be negative, fnet of output layer neuron employs the non-negative sigmoid function. In addition, it is essential to provide the correct initial conditions for an ANN-based controller. The desired initial values of the voltage and frequency signals are set to their nominal values 220V50Hz.The activation function differential at the hidden layer can be written as [46].(36)f′netjp=fnetjp1−fnetjp.Calculation of the network’s output layer nodes is(37)ykp=netkp=f∑j=1Qyjpwjkp−θj,k=1,2where Q represents the hidden layer neurons, wjkp is the weight vector for the output layer at iteration p, k represents the neurons number in output layer.The frequency and voltage PI controllers’ parameters can be computed as follows:(38)KpfANN=O1fp,KifANN=O2fp,KpVANN=O1Vp,KiVANN=O2Vp,where the O1fp,O2fp,O1Vp,andO2Vp denote the outputs of ANNs, which are frequency and voltage controllers’ proportional and integral gains, respectively.The frequency and voltage outputs are compared to their desired vector, denoted byydkp, in order to enhance frequency and voltage performance through intelligent online tuning of control parameters using an ANN structure. This study employs a supervised learning method to learning. The back-propagation method is used to implement the learning approach. The following is the error function at the neuron k and p iteration [46]:(39)ekp=ydkp−ykp,where ykp represents the measured output and ydkp denotes the desired output.The weights have been updated as follows based on the errorekp [46]:(40)wjkp+1=Δwjkp+wjkp,(41)wijp+1=Δwijp+wijp,where Δwijp and Δwjkp denote the weight changes due to the system error value. The indices i, j, and k represent the neurons in the input layer, hidden, and output layers, respectively.(42)Δwjkp=η×yjp×δkp,where η represent the learning rate (it is small positive number), and δkp represents the error gradient at iteration p and neuron k in the output layer.Multiplying the error at the output neuron by the derivative of the activation function yields an error gradient. This means that in the output layer, for neuronk, we have(43)δkp=∂ykp∂Xkp×ekp,where at iteration p, Xkp is the net weighted input to neuron k at the same iteration in the process.For a sigmoid activation function, equation (43) can be written as(44)δkp=ekp×∂1/1+e−Xkp∂Xkp=e−Xkp1+e−Xkp2×ekp.Consequently, we get(45)δkp=ykp×ekp×1−ykp,where(46)ykp=11+e−Xkp.The weight correction for the hidden layer can be determined using the same formula as for the output layer:(47)Δwijp=η×xip×δjp,where δjp represents the error gradient at j neuron:(48)δjp=yjp×1−yjp×∑k=1Rδkpwjkp,where R denotes the count of output layer neurons.(49)yjp=11+e−∑i=1nxipwijp−θi.The process of learning will continue until the minimum amount of error is reached.


### 5.2. ANNs-Based Reactive Power Compensator

To produce minimum deviations in reactive power, the ANNs-based reactive power compensators use the same technique as described in the previous subsection. In every DG, the voltage compensator output compensating term (equation (33)) is added to the reactive power compensating term and the reference system voltage. The complete summation signal must be applied to the primary control level in order to compensate for any voltage deviation.(50)ΔQrp=O1pfor ANN−based reactive power compensator.In addition, back-propagation is employed to implement the learning strategy, along with equations (39)–(49).


## 5.1. ANNs-Based Online Tuning PI Controller

We use an intelligent algorithm to fine-tune the control parameters in real-time in order to improve the capabilities of secondary controllers. Voltage and frequency control must be controlled simultaneously for the efficient and reliable operation of the MG. Therefore, we develop IDSCS based on ANNs. In particular, the ANN is a parallel processing tool comprised of numerous processing components. To accomplish a specific goal, these components are organized in a particular manner. Its benefits include parallel processing, extensibility, and tolerable mechanisms for noisy and uncertain processes. In general, feedforward and feedback processes are applied to the training process and weight adjustment.The operating point of the MG changes as a result of changing load conditions. Thus, noticeable variations can be seen to occur in both frequency and voltage signals. It is necessary to make online adjustments to the control parameters of frequency and voltage compensators using ANNs to prevent this issue. This broadens the range of operational conditions. The proposed IDSCS is shown pictorially in Figure3. First, both the frequency and voltage deviations are being collected. These data are processed and used as the inputs to the ANN, and the appropriate learning rules are applied in order to make adjustments for the weights of the nodes. As a direct consequence of this, accurate set-points are produced in each DG. By carrying out the control procedure, a risk-free outcome is achieved, which in turn ensures that the MG voltage and frequency will continue to be stable.An ANN-based PI controller is composed of three layers: the input, output, and hidden layers. We have decided to utilize five neurons for the input layer based on the information supplied by the system expert. Twenty neurons are located in the hidden layer. In the input layer, the neurons are of the linear type, while in the hidden layer, they are of the nonlinear type. The number of controlling variables determines how many neurons comprise the output layer. As shown in Figure2, the investigated MG is composed of a total of five DGs. Each DG has two SCUs, one for voltage signal and other for frequency. Each of these controllers possesses a proportional gain parameter in addition to an integral gain. Consequently, the output layer contains two linear neurons per SCU. The feed-forward mechanism activates the hidden and output layers when the input date is considered. A neuron is the fundamental building block of an ANN, and it consists of three primary components: weights, biases, and activation functions. The labels xi indicate the incoming data. The equation (35) depicts the relationship between these variables.(35)yjp=netjp=f∑i=1nxipwijp−θi,where n is the total number of input layer neurons, θi stands for bias, fnet is the activation function, wijp is the weights of the hidden layer at iteration p, and indices i and j are the input layer and output layer neurons, respectively. fnet may indeed be sign, logsigmoid, tansigmoid, etc. For learning algorithms such as the back-propagation algorithm, activation function derivative (f′net) are required. Because the control parameters (Kp and Ki) cannot be negative, fnet of output layer neuron employs the non-negative sigmoid function. In addition, it is essential to provide the correct initial conditions for an ANN-based controller. The desired initial values of the voltage and frequency signals are set to their nominal values 220V50Hz.The activation function differential at the hidden layer can be written as [46].(36)f′netjp=fnetjp1−fnetjp.Calculation of the network’s output layer nodes is(37)ykp=netkp=f∑j=1Qyjpwjkp−θj,k=1,2where Q represents the hidden layer neurons, wjkp is the weight vector for the output layer at iteration p, k represents the neurons number in output layer.The frequency and voltage PI controllers’ parameters can be computed as follows:(38)KpfANN=O1fp,KifANN=O2fp,KpVANN=O1Vp,KiVANN=O2Vp,where the O1fp,O2fp,O1Vp,andO2Vp denote the outputs of ANNs, which are frequency and voltage controllers’ proportional and integral gains, respectively.The frequency and voltage outputs are compared to their desired vector, denoted byydkp, in order to enhance frequency and voltage performance through intelligent online tuning of control parameters using an ANN structure. This study employs a supervised learning method to learning. The back-propagation method is used to implement the learning approach. The following is the error function at the neuron k and p iteration [46]:(39)ekp=ydkp−ykp,where ykp represents the measured output and ydkp denotes the desired output.The weights have been updated as follows based on the errorekp [46]:(40)wjkp+1=Δwjkp+wjkp,(41)wijp+1=Δwijp+wijp,where Δwijp and Δwjkp denote the weight changes due to the system error value. The indices i, j, and k represent the neurons in the input layer, hidden, and output layers, respectively.(42)Δwjkp=η×yjp×δkp,where η represent the learning rate (it is small positive number), and δkp represents the error gradient at iteration p and neuron k in the output layer.Multiplying the error at the output neuron by the derivative of the activation function yields an error gradient. This means that in the output layer, for neuronk, we have(43)δkp=∂ykp∂Xkp×ekp,where at iteration p, Xkp is the net weighted input to neuron k at the same iteration in the process.For a sigmoid activation function, equation (43) can be written as(44)δkp=ekp×∂1/1+e−Xkp∂Xkp=e−Xkp1+e−Xkp2×ekp.Consequently, we get(45)δkp=ykp×ekp×1−ykp,where(46)ykp=11+e−Xkp.The weight correction for the hidden layer can be determined using the same formula as for the output layer:(47)Δwijp=η×xip×δjp,where δjp represents the error gradient at j neuron:(48)δjp=yjp×1−yjp×∑k=1Rδkpwjkp,where R denotes the count of output layer neurons.(49)yjp=11+e−∑i=1nxipwijp−θi.The process of learning will continue until the minimum amount of error is reached.


## 5.2. ANNs-Based Reactive Power Compensator

To produce minimum deviations in reactive power, the ANNs-based reactive power compensators use the same technique as described in the previous subsection. In every DG, the voltage compensator output compensating term (equation (33)) is added to the reactive power compensating term and the reference system voltage. The complete summation signal must be applied to the primary control level in order to compensate for any voltage deviation.(50)ΔQrp=O1pfor ANN−based reactive power compensator.In addition, back-propagation is employed to implement the learning strategy, along with equations (39)–(49).


## 6. Simulation Results and Discussion

The proposed islanded MG has been simulated in MATLAB/Simulink environment. We have carried out the three described scenarios below:Scenario #1: The MG operates with an overall proposed control structure and an unchanged load conditions.Scenario #2: The MG operates with secondary and primary control separately with an unchanged load conditions.Scenario #3: The MG operates with an overall proposed control structure and changing load conditions.In the starting condition of the first work’s scenario, the system is under the proposed control structure and constant load (58 kW +j24 kVAR). There are three adopted loads, as shown in Figure 2, and they are all the same: (58 kW + j24 kVAR)/3, with a 0.924 power factor (active power/apparent power). The evolutions of the frequency, voltage, active power, and reactive power responses of all DGs are shown in Figures 8(a)–8(d). It is cleared that the proposed control can maintain frequencies and voltages to their nominal values (50 Hz and 220 V). The active/reactive power of all DGs share the load power equally, as shown in Figures 8(b) and 8(d). The voltage signals at each load are illustrated in Figure 9. The load voltages here are unmistakably sinusoidal signals of constant amplitude, which match up very well with the nominal system values. The root mean square values of the load voltages per phase are illustrated in Figure 9(b). In Figure 10(a), the current signals of each loads are shown. Since the loads are held constant in this scenario, the resulting currents can be seen to be sinusoidal signals of constant amplitude. The root mean square values of the load currents per phase are illustrated in Figure 10(b). Each load draws a current of up to 33 A.Figure 8
The proposed control’s performance (a) frequency, (b) active power, (c) voltage, and (d) reactive power of all DGs under first scenario.
(a)(b)(c)(d)Figure 9
The 3ϕ load voltage signals in (a) and root mean square of load voltages in (b) under first scenario.
(a)(b)Figure 10
The 3ϕ load current signals in (a) and root mean square of load currents in (b) under first scenario.
(a)(b)In the second scenario’s starting condition, the system is under the IDSCSs and constant loads. After 5 seconds, the system operates with primary control level only. The evolutions of the output frequency, voltage, active power, and reactive power of all DGs are shown in Figures11(a)–11(d). It is cleared that the proposed control can maintain frequency and voltage of each DG to their nominal values (50 Hz and 220 V) in the interval of [0 10] second. In this interval, it is capable of accurately sharing active/reactive power, the active and reactive power distributed by DGs is equally sharing. After this interval, it is seen that the DGs cannot equally sharing active and reactive load power due to the frequency and voltage deviate below the nominal values. Figures 12(a) and 12(b), respectively, show the root mean square values of the load voltages and currents measured across each phase of the distribution system. Before the time point (5 second), the load voltages are maintained at their nominal values while being kept at a constant level. After this period of time, there was a deviation from the nominal value, which caused a drop in the load current.Figure 11
The proposed control’s performance (a) frequency, (b) active power, (c) voltage, and (d) reactive power of all DGs under Second scenario.
(a)(b)(c)(d)Figure 12
The average (a) frequency and (b) voltage of all DGs.
(a)(b)In the third scenario, the load starts at 58 kW +j24 kVAR at 0 seconds, increases by 50% at 10 seconds, increases by another 50% of the initial total at 20 seconds, returns to 150% at 30 seconds, and then returns to 100% at 40 seconds. Figures 13 display the time series of frequency, voltage, active power, and reactive power output by all DGs. As can be seen, regardless of load changes, the proposed IDSCSs can keep frequencies and voltages of all DGs within nominal ranges. In all scenario time, the IDSCSs are in effect, and it can accurately share active/reactive power regardless of whether the load is increased or decreased; DGs distribute both active and reactive power in an equal fashion. Figure 14 illustrates the voltage signals at each load in the third scenario. The load voltages here are unmistakably sinusoidal signals with constant amplitudes, and they remain very close to the specified system values even as the load values vary. See Figure 15(a) for a visual representation of the current signals drawn by each load. Because the load changes, the resulting currents can be visualized as sinusoidal signals whose amplitudes increase and decrease proportionally to the change in load values. Figure 15(b) illustrates the values of the load currents’ root mean square per phase. To maintain the desired frequency and voltage levels, the ANNs made real-time adjustments to the control parameters of the frequency and voltage PI controllers in all of the adopted SCU-based DGs. In response to variations in critical operating variables, these modifications are being implemented. These adjustments are being made in light of shifting operating parameters. The variation graphs for these parameters are shown in Figure 16.Figure 13
The proposed control’s performance (a) frequency, (b) active power, (c) voltage, and (d) reactive power of all DGs under Third scenario.
(a)(b)(c)(d)Figure 14
The 3ϕ load voltage signals in (a) and root mean square of load currents in (b) under second scenario.
(a)(b)Figure 15
3ϕ current signals of the load in (a) and root mean square of load currents in (b) under Third scenario.
(a)(b)Figure 16
Updating the frequency control parameters in (a) and (c) and voltage control parameters in (b) and (d) of the secondary controllers in each DG with utilizing ANNs under Third scenario.
(a)(b)(c)(d)


## 7. Conclusion

This paper proposes IDSCS for three-phase islanded MG. Two control levels made up the control structure based on the stationary reference frame. By using anαβ-frame, voltage and current inner control loops and inverter mathematical models require fewer computing resources. Unlike traditional dq-frame-based control methods, this work does not require any αβ/dq or dq/αβ transformations. The droop control serves as the foundation for the primary control. By essentially increasing the network’s inductance, the virtual impedance-based primary control is used to enhance control performance. The secondary control level is meant to compensate for the frequency and voltage deviations caused by the primary control. The IDSCS is proposed in multiagent MG-based consensus algorithm and ANNs for carrying out voltage/frequency restoration and sharing active/reactive power. The consensus-based state estimators produce average frequency, voltage, and reactive power discrete signals. The average voltage and frequency signals are applied with their nominal values into ANNs-based PI compensators. ANNs are proposed here for online tuning the control parameters of the PI controllers. The combination of PI controller and ANNs utilizes the simplicity of the PI controller mathematical formula and the capacity of ANN to handle parameter variations and nonlinearity. The outputs of these controllers represent compensating voltage and frequency deviation signals. Also, ANNs are proposed to implement reactive power compensators. The primary control level adopts secondary-to-primary frequency compensating to correct any frequency deviation. By combining the output values from the reactive power and voltage compensators, the secondary-to-primary compensating signal is applied to the voltage primary loop. In contrast to traditional secondary control, the presented secondary control strategy dynamically adapts to changes in the load; it not only maintains frequency and voltage but also ensures accurate control of active and reactive power during the process, realizing the MG’s reasonable operation in the process. The MATLAB/Simulink platform is used to validate the proposed control strategy, and it shows that all agents can agreeably accomplish control goals in consensus.It is feasible in the future to implement practically the proposed approach in a real renewable resources-based microgrid that functions in isolated operation. Moreover, the demand response program may be considered to transfer loads from peak to off-peak operating hours in order to minimize peak-to-average power consumption and improve load factor.



---

*Source: 6812351-2023-02-15.xml*