A Novel Cooperative Control Technique for Hybrid AC/DC Smart Microgrid Converters

This study proposes a novel technique of cooperative control for a distributed hybrid DC/AC Microgrid (MG) by designing a digital Infinite Impulse Response (IIR) filter-based Proportional-Resonant (PR) current controller. This controller adopts an Adaptive Neuro Fuzzy Inference System (ANFIS) trained by Particle Swarm Optimization (PSO) to control inverter output current while tracking Maximum Power Point (MPP). A hybrid ANFIS-PSO extracts maximum power from both inverter and boost converter-based solar Photovoltaics (PVs) systems quickly and with zero oscillation tracking. The proposed PR controller cancels harmonics while achieving high gain at the resonant frequency (grid frequency). The PR controller offers quick reference signal tracking, grid frequency drift adaptation, easy system design, and no steady-state error. Moreover, this investigation features a PR controller frequency-domain analysis. The proposed technique smooths voltage and improves steady-state and transient responses. Cooperative control is implemented on an IEEE 14-bus MG with distributed communication. The findings indicate that the proposed control technique can regulate MG voltage to obtain a more stable voltage profile. The adopted MG, made up of dispersed resources, is crucial for assessing power flow and quality indicators in a smart power grid. Finally, numerical simulation results are utilized to verify the recommended technique.


