Fuzzy Logic Controller Equilibrium Base to Enhance AGC System Performance with Renewable Energy Disturbances

: Owing to the various sources of complexity in the electrical power system, such as integrating intermittent renewable energy resources and widely spread nonlinear power system components, which result in sudden changes in the power system operating conditions, the conventional PID controller fails to track such dynamic challenges to mitigate the frequency deviation problem. Thus, in this paper, a fuzzy PI controller is proposed to enhance the automatic generation control system (AGC) against step disturbance, dynamic disturbance, and wind energy disturbance in a single area system. The proposed controller is initialized by using Equilibrium Optimization and proved its superiority through comparison with a classical PI optimized base. Results show that the fuzzy PI controller can reduce the peak-to-peak deviation in the frequency by 30–59% under wind disturbance, compared to a classical PI optimized base. Moreover, a fuzzy PID controller is also proposed and EO initialized in this paper to compare with the PIDA optimized by several techniques in the two-area system. Results show that the fuzzy PID controller can reduce the peak-to-peak deviation in the frequency of area 1 by 30–50% and the deviation of frequency in area 2 by 13–48% under wave disturbance, compared to the classical PIDA optimized base.


Introduction
Recently, the power system is becoming more complex due to the integration of renewable energy sources used by the continuous change in generated power, as well as the constant rise in load demand and the variety of generating unit sizes.Moreover, one of the main complex characteristics of the power system is the local and global interconnection of power systems.These interconnections are made through inter-power lines, which are very crucial for the power interchange between different control areas.To maintain the maximum reliability and quality of the power system, the frequency and voltages are mainly monitored and regulated.Two different types of control approaches are mainly used.One is the automatic voltage regulator (AVR), and the other is the automatic generation control (AGC).The AVR system aims to maintain the alternator's output voltage at its supposed value as well as reduce any expected variations in its value if exposed to a fault or unusual condition.To achieve such an objective, AVR controls the exciter's DC current, which is connected to the alternator's rotor, and this is quite an effective approach [1][2][3][4][5].AGC is another method used to stabilize the frequency tie-line power for various control areas as well as to maintain power balance [6].Both approaches are very effective.However, some researchers prefer the AGC approach since it includes the effect of interconnected areas, which is more likely to become a real case.Moreover, AGC plays a very essential role in Energies 2022, 15, 6709 2 of 18 electric power operation by maintaining the frequency and efficiency of the interconnected power systems [7][8][9][10][11].Several parameters can be used to control the frequency.One of them is the governor droop (R), which is used to minimize the frequency's steady-state error when it is set to a specified limit, as mentioned in [12][13][14][15].Subsequently, it is a great necessity to have a well-designed controller for AGC.According to [16], there are various control techniques that are used in AGC.They are classified into two classes: one is nature-inspired metaheuristic techniques, and the other is robust control methods.Various metaheuristic algorithms are employed to design the proper controller, such as genetic algorithm (GA), particle swarm optimization (PSO), differential evaluation (DE), ant colony optimization (ACO), and firefly algorithm (FA) [17][18][19][20][21].They are preferred over other control techniques due to their high accuracy and fast response.The PI controller is very prevalent, due to its high availability in the industry.Therefore, it can be used if its gains are properly chosen.Various optimization algorithms are used for tuning the gains of the PI controller in AGC [22][23][24][25][26][27][28].Furthermore, renewable energy sources are included in [29][30][31][32].The control of AGC is generally studied for single or multi-area systems, as in [33][34][35].Fuzzy logic controllers are proposed in [36][37][38].Other controllers were proposed in [39][40][41].
In this paper, the fuzzy logic PI controller with Equilibrium Optimizer (EO) initialization is used in AGC with and without the inclusion of a wind generator in a single area system and is compared with a classical optimized PI controller.Moreover, the fuzzy logic PID controller with Equilibrium Optimizer (EO) initialization is used in a two-area system under step and wave energy disturbance and compared with the optimized PIDA controller.The strategy of the proposed controller is to initialize the PI/PID controller gains by using EO optimization then the fuzzy logic controller will update these gains to deal with the input disturbances.

