Real-Time LFO Damping Enhancement in Electric Networks Employing PSO Optimized ANFIS

: In recent years, machine learning (ML) tools have gained tremendous momentum and received wide-spread attention in di ﬀ erent segments of modern-day life. As part of digital transformation, the power system industry is one of the pioneers in adopting such attractive and e ﬃ cient tools for various applications. Apparently, a nonthreatening, but slow-burning issue of the electric power systems is the low-frequency oscillations (LFO), which, if not dealt with appropriately and on time, could result in complete network failure. This paper addresses the role of a prominent ML family member, particle swarm optimization (PSO) tuned adaptive neuro-fuzzy inference system (ANFIS) for real-time enhancement of LFO damping in electric power system networks. It adopts and models two power system networks where in the ﬁrst network, the synchronous machine is equipped with only a power system stabilizer (PSS), and in the other, the PSS of the synchronous machine is coordinated with the uniﬁed power ﬂow controller (UPFC), a second-generation ﬂexible alternating current transmission system (FACTS) device. Then, it develops the proposed ML approach to enhance LFO damping for both adopted networks based on the customary practices of statistical judgment. The performance measuring metrics of power system stability, including the minimum damping ratio (MDR), eigenvalue, and time-domain simulation, were used to analyze the developed approach. Moreover, the paper presents a comparative analysis and discussion with the referenced works’ achieved results to conclude the proposed PSO-ANFIS technique’s ability to enhance power system stability in real-time by damping out the unwanted LFO.


Introduction
Energy demand is increasing gradually due to the growing population. To meet this increased energy demand, modern power systems are typically operated at their highest capacity. Under this situation, the power systems utilize their maximum ability, and therefore, the operation is economical. However, this situation leads the system to violate the system constraints. As a result, the system parameters become oscillatory, which eventually leads to system instability. In addition, recently, the trend in power systems has been to integrate renewable energy sources at the maximum possible machine (ELM) [30]. Hybridization of ANN with other algorithms was also applied successfully in many other power system applications [31] besides PSS parameter tuning. A neuro-fuzzy algorithm based nonlinear model-free robust controller was proposed for damping out the LFO from any power system to replace the conventional PSS in [32]. An intelligent control approach, namely the neuro-fuzzy intelligent controlling technique, was applied to control newly developed real-time dynamics [33]. However, real-time based parameter settings can be achieved by employing another highly efficient machine learning approach, PSO tuned adaptive neuro-fuzzy inference system (ANFIS) to improve the overall system stability. PSO tuned ANFIS models were implemented in various scenarios, such as viscosity estimation of an oil mixture [34] and predicting the wave reflection coefficient for semicircular breakwater considering a range of wave heights [35]. Therefore, in this paper, a PSO-tuned ANFIS approach was implemented to achieve real-time tuning of the PSS parameters. The stability indicators of the power system were analyzed to determine the performance. The technique was implemented in two different electric networks to show the effectiveness of the approach. One electric power network is made of a SMIB system with PSS only, and the other one is a SMIB system with UPFC coordinated PSS. The efficiency of the PSO-ANFIS machine learning tool was investigated through minimum damping ratio (MDR) and eigenvalue analyses. The proposed technique's superiority was established by comparing it with the conventional and the literature reported approaches for several loading conditions. Some other statistical performance indices (SPI) including the root mean squared error (RMSE), mean absolute percentage error (MAPE), RMSE-observations to standard deviation ratio (RSR), coefficient of determination (R 2 ), and Willmott's index of agreement (WIA) were also evaluated to explore the robustness of the proposed machine learning model. The superiority of the proposed method over the conventional one was determined by comparing time-domain simulation results. The main contributions of this research are as follows: • Two versions of SMIB electric networks were considered to demonstrate the proposed approach of LFO mitigation. For both the networks, optimized PSS parameters were found offline for a large number of operating conditions using a heuristic optimization technique.

•
The PSO inspired ANFIS model was developed by taking the range of operating points as the inputs and the PSS key parameters as the outputs. Different statistical parameters were used to check the efficacy of the developed model.

