Real-Time Detection of Power Quality Disturbance using Fast Fourier Transform and Adaptive Neuro-Fuzzy Inference System

,


I. INTRODUCTION
Currently, electricity is one of the most needed things in industry, government, education, and public society.Power quality refers to the electrical characteristics of the power supply that affect the performance of electrical and electronic equipment.Bad power quality can lead to equipment malfunctions, reduced productivity, and safety hazards.Power quality disturbances refer to any deviation from the ideal sinusoidal waveform of voltage and current in an electrical power system [1]- [3].Power quality disturbances can be caused by a variety of factors, including the operation of heavy machinery, lightning strikes, and power system faults.
Power quality disturbances are separated into two categories based on the duration of the voltage RMS value: short-duration Root Mean Square (RMS) variations and long-duration RMS variations [4].Therefore, power quality disturbances with voltage values that fluctuate periodically over 5% from the nominal voltage are called voltage flicker [5]- [6].On the other hand, the presence of waveforms with varying frequencies can combine with the fundamental frequency, resulting in waveform distortions.Voltage harmonics are a type of waveform distortion characterized by Total Harmonic Distortion Voltage (THDv) greater than 8% [7].Based on that, it can be inferred that there are 3 kinds of PQ disturbance: disturbances based on the time domain, disturbances based on the frequency domain, and disturbances based on the time-frequency domain.
The various power quality disturbances that may occur in an electric power system necessitate thorough monitoring.Power quality monitoring and analysis can help identify potential issues and provide solutions to mitigate them.Power quality disturbance can be accomplished using a variety of techniques, such as RMS [8] and Fuzzy Logic [9].The fuzzy logic algorithm can detect 3 power quality disturbances based on the time domains: interruption, sag, and swell [10].This technique cannot detect power quality disturbances in the frequency domain.Therefore, the Fourier transform algorithm [11]- [12] can identify Power Quality (PQ) disturbances based on the frequency domain.
On the other hand, the combination algorithm of Fast Fourier Transform (FFT) and Artificial Neural Network (ANN) was proposed by Anggriawan [13].The method can distinguish 8 variations in the time-frequency domain, such as sag, swell, undervoltage, overvoltage, sag + harmonic, swell + harmonic, undervoltage + harmonic, and overvoltage + harmonic [13].However, this technique cannot be used to classify voltage flicker simultaneously with the other disturbances.
A hybrid technique combining FFT and Adaptive Neuro-Fuzzy Inference System (ANFIS) with fourparameter inputs is required to solve those issues.This proposed technique can categorize a greater variety of PQ

A. Voltage RMS Variation and Flicker
Based on the length of the voltage RMS value, PoQ disturbances are divided into two categories: short-duration RMS variations and long-duration RMS variations.Voltage RMS variation was a temporary disturbance Table 1 denotes a voltage disturbance category with a particular parameter.Voltage flicker is the term used to describe the result of very rapid and continuous load variations.The term "flicker" comes from the voltage fluctuation at a bulb that causes the winking of the human eye.

B. Voltage Harmonic
A steady-state divergence from a pure sine wave is known as waveform distortion, and it is primarily referred to by its spectral content.Harmonics are sinusoidal currents or voltage with frequencies that are integer multiples of the fundamental frequency.Total harmonic distortion (THD) is the proportion of the RMS of the harmonic spectrum expressed as a percentage of the fundamental frequency.THDv above the tolerance value is a characteristic of the waveform distortion known as voltage harmonic.The permitted distorted voltage is displayed in Table 2.

A. Root Mean Square (RMS)
The effective amount of a sine wave is RMS (Root Mean Square).The nominal value is the constant-value equivalent of the DC waveform.RMS is commonly used for guidance during the determining procedure.The RMS value might be chosen to estimate current & voltage values.It is possible to expressed the rms voltage equation as (1).
[ ] where V rms is the value of voltage rms, T is the periode time, and v(t) is the voltage magnitude in time t.RMS values are only possible to quantify in the time domain.This algorithm is useful for determining voltage RMS variations, especially voltage sag, swell, undervoltage, and overvoltage.

