Optimal Coordinated Control of DC Microgrid Based on Hybrid PSO–GWO Algorithm †

Load and Generation Uncertainties Algorithm. Abstract: Microgrids (MGs) are capable of playing an important role in the future of intelligent energy systems. This can be achieved by allowing the effective and seamless integration of distributed energy resources (DERs) loads, besides energy-storage systems (ESS) in the local area, so they are gaining attraction worldwide. In this regard, a DC MG is an economical, ﬂexible, and dependable solution requiring a trustworthy control structure such as a hierarchical control strategy to be appropriately coordinated and used to electrify remote areas. Two control layers are involved in the hierarchy control strategy, including local- and global-control levels. However, this research focuses mainly on the issues of DC MG’s local control layer under various load interruptions and power-production ﬂuctuations, including inaccurate power-sharing among sources and unregulated DC-bus voltage of the microgrid, along with a high ripple of battery current. Therefore, this work suggests developing local control levels for the DC MG based on the hybrid particle swarm optimization/grey wolf optimizer (HPSO–GWO) algorithm to address these problems. The key results of the simulation studies reveal that the proposed control scheme has achieved signiﬁcant improvement in terms of voltage adjustment and power distribution between photovoltaic (PV) and battery technologies accompanied by a supercapacitor, in comparison to the existing control scheme. Moreover, the settling time and overshoot/undershoot are minimized despite the tremendous load and generation variations, which proves the proposed method’s efﬁciency.