System Modeling
Since the frequency is a key indicator of the robustness of the power system, an efficient load frequency control (LFC) is required to maintain the frequency at its nominal level.Automatic generation control or AGC is a scheme used to regulate the system frequency.The presented systems under study are single-area and two-area systems, as shown in Figure 1.The main components of the system are the governor, the turbine, the generator, the load, and a wind turbine to represent the dynamic disturbances imposed on the system [42], which are explained in the following subsections.In the single-area system, a fuzzy PI controller is presented and compared with the classical optimized-based PI controllers, while in the two-area system, a fuzzy PID controller is presented and compared with the classical optimized-based PIDA controllers.
for various control areas as well as to maintain power balance [6].Both approaches are very effective.However, some researchers prefer the AGC approach since it includes the effect of interconnected areas, which is more likely to become a real case.Moreover, AGC plays a very essential role in electric power operation by maintaining the frequency and efficiency of the interconnected power systems [7][8][9][10][11].Several parameters can be used to control the frequency.One of them is the governor droop (R), which is used to minimize the frequency's steady-state error when it is set to a specified limit, as mentioned in [12][13][14][15].Subsequently, it is a great necessity to have a well-designed controller for AGC.According to [16], there are various control techniques that are used in AGC.They are classified into two classes: one is nature-inspired metaheuristic techniques, and the other is robust control methods.Various metaheuristic algorithms are employed to design the proper controller, such as genetic algorithm (GA), particle swarm optimization (PSO), differential evaluation (DE), ant colony optimization (ACO), and firefly algorithm (FA) [17][18][19][20][21].They are preferred over other control techniques due to their high accuracy and fast response.The PI controller is very prevalent, due to its high availability in the industry.Therefore, it can be used if its gains are properly chosen.Various optimization algorithms are used for tuning the gains of the PI controller in AGC [22][23][24][25][26][27][28].Furthermore, renewable energy sources are included in [29][30][31][32].The control of AGC is generally studied for single or multi-area systems, as in [33][34][35].Fuzzy logic controllers are proposed in [36][37][38].Other controllers were proposed in [39][40][41].
In this paper, the fuzzy logic PI controller with Equilibrium Optimizer (EO) initialization is used in AGC with and without the inclusion of a wind generator in a single area system and is compared with a classical optimized PI controller.Moreover, the fuzzy logic PID controller with Equilibrium Optimizer (EO) initialization is used in a two-area system under step and wave energy disturbance and compared with the optimized PIDA controller.The strategy of the proposed controller is to initialize the PI/PID controller gains by using EO optimization then the fuzzy logic controller will update these gains to deal with the input disturbances.

System Modeling
Since the frequency is a key indicator of the robustness of the power system, an efficient load frequency control (LFC) is required to maintain the frequency at its nominal level.Automatic generation control or AGC is a scheme used to regulate the system frequency.The presented systems under study are single-area and two-area systems, as shown in Figure 1.The main components of the system are the governor, the turbine, the generator, the load, and a wind turbine to represent the dynamic disturbances imposed on the system [42], which are explained in the following subsections.In the single-area system, a fuzzy PI controller is presented and compared with the classical optimizedbased PI controllers, while in the two-area system, a fuzzy PID controller is presented and compared with the classical optimized-based PIDA controllers. (a)

Governor Model
The governor model is represented using a first-order linear transfer function where Tg is the governor time constant.

Turbine Model
The turbine model is represented by a first-order linear transfer function where Tch is the turbine time constant.

Generator/Load Model
The generator/load model is represented by a first-order linear transfer function and  = where D is the frequency sensitive coefficient, M is the constant of inertia, R and is the speed regulation, and B is the frequency bias factor.

Governor Model
The governor model is represented using a first-order linear transfer function where T g is the governor time constant.

Turbine Model
The turbine model is represented by a first-order linear transfer function 1 1 + sT ch where T ch is the turbine time constant.