B. Fast Fourier Transform (FFT)
Signals from the discrete time domain are converted into signals in the frequency domain using the Fast Fourier Transform (FFT) algorithm.The Discrete Fourier Transform (DFT) can be computed quickly and effectively using the FFT method.DFT, on the other hand, is a mathematical technique for transforming discrete time signals into the frequency domain.mathematically illustrates the Fourier transform (DFT) represented as (2).(2) The extensiveness of the transformations carried out by DFT is decreased using FFT.The total amount of operations necessary to determine the spectrum could be minimized via the FFT algorithm.Odd even numbers are created while splitting the value of x[n] according to the DFT equation.The FFT formulation is shown in (3) by setting an odd (n = 2r + 1) and for the even (n = 2r).
[ ] The FFT computation is less than the DFT, for the equation the number of DFT computations is ² while the computational FFT is  log 2N [14].FFT method is only possible to quantify in the frequency domain.This algorithm is useful for determining flicker and harmonic disturbance.

C. Adaptive Neuro-Fuzzy Inference System (ANFIS)
ANFIS is a fuzzy logic enhancement method.Where ANFIS represents a single adaptive network processor and its purpose is similar to the Fuzzy Inference System (FIS).ANFIS is a technique that uses a neural network for learning data, but the network topology is interpreted using a set of fuzzy parameters.The fuzzy inference system of Sugeno is commonly adopted by the ANFIS algorithm.Figure 1 depicts a block diagram of neuro-fuzzy inference system.Fuzzy sets (fuzzification and defuzzification) were employed to determine input-output, whereas artificial neural networks were used to identify a rule base.
ANFIS network consists of 5 layers [15].The first layer has adjustable nodes or changeable values.In the ANFIS structure, this layer is the degree of membership (µi) of the fuzzy set.The first layer node's function is seen in ( 4), and (5).
i Bi L x µ − = where, node L 1,i denotes the degree of membership µ(x) of each input to the fuzzy set A and B. The generalized bell (gbell) type is one of the most popularly employed membership functions, as seen in ( 6).The adaptive premise parameters a, b, and c will vary during the learning process.These adaptive premise cases will differ based on the membership function chosen.Figure 2 depicts the ANFIS architecture.

D. FFT -ANFIS Algorithm
The ANFIS method is the primary approach used in this research to combine RMS and FFT methodologies to detect and classify any power quality disturbance.The detailed process of the proposed algorithm can be seen in Figure 3.The detection process starts by sensing voltage and calculating all the parameters, where THDv was obtained by FFT.All the parameters such as Vrms, duration, THDv, and Fluctuation-Count are processed by ANFIS, and the result is the type of disturbance.

A. Power Quality Disturbance Modeling
Before illustrating the FFT and ANFIS techniques for fault identification, the power quality disturbance signal must be modeled in Matlab.The disturbance are voltage sag, voltage swell, undervoltage, overvoltage, flicker, voltage harmonic, sag + harmonic, swell + harmonic, undervoltage + harmonic, overvoltage + harmonics, flicker + harmonics.The mathematical model for every PQ disturbance can be seen in Table 3.
However, the mathematical equations for every power quality disturbance need to be create in Matlab.If the formula for mathematical equations in table 3 was  Normal Sine ( ) sin( )   There are 4 parameter input of the proposed algorithm: Vrms, Duration, THDv, and Fluctuation-Count.Vrms is the value of the rms voltage that is measured at any time.Duration is the time from the relative change in the voltage value to the nominal voltage value beyond the voltage variation tolerance limit.THDv is the total harmonic distortion voltage obtained from the Fast Fourier Transform (FFT) process.Fluctuation-Count is the amount of voltage fluctuation outside the voltage fluctuation tolerance limit, which is ±5% of the nominal value.Output Condition is a value that indicates if the power quality is normal or whether interference exists.It is applied to detect power quality issues.
Figure 6 shows that the "Vrms" is divided into 3 labels including Low Magnitude (LM), which has a value range of 22V to 198V.NM (Normal Magnitude), has a value range between 198V and 242V.HM (High Magnitude), has a value range of 242V to 264V.
Figure 7 shows that the "Duration" is divided into 2 labels including Short Time (ST), which has a value range    Figure 8 shows that the "THDV" is divided into 2 labels including: NH (Not Harmonic), has a value from 0% to 8%.H (Harmonic), has a value above 8% until 100%.
Figure 9 shows that the "Fluctuation-Count" is divided into 2 labels including: Temporary (T), has a value from 0 to 2. Periodic (P), has a value greater than 2. Table 4 are rule base ANFIS for PQ detection.The simulated value on ANFIS is not based on actual data but the data was entered manually.This ANFIS design will be used as a reference in carrying out system integration modeling, so that it can be more directed and on target with low error.