Introduction
Electrical energy is deemed as the fuel for today's computerized world, and in the not-too-distant future, electricity scarcity will be a serious issue for many countries, especially in remote areas [1]. The distance from the central electrical grid system or the high cost of installing the grid line to such a distance are the primary reasons for the lack of electrification for the population in these areas [2]. Moreover, load demand is much lower in rural locations than in more populated ones. Therefore, using grid electricity is not the ideal option because of the transmission and regular maintenance expenditures. Furthermore, power outages, grid shutdowns, CO 2 emissions, degradation of the ozone layer, biomass fuel reliance, and global warming, as summarized in Figure 1, have all contributed to a greater awareness of the need for safe, renewable, environmentally friendly, and clean energies. The direct integration of available renewable energy sources, involving photovoltaic (PV) and wind turbine generation (WTG), into the utility grid, is not easy due to their sporadic nature [3]. In this regard, the standalone MGs power system can (WTG), into the utility grid, is not easy due to their sporadic nature [3]. In this regard, the standalone MGs power system can combine such resources in one place as an excellent choice for isolated locations where grid power is unavailable [4]. In the literature, several categories of MGs, comprising AC, DC, and hybrid AC/DC MGs, have been employed to coordinate both renewable energy resources and energy storage systems to cater to required demand [5]. However, DC MGs are expanding more rapidly as compared to conventional AC MGs [6]. There are no harmonics or frequency conflicts, no synchronization is needed in the islanded mode, and no concerns about reactive power regulation exist [7,8]. In order to gain the full utilization of this type of microgrid, there are a few obstacles that need to be considered, including a seamless transition from islanded mode to on-grid mode operation, along with compatibility with AC loads [9]. Furthermore, microgrid protection is a problematic issue owing to the unavailability of zero-crossing current in addition to grounding [10,11]. The stability of the DC microgrid is a significant problem during fault circumstances, because of the resistive impedance characteristic of DC microgrid schemes and the absence of physical inertia [12]. Standardization seems to be another obstacle to the adoption of DC MGs [13]. Regardless of the abovementioned issues, DC MGs have a bright future owing to their improved compatibility with distributed renewable energy sources (DRES), better efficiency, and increased reliability [4]. It is essential to mention that power electronics converters are commonly employed as interfaces in each MG, to link each source to the shared bus [14]. Power electronics technology improvements have allowed DC electric grid schemes to achieve the criteria cost-effectively and smoothly [15]. With the advent of the DC MG ap- Power electronics technology improvements have allowed DC electric grid schemes to achieve the criteria cost-effectively and smoothly [15]. With the advent of the DC MG approach, DC loads were widely used throughout different industries, including telecom facilities and data centers [16]. DC voltage rates are required for the operation of most modern electronic devices, including LED bulbs, phones/laptops chargers, and televisions. Therefore, DC MGs may address the rising demand in remote and tiny towns worldwide because of these qualities [17]. It is worth mentioning that the control of DC-bus voltage, besides power-sharing in the DC MGs, is a crucial aspect that scholars always need to be focused on [6]. Providing voltage support and efficient power distribution are the main challenges in a multi-source DC MG. In the literature, the conventional droop control approach of DC MGs has been used because it has simplicity in implementation due to the non-existence of a communication link [18]. This control strategy, nevertheless, results in inappropriate current distribution, voltage fluctuations, and circulating current regulation because of droop and line resistance amongst converters in an MG [4]. These converters must be properly managed to achieve an MG's desired performance. In this regard, the DC MG has employed a hierarchical control method consisting of local and global control layers. In the first control layer of the MG, the primary control goals are determined to achieve adequate power and bus voltage stabilization within allowable constraints. Numerous control strategies have been put forth at the local control levels [14][15][16][17][18][19][20][21][22][23][24][25] to achieve these objectives. For realizing such objectives, there are various extensive studies on solving control issues in the local layers, especially droop control methods, including voltage/current, current/voltage, or voltage/power, which are often used to coordinate autonomously distributed units and manage the flow of power between load demand and generation [19][20][21]. The droop control approach is a popular decentralized approach for distributing power based on using virtual resistance. It is important to mention that power-sharing accuracy and voltage stability are intimately related to the droop coefficient of the system [22]. More specifically, as the droop coefficient increases, current sharing accuracy improves with an increase in voltage variations and vice versa [23]. This confirms that the selection of the droop coefficient value is the controller's intrinsic trade-off. Although the key benefit of the droop control approach is that it eradicates the need for crucial communication links between parallel-connected converters since there are no communication links between parallelconnected converters, there is a lot of flexibility and reliability [24]. In contrast, there are several drawbacks to the conventional droop strategy: sluggish transient response, the intrinsic trade-off between voltage control and load sharing, line-impedance misalignment between parallel converters that impact active power-sharing, and unsatisfactory performance renewable resource [22,25]. Therefore, droop control is the subject of many related studies in the literature to enhance its performance. In [12], an adaptive droop method has been suggested to adjust the virtual resistance to follow the load current's fluctuation across parallel-linked DC-DC converters. Owing to the sporadic nature of renewable resources (PV and WTG), energy storage systems (ESSs) consisting of batteries, supercapacitors (SCs), and ultracapacitors need to be included to overcome any load-generation mismatch that requires reliable control approaches to work effectively. Many control techniques to regulate power-sharing between supercapacitors and batteries have been discussed in the literature. In [26], state-of-charge feedback control is employed to ensure the battery's charging level is within its allowable threshold, whereas the scheme of battery-energy storage (BES) is utilized to smooth out a wind farm's production fluctuations. Combining the two into a hybrid electrical system is important because batteries have a higher power density and SCs have a high-power density. The batteries supply the main source of energy, and the SCs handle momentary load interruptions and power peaks during unforeseen circumstances [27][28][29]. Various control strategies have been proposed to enhance the performance, to keep the new hybridization system operating more efficiently. In [30], a novel control method has been presented based on the disconnection of low-and high-frequency power components of the hybrid battery/SCr energy supplier. The proposed technique leverages the battery current error component to control the SC. This method offers the advantages of faster voltage control and less battery-current stress. In [31], a new control approach is given to regulate power-sharing between batteries and SC and, therefore, keep MG voltage stability even with large energy-generation fluctuations. The authors of [32] concentrated on MG control schemes that involved PV, WTG, batteries, and SCs with hybrid AC/DC buses. The approach proposed a basic control technique for managing power between renewable resources and storage systems. It is noticed that the control methods used in local layers suffer from some issues under load disruptions and fluctuations of power generation because of dependency on classical proportional-integral (PI) controllers [33,34]. Under such conditions, these controllers do not provide satisfactory performance. Converters, on the other hand, are non-linear and time-variable systems [35]. Therefore, some attempts have been made to overcome such issues by replacing classical PI controllers with non-linear and advanced controllers. For instance, the authors in [27] adopted a proper control approach to reject the transient disturbance that results from the load current and limit the oscillations of the battery current. A new disturbance-rejection control approach based on a sole DC/DC converter has been devised for a hybrid battery/SCs system. The suggested control approach uses a super-twisting (STC) and PI controller in the internal and external voltage control loops. Furthermore, a Pulse Wave Modulator (PWM)-based sliding-mode control method is presented in [35] to adjust the voltage of the DC-DC boost converter. Although this method confirms its effectiveness in controlling the DC voltage, power-sharing has not been considered. In order to coordinate the power-sharing among renewable resources, battery packs, and load, the authors [36] developed a multilayered feed-forward artificial neural network (ANN)-based power management system (PMS). To realize the farthest utilization of the energy resources, while also controlling the voltage and power-sharing amongst hybrid renewable resources, a hybrid-modified Bat search algorithm/ANN control approach has been presented in [37]. The main issues with these methods are that hybrid energy storage systems have not been taken into account, so they may not be applied to experience high energy variations. Furthermore, ANN-based DC MG power management with a hybrid battery-SC energy system was proposed in [38,39] to accomplish a better voltage regulation besides well-organized power-sharing under various operating conditions, and the results were compared to the traditional control technique to confirm the superiority of the proposed approach. However, the proposed control strategy in [38,39] has not been examined simultaneously under extreme load changes and PV power fluctuations, to assess its effectiveness in such critical conditions in a real-life scenario. Moreover, the improvement of the droop control of the PV system and hybrid battery/SC control sides has not been explored. Furthermore, the authors of the aforementioned articles have not addressed the additional battery power provided to the simulated MG, which might possibly reduce its efficiency, especially in [38,39]. It has been discovered that there is a lack of focus on using meta-heuristic optimization approaches, which are featured because of their capability in addressing complex problems and optimizing controller parameters [34] to tackle the major challenges in the local control layer of DC MGs that have been discovered in earlier studies. These problems can be addressed using a variety of metaheuristic algorithms. A few examples of these algorithms are the ant lion algorithm, the PSO method, and the gravitational search algorithm. It is important to note that no single optimization algorithm can guarantee optimal system performance due to inherent strengths and drawbacks. As an illustration, PSO is characterized by its uncomplicated concept, relative resilience to control parameters, and computing efficiency; on the other hand, PSO's restricted local/global search functionality causes it to get stuck in a local minimum when dealing with situations that are both highly constricted and highly robust [40]. Another example is the GWO algorithm, which has been demonstrated to outperform all the above mentioned algorithms [41]. Although GWO is featured by its speedy convergence, simplicity of implementation, and higher performance in uncertain and challenging search spaces, particularly in engineering applications [42], its delayed late-stage convergence and proneness to local optimality are major disadvantages [43,44]. There is no doubt that each of the two algorithms has a special search strategy. Their updating strategies guided by two or three agents leads to a reduction in variety, early convergence, or collapsing into the local optimum [45]. In order to address such issues, hybridization among algorithms has been proposed in previous studies to achieve a proper performance of the system. Hybrid PSO-GWO can be adopted to utilize the strengths of GWO and PSO. The primary goal of this hybridization is to enhance the capability of exploitation in PSO with the power of exploration in GWO [46]. As a result of this, this paper is focused on solving all of the problems depicted in Figure 1 using the hybrid PSO-GWO algorithm, which is characterized by its simplicity and ease of use as a tool to be used in successful execution, as well as completive performance, in comparison to those other optimization algorithms [47]. Using this algorithm to locate the global-best solution to an optimization problem has been shown to be effective [48], and this can boost the simulated MG's local control layer's performance. It is important to mention that improved power-sharing across paralleled DC-DC converters, improved MG voltage regulation within the specified level of 5%, reduced battery power losses, minimized settling time, and less overshoot/undershoot under diverse operating situations are significant contributions of the suggested technique. It is worth noting that this study is an extension of [49], with the new proposed approach achieving more consistent performance than [49]. For this study, a standard DC MG comprises several distributed energy resources (DERs), including a PV system and hybrid battery/supercapacitor, which are connected to a DC-bus by using boost and buck-boost converters, respectively, to support DC load in the system, as illustrated in Figure 2. It is important to mention that this microgrid is explained in detail in Section 2.
Electricity 2022, 3, FOR PEER REVIEW 5 ing into the local optimum [45]. In order to address such issues, hybridization among algorithms has been proposed in previous studies to achieve a proper performance of the system. Hybrid PSO-GWO can be adopted to utilize the strengths of GWO and PSO. The primary goal of this hybridization is to enhance the capability of exploitation in PSO with the power of exploration in GWO [46]. As a result of this, this paper is focused on solving all of the problems depicted in Figure 1 using the hybrid PSO-GWO algorithm, which is characterized by its simplicity and ease of use as a tool to be used in successful execution, as well as completive performance, in comparison to those other optimization algorithms [47]. Using this algorithm to locate the global-best solution to an optimization problem has been shown to be effective [48], and this can boost the simulated MG's local control layer's performance. It is important to mention that improved power-sharing across paralleled DC-DC converters, improved MG voltage regulation within the specified level of 5%, reduced battery power losses, minimized settling time, and less overshoot/undershoot under diverse operating situations are significant contributions of the suggested technique. It is worth noting that this study is an extension of [49], with the new proposed approach achieving more consistent performance than [49]. For this study, a standard DC MG comprises several distributed energy resources (DERs), including a PV system and hybrid battery/supercapacitor, which are connected to a DC-bus by using boost and buck-boost converters, respectively, to support DC load in the system, as illustrated in Figure 2. It is important to mention that this microgrid is explained in detail in Section 2. The structure of this article is as follows. DC MG control techniques, including traditional and new ones, are discussed in Section 2. In Section 3, HPSO-GWO is reviewed and formulated in order to address the problem under consideration. The graphic comparison of the significant outcomes of the traditional technique and the new control approach is shown in Section 4. A summary of what has been accomplished is provided in Section 5.

