Improved Gorilla Troops Optimizer-Based Fuzzy PD-(1+PI) Controller for Frequency Regulation of Smart Grid under Symmetry and Cyber Attacks

: In a smart grid (SG) system with load uncertainties and the integration of variable solar and wind energies, an effective frequency control strategy is necessary for generation and load balancing. Cyberattacks are emerging threats, and SG systems are typical cyber-attack targets. This work suggests an improved gorilla troops optimizer (iGTO)-based fuzzy PD-(1+PI) (FPD-(1+PI)) structure for the frequency control of an SG system. The SG contains a diesel engine generator (DEG), renewable sources like wind turbine generators(WTGs), solar photovoltaic (PV), and storage elements such as ﬂywheel energy storage systems (FESSs) and battery energy storage systems (BESSs) in conjunction with electric vehicles (EVs). Initially, the dominance of the projected iGTO over the gorilla troops optimizer (GTO) and some recently suggested optimization algorithms are demonstrated by considering benchmark test functions. In the next step, a traditional PID controller is used, and the efﬁcacy of the GTO method is compared with that of the GTO, particle swarm optimization (PSO), and genetic algorithm (GA) methods. In the next stage, the superiority of the proposed FPD-(1+PI) structure over fuzzy PID (FPID) and PID structures is demonstrated under various symmetry operating conditions as well as under different cyberattacks, leading to a denial of service (DoS) and delay in signal transmission.


Introduction
Environmental pollution due to the usage of fossil fuels in generating stations has motivated researchers to focus on alternative sources like renewable energy.As an alternative, a concept called smart grid (SG) was recently proposed, which provides better performance when combining distributed generation sources [1,2].RESs exhibit frequency regulation problems, which result in the net inertia reduction in the SG system [3].Due to the variations in RESs and load, the unbalancing of power occurs, which may lead to frequency instability, thereby hindering SG system consistency and stability [4].
To overcome the issues regarding the frequency stability due to the high-level integration of RESs into the existing grid, recently published articles have suggested novel control approaches [5,6].One approach with exhaustive power management integrates hybrid storage elements for voltage control and energy management during the on/off-grid mode operation of an active distributed system [7].In [8], the supportive control approach for interconnected SG systems involves effective voltage/frequency regulation and powersharing.Due to load fluctuations, the intermittent operational events that occur in system performance can be stabilized via the integration of centralized observer-controlled electric vehicles [9].A cascade PD-(1+I) controller was proposed for the frequency analysis of an Symmetry 2023, 15, 2013 2 of 20 SG system using various energy storage devices [10].An equilibrium-optimization-based fuzzy type-2 controller was proposed in [11] for frequency regulation.An adaptive control strategy was developed for frequency regulation via modulating micro turbines and power when photovoltaic sources are integrated into an SG [12].The operating cost and system efficiency can be improved by the smart management of various distributed sources of an SG system [13].The impact of rapid-acting ESDs in an SG system for improved frequency regulation was described in [14].Many advanced controllers, such as modified equilibrium optimization tune multistage PID, have been proposed for frequency control schemes [15].The effect of wind power was also analyzed in a frequency-control study [16].A hybrid power system with more than one source was developed with a tilted PID for the regulation of frequency control issues [17].The grasshopper-optimization-algorithm-based multistage PDF+(1+PI) structure for frequency control was proposed in [18].The effect of different energy storage devices with a cascade controller structure on the frequency stability was studied in [19].
It can be seen from the literature that many theoretical and practical schemes and computationally intelligent methods for frequency control have been developed, mainly focusing on the attenuation of physical disturbances.Nevertheless, when cyber intrusions occur, disturbances begin to dramatically take cyber-physical forms, and the disorder can even cause cascading failures of existing schemes [20].Therefore, it is essential to take cyber attacks into consideration and analyze the designed controller under various types of cyber attack.Denial of service is a type of cyber attack that needs serious attention so that the reliability and frequency stability of an SG can be maintained.This paper presents the design and analysis of a frequency-tolerant controller that can overcome data transmission delays when data are transmitted through an unreliable communication channel and can work effectively under denial of service of the signals to the distributed energy resources.
Novel optimization methods have been employed in modified controller structure frequency regulation schemes [21][22][23][24].A modified sine cosine algorithm (SCA)-based PID for the frequency control of an SG was proposed in [25].In [26], a PDF-PI controller optimized via coyote optimization was proposed for the frequency regulation of a power system.A may fly optimization (MFO)-optimized fuzzy PD-(1+I) controller was suggested for microgrid frequency control in [27].Atom search optimization (ASO)-and gray wolf optimization (GWO)-tuned fractional-ordered PID controllers have been recommended for the frequency control of a hybrid power system [28,29].A Salp swarm algorithm (SSA)optimized fuzzy PID (FPID) controller was proposed in [30] to regulate the frequency of a realistic power system with a redox flow battery.
A review of the literature shows that numerous schemes with different control and optimizing methods have been suggested for the frequency control of different systems.But no specific approach gives suitable outcomes for all systems.Thus, this provides the opportunity to explore another scheme by developing anew controller structure and an improved optimization technique for creating a better frequency control scheme.The gorilla troops optimizer (GTO) is a newly developed optimization method inspired by gorilla troops' collective aptitude in nature [31].The dominance of GTO over the gravitational search algorithm (GSA), GWO, MFO, multiverse optimizer (MVO), PSO, SCA, whale optimization algorithm (WOA), and tunicate swarm algorithm (TSA) has been demonstrated using benchmark test functions [31].Although GTO has exhibited encouraging results in resolving different real-world problems, it can become trapped in local minima with early convergence.This paper proposes improved GTO (iGTO) employing a scaling factor and other variations to attain an improved equilibrium among the exploration and exploitation phases of the GTO method.
The main contributions in this research work are summarized as follows: i.
An improved adaptation of GTO, i.e., iGTO, was developed by changing some parameters of the GTO algorithm and introducing sine-cosine-based scaling factors to control the movement of gorillas during the search procedure.ii.
The effectiveness of iGTO is verified over GTO, GJO, GWO, GSA, PSO, TLBO and ALO techniques using numerous benchmark functions.iii.
The effectiveness of iGTO in engineering problems is also demonstrated over GTO, PSO and Genetic Algorithm (GA).iv.
Furthermore, the iGTO is used to design a fuzzy PD-(1+PI) i.e., FPD-(1+PI) structure for the frequency control of a smartgrid system and the superiority of FPD-(1+PI) over the FPID and PID structure is demonstrated.v.
The effectiveness of the projected frequency control scheme under various cyberattacks, like denial of service (DoS) and data transmission delay, is investigated.

