Optimal Fuzzy PIDF Load Frequency Controller for Hybrid Microgrid System Using Marine Predator Algorithm

This paper presents a fully optimized fuzzy proportional-integral-derivative with filter (FPIDF) load frequency controller (LFC) for enhancing the performance of a hybrid microgrid system. The Marine Predator Algorithm (MPA), a recent optimization algorithm, is used to optimize the gains as well as the input scaling factors and membership functions of the proposed fuzzy PIDF controller. The controller performance is tested on a two-area hybrid microgrid system containing various renewable energy sources and energy storage devices. The effectiveness of the MPA based FPIDF controller is compared with conventional PIDF and FPIDF controllers based on other heuristic techniques presented in literatures. Moreover, different scenarios are implemented in this study to verify the robustness and sensitivity of the proposed controller to different step load perturbations, system parameters variations, wind speed fluctuation and solar irradiance variation. The dynamic response of the system is compared using different controllers in terms of settling time, maximum overshoot and undershoot values. The results are presented in the form of time domain simulations conducted via MATLAB/SIMULINK.

Frequency deviation in Area 2 P tie−line Tie-line power deviation

I. INTRODUCTION
A microgrid is a small-scale version of the utility grid, which can operate in two modes, the grid-connected mode or the islanded mode [1]- [4]. A hybrid microgrid system is an innovative system that integrates different renewable energy sources (RES) such as wind and solar energy with conventional energy sources such as diesel generators as well as energy storage devices [5]. With hybrid systems, multiple benefits can be offered such as fuel-savings, increased system capacity, reduced pollution, and increased system reliability [6], [7]. However, serious problems such as frequency deviations may occur due to the energy unbalance between generation and load when the microgrid system is subjected to load disturbances and/or uncertainties of RES [8], [9]. The intermittent nature of RES such as solar irradiance variation and wind speed fluctuation may cause severe frequency and power oscillations, which should be effectively minimized [10]- [12]. Therefore, a properly designed LFC is essential to maintain the frequency deviations within acceptable limits especially when the grid is operating in a standalone mode [13]- [15]. Several control techniques were developed in the literature to improve the LFC performance. Classical PID and PI controllers were widely used in the LFC design due to their simplicity [16], [17]. For example, a PI-LFC based on the particle swarm optimization (PSO) technique was suggested in [18] to improve the frequency response under different load disturbances. Moreover, different optimization algorithms were implemented for tuning the PID-LFC parameters such as the ant colony optimization in [19], the genetic algorithm in [20], the harmony search algorithm in [21], [22], the social-spider optimizer algorithm in [23], the whale optimization algorithm in [24] and the PSO algorithm in [25], [26]. Another LFC, based on the model predictive control for a hybrid power system taking into consideration the effect of governor and turbine parameters variation, was presented in [27], [28]. Whereas a decentralized LFC was implemented in [29] based on H-infinity to control the frequency of a deregulated power system. In addition, fractional-order PID controllers were introduced by some authors to solve the LFC problem in multi-area systems [30]- [32]. The PIDF controller is an extension of the PID that is attached with a low-pass filter on its derivative term to further improve the system dynamics. The filter aids to suppress the undesired high-frequency noise of the control signal [33]- [36]. Furthermore, some researchers have suggested implementing the Fuzzy logic controller (FLC) along with conventional controllers to improve the overall system performance [37]- [41]. The input variables of the fuzzy control system are generally defined by combinations of membership functions known as fuzzy groups and the parameters can be tuned more smoothly to produce the desired performance required by the system [42], [43]. Different optimization algorithms were presented in the literature to adjust the fuzzy controller gains such as the grey wolf algorithm in [37], the multi-verse algorithm in [40], the harmony search algorithm in [43], the ant colony algorithm in [44], and the genetic algorithm in [45], [46]. Whereas for frequency stabilization for hybrid systems, Fuzzy-PIDF controllers were proposed in [47] based on the PSO algorithm and in [48] based on the competition over resources (COR) algorithm. In [49], a Fuzzy-PID controller was proposed for the automatic generation control of a hydro-thermal power system based on the glow-worm swarm optimization technique. The system response was improved and compared to the traditional PI and PID controllers. Another Fuzzy-PID controller was proposed in [50] to control the load frequency of multi-source power systems where the input and output controller parameters were optimized by the genetic algorithm to improve the controller performance. In [51], an improved Fuzzy-PID controller design was proposed for the LFC of multi-area reheat thermal systems using VOLUME 9, 2021 a mine blast algorithm. The system included the effect of the governor dead zone and the nonlinear limitations of the turbine generation rate. Authors in [52] proposed a fuzzy self-tuning PID controller for LFC based on the Tribe-DE optimization algorithm in parametric uncertainties in addition to the presence of external perturbations. Although the previous fuzzy-based LFC structures had demonstrated a good system response, they could not be considered fully optimized controllers because the input and output scaling factors were the only optimized parameters while the boundaries of the membership functions were selected by the designer experience [37]- [50].
One recent metaheuristic optimization technique is the Marine Predator Algorithm (MPA), which relies on the way ocean predators search for their prey [53]. It can be considered as a robust heuristic algorithm that includes many advantages such as simple procedures, small number of designed variables, flexibility, high convergence speed, near-global solution, and gradient free-nature [53]. Furthermore, the MPA has been used in different research areas and has proven effective. For example, a robust design based on the MPA was implemented for large-scale photovoltaic (PV) systems to achieve the maximum power under conditions of partial shading in [54]. In [55], the MPA was applied to identify the electrical parameters of a triple-diode PV model under different operating conditions. Moreover, the MPA was applied to predict the COVID-19 infected cases in [56], [57]. Another application of the MPA was presented in [58] to solve the problem of the optimized reactive power dispatch in power systems.
In this paper, MPA, a modern heuristic algorithm that has proven effective in other research, is used to optimize the boundaries of the membership functions as well as the input and output scaling factors of the proposed FPIDF controller to improve the frequency and tie-line power response of a two-area hybrid microgrid system. The hybrid microgrid system under study includes PV and wind energy sources with real irradiance and wind speed data as well as energy storage devices. The results of the proposed controller are compared with different controllers such as MPA-PIDF and recently introduced CRO-PIDF, CRO-FPIDF [48], and PSO-PIDF controllers. Moreover, the robustness of the proposed MPA-FPIDF controller is tested under different load perturbations, system parameters variation and uncertainties of renewable energy sources such as wind speed fluctuation and solar irradiance variation. The proposed controller effectiveness is validated using the time domain simulations implemented in the MATLAB/SIMULINK environment.
The paper is structured as follows: Section I introduces the research topic while the system modeling and components are presented in Section II. Further, the proposed optimization algorithm is presented in Section III followed by the problem formulation and the proposed control strategy in Section IV. In section V, the simulation results are discussed for different scenarios. Finally, Section VI concludes the paper.