DC MG Control
A typical MG incorporates several forms of distributed energy resources such as PV, WTG, and fuel cells accompanied by ESSs to deal with the intermittent nature of such sources [3,50]. Most of these resources provide inherently DC electric power to the system, and it is possible that WTGs that provide AC power may be connected to the DC MG if they have been rectified [33]. To optimally coordinate distributed renewable energies, a DC MG necessitates an optimum control approach to accomplish appropriate power-sharing amongst all coupled sources in the system, while also managing the voltage within the IEEE standard limit of 5%. In this respect, hierarchical control mechanisms involving local and global control stages have been proposed to fulfill the above control objectives [23,51]. The The structure of this article is as follows. DC MG control techniques, including traditional and new ones, are discussed in Section 2. In Section 3, HPSO-GWO is reviewed and formulated in order to address the problem under consideration. The graphic comparison of the significant outcomes of the traditional technique and the new control approach is shown in Section 4. A summary of what has been accomplished is provided in Section 5.

DC MG Control
A typical MG incorporates several forms of distributed energy resources such as PV, WTG, and fuel cells accompanied by ESSs to deal with the intermittent nature of such sources [3,50]. Most of these resources provide inherently DC electric power to the system, and it is possible that WTGs that provide AC power may be connected to the DC MG if they have been rectified [33]. To optimally coordinate distributed renewable energies, a DC MG necessitates an optimum control approach to accomplish appropriate power-sharing amongst all coupled sources in the system, while also managing the voltage within the IEEE standard limit of 5%. In this respect, hierarchical control mechanisms involving local and global control stages have been proposed to fulfill the above control objectives [23,51]. The three control layers of a hierarchical control technique are the primary or local control layer, which is followed by a secondary level, and the third level of control, classified as a global control layer. In detail, the goal of the local layer is to facilitate the transfer of power among these DGs. The secondary level is intended to compensate for voltage variations.
The objective of the tertiary stage is to govern power transfer between MGs and the electric grid [33].