Test System
For the design and investigation of the projected controller, the smartgrid (SG) system revealed in Figure 1 is used.The SG system contains a battery energy storage system (BESS), flywheel energy storage system (FESS), diesel engine generator (DEG),wind turbine generators (WTGs), solar photovoltaic (PV), aqua electrolyzer (AE), fuel cell (FC), and electric vehicle (EV).A centralized controller is employed for all the controllable sources of the SG system.This results in an easier control system (fewer control parameters) with less maintenance.For all the controllable sources, the rate limiters are included to make the system more realistic.i.
An improved adaptation of GTO, i.e., iGTO, was developedby changing some parameters of the GTO algorithm and introducing sine-cosine-based scaling factors to control the movement of gorillas during the search procedure.ii.
The effectiveness of iGTO in engineering problems is alsodemonstrated over GTO, PSO and Genetic Algorithm (GA).iv.
Furthermore, the iGTO is used to design a fuzzy PD-(1+PI) i.e., FPD-(1+PI) structure for the frequency control of a smartgrid system and the superiority of FPD-(1+PI) over the FPID and PID structure is demonstrated.v.
The effectiveness of the projected frequency control scheme under various cyberattacks, like denial of service (DoS) and data transmission delay, is investigated.

Test System
For the design and investigation of the projected controller, the smartgrid (SG) system revealed in Figure 1 is used.The SG system contains a battery energy storage system (BESS),flywheel energy storage system (FESS), diesel engine generator (DEG),wind turbine generators (WTGs), solar photovoltaic (PV), aqua electrolyzer (AE), fuel cell (FC), and electric vehicle (EV).A centralized controller is employed for all the controllable sources of the SG system.This results in an easiercontrol system (fewer control parameters) with less maintenance.For all the controllable sources, the rate limiters are included to make the system more realistic.

Modeling of Components
The modeling of components present in the SG system can be represented by the transfer function (TF).