•
The proposed ANFIS model was assessed to provide the optimal PSS parameter in real-time, under any loading condition. Time-domain analysis, eigenvalues, and the damping ratios were used to measure the developed approach's performance.
The rest of the paper is organized as follows: Section 2 illustrates the dynamic models of electric networks under investigation. Section 3 presents the proposed machine learning (PSO inspired ANFIS) tool for real-time tuning of the PSS parameters. Section 4 demonstrates the proposed machine learning model development along with the data generation and processing technique. Section 5 offers a detailed discussion of the obtained results and the developed ML model's compatibility and superiority. Finally, Section 6 provides concluding remarks along with the future research directions on the topic under investigation.

Power System Models
This article analyzed two different power system networks' stability employing the proposed PSO-ANFIS tool by tuning the PSS parameters in real-time. This section briefly describes the modeling of these two networks under investigation. Figure 1a shows the PSS integrated SMIB electric power network, where the synchronous generator is connected to an infinite bus system through a transmission line of specific reactance. The fourth-order nonlinear model of the SMIB system and its linearized form can be found in [36][37][38][39]. The incorporated PSS is one of the commonly used single-stage lead-lag controllers, as shown in Figure 1b. The state-space model of the overall network after inclusion of the PSS is available in Ref. [36] and represented as (1) where the number of states is six. The modes of a power network are represented by the eigenvalues of its state matrix (Ac 1 ) corresponding to the system states. Any small disturbances on the system are reflected on the eigenvalues. The electric network's stability is ensured if all the eigenvalues lie within the left half-plane of the complex plane, meaning real parts of the eigenvalues should take negative numbers. On the contrary, the positive real part of any one of the eigenvalues leads towards system instability. Therefore, appropriate tuning of the PSS parameters is the key to locate all the eigenvalues of the state matrix of the targeted electric network in the left half-plane that ensures the system stability. Additionally, proper placement of the eigenvalues on the complex plane enhances the system stability by suppressing the low-frequency oscillations. This article tuned the PSS parameters of the SMIB system employing the developed PSO-ANFIS tool where the inputs were the system operating conditions, e.g., terminal voltage, real power, and reactive power of the machine.

Example 2: SMIB Electric Network Equipped with PSS and UPFC
In the second test network, a SMIB system is equipped with a UPFC, as shown in Figure 2a, where the synchronous machine is connected with an infinite bus through a transmission line. In this case, a PSS is also connected with the synchronous machine and coordinated with the UPFC to improve the system stability. A boosting transformer (BT) and an excitation transformer (ET) link the UPFC with the network. With a voltage source converter (VSC-E) aid, a DC link capacitor is coupled with the ET. Likewise, the BT is coupled with that capacitor through another voltage source converter (VSC-B). The UPFC has a total of four control parameters consisting of two-phase angles and two-amplitude modulation ratios. Therefore, according to the specification in Figure 2a, the phase angles of boosting and excitation transformers are δ B and δ E . The amplitude modulation ratios of boosting and excitation transformers are m B and m E . A detailed explanation of these control parameters and the considered system can be found in [26][27][28][29]. The structure of a two-stage lead-lag PSS is shown in Figure 2b. Like the first network of Figure 1b, this two-stage lead-lag PSS is coupled with the synchronous generator and coordinated with the UPFC. After incorporating both the PSS and UPFC into the system and linearization, the final state-space model can be formulated, consisting of nine states. This overall model of the PSS-UPFC incorporated SMIB system can be represented by Equation (2) [36]. As mentioned earlier, the state matrix's eigenvalues (Ac 2 ) indicate the modes of operation of the system after being subjected to any disturbances. The electric network's stability is ensured when all eigenvalues lie within the complex plane's left half-side, meaning all eigenvalues should have negative real parts. On the other hand, the positive real part of anyone of the state matrix's eigenvalues leads the system into instability. Therefore, the proper selection of PSS parameters is the key to placing the system eigenvalues in the left half-plane to enhances system stability by damping out the LFO. This article proposed a strategy to tune the UPFC coordinated PSS parameters of the SMIB system employing the PSO-ANFIS tool where the inputs were the system operating conditions.