I. INTRODUCTION
Power electronics converters and output power filters are critical components in connecting Renewable Energy Resources (RERs) to the utility main grid. The power converter enables appropriate, secure, and dependable energy transactions between the grid and RES. Traditional power grids have evolved into Smart Grids (SGs), which rely on bidirectional power flow and data transfer capabilities [1]. Control centers, generation power, power transmission, distribution, and end users are all parts of a traditional grid [2]. Several applications have been distributed in the SG as a result of the advancement of new digital technologies, such as micro- The associate editor coordinating the review of this manuscript and approving it for publication was Pinjia Zhang . processors, and developments in power electronics, notably in the configuration of energy conversion systems and controllers. Recent academic advancements have a substantial impact on these fields, primarily in the areas of data acquisition, automation, and MG regulation [3]. MGs not only reliably and neatly combine distributed generation with the utility grid, but also produce greater dependability in its ability to function in response to natural events and changing distribution grids, resulting in lower energy losses in transmission/distribution and reduced time spent on construction and investment [4], [5], [6], [7].
Due to the depletion of traditional energy sources, the demand for RERs is growing exponentially throughout the world. Since the previous decade, the PV system has made remarkable strides in comparison to the rest of the renewable energy sources [8]. The transfiguration ability of PV modules is restricted due to the nonlinear voltage/current characteristics of the modules. MPPTs are critical components in ensuring that solar PV energy output is at its maximum under global MPPT conditions. Many MPPT control techniques have been examined in the literature in [9], [10], and [11]. Classic MPPT approaches such as Perturb and Observe (P&O), Hill Climbing (HC), and Incremental Conductance (INC) are discussed in [12], [13], and [14] as conventional MPPT methods. It is easier to implement the P&O and HC techniques, but it includes significant oscillations closer to the Maximum Power Point (MPP), which results in power losses. Even in the face of altering atmospheric conditions, the INC technique remains precise and adaptable. Despite this, there are complications in modeling and implementation. The above mentioned techniques, on the other hand, are inefficient when subjected to fluctuating solar irradiation and when attempting to calculate the right perturbation size. Because of this, intelligent Fuzzy Logic Control (FLC) and Artificial Neural Network (ANN) approaches have been chosen to serve as MPPT trackers in order to correct the deficiencies of traditional MPPT algorithms when operating in changeable weather situations [15]. The MPPT technique based on fuzzy logic plays a critical role since it has a more robust design and a simpler structure that is capable of solving the uncertainties and nonlinearity problems. FLC design, on the other hand, is complicated by the need for expert knowledge and the construction of rule base systems. While the ANN approach, which consists of multilayered neurons rather than classical algorithms, is commonly used for quick PV power monitoring under changing environmental circumstances. After integrating ANN and FLC, a hybrid algorithm is created that has attractive learning skills and may be used to train members for MPPT activity. The training and updating of ANFIS standards is a difficult undertaking for the designers to do on time. Optimization issues are solved with the help of recently developed artificial intelligence algorithms, such as the PSO, the firefly algorithm, the ant colony optimization (ACO), and the artificial bee colony (ABC) [16], [17], [18], [19]. When the Sun's insolation level varies uniformly, the FLC and ANN have greater PV tracking capabilities than the FLC alone. Under changing weather conditions, when several peaks are present and it's difficult to reach the MPP region, PSO is an excellent solution because it only requires a few modification parameters. While the PSO method is less complex mathematically than the previously mentioned optimization algorithms, it is easier to implement and provides more economical computing estimation. It also provides fast and accurate PV power tracking under a variety of operating conditions when compared to the previously mentioned optimization algorithms. In contrast to gradient approaches, the PSO delivers a simpler and more fast convergence velocity throughout the updating process [20]. A photovoltaic system's training and operational conditions make developing an effective ANFIS model training strategy challenging. The PSO algorithm can be used to find the opti-mum topology and determine the optimal initial weights of the ANFIS model in order to improve model accuracy. Thus, the conflict between computing speed and ANFIS model fit is solved, and the mean squared error is reduced. Therefore, it is more robust to improve the control method of DC/DC and DC/AC converters via ANFIS-PSO to efficiently extract MPP in addition to controlling the intended target.
The connectivity of Distribution Generation (DG) systems and the grid is now a major challenge for DG energy. These systems typically require DC/DC and DC/AC converters. Due to its importance in grid-connected operation, the DC/AC inverter, whether single or three-phase, can be regarded the system's core. In terms of inverter types, there are two types of inverters utilized in distributed generation: Voltage Source Inverter (VSI) and Current Source Inverter (CSI), also known as P-Q inverter. A two-layer cooperation method is used in both inverter variants. Grid Connected Inverters (GCIs) can be operated in either current or voltage mode. The GCI is an appealing option since its functionality is not as reliant on the impedance of the grid as VSI. Furthermore, a GCI in conjunction with a current controller can provide overcurrent protection.
Regarding of the control techniques of the inverters, Dead Beat (DB), hysteresis, Proportional Integral (PI), and PR controllers are the main control techniques for incorporating DG equipped with inverters into the power grid [5], [21], [22], [23], [24], [25], [26]. Reference [21] proposed a hysteresis control for grid connected inverter in MG. While the proposed method is simple and responsive, the output current has big ripples, which results in bad current quality and makes the design of the output filter more difficult [21]. DB current controller has gained attention because of its zero steady-state error. Although it is quite complex and highly reliant on system parameters, it is nonetheless very effective [22]. Among the numerous benefits of the PI controller are improved wave shaping, immediate control, and a constant switching frequency of the power inverter during its application in several grid-connected MGs [5], [25], [26]. However, the PI also has a downside of steady-state error. PR controllers are preferred over PI controllers in grid-connected converters because they have a high gain at the resonating frequency, which eliminates steady-state error, allows for fast tracking of the reference signal, can adapt to grid frequency drift, and are simple to implement. The PR control approach is often used when the intended goal is to compensate for a large number of harmonics underlying sinusoidal signals and minimize steady-state error [23]. However, in order to achieve best performance, the main grid frequency and resonant frequency must be identical. The authors of [24] presented a robust PR controller using an internal model-based harmonics compensator in MG. Also because of its simplicity and versatility, the PR controller has received a lot of attention lately. In fact, GCI with a PR controller is a popular combination of terms in the literature. Some of them go into detail on the process of designing the PR controller. All of these studies are legitimate, and they demonstrate the effectiveness of public relations campaigns.
Most of them, on the other hand, express their technique in continuous-time manner, but the vast majority of GCI applications are implemented digitally. Numerous studies have been conducted to control MG's power supply and inverter-based distributed energy system. An AC/DC hybrid MG powered by wind, hydrogen, and supercapacitors was proposed by the authors of [27]. A primary inverter connects a DC-bus that supplies energy from renewable sources to the community power grid. The effects of load variability on the infrastructure have not been studied. Another proposal for a photovoltaic and fuel-cell based hybrid DC/AC MG system is provided in [28]. To increase system stability and lessen the number of operating mode variations, a synchronized scheme of system control and feeder flow control was developed. Similar hybrid MG architecture is described in [29]. In order to meet frequency regulatory requirements when using hybrid MGs, proper day-ahead scheduling is required, as stated in [30]. In order to serve a market for frequency regulation, MG's Distributed Generation is analyzed for the optimal balance of power production and related services. In [31], the AC / DC hybrid MG system for managing AC power in an isolated village that uses a solar-powered desalination system was investigated. It was proposed that an optimization technique based on mixed-integer nonlinear programming be used, and that the goal functionality be used to lower the daily operating costs. In [32] and [33], the authors demonstrated how a real-time power management application may be constructed. A complete, incomplete, and accurate forecast were made for each of the three scenarios under consideration. The optimization model was examined on both linked and isolated MGs, and it was discovered that there was a considerable imbalance between load and generation. The authors of [34] provide a PI control of grid connected MG inverter. Using an IEEE 14 bus program, the recommended algorithm's efficiency was tested. The authors of [35] propose an approach for managing power transmission/management in hybrid AC/DC MGs. The penetration ratio for MGs is critical in determining the MG's location within a power distribution setup. This study determines the MG's optimal location by comparing two distribution systems. The voltage characteristics and line losses of these systems are investigated. While MGs are considered on a small scale, their technical complexity for modeling and simulation is greater than that of the conventional energy system. As a result, dynamic analysis models are critical for ensuring the stability of future MGs.
The literature has a lot of references to GCI with PR controllers. Few studies describe how to design the PR controller [36], [37], [38]. Moreover, the majority of research emphasizes the PR controller's application without a systematic process to determine control parameters, while others deal with PR controller modeling in continuous-time only. Unlike, most GCI applications need a digital set up. In this case, the reader should figure out how to use the PR controller digitally. Furthermore, this research proposes a novel method for PR current controller design-based PV inverter fed by a reference signal through an adopted PSO-ANFIS-based MPPT. Also, PSO trained ANFIS adopted for maximum energy extraction from boost converter-based solar PV. The following are the primary distinctive contributions of the strategy advocated in this paper: The rest of the paper is structured as follows: Section 2 describes the system being proposed. The mathematical modes of energy generation resources and power converters are described in the third section. Section 4 addresses problem formulation. A case study has been described in Section 5. Section 6 defines system analysis. The results of the simulation are presented and discussed in Section 7. Section 8 concludes the paper.