Generator/Load Model
The generator/load model is represented by a first-order linear transfer function 1 M s + D and B = 1 R where D is the frequency sensitive coefficient, M is the constant of inertia, R and is the speed regulation, and B is the frequency bias factor.

Wind Disturbance Generator Model
The mechanically generated output power from the wind turbine generator is represented by the Equation (1): where ρ is the flowing air density in kg/m 3 , C p is the power coefficient, A is the swept area in m 2 , and U is the wind speed in m/s.The variation in wind speed against time is shown in Figure 2 [42].

Wind Disturbance Generator Model
The mechanically generated output power from the wind turbine generator is represented by the Equation (1): where  is the flowing air density in kg/m 3 , Cp is the power coefficient, A is the swept area in m 2 , and U is the wind speed in m/s.The variation in wind speed against time is shown in Figure 2 [42].

Proportional Integral Controller Model
A PI controller is employed for providing the control signal to adequately adjust the frequency at its predetermined level.Its transfer function is represented by An exponential time delay in the single-area system whose time constant equals 2 s is added.The system parameters' values are indicated in Table 1 [27].

Proportional Integral Controller Model
A PI controller is employed for providing the control signal to adequately adjust the frequency at its predetermined level.Its transfer function is represented by An exponential time delay in the single-area system whose time constant equals 2 s is added.The system parameters' values are indicated in Table 1 [27].

Optimization Algorithms
There are several optimization algorithms that proved their effectiveness.In this study, the authors chose to use an optimization algorithm named the Equilibrium Optimizer (EO) for optimizing the proposed controller due to its high exploitation rate, fast convergence, and high accuracy.

Equilibrium Optimizer (EO)
Afshin Faramarzi developed a relatively new optimization algorithm in 2020.This algorithm is called the Equilibrium Optimizer algorithm (EO) [43].The inspiration for this algorithm is performed by the balance models of control between volume and mass.These balance models are used to estimate dynamic and equilibrium states.Most metaheuristic algorithms usually have the same approach.A vector of suggested solutions is primarily generated, then the main algorithm function is used to update the solution vector every iteration.For EO, the volume equilibrium concentration parameter ( → VC) is calculated for each suggested solution for updating every iteration.

→
VC can be determined from Equation (3) as follows.
Given that: → VC is the concentration inside the volume; V is the volume; → VC eq is the concentration at an equilibrium state; → m g is the mass generation rate; → α is the turnover rate, it is assumed to be a random vector in the interval of [0, 1]; While → F can be calculated using Equation ( 4) as follows: Moreover, it is time defined in terms of running iteration (I) and the maximum number of iterations (I m ) and diminishes with the number of iterations.It can be determined from Equation (5).
where → m g can be determined from Equation (6), while → m gi , t o , and P g are calculated from Equations ( 7)-( 9), respectively.
Note that, EO is used to optimize the PI/PID controller gains, and the flowchart in Figure 3 shows how it is used in this case [43].

Fuzzy EO PID/PI Controller
The fuzzy control technique was applied successfully as a soft computing method for various decision-making applications such as load frequency control.Fuzzy systems mimic the human reasoning behavior in which imprecise inputs are managed through IF-THEN Energies 2022, 15, 6709 7 of 18 rules to realize a precise output.Fuzzy control structures have been employed as a new paradigm for automatic control succeeding the developing of fuzzy sets by L.A. Zadeh 1965 [44].The fuzzy controller is treated as a nonlinear controller defined by linguistic rules such as big and small instead of differential equations.Consequently, the fuzzy control system exhibits remarkable performance with uncertain systems that embrace deficient or vague information regardless of the model of the system [29].Fuzzy logic deposits the concept of infinite number of truth values manipulated between 0 and 1, unlike classical logic which has only two truth values, 0 or 1.
Two types of fuzzy logic controller exist, namely type 1 (T1FLC) and type 2 (T2FLC).T2FLC can deal with systems with more uncertainties to add more degrees of freedom to cope with the rapid varying uncertainties.T1FLC can be viewed as first-order approximation while T2FLC as second-order approximation of uncertainty [45,46].T1FLC is mainly composed of four fundamental blocks, namely fuzzification, inference engine or mechanism, knowledge base, and defuzzification [47][48][49].In T2FLC, an extra block is added called the type reducer to be inserted between the defuzzification stage and the inference stage [45].
Fuzzification is the conversion of the inputs from crisp values to linguistic variables.Each crisp input is assigned a degree to the fuzzy subset they belong via the membership function.The knowledge base contains the main rule which contains the IF-THEN fuzzy rules, as well as the database which contains the membership functions of the fuzzy sets.The inference mechanism is the decision-making part that performs the logic operations.Defuzzification is obtaining non fuzzy crisp output from the aggregate fuzzy set to be processed as a control signal.Various defuzzification methods such as Centroid Average, Maximum Center Average, and Bisector are used.The most common inference engines are Mamdani and Sugeno models.They are mainly different in the production stage, where Mamdani has an output membership function whereas Sugeno uses weighted average of the consequents to calculate the crisp output.The fuzzy inference process diagram is shown in Figure 4 [45].