Proposed Optimization Method
In this article, PSO optimized ANFIS models were employed to estimate the PSS parameters of the SMIB systems either incorporated the UPFC or functioning alone. The successful performance of ANFIS models depends on the appropriate parameter selection through rigorous training and testing processes. Both the derivative and metaheuristic-based approaches for selecting appropriate parameters of ANFIS can be found in [41]. In the following subsections, the ANFIS model and the PSO algorithm are described briefly.

Adaptive Neuro-Fuzzy Inference System (ANFIS)
The ANFIS integrates the property of two machine learning algorithms: neural network and fuzzy logic. It was first proposed in 1993 [42] and demonstrated significant success in diverse application fields for its unique features [43,44]. It uses fuzzy logic to convert the given inputs to a targeted output, with the help of highly interconnected neural network processing elements. Figure 3 shows the basic structure of the ANFIS consisting of two inputs, one output, two membership functions, and two fuzzy rules that works in five different stages [41]. The first stage (M 1 i ), also known as the fuzzification stage, obtains the fuzzy clusters from the provided inputs (a and b) through the membership functions.
The premise parameters (x, y, and z) determine the nature of the membership function. The degree of membership, µA i (a), can be calculated from the following Equation (3) for the first input. Similarly, it can be calculated for the second input as µB i (b).
Layer l Layer 4 Figure 3. Structure of the adaptive neuro-fuzzy inference system (ANFIS).
The next layer (M 2 i ), also known as the rule layer, uses the membership values of the previous layer and calculates the firing strengths (k i ) of the applied rules by multiplying the membership values as in (4).
The third layer (M 3 i ), known as the normalization layer, calculates the normalized firing strengths (k l ) for all the applied rules. The normalization approach is shown below in (5), where the corresponding value of k is divided by the total firing strength.
In the next stage (M 4 i ), defuzzification is performed, as shown in (6), where all the rules' weighted values are found for each node. The first-order polynomial determines these values where m i , n i , and o i represent the coefficients. The number of coefficients, known as the consequence parameters, is one more than the given inputs.
Finally, the ANFIS model's output is calculated in the fifth stage (M 5 i ) by adding all the weighted outputs according to (7).
The above-mentioned parameters of the ANFIS models are optimized using the PSO algorithm in this article through comprehensive training and testing processes.

Particle Swarm Optimization (PSO)
The PSO, a swarm-based metaheuristic technique, is used to search the global solution from the search space. This optimization technique is inspired by biological populations' swarming characteristics like a flock of birds or school of fishes that move together in the multi-directional search spaces to find the food source, inhabitation place, or other objectives. During this searching process, the swarm particles (birds/fishes) can change and adjust their movements and positions based on their social and cognitive experiences. Kennedy and Eberhart introduced this global search optimization algorithm in Ref. [45]. In PSO, every particle locates a position in the search space and continually changes its position to find the optimal location. Thus, the global solution can be exploited by any particle of the swarm. Initially, a random set of particles is assumed with a probable location of each particle, and the velocity of each particle within the swarm is also generated. The algorithm then evaluates the fitness of the particle's positions based on the objective function of the optimization problem under investigation. The particles' positions are stored as the individual best solutions and the best position as the global best solution. In each iteration, the PSO algorithm updates the inertia weight and velocities of the particles, hence the particles' positions. The update of the particles' velocities depends on three main factors: the inertia component, the cognitive component, and the social component. According to the PSO model proposed by Kennedy and Eberhart, each swarm particle's new position is translated/enhanced from the old position with respect to the corresponding particle's new velocity. A detailed explanation of the PSO algorithm model can be found in [46]. Hence, this procedure of updating the particles' velocities and positions is repeated in each iteration until the targeted convergence criteria are satisfied. The flow diagram of the PSO algorithm is shown in Figure 4. According to this flow diagram, the initial positions and velocities are generated randomly, and after evaluation of their fitness, the individual and the global best solutions are stored. After that, if the stopping criteria are satisfied for the stored solutions, the algorithm is terminated; otherwise, the inertia weight, velocities, and positions of the swarm particles are updated again. Then, after checking the boundary violation condition, the particles' positions' fitness is evaluated, and the algorithm continues as illustrated in the flow diagram.