II. DESCRIPTION OF THE PROPOSED SYSTEM
In contrast to previous studies-based inverter control, this study focuses on the design of a PR control unit with a reference current signal derived from an ANFIS-based MPPT trained by PSO. This hybrid achieves the advantages of the previously described PR controller while simultaneously extracting the maximum capacity from the solar PV. The arrangement of investigated hybrid DC/AC IEEE MG is illustrated in Figure 1. It is comprised of two substation MGs, 14 lines, 14 buses or nodes, and 9 loads. The proposed network combines a MG with a 69 kV power transmission system. AC MG supplies electricity to all loads via a diesel generator, Battery Energy Storage System (BESS2) and PV2. The AC MG operates at 60 Hz. The second zone (DC MG) includes a PV1 and BESS1. A two-way power flow buck-boost converter connects the BESS1, while a boost converter connects the PV1. Two parallel bidirectional power transformers connect the DC bus and the AC MG, which can be used as rectifiers or inverters to exchange reactive and active power. Eventually, this hybrid system is equipped with a grid, load-equivalent and a diesel generator. Residential loads make up the majority of the loads. Residential loads are calculated using daily non-seasonal consumption on the resort island. Furthermore, simulations of residential loads are carried out based on the actual differences in the specific loads profile of the specified resort island. Table 1 shows the MG load information. The main 13.8 kV network has a resistance of 0.339 ohm/km, a reactance of 0.1168 ohm/km, and an impedance of 0.41 ohm/km. Table 2 contains more details information of the MG lines [39].

III. MATHEMATICAL MODELS OF ENERGY GENERATION RESOURCES AND POWER CONVERTERS A. SOLAR PHOTOVOLTIC
The I-V behavior of a model of PV cell circuit with one diode and two resistors is described by eqn. (1) [40].
where I PV represents the PV current; the diode has a reverse saturation current denoted by I O ; R s is the resistor in series that compensates for losses in the cell's solder joints, junction box, interconnection, and other components; p-n junction current leakage is accounted for by the shunt resistor denoted by R sh ; α represents an ideality factor that describes the deviation of diodes from Shockley diffusion. V T denotes the diode's thermal voltage, and it depends on the diode's temperature (T), the Boltzmann constant (k), the number of electrons (q), and the number of cells in series (n).
The State Of Charge (SOC) and terminal voltage of BESS are two critical parameters that accurately represent the battery's state, and they are represented as follows [41]: where R b denotes the BESS internal resistance, V o denotes the battery's open circuit voltage, i b denotes the charging current for the BESS, K denotes the polarization voltage, Q denotes the capacity of BESS, A denotes the exponential voltage, and B denotes the battery's capacity.

C. DIESEL GENERATOR
Diesel generators keep a balance between the demand for electricity and electricity supply generated by MGs. Several components are required for making diesel generator's  model include a diesel engine, an anticipatory system, a synchronous computer, and a control system. The diesel engine and governor system models are connected via two inputs, one for real speed and another for required speed in one unit. The mechanical prowess of the diesel engine is referred to as its ''mass production'' capability. The console functions in a similar way to the transfer function described below [42]: where k denotes proportional gain and T 1 , T 2 , and T 3 are used to denote the regulator's time constants (seconds). The transfer function of the actuator is as follows: On the other hand, a time delay is incorporated into the design of engine generators, which temporarily reduces the torque output produced by the operator. The transfer function describes the machine's excitation system shown below [42]: where V fd denotes the exciter voltage, V ro denotes the regulator's output, k s denotes the gain, and T e is the exciter time constant. VOLUME 11, 2023

D. GRID SIDE CONVERTER
The equations for the AC side voltage of the main inverter are shown in abc-frame and dq coordinates respectively, in eqns. (8) and (9) [43] where R f and L f are the inverter power filter resistor and inductor, v Ca , v Cb and v Cc are the voltages of AC side of inverter, v C f a , v C f b and v C f c are the voltages across the capacitors of the three phase power filter; I d and I q , v cd and v cq , and v sd and v sq are the dq coordinate variables that correspond to them.