Fuzzy EO PID/PI Controller
The fuzzy control technique was applied successfully as a soft computing method for various decision-making applications such as load frequency control.Fuzzy systems mimic the human reasoning behavior in which imprecise inputs are managed through IF-THEN rules to realize a precise output.Fuzzy control structures have been employed as a new paradigm for automatic control succeeding the developing of fuzzy sets by L.A. Zadeh 1965 [44].The fuzzy controller is treated as a nonlinear controller defined by linguistic rules such as big and small instead of differential equations.Consequently, the fuzzy control system exhibits remarkable performance with uncertain systems that embrace deficient or vague information regardless of the model of the system [29].Fuzzy logic deposits the concept of infinite number of truth values manipulated between 0 and 1, unlike classical logic which has only two truth values, 0 or 1.
Two types of fuzzy logic controller exist, namely type 1 (T1FLC) and type 2 (T2FLC).T2FLC can deal with systems with more uncertainties to add more degrees of freedom to cope with the rapid varying uncertainties.T1FLC can be viewed as first-order approximation while T2FLC as second-order approximation of uncertainty [45,46].T1FLC is mainly composed of four fundamental blocks, namely fuzzification, inference engine or mechanism, knowledge base, and defuzzification [47][48][49].In T2FLC, an extra block is added called the type reducer to be inserted between the defuzzification stage and the inference stage [45].
Fuzzification is the conversion of the inputs from crisp values to linguistic variables.Each crisp input is assigned a degree to the fuzzy subset they belong via the membership function.The knowledge base contains the main rule which contains the IF-THEN fuzzy rules, as well as the database which contains the membership functions of the fuzzy sets.The inference mechanism is the decision-making part that performs the logic operations.Defuzzification is obtaining non fuzzy crisp output from the aggregate fuzzy set to be processed as a control signal.Various defuzzification methods such as Centroid Average, Maximum Center Average, and Bisector are used.The most common inference engines are Mamdani and Sugeno models.They are mainly different in the production stage, where Mamdani has an output membership function whereas Sugeno uses weighted average of the consequents to calculate the crisp output.The fuzzy inference process diagram is shown in Figure 4 [45].Since a conventional PID controller possess linear characteristics, it fails to track fast and dynamic changes in widely spread nonlinear power systems.Accordingly, the integration of a PID controller with fuzzy logic as a hybrid controller can be an efficient solution to handle complex and nonlinear systems [45,46].
In our study, PI and PID controllers were implemented using a fuzzy control system to preserve the system frequency at its nominal value, which showed greater flexibility and adaptability to track the system rapid changes.The generalized architecture of the presented hybrid fuzzy controller is shown in Figure 5, where the system frequency error ∆f, and the derivative of this error d∆f, are taken as inputs to the fuzzy controller.The hybrid fuzzy logic controller has one output that is continuously and online tuned to cope Since a conventional PID controller possess linear characteristics, it fails to track fast and dynamic changes in widely spread nonlinear power systems.Accordingly, the integration of a PID controller with fuzzy logic as a hybrid controller can be an efficient solution to handle complex and nonlinear systems [45,46].
In our study, PI and PID controllers were implemented using a fuzzy control system to preserve the system frequency at its nominal value, which showed greater flexibility and adaptability to track the system rapid changes.The generalized architecture of the presented hybrid fuzzy controller is shown in Figure 5, where the system frequency error ∆f, and the derivative of this error d∆f, are taken as inputs to the fuzzy controller.The hybrid fuzzy logic controller has one output that is continuously and online tuned to cope with any change in system frequency to acquire better dynamic and steady-state response.Based on the problem domain, input and output triangular membership functions were chosen for their simple and easy computation to generate the antecedents.Input membership functions are illustrated in Figure 6, with five linguistic variables, namely Negative Big (NB), Negative (N), Zero (Z), Positive (P), and Positive Big (PB), and twenty-five IF-THEN rules as shown in Table 2, while the output membership function is illustrated in Figure 6c.The minimum-type implication method was utilized to produce the fuzzy consequents from the antecedents.Then, the maximum-type aggregation method was applied to obtain the output fuzzy set for each case.After that, the centroid method was used for defuzzification to generate the control signal that is applied to the governor of the turbine to increase or decrease the output generator frequency.The Mamdani fuzzy model was incorporated as the inference engine.
with any change in system frequency to acquire better dynamic and steady-state response.Based on the problem domain, input and output triangular membership functions were chosen for their simple and easy computation to generate the antecedents.Input membership functions are illustrated in Figure 6, with five linguistic variables, namely Negative Big (NB), Negative (N), Zero (Z), Positive (P), and Positive Big (PB), and twenty-five IF-THEN rules as shown in Table 2, while the output membership function is illustrated in Figure 6c.The minimum-type implication method was utilized to produce the fuzzy consequents from the antecedents.Then, the maximum-type aggregation method was applied to obtain the output fuzzy set for each case.After that, the centroid method was used for defuzzification to generate the control signal that is applied to the governor of the turbine to increase or decrease the output generator frequency.The Mamdani fuzzy model was incorporated as the inference engine.with any change in system frequency to acquire better dynamic and steady-state response.
Based on the problem domain, input and output triangular membership functions were chosen for their simple and easy computation to generate the antecedents.Input membership functions are illustrated in Figure 6, with five linguistic variables, namely Negative Big (NB), Negative (N), Zero (Z), Positive (P), and Positive Big (PB), and twenty-five IF-THEN rules as shown in Table 2, while the output membership function is illustrated in Figure 6c.The minimum-type implication method was utilized to produce the fuzzy consequents from the antecedents.Then, the maximum-type aggregation method was applied to obtain the output fuzzy set for each case.After that, the centroid method was used for defuzzification to generate the control signal that is applied to the governor of the turbine to increase or decrease the output generator frequency.The Mamdani fuzzy model was incorporated as the inference engine.