Data Processing and ANFIS Model Development
Details of data generation and processing and the ANFIS model development steps are illustrated in the following subsections.

Data Generation and Processing
In this research, a total of 1000 loading conditions for each of the considered power system networks from the ranges of operating conditions given in Table 1 were generated. These data sets were prepared with the variation and combination of three parameters of the power systems: terminal voltage (V t ), real power (P e ), and reactive power (Q e ). Each variety of selected parameters was considered as a distinct loading condition of the corresponding electric network. The PSO algorithm was then employed to optimize the PSS's key parameters (K and T 1 ) in offline mode for all generated loading conditions. For the first network, the objective was to maximize the system minimum damping ratio. In contrast, the second network's objective function was to minimize a multi-objective function combining two major decision-taking parameters, e.g., damping factor and damping ratio. Details about the optimization problem formulation and solution methodologies using the PSO can be found in [47] and in [48] for the first and second networks. As shown in Figure 5, the PSO algorithm converged the objective functions to the specific values for both networks for five different runs that signified the algorithm's robustness and efficacy in finding PSS key parameters. Table 1. Ranges of the operating condition in per unit (pu) for the selected power system networks.

Limit
Real

PSO-ANFIS Model Development
In this work, the ANFIS toolbox available in [49] was employed, where 70% of data were used for training, and 30% of data were used for the testing purposes of the proposed machine learning tool. A continually regulated trial and error process was taken into account to adjust the ANFIS models' parameters. Statistical performance indices, including the RMSE, MAPE, RSR, R 2 , and WIA, were measured to evaluate the proposed PSO-ANFIS models' effectiveness in predicting PSS key parameters. The higher values of RMSE, MAPE, and RSR refer to more unsatisfactory model performance. On the contrary, the remaining indices, R 2 and WIA, maintain the unity values for perfect matching between the model predicted output and the actual system output. In contrast, the variation of R 2 and WIA values from "1" to "0" indicates matching the predicted and actual data from 100% to 0%. To investigate the efficiency of the proposed PSO-ANFIS models in predicting PSS key parameters, the mentioned SPI values were evaluated and summarized in Table 5 for both networks' testing datasets.
Based on the obtained MAPE and R 2 values of Tables 2 and 3, this research selected 8 and 9 clusters for the first and second networks, respectively. The selected clusters were used to model the PSS key parameters (K and T 1 ). It is worth noting that it selected 10,000, 1, and 0.99 as the maximum number of iterations, inertia weight, and inertia weight damping ratio, respectively. The cognitive and social learning coefficients were selected as 1 and 2, respectively. The total numbers of parameters of the ANFIS models for the first and the second networks were 80 and 90, respectively, as per their preselected number of clusters. The particle positions corresponding to the ANFIS parameters to be optimized were found from the 'GetFISParams' function of the employed toolbox of Ref. [49]. In the ANFIS models, the parameters related to the input (fuzzification) and output (defuzzification) sides are known as the premise and the consequence parameters [41]. Out of the 80 parameters of the ANFIS models of the first electric network, 48 of them were the premise parameters, and the remaining 32 were the consequence parameters. Similarly, there were 54 premise and 36 consequence parameters of ANFIS models of the second electric network. Table 4 presents the optimized parameters of the ANFIS model while tuning the T 1 parameter of the second electric network. Moreover, to set the PSO algorithm-generated values of the premise and consequence parameters, the 'SetFISParams' function inside the 'TrainFISCost' of the toolbox was employed. However, as can be seen from Table 5, the SPI indices, RMSE, MAPE, and RSR values are minimal, while the other two SPI indices' values are close to unity for both electric networks. Furthermore, the MAPE and R 2 were improved significantly with the PSO optimized ANFIS model over the nonoptimized ANFIS model for both test networks (comparison of Tables 2, 3 and 5). Therefore, SPI's obtained values confirmed the proposed PSO tuned ANFIS models' effectiveness in estimating PSS parameters.   Figures 6 and 7 show the RMSE values convergence curves, and the scatter plots for the PSS key parameters (K and T 1 ) of the first network test dataset. Figure 8 shows the expected and approximated gain parameter (K) and time constant parameter (T 1 ) values for randomly chosen thirty different operating/loading conditions from the first electric network's test dataset. In this case, the actual values were evaluated using the offline mode PSO algorithm, whereas the estimated ones were the output from the PSO-ANFIS model. It can be observed from Figure 8 that the predicted and actual values of the PSS parameters (K and T 1 ) are entirely overlapped with each other. Therefore, the proposed PSO-ANFIS model showed confidence in the online estimation of the first electric network's PSS parameters. Likewise, Figures 9 and 10 show the RMSE values convergence curves, and the scatter plots for the UPFC coordinated PSS key parameters (K and T 1 ) of the second network test dataset. Furthermore, Figure 11 proved the efficiency of estimating the PSS parameters employing the proposed PSO-ANFIS learning model for the second electric network. Therefore, Figure 6 to Figure 11 confirmed the developed PSO-ANFIS models' effectiveness in predicting PSS key parameters for both electric networks.  Lastly, it is essential to mention that this research was carried out using the MATLAB simulation environment in a desktop computer with an Intel Core i5 (3.5 GHz Processors, 8 GB RAM). It required several hours to develop the PSO-ANFIS models. However, the developed PSO-ANFIS models estimated the first network's PSS parameters around 0.285 s for 700 arbitrarily produced operating situations. Hence, the proposed model required an average of around 0.000407 s to estimate the PSS parameters for a single operating situation. For the second test system, the developed PSO-ANFIS models took 0.30 s to estimate UPFC coordinated PSS parameters for another 700 loading conditions; thus, it required an average of 0.000429 s for a single loading condition. As mentioned, the times needed for PSS parameters estimation employing the developed PSO-ANFIS models are almost 35 times smaller than a period of 60 Hz electric network. Therefore, a conclusion can be made that the faster response of the developed PSO-ANFIS models makes them suitable to be implemented online in tuning the PSS parameters.