C. Integration Modeling (PQ disturbance detection)
Integration modeling is made using Matlab Simulink by combining PQ disturbance modeling, FFT algorithm to calculate THDv, also ANFIS modeling to detection process.Input ANFIS are Vrms, Duration, THDv and Fluctuation-Count.The model that is being simulated presupposes the classifier was utilized with 220V 50hz system.The detail of Integration modeling shows in Figure 11.
According to the IEEE 1159-2019 standards, ANSI C84.1-2016 standards, IEEE 519-2014 standards, and IEEE 1453-2015 standards also combining with researcher idea, to easier classify the type of PQ disturbance can be conclude in some parameter in Table 5.

V. RESULTS AND DISCUSSION
PQ disturbance detection modeling was created in Matlab Simulink by combining PQ disturbance modeling, the FFT algorithm to calculate THDv, and ANFIS modeling for the detection process.The results of PQ disturbance modeling were great with the waveform output, which is generated based on a mathematical model, as well as the design.
On the other hand, the FFT analysis tool in Matlab may be used to verify the outcomes of the FFT method.A Matlab tool for calculating and transferring a signal from the time domain to the frequency domain was FFT analysis.FFT analysis shows that some disturbances have a THD greater than 8% with 9 harmonic orders such as: harmonic, sag + harmonic, swell + harmonic, undervoltage + harmonic, overvoltage + harmonic, and flicker + harmonic.Figure 12 at the upper part depicts the harmonic disturbance with a time base domain in 10 cycles from 0 seconds until 0.2 seconds.Furthermore, at the lower part depicts the harmonic disturbance with a frequency base domain in 1 cycle with 9 harmonic order.THD in harmonic disturbance was created in simulation is 20%.
Figure 13 at the upper part depicts the sag + harmonic and undervoltage + harmonic disturbance with a time base domain in 10 cycles from 0 seconds until 0.2 seconds.Furthermore, at the lower part depicts the sag + harmonic and undervoltage + harmonic disturbance with a frequency   base domain in 1 cycle with 9 harmonic order.THD in sag + harmonic and undervoltage + harmonic disturbance was created in simulation is 18,56%.Figure 14 at the upper part depicts the swell + harmonic and overvoltage + harmonic disturbance with a time base domain in 10 cycles from 0 seconds until 0.2 seconds.Furthermore, at the lower part depicts the swell + harmonic and overvoltage + harmonic disturbance with a frequency base domain in 1 cycle with 9 harmonic order.THD in swell + harmonic and overvoltage + harmonic disturbance was created in simulation is 18,19%.
Figure 15 at the upper part depicts the flicker + harmonic disturbance with a time base domain in 10 cycles from 0 seconds until 0.2 seconds.Furthermore, at the lower part depicts the flicker + harmonic disturbance with a frequency base domain in 2 cycle with 9 harmonic  16.The results show that the error is only 2.027 x in 100 epochs.
Figure 17 illustrates the ANFIS testing data after training data.According to the tests, the ANFIS data produced excellent outcomes, which are nearly identical to the standard specifications of power quality disturbances in Table 5.The results show that the average testing error is only 2.027 x .
For the integration modeling in Matlab Simulink, the results show that the suggested method with a combination of Fast Fourier Transform and Adaptive Neuro-Fuzzy Inference Systems can detect PQ disturbance, as can be seen in Table 6.The results show that the suggested method can detect and classify PQ disturbances in total 4983 data outstandingly with average error only 0.7%.
The proposed method combining FFT and ANFIS algorithm can detect and classify 11 type of PQ disturbances with 99.3% accuracy.When compared to Fuzzy Logic algorithm and FFT-ANN algorithm, FFT -ANFIS method can identifies more kinds of disturbance with total 11 type of PQ disturbances including Voltage Flicker as seen in Table 7.