Results
The results are divided into two sections.In the first section, a single area system is presented where three test cases are studied.The first case is applying a step disturbance at t = 10 s, as shown in Figure 7.The proposed fuzzy EO PI controller is used and compared with a PI controller optimized once by a harmony search algorithm (HSA), once by a genetic algorithm (GA), and finally by a gravitational search algorithm (GSA), as presented in [42].The second case is conducted by examining all the controllers used in case 1 against dynamic reference, as shown in Figure 8. Finally, in the third case, the controller is examined without repeating the optimization against wind disturbance, as illustrated in Figure 9 and compared with the PI controller in [42], but the optimization is repeated.
Energies 2022, 15, x FOR PEER REVIEW 10 of 20 illustrated in Figure 9 and compared with the PI controller in [42], but the optimization is repeated.
In the second section, a two-area system is presented and two test cases are applied.In the first case, the proposed fuzzy EO PID controller is compared with the PIDA controller optimized by the harmony search algorithm (HSA), sine-cosine algorithm (SCA), and teaching-learning-based-optimization (TLBO) [50] under 1% disturbance in area 1.In the second case, the proposed fuzzy EO PID controller is compared with PIDA optimized by TLBO [50] under wave disturbance.Energies 2022, 15, x FOR PEER REVIEW 10 of 20 illustrated in Figure 9 and compared with the PI controller in [42], but the optimization is repeated.
In the second section, a two-area system is presented and two test cases are applied.In the first case, the proposed fuzzy EO PID controller is compared with the PIDA controller optimized by the harmony search algorithm (HSA), sine-cosine algorithm (SCA), and teaching-learning-based-optimization (TLBO) [50] under 1% disturbance in area 1.In the second case, the proposed fuzzy EO PID controller is compared with PIDA optimized by TLBO [50] under wave disturbance.The frequency deviation results of case 1, which has the step disturbance shown in Figure 7, are depicted in Figure 10.Clearly, the proposed fuzzy EO PI has the lower overshoot with respect to PI-GA, PI-GSA, and PI-HSA, by 18.65%, 15.88%, and 13.556%.The proposed controller output signals are shown in Figure 11.In the second section, a two-area system is presented and two test cases are applied.In the first case, the proposed fuzzy EO PID controller is compared with the PIDA controller optimized by the harmony search algorithm (HSA), sine-cosine algorithm (SCA), and teaching-learning-based-optimization (TLBO) [50] under 1% disturbance in area 1.In the second case, the proposed fuzzy EO PID controller is compared with PIDA optimized by TLBO [50] under wave disturbance.The frequency deviation results of case 1, which has the step disturbance shown in Figure 7, are depicted in Figure 10.The frequency deviation results of case 1, which has the step disturbance shown in Figure 7, are depicted in Figure 10.Clearly, the proposed fuzzy EO PI has the lower overshoot with respect to PI-GA, PI-GSA, and PI-HSA, by 18.65%, 15.88%, and 13.556%.The proposed controller output signals are shown in Figure 11.Clearly, the proposed fuzzy EO PI has the lower overshoot with respect to PI-GA, PI-GSA, and PI-HSA, by 18.65%, 15.88%, and 13.556%.The proposed controller output signals are shown in Figure 11.