Results and Discussion
It is already mentioned that this paper proposed the PSO-ANFIS models that were applied to two different electric networks to estimate the PSS key parameters in real-time. In this section, the proposed ANFIS models' effectiveness was examined based on eigenvalues and minimum damping ratio for both systems under investigation. The efficacy of the developed models was also justified in online implementation through time-domain simulation results for some specific states of the machine.

Eigenvalues and Minimum Damping Ratio Analyses
Estimated PSS key parameters using the developed PSO-ANFIS model for three different operating conditions of the first test network were evaluated and summarized in Table 6. Corresponding eigenvalues and minimum damping ratio values of the loading conditions of Table 6 were presented in Table 7, Table 8, and Table 9. In this case, the eigenvalues in the tables for three cases were accumulated, including the PSO-ANFIS, conventional, and literature reported models with the same operating conditions for comparison purposes. As mentioned earlier, the eigenvalues' positions within the left-side of the complex plane ensure the electric network's stable operation. It is visible from the tables that the presented eigenvalues were situated in the left half-plane for all mentioned approaches. However, the PSO-ANFIS models showed effective action on the electric network in placing the eigenvalues at better positions over the conventional one. Furthermore, both referenced and developed models maintained higher MDR values than the conventional model. This higher MDR value ensured the developed model's efficacy in damping out the LFO and gaining better stability of the developed model over the conventional one. Comparison of MDR values of the first electric network for three different loading conditions is shown in Figure 12. Table 6. Estimated PSS key parameters using the developed PSO-ANFIS models for three different operating situations (first network).