E. BOOST AND BIDIRECTIONAL BUCK-BOOST CONVERTERS
As shown in Fig. 1, a PV1 panel is connected to a boost DC/DC converter (which is controlled by ANFIS-PSO) and subsequently to the open loop control inverter. According to [44], [45] the relationship between the boost converter load resistance (R L ) and optimal internal resistance of a PV panel at maximum power point (R MPP ) is as follows: where D MPP denotes the duty cycle of the boost converter at its MPP. Load resistance must be higher or equal to the PV array's optimal internal resistance at MPP for a boost converter to track maximum power (R L ≥ R MPP ), because the duty ratio (D) can be anywhere from 0 to 1. If the preceding condition is not met, the tracking of maximum power will be unsuccessful [44], [45].
The boost inductor's value is determined in accordance with the maximum allowable current ripple that occurs at the MPP under the highest solar irradiance (1000W/m 2 ). The ripple output current decreases with increasing inductor value and vice versa for the capacitor. Because the inductor is the priciest component when compared to the other components, it is preferable to use a lower inductor value in order to achieve a low-cost converter. The DC/DC boost converter's topology was designed to enhance the input DC voltage (V i ) from 100 V-130 V to roughly 350 V output voltage (V o ), which is the voltage level of the DC bus, as proposed by the authors in [51]. The switching frequency f is adjusted to 10kHz to avoid two common problems: audible sounds and high-frequency parasitic components. Both parameters are chosen above the critical values in order to retain the controller's stability. The critical parameters can be computed using the eqns. (11)(12)(13) [39]: where L c denotes the critical inductance value; C c denotes the critical capacitance value; D denots the duty cycle; f denotes the switching frequency; and R denotes the load resistance. The bidirectional buck boost DC/DC converter manages the battery's loading and unloading processes, regulating the DC bus voltage's connection to the BESS1. It uses two PI controllers to keep the reference current signal stable during loading and unloading processes. The controllers charge and discharge the BESS1, which is tied to the DC MG, using a current reference signal. The objective is to produce more efficiency and extend the battery system's usable life by focusing on low current ripples. It's also good to know that the control technique regulates the voltage of DC bus when the MG is in an ''off grid'' mode [44]. The characteristics of the adopted batteries are 120V rated voltage, 800Ah rated capacity, and 80% initial SOC for BESS1 unit, while 650V, 1.5Ah, and 80% for BESS1 units (three units). In order to select the filter values of buck boost, eqns. (14), (15), (16), and (17) are used.
where I HV is the boost side's inductor current; V HV is the boost side's capacitor voltage ripple; I LV is the buck side's inductor current; V LV is the buck side's capacitor voltage ripple. The adopted component values of both the boost and buck-boost converters are shown in Table 3. Considering a 45 DC resistance, which translates to a 2 kW power required at nominal voltage.

IV. PROBLEM FORMULATION
The inverter's proposed closed loop control method is illustrated in Figure 2. Figure 3 shows the proposed PSO-ANFISbased boost converter. The following subsections elaborate on the proposed diagrams' individual blocks.