II. SYSTEM MODELING
The suggested case study is a hybrid microgrid system consisting of two areas interconnected with each other by a tie-line, as shown in Fig. 1. Area 1 is represented by a diesel generator equipped with a valve actuator, a wind turbine energy source, a superconducting magnetic energy storage (SMES) device and load. While Area 2 includes a diesel generator equipped with a valve, PV energy source, a battery energy storage (BES) device and load. In addition, each area is integrated with a proposed Fuzzy PIDF controller to control the system frequency and maintain a stable system when subjected to different operating conditions such as different load disturbances, system parameters change, wind speed fluctuation and solar irradiance variation. In this case study, the wind turbine system is assumed to supply about 25% of the total microgrid load, similarly for the PV system and each of the diesel generators. Moreover, the storage in each area is considered to have the same capacity as the renewable energy connected to it. All components of the microgrid system are assumed as linear models using the first-order transfer functions as illustrated in Table 1 [48]. For more details, models of different components of the hybrid microgrid system are briefly described in the following sub-sections:

A. PV MODEL
The output power of the PV modules (P PV ) mainly depends on the ambient temperature (T a ) and the solar radiation (G) on the PV arrays surface. The PV power can be evaluated using equation (1) as follows [23], [24], [48]: where P PV ,STC is the rated output power under standard test conditions (STC), G STC is the solar irradiance under STC (1000 W/m 2 ), T STC is the reference temperature (25 • C), α is the temperature coefficient, and η MPPT is the maximum power tracking efficiency. In this study, the solar irradiance data is extracted from a typical PV field located in Aswan, Egypt with a maximum solar radiation of 750 W/m 2 and η MPPT = 98%. If the surrounding temperature remains constant at 25 • C, the PV power only varies linearly with G. Therefore, the PV system can be modeled using a first-order transfer function as follows: with a unity gain and a time constant of 0.03 s.