VI. CONCLUSION
The model that is being simulated presupposes the classifier was utilized with a 220V, 50Hz system.Matlab simulations show that the suggested method with a combination of FFT and ANFIS can detect and classify 11 types of PQ disturbances, such as voltage sag, voltage swell, undervoltage, overvoltage, voltage flicker, voltage harmonic, sag + harmonic, swell + harmonic, undervoltage + harmonic, overvoltage + harmonic, and flicker + harmonic.This method performs outstandingly, with 99.3% accuracy.The FFT-ANFIS algorithm can identify 9 kinds of disturbances that Martin's method was unable to do.The proposed method can also identify 3 kinds of disturbances that Anggriawan's method was unable to identify.

Figure 2
Figure 2. ANFIS architecture Elektrika Vol. 20, No. 1, March 2024 generated in Matlab, a waveform with the design might develop in Figure 4.B.ANFIS ModelingThe ANFIS technique was used in this research to identify numerous kinds of power quality issues in realtime.Fuzzy logic FIS Sugeno architecture is employed to determine the input, rulebase, and output, which are subsequently converted into ANFIS.Based on journal references and power quality standard.Four input parameters are utilized in the ANFIS model.The input of ANFIS are magnitude vrms, duration, THDv, and fluctuation-count.

Figure 5
depicts the ANFIS architecture to identify PQ disturbance.In the ANFIS process, it is necessary to training a lot of data and check the training results.Data for training is obtained based on power quality disturbance standards.For voltage RMS variation using the IEEE standards 1159-2019, for voltage harmonic using IEEE standards 519-2014, and for flicker using the standard from ANSI C84.1-2016 and IEEE standards 1453-2015.

Figure 4 .
Figure 4. Waveform representation of each PQ disturbance

Figure 10 shows
that the "Condition" is divided into 12 labels including: Normal has a value of 1, Sag has a value of 2, Swell has a value of 3, Undervoltage has a value of 4, Overvoltage has a value of 5, Flicker has a value of 6, Harmonic has a value of 7, Sag + Harmonic has a value of 8, Swell + Harmonic has a value of 9, Undervoltage + Harmonic has a value of 10, Overvoltage + Harmonic has a value of 11, and Flicker + Harmonic has a value of 12.

Figure 12 .Figure 13 .
Figure 12.Harmonic disturbance in time domain and frequency domain

Table 1 .
Voltage category

Table 2 .
Voltage distortion limit Figure 1.Block diagram of neuro fuzzy inference system

Table 5 .
PQ disturbance parameter for identification

Table 6 .
Integration modeling results for PQ disturbance detection

Table 7 .
Comparing proposed algoritm with previous methodsFigure 16.ANFIS training data for PQ disturbance detection Figure 17.ANFIS testing data for PQ disturbance detection Figure 14.Swell + harmonic and overvoltage + harmonic disturbance in time domain and frequency domain Figure 15.Flicker + harmonic disturbance in time domain and frequency domain order.THD in flicker + harmonic disturbance was created in simulation is 18,79%.Therefore, ANFIS modeling needs data training to produce the best results.The data training was created manually in Excel with four parameter inputs for various data based on Table 5.Total data training was 754, and the results of training are depicted in Figure