A. HYBRID ANFIS-PSO BASED MPPT CONTROLLER
Here, we propose an innovative inverter control technique based on PR digital current controller that employs a reference current control signal applied by PSO trained ANFIS to control the output current of the inverter accurately and to obtain maximum power from the PV related to that inverter. The ANFIS uses fuzzy logic and weighted artificial neural networks to transform system inputs into desired outputs. The ANFIS is a machine learning methodology that combines the advantages of two machine learning methods (least square error algorithms and backpropagation) into a single method. A first-order Sugeno model is used to illustrate the ANFIS structure using the two fuzzy IF-THEN rules below [46]:  structure of the ANFIS is shown in Figure 4. ANFIS features a five-layer design, with nodes in each tier performing tasks that are similar to one another. Each layer is discussed in further depth below. Layer 1: In this layer, the eqns. (18 and 19) are used to determine the fuzzy membership classes of the inputs, which are then rendered visible on the layer as the outputs. The inputs' fuzzy membership grades are transformed into the outputs of Layer 1.
The node i has two inputs which are x and y, and the linguistic labels Ai and Bi (low or high) associated with this node's functions. µ Ai (x) and µ Bi−2 (y) may take on any fuzzy membership function. For instance, if the Gaussian membership function is used, the following is the value of µ Ai (x): Here, cn i stands for center, d i stands for width, and g i stands for fuzzification factor. Layer 2: Layer 2's nodes are fixed nodes. The layer makes use of fuzzy operators, and by adopting the AND operator it fuzzifies the inputs. They are recognized with the letter π, which indicates that they execute the function of a simple multiplier. The output of this layer may be represented by the following: These are the rules' so-called ''firing strength''. Layer 3: The fixed nodes, labeled N, play a role in layer 3. They normalize the firing strengths from layer 2. This layer's output may be represented by the following equation: This layer's outputs are normalized firing strengths. Layer 4: Nodes in layer 4 are adaptable. Each node's output is equal to the product of its normalized firing strength and a first-order polynomial (for a first-order Sugeno model). This layer's output may be expressed as follows: where W i is the output of layer 3 and k i , r i , and p i are the consequent parameters.
Layer 5: In layer 5, there is only one fixed node with the name x. This node sums up all the signals that have come in. Output from the model as a whole is given by this.
Designers today must update and train ANFIS requirements. The PSO updates are simpler and quicker than gradient updates. In a D-dimensional study space, the swarm's particle k is represented by its vector position X k = (x k1 , x k2 , . . . .., x kD ) as well as by its vector of velocity V k = (v k1 , v k2 , . . . .., v kD ). This particle retains the best position in memory through which it has already travelled, which we denote by P k = (p k1 , p k2 , . . . .., p kD ). The best position attained by all of the swarm's particles is denoted by P z = (p z1 , p z2 , . . . .., p zD ). The following equations are used to calculate the position and velocity vectors at iteration n [47], [48]: where r 1 and r 2 are random values between 0 and 1, and c 1 and c 2 are positive constant (personal and global) learning rates; χ is referred to as the constriction factor and is defined as follows [49]: The comprehensive flowchart of a PSO trained ANFISbased MPPT control is shown in Fig. 5. An advanced hybrid ANFIS method gathers fuzzy data with the help of trained learning rules for adjusting membership values appropriately before error minimization is performed. The learned system can serve as a hybrid MPPT controller once the appropriate membership parameters are set. By employing the flowchart depicted in Fig. 5, the ANFIS parameters (Table 4), and PSO parameters (Table 5), we can defuzzify the system so that the output is calculated using the weighted average method. Independent simulations of the foregoing and following parameters have been conducted. In contrast, the mean square error is minimized while simultaneously training all parameters in this hybrid ANFIS-PSO approach. We have used input/output parameters to measure the ANFIS architecture's adaptive learning rate.
The inputs of ANFIS are solar irradiance and temperature, and the structure formed was based on fuzzy clustering, as illustrated in Figure 6. There are ''2'' inputs and ''1'' output in this arrangement. Each input has ten Gaussian membership   functions as shown in Figure 7 (a and b), with 10 linear membership functions in the output and ten rules.
The Figures 8 and 9 show the initial fuzzy inference system's structure, which was based on the fuzzy clustering structure. As illustrated in Figures 8 (a) and 9 (a), there is no difference between the actual output and ANFIS during the testing and training stages.    The proposed ANFIS-based MPPT controller is comprised of the ANFIS reference model and a discrete PI or PR controller. This application uses these controllers because both  are equally effective at handling constant signals in this stage. Knowing the maximum power point (MPP) of a PV module under a given solar irradiation and temperature allows this MPPT controller to accurately monitor the MPP in real time. Maximum power output from PV modules can be estimated using the PSO trained ANFIS reference model for a given temperature and irradiance. When comparing the ANFIS model's reference value to the PV module's actual voltage, a low-pass filter with a 500Hz cutoff frequency is used to remove distortion. The difference between the two voltage levels is computed to provide an error, which is then applied to the PI controller (with proportional gain k p = 2 and integral gain k i = 400) to produce a control signal (reference inverter DC voltage (V dc,ref )) as shown in Fig. 10. Figure 11 (a and b) shows the maximum powers extracted using the ANFIS-PSO technique from the PVI, which is connected to the boost converter, and the PV2, which is connected to the inverter-based PR controller, respectively.

B. DC VOLTAGE CONTROLLER
The referenced DC voltage from ANFIS-PSO is applied to the PI DC voltage regulator (has k p = 2 and k i = 400) with the measured inverter's input voltage (V dc ) to produce reference d-axis current component (I dref ) as shown in Figure 10. The d-axis component of the reference current is given in eqn. (28), while the q-axis component is set to zero (I qref = 0).
where V dc,nom is the nominal DC voltage.