PV Side Control Strategy
PV system is the dominant source in DC MG due to availability and inherently producing DC power, so it is not vital for it to be converted to another form of power. However, it cannot be directly coupled to a common DC-link without adopting DC-DC converters because both voltage and power of PV systems are uncontrollable and are not always compatible with the system specifications [10]. These converters need to be efficiently controlled to stabilize a DC-bus under different operating conditions. In this regard, two operating modes, as illustrated in Equation (1), droop and maximum power point tracking (MPPT) modes are adopted to control the DC-DC converter [52]. The first mode is activated in case a low-load demand is required or a fully charged battery reaches, so this mode matches the altering load to retain the voltage of the DC-bus [53]. Otherwise, MPPT mode needs to be initiated for compensating the power and the DC-link voltage destabilization, if not addressed. PV systems commonly work in this mode to wholly exploit renewable energy sources [53,54].
The output voltage of the droop-controlled converter is presented as Equation (1).
where IL-converter output current, Iref-the reference value of output current, SOC-state of charge along with its minimum value SOC min and maximum value SOC max , and D mppt -duty cycle in the case of the MPPT mode. Furthermore, the parameters of the current controller are signified by Kp pv and Ki pv , as revealed in Figure 3. It can be noted from Equation (1) that voltage stabilization can be controlled effectively under different operation conditions, based on the threshold value of the SOC of the battery.

Hybrid Battery/SC Side Control Strategy
The intermittent nature of RESs such as PV and WTG makes it challenging to cater to load demand without ESSs. Power balance and voltage adjustment are essential functions of a battery storage system. The droop control approach is utilized in this paper to sustain the steadiness of the DC-bus voltage and the battery's automatic charge and dis-  It can be noted from Equation (1) that voltage stabilization can be controlled effectively under different operation conditions, based on the threshold value of the SOC of the battery.

Hybrid Battery/SC Side Control Strategy
The intermittent nature of RESs such as PV and WTG makes it challenging to cater to load demand without ESSs. Power balance and voltage adjustment are essential functions of a battery storage system. The droop control approach is utilized in this paper to sustain the steadiness of the DC-bus voltage and the battery's automatic charge and discharge process [55]. Since the batteries feature a lower power density with a high energy density, which minimizes discharge/charge speed, SCs, which have a high power density, could be unified with batteries to realize the efficient operation of the ESSs in the system [38,39]. By adopting this hybridization, the batteries are exploited to generate the major energy supply, whereas the SCs are adopted to address the momentary fluctuations of the localized load in the MG and tackle power peaks during unpredicted circumstances [27]. In this article, hybrid ESS (HESS) is used to boost the efficacy of the MG under various loads and PV-generation scenarios. In order to reduce the stress on the dynamo battery and maintain a suitable DC bus voltage, the SC is offered to collect the high-frequency component. In addition, it prevents the batteries from overcharging and deep discharging, preserving their lifespan [52]. The hybrid battery/SC energy system is illustrated in Equations (2) and (3), as follows: where, I bref and I b refer to a reference value of battery current and real value of battery current, respectively, along with Kp bat and Ki bat , which indicate the parameters of the battery controller, as illustrated in Figure 3. While the SC current with its reference is denoted by I sc and I scref , respectively, in addition to Kp sc and Ki sc , which indicate the parameters of the supercapacitor controller, as illustrated in Figure 3. The difference between battery currents I bref and I b and supercapacitor currents I sc and I scref passes to the battery controller and the supercapacitor controller, as illustrated in Figure 3, to produce duty ratios δ b and δ sc , which are sent to pulse-width modulation (PWM) generators to generate switching pulses (SWb1 and SWb2) for the bidirectional converter of the battery and (SWsc1 and SWsc2) for the bidirectional converter of the supercapacitor.

Design Considerations of the DC-DC Power Converters
The DCMG, which is shown in Figure 2, has been simulated in the MATLAB environment. In this step, the specifications of PV arrays and hybrid batteries/SCs are necessary to be determined based on MGs requirements at the normal operating conditions. Moreover, directional DC-DC converters and bidirectional converters need to be designed based on the RESs, ESSs, and general system requirements. Therefore, in the following subsections, the design considerations of such converters are included to provide a clear idea about designing converters for other MGs.