Time-Domain Simulation under Disturbance
This section analyzed the performance of the PSO-ANFIS and the conventional models in damping out the LFO from the first electric system following an external disturbance. In this case, a pulse of an extra 10% of mechanical torque was introduced as a disturbance to the input at 1.0 s for four cycles. Following this disturbance, this research measured the responses of the two states (rotor angle and angular frequency) of the system. These responses (changes of rotor angle and angular frequency) of the synchronous machine were plotted in Figure 13a,b with the loading condition # 3 of Table 6. Although both models stabilized the electric network by damping out the LFO from the system, the PSO-ANFIS model demonstrated a faster response than the conventional one. From both figures, it can be observed that the developed PSO-ANFIS models damped out the LFO and stabilized the system states within 3.5 s, while the conventional model took approximately 6.0 s. Hence, it can be concluded that the developed PSO-ANFIS technique will be well-suited for real-time prediction of PSS parameters to damp out the LFO in the power system network.

Eigenvalues and Minimum Damping Ratio Analysis
Estimated PSS key parameters using the developed PSO-ANFIS models for three different loading situations for the second test network were evaluated and summarized in Table 10. Table 11, Table 12, and Table 13 tabulated the corresponding eigenvalues and MDR values. The tables also accumulated the eigenvalues and MDR values of the literature reported and the conventional models for the same loading conditions for comparison purposes. All models of the tables exhibited stable operation as the eigenvalues were placed on the left half-plane. However, the PSO-ANFIS models demonstrated better stability over the conventional one as the corresponding eigenvalues were located comparatively far away from the imaginary axis. Additionally, the PSO-ANFIS and the referenced works models maintained the larger MDR values over the conventional model that signified their abilities in damping out of the LFO to gain better stability. The comparison of the second test network's MDR values for three different loading conditions is shown in Figure 14.

Time-Domain Simulation under Disturbance
Like the first electric network, this section analyzed the performance of the proposed PSO-ANFIS and the conventional models in damping out the LFO from the second test network following an external disturbance. A pulse of an extra 10% of mechanical torque was introduced again as a disturbance to the input at 1.0 s for four cycles. Following the disturbance, this research recorded the responses of the two states of the second electric network for the PSO-ANFIS and the conventional models. The recorded responses (changes in rotor angle and angular frequency) were plotted in Figure 15a,b for the loading condition # 4 of Table 10. As can be observed, both models stabilized the electric network by damping out the LFO from the system. However, the PSO-ANFIS models exhibited a faster response than the conventional one. The PSO-ANFIS models stabilized the power system's states within 3.5 s, while the conventional method fails to damp out the LFO from the system even after 7.0 s. Hence, it can be concluded that the developed PSO-ANFIS technique demonstrated better suitability in improving the power system stability in real-time.

Conclusions
This paper proposed the PSO optimized ANFIS models for real-time (online) tuning of the PSS parameters to damp out the unwanted LFO from the electric power system networks. To evaluate the real-time operating performance, this research implemented the developed models on two different power system networks, namely the SMIB system with PSS only and the SMIB system with UPFC coordinated PSS. Then, it investigated the performance of the developed models for real-time power system stability enhancement. Superiority and compatibility of the developed models with the conventional and the referenced works were determined through eigenvalues and MDR values analyses for several operating situations. Additionally, the time-domain simulation results confirmed the superiority of the developed models over the conventional models for both test networks to damp out the LFO within reasonable times. The SPI's fair values, including the RMSE, MAPE, RSR, R 2 , and WIA, signified the developed PSO-ANFIS models' effectiveness in predicting the PSS key parameters. Furthermore, it also notified that the required time for the developed models in estimating the PSS parameters was around 35 times less than that of a single cycle of 60 Hz electric network for any operating situation. Therefore, it can be concluded that the proposed PSO-ANFIS models have a high potentiality of deployment in electric grids for fine-tuning of the PSS parameters in real-time for system stability enhancement via damping out of the unwanted LFO. However, the proposed strategy's robustness can be tested on other power system networks as the extension of this work, especially with multi-machine power system networks.