C. PROPORTIONAL RESONANT CONTROLLER
The PR controller receives an error signal based on a comparison between the inverter's output current and the reference current from the DC voltage regulator. Pulse Width Modu-lation (PWM) is used to regulate the PR output signal. The modulator uses a carrier signal with an amplitude of ''1''. Because the reference signal is a grid tension-synchronized sinusoidal signal, voltage sensing and transmission can be demonstrated. However, synchronization is guaranteed by a Phase-Locked Loop (PLL). As things stand, the PWM delay is greater than the time constant of the current control loop. The controller's architecture need not change to accommodate for PWM delay. The ideal PR controller's transfer function is given in eqn. (29): where k P is the controller's proportional gain, k R is the controller's resonant gain, and ω o is the controller's resonant frequency in general, which is the grid frequency.
The ideal PR controller behaves like a system with an infinite quality factor, which makes it difficult to implement in reality. As a result, the following is an non-ideal PR controller: where ω c = 2 * pi * f bw angular resonance bandwidth revolves around ac frequency ω o = 2 * pi * f r or ω o = 2 * pi * f g ; f bw is the resonance bandwidth frequency, f r and f g are the resonant and grid frequency respectively.
The closed loop control technique of the microgrid's inverter with a discretized PR controller uses the tustin frequency pre-wrapping method. Tustin's method can be used to explore the discretization of analog controllers [50]. According to this relationship, each S-domain in analog controllers is replaced with a Z-domain.
where T is the sampling time.
The digital PR controller is shown in Figure 8 proceeding from a proportional gain (k P ) to a resonant part. The resonant path is coherent with the discrete resonant IIR filter and the resonant gain (k R ), and its defined by the z-domain transfer G R (z) as shown by eqn. (33).
where b 0 , b 1 , b 2 are the feedback filter parameters and a 0 , a 1 , a 2 are the feedforward filter parameters. VOLUME 11, 2023 It should be noted that the value of a 0 is intentionally set to 1 in order to allow the z-domain IIR filter transfer function in eqn. (33) to be rewritten as a difference equation by: y (n) = −a 1 y (n − 1) − a 2 y (n−2) + b 0 u (n)+b 1 u (n−1) where y (n) denotes the resonance filter output while u (n) denotes the resonance filter input. This step can be regarded as an important contribution made by this work overall. Defining the resonant frequency is the most important parameter to consider because it determines the frequency at which the controller will act in order to achieve zero error in steady-state. The designer is able to compute for the resonant filter coefficients, allowing for more accurate filter design, if only the preferred filter frequency response is outlined in the s-domain. The proportional gain, resonant gain, and the coefficients for digital implementation are then provided by eqns. (35) to (43) [51].
where C is a constant that has the following definition: where H i denotes the measured current gain, R 0 and L 0 denote the inverter's line resistor and inductor, ζ denotes the damping factor, B r is the angular resonance bandwidth, ω r is the resonance angular frequency, T a denotes the sampling period, k r denotes the resonance gain, and V dc is the DC voltage applied to the inverter. Notch Filter is a term used to describe a resonant filter. In this paper, the term ''resonant IIR filter'' is used. As a result of the digital PR controller architecture, the values of the controller's gains and coefficients (k P , k R , a 0 , a 1 , a 2 , b 0 , b 1 , and b 2 ) can be obtained using eqns. (35)(36)(37)(38)(39)(40)(41)(42)(43) above.
The magnitude response of the designed resonant filter in the w-domain is shown in Fig. 12 (a). The gain is 0 dB only at 60 Hz, demonstrating the effectiveness of the specified resonant filter. Only the component of the error at 60 Hz is multiplied by one in this case. The power of all other components is greatly reduced. The filter's phase response in the wplane is illustrated at the bottom of Fig. 12 (a). Because of the transfer function's poles, the phase shifts 180 degrees at the resonance. Fig. 12 (b) displays the designed PR controller's magnitude response. At 60 Hz, the most amplification occurs. The same figure displays the designed PR controller's phase response. The phase shift is the same as the resonant filter's phase shift for both low and high frequencies, which is zero.

V. CASE STUDY
A case study is to develop a control technique for the GCI by designing a digital PR current regulator that adopts the reference input current signal obtained from PSO-based ANFIS and a DC voltage regulator, respectively, as depicted in Figure 2. This control technique based inverter is proposed to be applied in IEEE 14 bus MG inverter to improve transient and steady-state responses by smoothing the voltage signals while also producing the maximum electric power available from inverter's solar PV. The proportional gain, resonant filter's  gain and coefficients were determined separately using eqns. (35 and 43). Table 6 summarizes the parameters of digital IIR resonant filter that has been designed, while the other GCI designed parameters are listed in Table 7. To be more precise, all obtained resonant filter's coefficients must have a minimum of 15 decimal points. These coefficients of IIR filter type are very sensitive, see [52] for more information about these filters. Moreover, in this work, the PSO trained ANFIS technique has been presented to extract maximum power from boost DC/DC converter-based solar PV. The PV voltage is filtered with a low pass filter before being digitized with the Zero Order Hold (ZOH) method. The digitalized voltage is compared with the PSO-ANFIS output to generate an error signal, which is then applied to a discrete-time PI controller to generate a duty ratio signal.