Boost Converter
These converters are more prevalent in industrial applications because of their straightforward construction, ruggedness, ease of use, and relative inexpensiveness, so they are widely used in MGs [56]. These converters not only improve the output voltage of the PV system to the required limit but also accomplish MPPT control. In order to achieve an appropriate performance of this converter in the studied MG, its components, including the inductor L boost and capacitance C boost , need to be appropriately calculated based on the following, Equations (4) and (5) [56,57]: Electricity 2022, 3 where, I o and ∆I l refer to the output current and inductor current ripple, respectively. While the output power, switching frequency, input voltage, duty cycle, and output voltage with its ripple are denoted by P L , F s , V i , D, V o , and ∆V o , respectively. It is important to mention that ∆V o is selected to be 5% out of output voltage, which can be calculated based on Equation (6), and ∆I l is required to be rated within 20% − 30% of the output current that is determined by using Equation (7). All these equations are essential to be considered in designing a boost converter, to obtain the proper DC-bus voltage of the system.

Buck-Boost Converter
A solar power system would be incomplete without some form of energy storage. A standard bidirectional DC/DC converter is used to coordinate the battery charging/discharging process in the MGs based on the system situation. In order to make this converter operate efficiently, the inductor L bat and capacitor C bat need to be calculated accurately based on the following Equations (8)-(10) [56,57].
where V i and D bt refer to the battery voltage and duty cycle at boost operation mode of the converter, respectively. Moreover, switching frequency and duty cycle are signified by F s and D, which can be calculated by Equation (10), respectively. It should be noted that ∆V o is chosen to be 5% of the output voltage (V o ) that can be determined by Equation (10), and ∆I l has to be within 20%-30% of the output current (I o ). These formulas must be taken into account for designing a buck-boost converter.

Proposed Control Method
Metaheuristic optimization approaches such as GWO, explained in [49], and HPSO-GWO [46] are investigated in this study as an alternate strategy to realize optimal PI parameters, as illustrated in Figure 3. This figure includes boost converter with its control strategy, as explained in Section 2.2, and bi-directional converters with their control approaches, as illustrated in Section 2.3, to achieve reliable and stable operation of the PV system, battery, and supercapacitor, respectively. In this study, the accumulated errors between the nominal values of voltages/currents and their real values are used as a fitness function, with PI controllers' constraints to be applied in the hybrid PSO-GWO MATLAB code, which is explained in [46], to determine the best values of parameters of PI controllers employed in the local layer that can improve the performance of DC microgrids.

HPSO-GWO Algorithm
The HPSO-GWO is a novel type of swarm-based metaheuristic that has numerous benefits, including easy implementation and minimal memory usage [46]. The fundamental concept is to bring together PSO's exploitation ability with GWO's exploration ability to create both variations' strength and memory consumption. Therefore, it is coevolutionary since both variants do not utilize one after other. In other ways, they run in parallel. Instead of utilizing traditional mathematical formulae, the exploitation and exploration of the first three agents' sites in the search space are updated in HPSO-GWO. The mathematical expressions are shown in Equations (11)- (17).
where it is important to mention that  (18) and (19)): where v i k+1 and x i k+1 refer to the updated values of velocity and position of the best three grey wolves, while w represents the inertia, constantly generated randomly in [0, 1]; besides, r 1 , r 2 , and r 3 are random values in [0, 1]. Moreover, x 1 , x 2 , and x 3 indicate the position of the best three wolves, which are obtained by using Equations (14)- (16). Furthermore, c 1 , c 2 , and c 3 refer to optimization parameters, which are selected to be 0.5, whereas the current position of the particle is signified by x i k .

Problem Formulation
This paper aims to optimize the parameters of PI controllers employed in the local control level of the studied MG. Consequently, proper voltage adjustment and precise power transfer can be realized, which may enhance the performance of the simulated MG. The proposed control approach optimizes PI controllers' parameters based on the objective function in Equation (20). In the literature, there are many types of objective functions that have been used to tune PI controllers, including the integral time absolute error (ITAE), the integral time square error (ITSE), the integral absolute error (IAE), and the integral square error (ISE). The objective function of ITAE has been considered in this article, as it gives shorter settling time, overshoots, and rising time than the other objective functions used in the literature [58], with the constraints stated in Equation (27).
Subject to: where ITAE-integral of time-weighted absolute error; Er(t)-disparity between starting points and variables to be managed-the simulated time; Rd-virtual droop resistance, which can be determined by dividing the maximum voltage deviation (5% of Vdc) by the output current (IL); Vref-the reference voltage of the DC microgrid, which is set to be 48 V; and Vdc-the output voltage of the DC microgrid. N indicates the number of the obtained errors from PI controllers. It can be noticed that errors resulting from differences between the reference and actual values of voltages and currents in the microgrid, including the output voltage (Vdc), with its reference value (Vref) and virtual droop voltage (Rd * IL); the output current (IL), with its reference value (Iref); battery current (Ib), with its reference value (Ibref); and the SC current (Isc), with its reference value (Iscref), as shown in Equations (21)- (26) and Figure 3, are substituted in Equation (20) to determine the optimal values of the PI controllers parameters that achieve minimum error in the system. It is essential to mention that the parameters of the local control layer have been set by using the hybrid PSO-GWO, as shown in Figure 3. The maximum and minimum values of PI parameters have been included in the HPSO-GWO Matlab code, to determine the best values based on the system requirements, as illustrated in Equation (27): where Kp min and Kp max , along with Ki min and Ki max , refer to the minimum and maximum values of PI controllers' parameters used in the local control of the DC microgrid, as illustrated in Figure 3. The main objective of limiting such values is to enable the hybrid PSO-GWO algorithm to search for proper values of Kp and Ki, within a certain range based on the system requirements.
To get the best values of Kp and Ki in the local control layer for this investigation, a number of steps have been used, including:

Initialize parameters →
A, → C, and → a , as their capabilities for exploration and development may be leveraged to achieve a better balance in the GWO algorithm.

3.
Compute the fitness value of each agent (grey wolf) to determine the best three wolves. 4.
The placements of the best three wolves regarding targeted prey can be determined, based on Equations (11)-(17).

5.
The locations and velocities of the best wolves are updated, based on Equations (18) and (19), respectively. 6.
In case the current iteration is less than the maximum iterations limit, based on step 3, all other wolves (ω) will update the positions. Otherwise, the optimal values of X agents (Kp and Ki) will be obtained to be applied in the system.

7.
Based on the first condition in step 4, → A, → C, and → a will be updated accordingly. Then, the value of each search agent (wolf) is recalculated. Based on the previous updates, the best position is updated. This process continues until the best values of Kp and Ki are obtained. 9. Figure 4 depicts all these steps. It is worth mentioning that the list of PI control parameters obtained by hybrid PSO-GWO is presented in Table 1.  Figure 4 explains the process of selecting PI controller parameters using the hybrid PSO-GWO algorithm. In this regard, a number of populations with the GWO and HPSO parameters are initialized to assign the initial Kp and Ki of the system. These initial values of PI controllers are applied in the local control layer to assess the microgrid's performance. In case its performance is not acceptable, which means less-accurate power sharing among sources in the microgrid and unregulated DC voltage, along with a high ripple of the battery current, are realized, the errors that result from the difference between the actual values of voltages and currents in the microgrid are substituted in the fitness function (Equation (20)), to be used in the hybrid PSO-GWO code to recalculate the new values of Kp and Ki for the local control layer. The main objective is to achieve minimum error, which may boost the performance of the local control level in the studied MG. It is worth It is worth mentioning that the list of PI control parameters obtained by hybrid PSO-GWO is presented in Table 1.  Figure 4 explains the process of selecting PI controller parameters using the hybrid PSO-GWO algorithm. In this regard, a number of populations with the GWO and HPSO parameters are initialized to assign the initial Kp and Ki of the system. These initial values of PI controllers are applied in the local control layer to assess the microgrid's performance. In case its performance is not acceptable, which means less-accurate power sharing among sources in the microgrid and unregulated DC voltage, along with a high ripple of the battery current, are realized, the errors that result from the difference between the actual values of voltages and currents in the microgrid are substituted in the fitness function (Equation (20)), to be used in the hybrid PSO-GWO code to recalculate the new values of Kp and Ki for the local control layer. The main objective is to achieve minimum error, which may boost the performance of the local control level in the studied MG. It is worth mentioning that this process continues until the best performance of the microgrid is achieved.

Results and Discussion
In this study, the rating of the components of DC MG, which comprise of a PV array (6 panels, 120.7 W each) to provide 724.6 W, 14 Ah, and 24 V battery with 50% as a state of charge (SOC), 32 V, 29 F SC, and 48 V, 300 W load are taken from [39]. In order to validate the effectiveness of the proposed strategy in improving the performance of the local control layer, compared to that of the existing techniques in [38,39], different scenarios, including PV-generation variations and load fluctuations, are adopted in this study. It is important to mention that the durability of the suggested method has been evaluated using the rate of overshooting/undershooting in the voltage of MG, power sharing, battery current tracking, and system responsiveness. These scenarios have been tested, first with the conventional control approach, as depicted in Figure 5a-e. In this case, load changes by the rate of 50%, 38%, and 32%, and the fluctuations of solar irradiance simultaneously occur at 2 s, 3.5 s, and 4 s, respectively. The PV system can only generate 471 W at 0 s; therefore, most of this power is used to cater to demand, which is set to 300 W, while the remaining power is exploited to charge the battery to increase its SOC to an allowable threshold. This amount of PVgenerated power remains 470 W until 2 s, so there is no extra power that can be employed to charge the battery at the time interval (1 s-2 s), due to the load demand going up to 500 W. Thus, the DC-link voltage drops sharply at 1 s, as shown in Figure 5a. It can also be noticed that PV generation increases to 580 W at 2 s, which leads to an increase in DC-link voltage up to 50.25 V. As previously mentioned, load demand increases by dissimilar rates at 1 s, 3 s, and 4 s, and this causes the bus voltage to diverge unacceptably from the standard limit of 5% at these time intervals. Based on the obtained results, this strategy is ineffective in facing critical operating conditions such as load-generation uncertainty. It is also worth noting that, even though the battery current is closely tracked in its reference value, some unwanted ripples are still involved. Furthermore, one of the most critical aspects to note is the system's poor responsiveness in rejecting imposed interruptions, implying that the system would be neither stable nor trustworthy. Electricity 2022, 3, FOR PEER REVIEW 13 mentioning that this process continues until the best performance of the microgrid is achieved.