B. WIND TURBINE MODEL
The output mechanical power of the wind turbine can be calculated using equation (3) as follows [23], [24], [48]: where ρ is the air density, A is the rotor swept area, and V w is the wind speed. C p is the power coefficient which is a function of the tip speed ratio λ and the blade pitch angle β.
The parameter C p is usually controlled at low to medium wind speeds to allow wind turbine to operate in their optimum conditions. For this study, real wind speed data are recorded from a typical wind turbine farm located in Zafarana, Egypt. For small-signal stability of the system, the rate of change of the wind output power can be approximated using a first-order transfer function as follows [23], [48]: with a unity gain and a time constant of 1.5 s.

C. BES MODEL
The battery energy storage (BES) systems store chemical energy in the form of chemical reactions and convert it into electrical energy. Therefore, the BES should be equipped with a battery charger and an inverter to convert DC power into AC power. For our study, fast response types of BES devices are used [23], [48]. Therefore, the BES system can be modeled using a first-order transfer function with a time constant of zero and a gain of 1.8 as follows: The superconducting magnetic energy storage (SMES) systems store energy in the form of magnetic field generated by flowing a dc current in a superconducting coil at a temperature lower than the critical superconducting temperature [23], [48]. Therefore, the SMES should be equipped with an inverter and a cryogenic refrigerator. The stored magnetic energy (E) and power (P) can be calculated using equations (6) and (7) as follows [23], [48]: For this study, the SMES system is modeled using a firstorder transfer function with a gain of 0.98 and a time constant of 0.03 s as follows: For stand-alone hybrid microgrid systems, renewable energy sources are combined with diesel generators to provide reliable power for isolated loads since the power of renewable sources is intermittent due to climatic conditions. Generally, the diesel generators are equipped with a valve actuator to regulate the speed of the diesel engine and control the output power [23], [48]. For heavy load demands, both diesel engines and energy storage devices can supply energy to meet this demand. In this study, both diesel generators and valve actuators are modeled using a first-order transfer functions with a unity gain and time constants of 0.5 and 0.05 s, respectively. The proposed optimization technique will be presented in the next section.

III. MARINE PREDATOR ALGORITHM (MPA)
The MPA is a recent metaheuristic algorithm that relies on the optimal movements of the ocean predators when they seek their prey. The great feature of MPA is that the prey and predator are taken as search members [53]. Levy and VOLUME 9, 2021 Brownian based movements are the common techniques used to identify the strategy of the predator movements [54]. The key factor in this algorithm is the prey-to-predator speed ratio that moves the optimization process from one phase to the next. The MPA flowchart is shown in Fig. 2 and the main steps are as follows: 1) Initialization: Two matrices are constructed, the Prey matrix and the Elite matrix where the Prey matrix consists of variable random positions uniformly distributed across the suggested domain. While, the Elite matrix repeats the position vector whose fitness function is the best.
2) Phase (1) [First third of iterations]: Here, the prey moves using the Brownian strategy while the predator stands still. The Prey matrix is updated using (9) and (10) [53], [55]: where − → S y is the step size, − → R B is a vector with random numbers based on Brownian motion normal distribution and − → R is a random uniform vector between [0, 1].
3) Phase (2) [Second third of iterations] in which the Predator moves using Brown's motion, while the Prey uses Levy's motion. The first half of the population is updated using (11) and (12) [53], [55]: where the vector − → R L contains random values based on Levy's motion normal distribution. Moreover, the other half of population is updated using (13) and (14) [50], [52]: where C f controls the predator step size and is calculated as in (15) [53], [55]:

4) Phase (3) [Last third of iterations]:
Here, the Predator moves using Levy's motion and the Prey is updated using (16) and (17) [53], [55]: 5) Finishing: After each iteration, the best solution is memorized and saved in the Elite matrix presenting the best solution by the end of the iterations. The next section will present the proposed FPIDF controller and the problem formulation.