VI. SYSTEM ANALYSIS
Daily demand characteristics for the proposed MG system are depicted in Figure 13. The curve is computed by adding the total hourly demand for each load defined by the model. As can be seen in Figure 13, the system has a minimum demand that is only 30% of its maximum demand. The minimum demand scenario must be utilize to determine the com-pensation mechanism's capacity and location. As illustrated in Figure 13, peak demand occurs at 11:00 AM., which is also the time of greatest solar irradiance, thus, solar energy production.
With both load scenarios, the voltage profile can be visualized by measuring each bus voltage independently. The voltage deviation is calculated by measuring the voltage in each bus and comparing it to the desirable voltages. Eqn. (44) defines the formula for calculating the magnitude of the Maximum Voltage Deviation (MVD).
where v di denotes the desired voltage, and v i denotes the bus voltage.
All angle buses in the hybrid MG system depicted in Figure 1 are calculated using an adaptive notch filter based on PLL. After that, a subtraction is performed on these two numbers in order to compute θ i for each bus (i).
When a voltage-current pair signal is received at the fundamental frequency, the power block computes the active power (P i ) and reactive power (Q i ) of the signal. For this calculation to be completed successfully, the block must first identify the peak magnitude of the two input signals v i (t) and i i (t), also known as |v i | and |i i |. It is therefore necessary to calculate the output variables (P i ) and (Q i ) for every period of the basic waveform, as indicated in eqns. (45), and (46).
However, Tables 8 and 9 show active and reactive power. P 1 and Q 1 are provided for any load bus, whereas P g and Q g are introduced for any generator bus, respectively. Finally, for each transfer bus, the letters P T and Q T are provided.
The system's active power losses have been calculated for both balanced and unbalanced currents. Eqn. (47) indicates the power losses [7]: where I i,a,b is current of the phase i cycling in line b during the condition of charge a; phase and neutral resistors are denoted by R L and R N , respectively. NP is the phase count of the system in line b. Also, the analysis of the sine wave voltage deformation is presented in this section. This is one of the factors affecting the quality of the electric power supply, particularly in distribution systems. The THD in each bus is estimated as given in eqn. (48) [53], [54].
where V i,w denotes the node i voltage component that corresponds to the harmonic w; V i,1 denotes the first of VOLUME 11, 2023 fundamental harmonic of voltage component at the node I ; W denotes the greatest harmonic order to be computed. Figure 14 (a) illustrates the calculated voltage profile in (per unit) for the maximum energy load scenario, while for the minimum load capacity is depicted in Figure 14 (b). In both cases, the voltage profile complies with the acceptable operating limits. As illustrated in Figure 14 (a), when demand reaches its maximum, low grid voltage (220 V) on buses 2 and 3 experience a noticeable voltage drop. The maximum voltage deviation for this system is found to be 0.071 on bus 3 (0.085, 0.05, and 0.08 for the first, second, and third stages, respectively) as illustrated in Figure 15 (a). As shown in Figure 15 (b), the system voltage deviations are quite low, and the voltage profile is enhanced, showing that the system is functioning properly under minimum load capacity.

VII. SIMULATION RESULTS
Both the kVA of power generated/consumed in each bus and the kW of electricity on the DC bus are shown in Figure 16 (a and b), indicating their relative importance for meeting the two different loads. Unless otherwise specified, positive power values in a schematic depict the amount of load power connected to that bus or the amount of power transferred. Where negative power is displayed, as it is for bus 14, the diesel generator is helping to power the grid (this is explained in more detail in Tables 8 and 9). The remaining negative powers are representative of the bus's internal power plant. There is a contribution of generating power in six buses in the highest demand scenario in Fig. 16 (a) (1,2,8,13,14 and DC Bus). Power balance of the system is shown in Fig. 16 (b) in the minimal demand scenario, where the power consumption in each bus reduces in comparison to the case of maximum demand. Additionally, this illustration depicts the contribution that distributed generation makes to this scenario, with just the diesel generator linked at bus (8) and the remaining contribution in active power being given by the connected grid via bus (13). Figure 17 (a) demonstrates the reactive power balance per bus for the maximum demand, while for the minimum  demand in Figure 17 (b). There is a consistent relationship between reactive injection and an increase in bus voltage when reactive power is compensated by available generation.   This system receives its reactive power from two different buses: bus 8, which houses the diesel generator, and bus 13, which houses the reactive power contribution from the utility main grid. However, buses 9 and 14 appear to be injecting reactive power when demand is at its peak. Transfer buses have negative powers in this case because the power flows' VOLUME 11, 2023  direction. Tables 8 and 9 provide a more in-depth discussion of this concept. The voltage profile in this case is presented in Fig. 14. There are certain buses when it exceeds 1PU. and has excellent values.
The power factor of each bus is critical when determining the power flow in a compensating system. Figure 18 (a and b) represents the power factor for each bus in the system under minimal and maximum scenarios, respectively. The scenario depicted in Figure 18 (a) depicts bus 2 and bus 9 have a unity power factor. This is due to the fact that bus 2 only draws active power from the DC MG at peak demand, while bus 9 has a nearly unitary power factor given the fact that the measurement was taken directly in the non-linear load.
By comparing the power factor for both demand circumstances, an interesting finding is discovered. The majority of buses have a maximum power factor operation at minimum demand than in maximum-demand scenario. According to this analysis, the grid's power factor has to be the same. However, at maximum demand, the power factor is 0.76 and at minimum demand, it is 0.79. Similarly striking is the power factor difference between the two scenarios, which is also evident in Buses 5 and 6. As the loss of active power contribution in solar PV output does not occur during times of low demand, such as at night when there is actually no solar radiation, this phenomenon does not occur. This analysis demonstrates the complications that can arise when using only active power to compensate a power electrical system. Because of the detrimental effect on power factor that injecting only active power can have on the grid, compensating systems must take into account additional criteria, such as compensating for both active and reactive power simultaneously. Due to the contribution of reactive power from the diesel generator, which is dependent on the power flows, power factor of the bus (7) is lower in the minimum demand scenario shown in Fig. 18 (b) than it is in the same bus in the maximum demand scenario.
In Fig. 19 (a) and (b), the losses in each phase of each line in the system are shown under maximum and minimum demand, respectively. It is interesting to note that despite the line's short length, it has the highest level of losses per phase (approximately 9 kW; connection between buses 3 and 4), a value that relates to the transportation of high imbalanced powers over a short distance. In buses with unbalanced loads, as shown in Fig. 19, active power losses are disproportionally distributed among the phases. A major contributor to this problem is the prevalence of single-phase loads on the system's low-voltage grid. Losses at maximum demand are shown in Fig. 19 (b), and even at their worst they don't add up to more than 1.4 kW per phase.
As shown in Figure 20 (a and b), the THD of each bus's and phase's voltage is calculated under two different scenarios: maximum and minimal demand, respectively. The proposed method reduces harmonic distortion to below 2.86% with two scenarios. In comparison to another control method, the PI controller-based inverter control restricts the maximum THD to 3.1%.