Results and Discussion
In this study, the rating of the components of DC MG, which comprise of a PV array (6 panels, 120.7 W each) to provide 724.6 W, 14 Ah, and 24 V battery with 50% as a state of charge (SOC), 32 V, 29 F SC, and 48 V, 300 W load are taken from [39]. In order to validate the effectiveness of the proposed strategy in improving the performance of the local control layer, compared to that of the existing techniques in [38,39], different scenarios, including PV-generation variations and load fluctuations, are adopted in this study. It is important to mention that the durability of the suggested method has been evaluated using the rate of overshooting/undershooting in the voltage of MG, power sharing, battery current tracking, and system responsiveness. These scenarios have been tested, first with the conventional control approach, as depicted in Figure 5a-e. In this case, load changes by the rate of 50%, 38%, and 32%, and the fluctuations of solar irradiance simultaneously occur at 2 s, 3.5 s, and 4 s, respectively. The PV system can only generate 471 W at 0 s; therefore, most of this power is used to cater to demand, which is set to 300 W, while the remaining power is exploited to charge the battery to increase its SOC to an allowable threshold. This amount of PV-generated power remains 470 W until 2 s, so there is no extra power that can be employed to charge the battery at the time interval (1 s-2 s), due to the load demand going up to 500 W. Thus, the DC-link voltage drops sharply at 1s, as shown in Figure 5a. It can also be noticed that PV generation increases to 580 W at 2 s, which leads to an increase in DC-link voltage up to 50.25 V. As previously mentioned, load demand increases by dissimilar rates at 1 s, 3 s, and 4 s, and this causes the bus voltage to diverge unacceptably from the standard limit of 5% at these time intervals. Based on the obtained results, this strategy is ineffective in facing critical operating conditions such as load-generation uncertainty. It is also worth noting that, even though the battery current is closely tracked in its reference value, some unwanted ripples are still involved. Furthermore, one of the most critical aspects to note is the system's poor responsiveness in rejecting imposed interruptions, implying that the system would be neither stable nor trustworthy. In order to tackle the main issues of the conventional control approach, GWO algorithms are adopted to enhance the microgrid's performance under such critical operating situations. The simulation results reveal that although the same critical operating conditions are applied with the proposed control scheme, the DC-bus voltage is preserved within the standard limit, and proper power-sharing of the studied DC MG is realized. To be more specific, by employing GWO, the voltage of the simulated MG rises from 43.66 V to 47.016 V, with a 50% increase in load demand at 1s as well as a voltage-overshoot decrease from 50.25 V to 48.7 V at 2 s, as seen in Figure 6a. In order to tackle the main issues of the conventional control approach, GWO algorithms are adopted to enhance the microgrid's performance under such critical operating situations. The simulation results reveal that although the same critical operating conditions are applied with the proposed control scheme, the DC-bus voltage is preserved within the standard limit, and proper power-sharing of the studied DC MG is realized. To be more specific, by employing GWO, the voltage of the simulated MG rises from 43.66 V to 47.016 V, with a 50% increase in load demand at 1 s as well as a voltage-overshoot decrease from 50.25 V to 48.7 V at 2 s, as seen in Figure 6a. In order to tackle the main issues of the conventional control approach, GWO algorithms are adopted to enhance the microgrid's performance under such critical operating situations. The simulation results reveal that although the same critical operating conditions are applied with the proposed control scheme, the DC-bus voltage is preserved within the standard limit, and proper power-sharing of the studied DC MG is realized. To be more specific, by employing GWO, the voltage of the simulated MG rises from 43.66 V to 47.016 V, with a 50% increase in load demand at 1s as well as a voltage-overshoot decrease from 50.25 V to 48.7 V at 2 s, as seen in Figure 6a. From the previous discussion, it is found that the microgrid's performance needs to be further improved, especially the system's responsiveness in rejecting disturbances, power sharing, and battery current tracking, to be more proper for real-life implementation. Thus, the proposed hybrid PSO-GWO is utilized in this article to improve the traditional control method and the GWO employed in the simulated DC MG. The obtained results in Figure 7 demonstrate that although the studied MG has been subjected to the same critical operating conditions of both load and power-generation variations simultaneously, several advantages in the local control layer, including maintaining the bus voltage at the acceptable level (1.67%), optimal power sharing, and optimal battery current tracking with its reference value are achieved, as shown in Figure 7a-c. It is also noted that the response of the respective system in rebuffing the imposed disruptions is very quick, making the system more dependable and stable with no additional battery power delivered to support the system under such fluctuations, as illustrated in Figure 7a and Figure 7b, respectively, which are better than [30,38,39]. This confirms that the proposed control method is more robust than the abovementioned studies under most operating conditions, implying that MG becomes more reliable and steadier in providing uninterrupted power to consumers under crucial operating conditions. It is also seen that the proposed control method achieves fewer overshoots/undershoots in the DC bus voltage, fewer current/voltage ripples, and less settling time in comparison with the conventional control approach used in the local control layer of the DC microgrid, as shown in Figure  7a, which enhances the reliability of the microgrid. In summary, it is clear that the proposed HPSO-GWO achieves a better voltage regulation, power-sharing, and settling time than the conventional control approach and GWO, as illustrated in Figures 7a-e and 8. From the previous discussion, it is found that the microgrid's performance needs to be further improved, especially the system's responsiveness in rejecting disturbances, power sharing, and battery current tracking, to be more proper for real-life implementation. Thus, the proposed hybrid PSO-GWO is utilized in this article to improve the traditional control method and the GWO employed in the simulated DC MG. The obtained results in Figure 7 demonstrate that although the studied MG has been subjected to the same critical operating conditions of both load and power-generation variations simultaneously, several advantages in the local control layer, including maintaining the bus voltage at the acceptable level (1.67%), optimal power sharing, and optimal battery current tracking with its reference value are achieved, as shown in Figure 7a-c. It is also noted that the response of the respective system in rebuffing the imposed disruptions is very quick, making the system more dependable and stable with no additional battery power delivered to support the system under such fluctuations, as illustrated in Figure 7a,b, respectively, which are better than [30,38,39]. This confirms that the proposed control method is more robust than the abovementioned studies under most operating conditions, implying that MG becomes more reliable and steadier in providing uninterrupted power to consumers under crucial operating conditions. It is also seen that the proposed control method achieves fewer overshoots/undershoots in the DC bus voltage, fewer current/voltage ripples, and less settling time in comparison with the conventional control approach used in the local control layer of the DC microgrid, as shown in Figure 7a, which enhances the reliability of the microgrid. In summary, it is clear that the proposed HPSO-GWO achieves a better voltage regulation, power-sharing, and settling time than the conventional control approach and GWO, as illustrated in Figures 7a-e and 8.  Electricity 2022, 3 Figure 8 illustrates that the large disturbances, including an increase in the load demand (300-825 W) along with the PV-generation fluctuations (470-680 W), are minimized by adopting the HPSO-GWO and GWO optimization approaches. Based on the obtained results, this control method may be suitable for being implemented in real-life scenarios, because the issues noted in previous articles, including transient stability issues, DC-bus voltage destabilization, power losses, and unregulated power sharing among participating sources in the microgrid, are solved in this article. Thus, this article may contribute to increasing the dependency on microgrids to generate reliable and uninterrupted power for consumers under crucial operating circumstances.