Case 2
The frequency deviation results of case 2, which has the dynamic disturbances of Figure 8, are shown in Figure 12.It is clear from Figure 12 that the proposed controller has the best dynamic performance over PI-GA, PI-GSA, and PI-HSA in [22].The control signals of the proposed controller are shown in Figure 13.

Case 2
The frequency deviation results of case 2, which has the dynamic disturbances of Figure 8, are shown in Figure 12.

Case 2
The frequency deviation results of case 2, which has the dynamic disturbances of Figure 8, are shown in Figure 12.It is clear from Figure 12 that the proposed controller has the best dynamic performance over PI-GA, PI-GSA, and PI-HSA in [22].The control signals of the proposed controller are shown in Figure 13.It is clear from Figure 12 that the proposed controller has the best dynamic performance over PI-GA, PI-GSA, and PI-HSA in [22].The control signals of the proposed controller are shown in Figure 13.The frequency deviation results of case 3, which has the wind disturbance shown in Figure 9 in addition to the step disturbance in Figure 7, are shown in Figure 14 and scoped in Figure 15.

Case 3
The frequency deviation results of case 3, which has the wind disturbance shown in Figure 9 in addition to the step disturbance in Figure 7, are shown in Figure 14 and scoped in Figure 15.

Case 3
The frequency deviation results of case 3, which has the wind disturbance shown in Figure 9 in addition to the step disturbance in Figure 7, are shown in Figure 14 and scoped in Figure 15.