VIII. CONCLUSION
A novel cooperative control method for hybrid AC/DC MG inverters was proposed, which makes use of a discrete PR controller fed by the PSO-ANFIS MPPT technique. In this paper, we present the design methodology for a GCI-integrated discrete PR current controller in details. To maximize electric power generation from solar PV while attaining a stable AC voltage with a low steady state error, the proposed controller adopted the reference input current obtained from ANFIS-PSO and DC voltage regulator. A systematic list has been presented to compute the resonant and proportional gains, as well as the coefficients of the digital resonant IIR filter. Applying the control technique with PR controller design-based procedure proposed here, the authors analyzed the frequency spectrum in the imaginary w-domain. In addition, with inverter proposed technique, the PSO trained ANFIS technique has been introduced as a technique to extract the maximum amount of power from boost DC/DC converter-based solar PV. This technique was developed in order to maximize the amount of power that can be harvested. A case study as well as a discussion demonstrated the efficiency of the design approach, which makes it a desirable tool for actual engineering applications.
The proposed method takes into account two different power demand scenarios: the minimal and maximum power demand. The outcomes of the simulations of power flow have been presented for each scenario. Each bus has its own measurement module. It is capable of calculating measures relating to power quality, voltage THD, power factor, and the losses of power lines. Separate result details were obtained from the analysis of both the minimum/maximum demand scenarios generated by the proposed system to provide a more comprehensive understanding of the problem for each power quality and efficiency analysis variable. Acquired results can be applied in design, development and implementation of systems in which energetic demands are crutial variables of feasibility [55]. ALI M. JASIM was born in Basrah, Iraq, in 1992. He received the B.Sc. and M.Sc. degrees in electrical engineering from the University of Basrah, in 2014 and 2017, respectively. He is currently pursuing the Ph.D. degree. His research interests include control theory, renewable energy technologies, electrical power engineering, power systems analysis, power electronics, microgrids, and signals processing.
BASIL H. JASIM (Senior Member, IEEE) received the B.Sc. and M.Sc. degrees in electrical engineering and in control and computer engineering and the Ph.D. degree in the field of control and systems from the University of Basrah, Basrah, Iraq, in 1995, 1999, and 2007, respectively. He is currently an Assistant Professor at the University of Basrah. His teaching and research interests include wide areas of modules across the Department of Electrical Engineering, University of Basrah, include intelligent control systems, robust control systems, microprocessor and microcontrollers, and industrial automation. His research interests include intelligent control of robotics, computational intelligence, chaos and nonlinear dynamics, renewable electrical energy systems, and PLC applications in industrial and engineering education. He currently serves as a Co-Editor for the Basrah Journal for Engineering Sciences. Currently, he is working as a Full Professor in systems engineering and the Head of the Department of Information Technologies, University of Hradec Králové. He has already published six books (as the author or a member of the authoring team) and tens of scientific papers published in several journals or in conference proceedings. He has participated in both international and national research projects (e.g., 6th or 7th European Framework Program Projects, Erasmus+). His research interests include system dynamics, systems engineering, information and knowledge management, systems theory, and application of ICT in various areas. He is a member of the program committee and an editorial board of several scientific conferences and journals, respectively. He is also a member of the System Dynamics Society and the International Council on Systems Engineering. PETER MIKULECKÝ has been a Professor in managerial informatics at the Faculty of Informatics and Management, University of Hradec Králové, Czech Republic, since 1993. He is currently the Former Head of the Department of Information Technologies. He also acted as the Director for Research and the Director of Postgraduate Studies at the Faculty of Informatics and Management. In 1990 and 1993, he was the Head of the Department of Artificial Intelligence, Faculty of Mathematics and Physics, Comenius University Bratislava, Slovakia, where he worked in various positions, since 1973. His research interests include ambient intelligence, artificial intelligence, knowledge-based systems and technologies, knowledge management, and human-computer interaction. He has published more than 150 papers in various journals and conference proceedings in these areas and a number of books and book chapters. He was one of the founder of a regular series of events called ambient intelligence forum. He has been a member of the Accreditation Commission of the Government of Slovak Republic, since 2004, responsible for accreditations of Slovak higher educational institutions. He is also a member of the programme committee for a number of international conferences. He is also a member of a number of scientific societies and scientific boards. VOLUME 11, 2023