IV. CONTROL STRATEGY AND PROBLEM FORMULATION
The main target of the controller design is to reduce the twoarea frequency deviations ( F 1 , F 2 ) and the tie-line power deviation between the two areas ( P tie−line ) for different load perturbations and renewable energy sources uncertainties. The controller used for each area loop in the microgrid case study system is the FPIDF controller.
The proposed FPIDF controller contains four variables, and its transfer function can be expressed as follows [33], [35]: where k p , k i , k d and N are the proportional gain, integral gain, derivative gain, and filter coefficient, respectively. The PIDF is defined as a PID controller attached with a low-pass filter on the derivative term to further improve the system dynamics. The low-pass filter aids to suppress the high-frequency oscillations of the system response. Furthermore, to evaluate the system performance under various operating conditions, conventional PIDF controllers are first implemented in each area loop then Fuzzy PIDF controllers are implemented to achieve a better dynamic response for F 1 , F 2 and P tie−line . Fig. 3 shows the structure of the FPIDF controller where the error inputs to the controllers are given   by Equations (19) and (20) as follows [37], [48]: where ACE 1 and ACE 2 are the area control error of Area 1 and Area 2, respectively. As shown in Figure 3, the input signals to the FLC are the error (E) and its derivative or the change of error (CE). The gains k 1 and k 2 are defined as the input scaling coefficients and the PIDF parameters (k p , k i , k d , N) are the output gains, all of which are optimized using the MPA in addition to the shape of fuzzy membership functions. The optimal gains of both conventional and FPIDF controllers can be obtained by minimizing the fitness function (FF) which can be considered as follows [23], [48]: where t sim is the simulation time. Moreover, the tuning of the controller parameters is carried out using the proposed MPA   subject to the following constraints [48]: To obtain a precise and efficient Fuzzy controller design, a triangular MF design was considered for its simplicity and effective results. The choice of 5-MF is based on the designer experience to make a compromise between the control complexity and the design error. Moreover, the only condition a membership function must satisfy is not to exceed the value 1 [59], as shown in Figs. 4-6. In addition, the Fuzzy controller rules are summarized in Table 2 Fig. 7. One could notice the wider membership functions and higher overlap that not only makes the rule surface smoother than the one suggested in [48] but also improves the system stability and the dynamic response characteristics (oscillation, settling time, steady state error) and enhances the controller performance at higher disturbances. The simulation results and discussion will be presented in the next section for different operating conditions.

V. SIMULATION RESULTS AND DISCUSSION
The microgrid system performance is evaluated based on conventional PIDF and fuzzy PIDF controllers using different optimization algorithms under various operating disruptions through the following scenarios:   including renewable energy sources variation. The system response is compared with the conventional MPA-PIDF controller and other controllers presented in literatures such as PSO-PIDF and recently COR-PIDF and COR-FPIDF controllers [48]. Table 3 shows the optimal gains obtained for different controllers based on different optimization algorithms. It can be observed that the proposed MPA-FPIDF controller gives the best (least) fitness function (FF) compared with other controllers. In addition, the fuzzy PIDF controllers provide lower FF than conventional PIDF controllers. By applying these gains to the case study model, the system dynamic response can be improved. As shown in Fig. 8(a)-(c), the MPA-FPIDF controller has better transient response compared with other controllers. It provides lower steady-state error, faster response, and better damped oscillation than other techniques for F 1 , F 2 and P tie−line . Moreover, the system dynamic response specifications are evaluated in terms of maximum undershoot (MUS), maximum overshoot (MOS), and settling time (T s ). As illustrated in Table 4 Table 3, the dynamic response of the system is evaluated under 1, 3, 5, 7 and 9% SLP in Area 1. The dynamic responses of F 1 , F 2 and P tie−line are shown in Fig. 9(a)-(c) for different small SLP percentages.
Furthermore, to prove the robustness of the proposed MPA-FPIDF controller, severe disturbances (10-20%) are applied to the system. The dynamic responses of F 1 , F 2 and P tie−line are shown in Fig. 10(a)-(c) for 10, 15 and 20% SLP. It can be observed that the maximum overshoot and undershoot oscillations increase with the increase of SLP. However, these oscillations are still within an acceptable range of the frequency and tie-line power deviations. For SLP=20%, the response of F 1 oscillates between maximum VOLUME 9, 2021   Hence, the transient response specifications for this case are given in Table 5 in terms of MUS and MOS values only. This confirms the ability of the MPA-FPIDF controller to continue to stay stable for different step load perturbations.
Moreover, to show the performance robustness of the proposed MPA-FPIDF controller at different perturbations compared with other controllers, a random load disturbance is applied to area 1, as shown in Fig. 11. The system response oscillations are illustrated in Fig. 12(a)-(c) when the load changes every 20 seconds based on different controllers. It can be observed that the proposed MPA-FPIDF controller continues to provide the best response for F 1 , F 2 and P tie−line for random load variation. It provides less steady-state error, faster response, and better damped oscillation than that achieved using other controllers. 54228 VOLUME 9, 2021   In this scenario, a sensitivity analysis is evaluated to claim the robustness of the proposed MPA-FPIDF controller to system parameters change. This is by changing all the parameters of the two area microgrid system by ± 25%. The results show that the dynamic response is unaffected except when the following parameters are changed T d1 , K SMES ,     Table 6 shows slight changes in the MUS and MOS values for the system frequency and tie-line power deviations. Moreover, the settling time of the system response shows no change and hence not included in Table 6. This confirms the robustness of the MPA-FPIDF controller to keep the system response insensitive to system parameters change. The next scenario will present the system performance under RES uncertainties.