Conclusions
This study focuses on adopting HPSO-GWO to boost the performance of the local control layer. It is examined under different load and PV-generation scenarios. Although the load changes by 50%, 38%, and 32% at different time intervals, accompanied by PV-generation fluctuations, precise power transfer among DGs and voltage regulation are realized. Furthermore, the battery current can keep a consistent relationship with its reference value. Additionally, system responsiveness is effectively improved to resist any perturbation that may arise without causing any power dissipation. It is noticed that the proposed technique achieves fast voltage recovery with less settling time, overshoot/undershoot, and rising time, so the system operation becomes more reliable and stable under the abovementioned critical operating conditions, and this ensures the robustness of this control technique.

Acknowledgments:
The authors appreciate Al-Furat Al-Awsat Technical University's financial support, and the research work is also part of the MBIE SSIF AETP, entitled Future Architecture of the Network.

Conflicts of Interest:
The authors declare no conflicts of interest.  Figure 8 illustrates that the large disturbances, including an increase in the load demand (300-825 W) along with the PV-generation fluctuations (470-680 W), are minimized by adopting the HPSO-GWO and GWO optimization approaches. Based on the obtained results, this control method may be suitable for being implemented in real-life scenarios, because the issues noted in previous articles, including transient stability issues, DC-bus voltage destabilization, power losses, and unregulated power sharing among participating sources in the microgrid, are solved in this article. Thus, this article may contribute to increasing the dependency on microgrids to generate reliable and uninterrupted power for consumers under crucial operating circumstances.

Conclusions
This study focuses on adopting HPSO-GWO to boost the performance of the local control layer. It is examined under different load and PV-generation scenarios. Although the load changes by 50%, 38%, and 32% at different time intervals, accompanied by PVgeneration fluctuations, precise power transfer among DGs and voltage regulation are realized. Furthermore, the battery current can keep a consistent relationship with its reference value. Additionally, system responsiveness is effectively improved to resist any perturbation that may arise without causing any power dissipation. It is noticed that the proposed technique achieves fast voltage recovery with less settling time, overshoot/undershoot, and rising time, so the system operation becomes more reliable and stable under the abovementioned critical operating conditions, and this ensures the robustness of this control technique.