Case 3
The frequency deviation results of case 3, which has the wind disturbance shown in Figure 9 in addition to the step disturbance in Figure 7, are shown in Figure 14 and scoped in Figure 15.It is clear from Figures 14 and 15 that the proposed controller has the lowest overshoot and less oscillations than the methods presented in [22] without repeating the initialization.It is obvious that the peak-to-peak oscillation with the proposed controller is lower than PI-GA by 59%, PI-HSA by 47%, and PI-GSA by 30%.The proposed controller signals are shown in Figure 16.It is clear from Figures 14 and 15 that the proposed controller has the lowest overshoot and less oscillations than the methods presented in [22] without repeating the initialization.It is obvious that the peak-to-peak oscillation with the proposed controller is lower than PI-GA by 59%, PI-HSA by 47%, and PI-GSA by 30%.The proposed controller signals are shown in Figure 16.The gains of the controllers in [42] and the initials of the proposed controller are presented in Tables 3 and 4.
Table 3. Gains of controller in case 1 and 2. The gains of the controllers in [42] and the initials of the proposed controller are presented in Tables 3 and 4.

Second Section
The model under study in this section is the two-area system presented in [50], as shown in Figure 1b.Two cases are studied for the two-area system.In the first case, the loading of area 1 is varied by 1%, while the disturbance in case 2 is the wave energy disturbance presented in Figure 17.From Figures 18-20, it is evident that the overshoot with the proposed controller is lower than PIDA-HSA by 55%, PIDA-SCA by 50%, and PIDA-TLBO by 42% in df1, while in df2, the overshoot with the proposed controller is lower than PIDA-HS by 50%, PIDA-SCA by 46%, and PIDA-TLBO by 28%.Finally in case of tie power, the overshoot with the proposed controller is lower than PIDA-HSA by 50%, PIDA-SCA by 40%, and PIDA-TLBO by 15%.Moreover, the proposed controller has more smoothing performance than the PIDA presented in [50].From Figures 18-20, it is evident that the overshoot with the proposed controller is lower than PIDA-HSA by 55%, PIDA-SCA by 50%, and PIDA-TLBO by 42% in df1, while in df2, the overshoot with the proposed controller is lower than PIDA-HS by 50%, PIDA-SCA by 46%, and PIDA-TLBO by 28%.Finally in case of tie power, the overshoot with the proposed controller is lower than PIDA-HSA by 50%, PIDA-SCA by 40%, and PIDA-TLBO by 15%.Moreover, the proposed controller has more smoothing performance than the PIDA presented in [50].From Figures 18-20, it is evident that the overshoot with the proposed controller is lower than PIDA-HSA by 55%, PIDA-SCA by 50%, and PIDA-TLBO by 42% in df1, while in df2, the overshoot with the proposed controller is lower than PIDA-HS by 50%, PIDA-SCA by 46%, and PIDA-TLBO by 28%.Finally in case of tie power, the overshoot with the proposed controller is lower than PIDA-HSA by 50%, PIDA-SCA by 40%, and PIDA-TLBO by 15%.Moreover, the proposed controller has more smoothing performance than the PIDA presented in [50].

Case 2
In this case, wave energy disturbance is applied to the system.The change in area 1 frequency (df1), the change in area 2 frequency (df2), and the tie power (dP12) are presented in Figures 21-23       From Figures 21-23, it is obvious that the peak-to-peak oscillation with the proposed controller is lower than PIDA-HSA by 50%, PIDA-SCA by 41%, and PIDA-TLBO by 30%   From Figures 21-23, it is obvious that the peak-to-peak oscillation with the proposed controller is lower than PIDA-HSA by 50%, PIDA-SCA by 41%, and PIDA-TLBO by 30% in df1.In df2, the peak-to-peak oscillation with the proposed controller is lower than PIDA-HS by 48%, PIDA-SCA by 35%, and PIDA-TLBO by 13%.Finally, in the case of tie power, the peak-to-peak oscillation with the proposed controller is lower than PIDA-HSA by 43%, PIDA-SCA by 23%, and PIDA-TLBO [50] by 20%.

Conclusions
A fuzzy PI/PID controller is proposed in this article to enhance the AGC system performance.The initialization of the controller gains was conducted by EO optimization.First, the validation of fuzzy PI controller was performed through comparison with PI-TLBO base, PI-HSA base, and PI-GSA base under step, dynamic, and wind generator disturbances in a single-area system.The proposed controller proved its superiority, where the system has better overshoot, dynamic performance, and less oscillations than the other methods.Moreover, the proposed controller proved its robustness through the auto-tuning of the gains.Finally, the proposed fuzzy PID controller also proved its superiority over the PIDA-TLBO, PIDA-SCA, and PIDA-HSA under step and wave energy disturbance in the two-area system.
value that control the exploration ability.It equals to 2; → σ is a random vector in the interval of [0, 1].