D. SCENARIO (IV): STUDY OF SYSTEM PERFORMANCE UNDER RENEWABLE ENERGY SOURCES (RES) UNCERTAINTIES
This scenario evaluates the system response under the uncertainty of hybrid renewable energy sources where real wind speed and solar irradiance data are considered. The wind speed variation is shown in Fig. 13 which is obtained from a typical wind farm site located in Zafarana, Egypt at the end of April 2020. The wind speed varies continuously within 24 hours with a wide range of fluctuations from 6 to 14 m/s. The wind turbine power in Area 1 is illustrated in Fig. 14 which ranges from 0.03 to 0.2 p.u.
In addition, the solar irradiance data is extracted from a typical PV field located in Aswan, Egypt, as shown in Fig. 15. The normal distribution of solar irradiance for a complete sunny summer day is taken from 6 am to 6 pm with a maximum of 750 W/m 2 . The smooth variation of the PV power in Area 2 is illustrated in Fig. 16 with a maximum value of 0.25 p.u. The dynamic responses of F 1 , F 2 and P tie−line are shown in Fig. 17(a)-(c) for different controllers when subjected to the aforementioned renewable energy sources variation. It can be seen that the proposed MPA-FPIDF controller can maintain stable system response with very small oscillations compared with other controllers. This confirms the effectiveness of the proposed controller when dealing with renewable energy sources uncertainty.

VI. CONCLUSION
This paper has proposed a novel optimized Fuzzy PIDF-LFC for enhancing the performance of a hybrid microgrid system including PV and wind energy sources with real irradiance and wind speed data as well as energy storage devices. The MPA, a recent heuristic algorithm, is effectively used to optimize the input scaling factors, output gains as well as the membership functions boundaries of the proposed FPIDF controller. The effectiveness of the proposed MPA-FPIDF controller was compared with conventional MPA-PIDF controller and other controllers presented in literatures for the same case study such as PSO-PIDF, COR-PIDF and COR-FPIDF controllers. Moreover, different scenarios were implemented to verify the robustness and sensitivity of the proposed controller to different step load perturbations, system parameters variations, and uncertainties of renewable energy sources such as wind speed fluctuations and solar irradiance variations. The results have proven that the proposed MPA-FPIDF controller is more effective than other controllers as it provides the best fitness function of 0.07 × 10 −3 . Moreover, for SLP = 5%, the MPA-FPIDF provides the lowest MUS of −0.22 × 10 −5 Hz, −0.73×10 −6 Hz, and −0.15 × 10 −4 p.u for F 1 , F 2 , and P tie−line , respectively. For this case, the lowest MOS can be achieved using MPA-FPIDF which is 0.05 × 10 −5 Hz for F 1 and zero for F 2 , and P tie−line . Also, the MPA-FPIDF provides the lowest settling time for all responses which equals 10 s compared to 18 s for COR and 20 s for PSO methods. Therefore, the MPA-FPIDF controller provides a faster response, and better damping to the system frequency and tie-line power deviations than other controllers. Also, variations of the dynamic responses specifications due to different load perturbations (1 to 20%) and some system parameters were found to be within the acceptable range validating the stability and performance robustness of the proposed controller. For SLP=20%, the response of F 1 oscillates between maximum undershoot of −9.25 × 10 −6 Hz and maximum overshoot of 2.18 × 10 −6 Hz, and the maximum allowable undershoot for F 2 and P tie−line are −2.95 × 10 −6 Hz and −6.20 × 10 −5 p.u., respectively. Moreover, the settling time did not change at all. To claim the robustness of the proposed controller, a sensitivity analysis was evaluated by changing the system parameters by ± 25%. In addition, the MPA-FPIDF shows robust and superior performance over other controllers when subjected to wind speed fluctuations and solar irradiance variation. Therefore, the MPA-based Fuzzy PIDF controller can be used effectively in controlling hybrid microgrid frequency and tie line power in case of multi-area microgrids. For future studies, the proposed controller shall be used to control various responses in smart grid systems.