Wind Turbine
The WTGs have numerous nonlinearities.The wind power output is given by [32]  where ρ, C P , A R, and V W denote the air density (ρ = 1.25 kg/m 3 ), power coefficient, swept area (A R = 1735 m 2 ), and wind speed, respectively.The TFof the WTG is given below (lstandsforno. of units).

Photovoltaic Cell
The power output of the PV [32] system is represented by where η indicates the conversion efficiency of the PV (taken as 10%), Sindicates the PV array area (taken as 4084 m 2 ) and φ indicates the solar irradiation in kW/m 2 .The PV system TF is expressed as:

Aquaelectrolyzer
Part of the energy (40%) produced by the WTG and PV is consumed by the AE to produce hydrogen for the FC.The TF of the AE is given as [

Fuel cell
The TF of the FC system is given by: where l = 1, 2.

Diesel Engine Generator
The DEG is capable of supplying the deficient power and can minimize the power disparity among the generation and load demand.The TF of the DEG is given as [32] G DEG (s) =

Energy Storage System Modelling
The BESS, FESS and EV are included in the control scheme.They are controlled by the signal sobtained from the controller output.These elements act as the source/load asper the needs of the SG for frequency control.Their TFs are [32]: Battery Energy Storage System : G BESS (s The nonlinearities are given by .P DEG < 0.01, .

Electric Vehicle
The EVs are used in the SG and they can consume (charging) or supply (discharging) real power.For frequency control, a 1st order TF is used [9].
2.1.7.Power System Variation in power in a power system (PS) is due to the change in its input resulting in a change in frequency.The TF of PS is: The value for the damping constant, shown here as D, is taken at 0.03, while the value for the inertia constant, shown here as M, is taken at 0.4 for the current study.

Controller Structure and Objective Function
Generally, PID controllers are used in control systems for their modest design, lower cost, and their practicality suitable for linear systems.However, these traditional PI structures are usually not competent for nonlinear systems.Alternatively, fuzzy logic control (FLC) is flexible, simple to comprehend and easy to put into practice.The performance of a control system can be improved by an FLC-based PID (FPID) controller.In FPID, an integral part is essential to eliminate the steady-state error.But, slowing down the system response results in raising the integral gain.To overcome these issues, a multistage structure adopted.Various studies demonstrate that moving the integral part to the second section of the cascaded controller enhances the performance.In view of the above, a Fuzzy PD-(1+PI) i.e., FPD-(1+PI) controller is proposed in the present study as shown in Figure 2.

Electric Vehicle
The EVs are used in the SG and they can consume (charging) or supply (discharging) real power.For frequency control, a 1st order TF is used [9].
2.1.7.Power System Variation in power in a power system (PS) is due to the change in its input resulting in a change in frequency.The TF of PS is: The value for the damping constant, shown here as D, is taken at 0.03, while the value for the inertia constant, shown here as M, is taken at 0.4 for the current study.

Controller Structure and Objective Function
Generally, PID controllers are used in control systems for theirmodest design, lower cost, and their practicality suitable for linear systems.However, these traditional PI structures are usually not competentfornonlinear systems.Alternatively, fuzzy logic control (FLC) is flexible, simple to comprehend and easy to put into practice.The performance of a control system can be improved by an FLC-based PID (FPID) controller.In FPID, an integral part is essential to eliminate the steady-state error.But, slowing down the system response results in raising the integral gain.To overcome these issues,a multistage structure adopted.Various studies demonstrate that moving the integral part to the second section of the cascaded controller enhances the performance.In view of the above, a Fuzzy PD-(1+PI) i.e., FPD-(1+PI) controller is proposed in the present study as shown in Figure 2. A fuzzy logic control (FLC)-based structureincreases the system performance as fuzzy logic can deal with nonlinearities.The design of anappropriateFLC involves the choice of appropriate membership functions (MFs), and the construction of rules is a complex job.Conversely, a common rule base and MFs can be selected, and the scaling factors (SFs)andcontroller parameters can be optimized for satisfactory operation.The error and its derivative is amplified through SFs (K1 and K2) and given as inputs to FLC.The FLC output is passed through a 1st stage PD structure and a 2nd stage (1+PI) A fuzzy logic control (FLC)-based structure increases the system performance as fuzzy logic can deal with nonlinearities.The design of an appropriate FLC involves the choice of appropriate membership functions (MFs), and the construction of rules is a complex job.Conversely, a common rule base and MFs can be selected, and the scaling factors (SFs) and controller parameters can be optimized for satisfactory operation.The error and its derivative is amplified through SFs (K 1 and K 2 ) and given as inputs to FLC.The FLC output is passed through a 1st stage PD structure and a 2nd stage (1+PI) structure, as shown in Figure 2. The FPD-(1+PI) outputs manage the powers of controllable sources.
Usually, triangular MFs are preferred, as its real-world execution can simply be attained.It also requires lowest storage requirements and can be functioned economically to meet the stiff real-time necessities.The same MFs for both inputs/output are typically preferred from a computational adeptness viewpoint in addition to memory management ability.In the present work, it is believed that the FLCs are based on (a) fixed MFs and (b) fixed rules.Triangular membership functions are taken with three linguistics classes as po_bi (positive big), z_o (zero) and ne_bi (negative big) for input/output in FLC, as shown in Figure 3.
structure, as shown in Figure 2. The FPD-(1+PI) outputs manage the powers of controllable sources.
Usually, triangular MFsarepreferred, asitsreal-worldexecution can simply be attained.It also requires lowest storage requirements and can be functioned economically to meet the stiff real-time necessities.The sameMFs for both inputs/output are typicallypreferred from a computational adeptnessviewpointin addition to memory managementability.In the present work, it is believed that the FLCs are based on (a) fixed MFs and (b) fixed rules.Triangular membership functions are taken with three linguistics classes as po_bi (positive big), z_o (zero) and ne_bi (negative big) for input/output in FLC, as shown in Figure 3. Table 1 describes the principles that identify the input and output.
where t is the time, are weights, which are taken as 100 and 2, respectively.These weights make both parts in Equation ( 12) important in the search process.
The optimization task is now expressed as shown below: MinimizeJ Subject to where the subscripts Min andMax indicate the ranges of the parameters chosen from limit 0 to 2. Table 1 describes the principles that identify the input and output.For controller design, an Integral Squared Error (ISE) criterion to reduce the ∆F and control actions (∆U) is chosen as: where t is the time, K w1 and K w2 are weights, which are taken as 100 and 2, respectively.These weights make both parts in Equation ( 12) important in the search process.The optimization task is now expressed as shown below: Minimize J Subject to where the subscripts Min and Max indicate the ranges of the parameters chosen from limit 0 to 2.

Gorilla Troops Optimizer (GTO)
The group activities of the gorillas lead to the development of an intelligent algorithm, namely GTO.It requires a few parameters to be optimized for obtaining the global solution, which makes it simple for implementation in engineering applications.The three important parts in GTO such as initialization, exploration and exploitation are based on the different strategies of gorillas, which include movement to the unknown area, migrating to the known locations, moving to the other gorillas, following the decisions of the silverback and challenging for the mature feminine gorillas.Once the initialization phase is over, the Symmetry 2023, 15, 2013 7 of 20 exploration phase depends on the three strategies including migrating to the unknown area, migrating to the identified locations and moving to other gorillas.Similarly, the exploitation phase in GTO is designed by employing the two strategies of gorillas, which are following the silverback and competition for the mature feminine gorillas.The three phases in GTO are described as follows.

Initialization Phase
The position of the n th gorilla is defined as: where n ∈ N and N is the number of gorillas present in the D dimensional search area.The position vector of gorillas can be written as X = { X 1 , X 1 , . . . . . .X n , . . . . . . ,X n } .

Exploration Phase
At each stage, all N gorillas are measured as contender solutions, and the best solution is supposed to be the silverback.Migration to unknown locations enhances the exploration in GTO, whereas the balance between the exploitation and exploration is obtained by moving to the other gorilla groups.Transfer to the identified location implies a diverse optimization search space.Based on those three strategies, the exploration phase is mathematically formulated as (14) where it represents the current iteration.X n (it) is the n th gorilla's current position vector.G n (it + 1) is a contender for the next iteration's gorilla job.The random numbers, r 1 , r 2 , r 3 , and r 4 , vary from 0 to 1. X A (it) and X B (it) depict the position vector that was chosen at random during the it th iteration.In addition, the parameter is a possible number between 0 and 1.The variables C, P and Q can be mathematically computed as shown below: where cos(.)denotes the cosine function.r 5 is the random number ranging from 0 to 1 and it max represents the maximum iteration taken in the optimization algorithm.In the similar manner, the candidate solution G n (it + 1) is evaluated for all N.After the completion of the exploration phase, fitness functions obtained from G n (it + 1) and G n (it) are evaluated.If F(G n (it + 1)) < F(X n (it)), then the fitness function obtained from G n (it + 1) is better than the fitness function obtained from G n (it).Hence, G n (it + 1) replaces the original vector G n (it).The optimal solution obtained from the above computation is referred to as the silverback, i.e., X silverback .

Exploitation Phase
This phase is based on two strategies; those are subsequent to the silverback and competition for mature females.Let z be the constant parameter which decides to switch between these two strategies.The silverback gorilla's decision is followed by C ≥ z.The mathematical expression representing the above behavior can be shown as follows: Symmetry 2023, 15, 2013 where X silverback is the best result obtained so far.The value of M is calculated as: The second strategy is chosen if C < Z, which is represented as: In the above equations, I signifies the impact force, where r 6 is a random value between 0 and 1. j represents the violence intensity, and ϕ is a constant.r 7 is a random value between 0 and 1.
After the completion of exploitation phase, the fitness functions are evaluated.If F(G n (it + 1)) < F(G n (it + 1)), G n (it + 1) replaces the original vector X n (it).The best solution is referred to as the X silverback .

Improved Gorilla Troops Optimizer (iGTO)
In the original GTO algorithm, the algorithm parameters P and Q are dependent on the variable C, which is calculated using Equation (11).These parameters influence the exploration and exploitation process of the GTO method.Excessive exploration capability could lead to a lower chance of becoming stuck in local minima.Elevated exploration capability will bring in extra uncertainty, and the best results may not be found.Also, overindulgence in the exploitation process causes less uncertainty, and the method might not provide best result.Hence, equilibrium among the exploration and exploitation stages should be preserved throughout the iterations.In the GTO method, C is controlled by it/it max, which linearly decreases with each iteration, as given in Equation (15).In the proposed algorithm, the parameter C is calculated using Equation (24) as shown below: In the above Equation ( 24), the inclusion of parameter α changes the variation in C from linear to nonlinear.For the proper selection of α, many values above 1 and below 1 are tried, and it is observed that the algorithm works in the most efficient manner when α = 0.2 is used.
In the GTO method, the detection of the gorilla's best positions at the early phases is not clear.Thus, a large step size at the initial phases of the GTO may move the gorilla's positions from the ideal positions.Accordingly, to regulate the gorilla's movement in initial phases, a sine cosine-adopted scaling factor (SCaSF) is engaged in the present work.This alters the gorilla's positions and hence enhances the search potential of GTO.The cyclic shapes of trigonometric functions facilitate a gorilla to be relocated to another location.This scheme will be able to enhance the exploration/exploitation potential of GTO.
At the end of the exploration and exploitation phases in each of the iteration, the new gorilla's location (X(t) New ) is adjusted in the proposed iGTO using SCaSF and the old gorilla's location (X(t) Old ) can be calculated as shown below: Symmetry where ScaSFis calculated as: where RD is an arbitrary value from 0 to and W T1 and W T2 are weighting parameters.
To suitably select W T1 and W T2 , different values are tested, and it is noted that the best outcomes are obtained when W T1 and W T2 are selected as 10 and 9.
The flow chart for the improved gorilla troop's optimizer is given in Figure 4.

Assessment of iGTO
At first, the efficacy of the recommended iGTO method is demonstrated by considering several benchmark test functions (BTFs), as given in Table 2 [9].To substantiate the worth of the recommended iGTO method, it is equated with GTO and

Assessment of iGTO
At first, the efficacy of the recommended iGTO method is demonstrated by considering several benchmark test functions (BTFs), as given in Table 2 [9].To substantiate the worth of the recommended iGTO method, it is equated with GTO and some recently proposed optimization algorithms like GJO, PSO, GSA, GWO, TLBO and ALO methods, taking the same algorithm parameters (200 iterations, 30 search agents, 30 independent runs) as presented in [9] for various dimensional BTFs.The outcomes are collected in Table 3.It is seen that iGTO dominates other algorithms for nearly all functions.The better convergence feature of GTO over GSA, GWO, MFO, MVO, PSO, SCA, TSA and WOA has been established using BTFs in [31].In the present study, the convergence characteristics of the proposed iGTO and GTO are compared and shown in Figure 5, from which it is evident that a superior convergence characteristic is achieved with the proposed iGTO compared with GTO.
Symmetry 2023, 15, x FOR PEER REVIEW 11 of 21 some recently proposed optimization algorithms like GJO, PSO, GSA, GWO, TLBO and ALO methods, taking the same algorithm parameters (200 iterations, 30 search agents, 30 independent runs) as presented in [9] for various dimensional BTFs.The outcomes are collected in Table 3.It is seen that iGTO dominates other algorithms for nearly all functions.The better convergence feature of GTO over GSA, GWO, MFO, MVO, PSO, SCA, TSA and WOA has been established using BTFs in [31].In the present study, the convergence characteristics of the proposed iGTO and GTO are compared and shown in Figure 5, from which it is evident that a superior convergence characteristic is achieved with the proposed iGTO compared with GTO.

Application of iGTO for Controller Design
The proposed iGTO is now employed for the controller design problem of the SG system shown in Figure 1.The parameters of the SG are provided in Appendix A. In the beginning, PID controllers are considered, and iGTO, GTO, PSO and GA methods are applied to tune the PID parameters.The limits of the controller parameters are taken as [0, 2] for all the structures.The optimized values are given in Table 4.It is clear from Table 4 that with PID, a lower J value is attained with GTO (J = 3.2751) compared to GA (J = 4.3437) and PSO (J = 3.3486).The J value is further decreased to 2.2011with iGTO.The percentage decreases in the J value with iGTO compared to GA, PSO, and GTO are 49.32%,34.26% and 32.79%, respectively.This authenticates that iGTOis a better fit than GTO, GA and PSO for solving the controller design problem of the considered SG system.
Figure 6 shows the system's response to a 10% load increase perturbation with constant WTG and PV power.It is clear from Figure 5 that the iGTO approach outperforms the GA, PSO, and GTO methods.The numerical values of the system performance are gathered in Table 4.It is apparent from Table 4 that iGTO-based PID yields the smallest integral errors compared to the GA, PSO, and GTO-based PID controllers.This substantiates the dominance of iGTO over the GA, PSO and GTO methods in the present controller design task.4 that with PID, a lower J value is attained with GTO (J = 3.2751) compared to GA (J = 4.3437) and PSO (J = 3.3486).The J value is further decreased to 2.2011with iGTO.The percentage decreases in the J value with iGTO compared to GA, PSO, and GTO are 49.32%,34.26% and 32.79%, respectively.This authenticates that iGTOis a better fit than GTO, GA and PSO for solving the controller design problem of the considered SG system.
Figure 6 shows the system's response to a 10% load increase perturbation with constant WTG and PV power.It is clear from Figure 5 that the iGTO approach outperforms the GA, PSO, and GTOmethods.The numerical values of the system performance are gathered in Table 4.It is apparent from Table 4 that iGTO-based PID yields the smallest integral errors comparedto the GA, PSO, and GTO-based PID controllers.This substantiates the dominance of iGTO over the GA, PSO and GTO methods in the present controller design task.Next, the iGTO scheme is used to optimize the FPID and FPD-(1+PI) controller to improve the performance further.The tuned parameters are shown in Table 4, from which it is evident that with the same iGTO technique, when the FPID controller is used, a lower J value is realizedcompared tothe PID controller.The J value is further reduced when the proposed FPD-(1+PI) controller is used.The percentage reductions in the J value with FPD-(1+PI) compared to FPID and PID are 21.09%, and 57.21%, respectively.This validates that FPD-(1+PI) outperforms FPID and PID.
To measure the designed controllers, various cases are considered as given below.
Case 1: Load variation (ΔPL) with constant renewable power ΔPRW (ΔPRW = solar power (ΔPPV) + wind power(ΔPWTG) + Fuel cell power (ΔPFC)); Case 2: Load variation with the change in sun irradiance and wind speed; Next, the iGTO scheme is used to optimize the FPID and FPD-(1+PI) controller to improve the performance further.The tuned parameters are shown in Table 4, from which it is evident that with the same iGTO technique, when the FPID controller is used, a lower J value is realized compared to the PID controller.The J value is further reduced when the proposed FPD-(1+PI) controller is used.The percentage reductions in the J value with FPD-(1+PI) compared to FPID and PID are 21.09%, and 57.21%, respectively.This validates that FPD-(1+PI) outperforms FPID and PID.To measure the designed controllers, various cases are considered as given below.Case 1: Load variation (∆PL) with constant renewable power ∆PRW (∆PRW = solar power (∆PPV) + wind power(∆PWTG) + Fuel cell power (∆PFC)); Case 2: Load variation with the change in sun irradiance and wind speed; Case 3: Various cyber-attack conditions.Case 1: In this case, only load variation (∆PL) with constant renewable power (∆PRW) as revealed in Figure 7a is considered.The power difference ∆PDF = ∆PRW − ∆PL is also revealed in Figure 7a.The dynamic responses with iGTO-tuned PID, FPID and FPD-(1+PI) are presented in Figure 7b.It can be observed from Figure 7b that the performance with FPD-(1+PI) is better than that with the PID and FPID controllers.The power supplied by controllable sources with the proposed iGTO optimized FPD-(1+PI) controller is shown in Figure 7c.It can be seen from Figure 7c that when the power imbalance is positive (up to 30s), which indicates that ∆PRW > ∆PL, controllable sources receive the real power to minimize the power imbalance.From 30s to 60 s, when generation is less than load demand, controllable sources supply power from the SG to minimize the power imbalance.During the time period from 60 to 90 s, the power imbalance becomes zero, and the controllable sources neither supply nor receive the power, as evident from Figure 6c

Figure 1 .
Figure 1.Smart grid system under study.

Symmetry 2023 ,
15, x FOR PEER REVIEW 5 of 21 Battery Energy Storage System: G

Figure 3 .
Figure 3. Membership functions of error and derivative of error of FLC.

Figure 3 .
Figure 3. Membership functions of error and derivative of error of FLC.

Figure 6 .
Figure 6.Frequency response with PID showing comparison of techniques.

Figure 6 .
Figure 6.Frequency response with PID showing comparison of techniques.

mmetry 2023 ,
15,  x FOR PEER REVIEW 15 of 21 are presented in Figure7b.It can be observed from Figure7bthat the performance with FPD-(1+PI) is better than that with the PID and FPID controllers.The power supplied by controllable sources with the proposed iGTO optimized FPD-(1+PI) controller is shown in Figure7c.It can be seen from Figure7cthat when the power imbalance is positive (up to 30s), which indicates that ΔPRW > ΔPL, controllable sources receive the real power to minimize the power imbalance.From 30s to 60 s, when generation is less than load demand, controllable sources supply power from the SG to minimize the power imbalance.During the time periodfrom 60 to 90 s, the power imbalance becomes zero, and the controllable sources neither supply nor receive the power, as evident from Figure6c.Various integral errors, MOs and MUs of ΔF for Case 1 are given in Table4.It is detected that the arithmetical values J (J = 0.3321), integral errors (ISE = 0.0016, ITAE = 1.2037,ITSE = 0.0073, IAE = 0.0916), MUs (−0.0515) and MOs (0.009) are attained with the FPD-(1+PI) controller.The percentage decrease in the J value with FPD-(1+PI) compared to FPID and PID is 18.34%and 46.83%, respectively, for Case 1.

Case 2 :
In Case 2, there are changes in ∆PL, ∆PPV and ∆PWTG, as shown in Figure 8a.The system responses with iGTO-tuned PID, FPID and FPD-(1+PI) are shown in Figure 8b.It can be observed from Figure 8b that the performance with FPD-(1+PI) is better than that with PID and FPID.The output powers of the controllable sources with the iGTO-tuned FPD-(1+PI) controller are revealed in Figure 8c, from which it can be noticed that when ∆PRW > ∆PL, all the controllable sources receive power and vice versa.Various integral errors, MOs and MUs of ∆F for Case 2 are given in Table 4.It is detected that the FPD-(1+PI) controller attains arithmetical values, J (J = 0.7103), integral errors (ISE = 0.0034, ITAE = 11.8140,ITSE = 0.0636, IAE = 0.3113), MUs (−0.0601) and MOs (0.0162).The percentage decreases in the J value with the FPD-(1+PI) controller compared to FPID and PID are 35.88% and 63.04%, respectively, for Case 2.

Table 1 .
Fuzzy rule base for FLC.

Table 1 .
Fuzzy rule base for FLC.

Table 3 .
Results for benchmark functions.