ω 1 and ω 2
are random numbers in the interval of [0, 1]; → R v is a vector constructed by the repetition; P g is the generation probability.

Figure 6 .
Figure 6.(a) The first input membership function.(b) The second input membership function.(c) Output membership function.

Figure 10 .
Figure 10.The frequency deviation under step disturbance.

Figure 10 .
Figure 10.The frequency deviation under step disturbance.

Figure 10 .
Figure 10.The frequency deviation under step disturbance.

Figure 11 .
Figure 11.The output control signals of the fuzzy PI controller in case 1.

Figure 12 .
Figure 12.The frequency deviation under dynamic disturbance.

11 .
The output control signals of the fuzzy PI controller in case 1.

Energies 2022 , 20 Figure 11 .
Figure 11.The output control signals of the fuzzy PI controller in case 1.

Figure 12 .
Figure 12.The frequency deviation under dynamic disturbance.

Figure 12 .
Figure 12.The frequency deviation under dynamic disturbance.

Figure 13 .
Figure 13.The output control signals of the fuzzy PI controller in case 2.

Figure 13 .
Figure 13.The output control signals of the fuzzy PI controller in case 2.

Figure 14 .
Figure 14.The frequency deviation under wind disturbance.

Figure 15 .
Figure 15.The scoped frequency deviation results under wind disturbance.

Figure 14 .
Figure 14.The frequency deviation under wind disturbance.

Figure 13 .
Figure 13.The output control signals of the fuzzy PI controller in case 2.

Figure 14 .
Figure 14.The frequency deviation under wind disturbance.

Figure 15 .
Figure 15.The scoped frequency deviation results under wind disturbance.

Figure 15 .
Figure 15.The scoped frequency deviation results under wind disturbance.

Figure 16 .
Figure 16.The proposed controller signals under wind disturbance.

Figure 16 .
Figure 16.The proposed controller signals under wind disturbance.

Figure 18 .
Figure 18.Change in area 1 frequency under 1% load change in area 1.Figure 18. Change in area 1 frequency under 1% load change in area 1.

Figure 18 . 20 Figure 19 .
Figure 18.Change in area 1 frequency under 1% load change in area 1.Figure 18. Change in area 1 frequency under 1% load change in area 1. Energies 2022, 15, x FOR PEER REVIEW 16 of 20

Figure 20 .
Figure 20.Change in power tie under 1% load change in area 1.

Figure 20 .
Figure 20.Change in power tie under 1% load change in area 1.

Figure 20 .
Figure 20.Change in power tie under 1% load change in area 1. .

Figure 22 .
Figure 22.Change in area 2 frequency under wave disturbance.

Figure 23 .
Figure 23.Change in tie power under wave disturbance.From Figures21-23, it is obvious that the peak-to-peak oscillation with the proposed controller is lower than PIDA-HSA by 50%, PIDA-SCA by 41%, and PIDA-TLBO by 30%

Figure 22 .
Figure 22.Change in area 2 frequency under wave disturbance.

Figure 23 .
Figure 23.Change in tie power under wave disturbance.

Figure 22 .
Figure 22.Change in area 2 frequency under wave disturbance.

Figure 23 .Figure 23 .
Figure 23.Change in tie power under wave disturbance.From Figures21-23, it is obvious that the peak-to-peak oscillation with the proposed controller is lower than PIDA-HSA by 50%, PIDA-SCA by 41%, and PIDA-TLBO by 30% Figure 23.Change in tie power under wave disturbance.

Table 2 .
Rules for the proposed controller.

Table 2 .
Rules for the proposed controller.

Table 3 .
Gains of controller in case 1 and 2.

Table 4 .
Gains of controller in case 3.