Curve Fitting Approach for Fundamental Frequency Measurement for Power Systems

1Graduate Institute of Mechanical and Electrical Engineering, National Taipei University of Technology, 1, Sec. 3, Zhong-xiao E. Rd., Taipei 10608, Taiwan 2Graduate Institute of Automation Technology, National Taipei University of Technology, 1, Sec. 3, Zhong-xiao E. Rd., Taipei 10608, Taiwan 3Research Center of Energy Conservation for New Generation of Residential, Commercial, and Industrial Sectors, National Taipei University of Technology, 1, Sec. 3, Zhong-xiao E. Rd., Taipei 10608, Taiwan


Introduction
In recent years, owing to the rising environmental awareness, many countries around the world are now developing green renewable energy using conventional power generation technologies to prevent environmental pollution. Various industries, such as conventional, semiconductor, chemical, and software industries, have been developed rapidly over the past decades. As a result, power consumption has increased rapidly. During a typical operation, generators may be tripped owing to an accident. The power generation and load cannot be balanced. This incident causes a rapid decline in system frequency. The dropping of the system frequency may further cause the tripping of other generation units. The chain reaction may result in power system black out. To alleviate the problem, a load shedding scheme is needed by installing low-frequency relays in systems. Accurately measuring the frequency of a power system is important for evaluating the stability of the system. (1)(2)(3)(4)(5)(6) At present, many techniques have been proposed for measuring the power system frequency. Common techniques include frequency domain interpolation, Prony's method, (7,8) the zero crossing method, (9,10) discrete Fourier transform (DFT) or fast Fourier transform (FFT), (1,3,6) and so on. In this study, the curve fitting approach is utilized. Curve fitting can be used to calculate the frequency in the absence of some sampling points. The missing sampling points can be obtained by the interpolation approach. On the other hand, the genetic algorithm (GA) is used to estimate a parameter directly. Two different mathematical models are investigated in this study to compare their performance characteristics. The first model considers only the ideal power signal form. The frequency variation term is used in addition to the ideal power signal for the second model. The performance characteristics of the two models are compared under various scenarios.

Materials and Methods
Traditionally, the ideal power signal is regarded as a sine wave, which is mainly composed of three parts, namely, amplitude, frequency, and phase. In this study, the curve fitting method is used to estimate the power system frequency in accordance with IEEE1459-2000. (11) In addition to the stationary frequency model, the frequency variation term is also considered. (12)

Basic power signal definition
The traditional power system signal is described in IEEE1459-2000. (11) The voltage signal can be expressed as If an ideal linear load is connected, the current signal can be expressed as where V is the voltage root mean square (RMS), I is the current RMS, f is the signal frequency, θ v and θ i are the voltage and current phase angles, respectively, and t is the time. When a voltage is applied to a nonlinear load, the linear relationship between voltage and current does not apply. Nonlinearity causes waveform distortion, resulting in the current waveform no longer being a pure sinusoidal waveform. This phenomenon is called harmonic distortion. Therefore, for voltage and current signals containing harmonic components, it can be expressed mathematically as (13) where V k is the kth order of the voltage harmonic amplitude, I k is the kth order of the current harmonic amplitude, f k is the kth harmonic frequency of the input signal, k is the kth harmonic order, and θ k and ψ k are the initial phase angles of the voltage and current signals, respectively.

Noise
In the process of signal transmission, the signal will be interfered by some external energy, e.g., noise. Noise will cause signal distortion. The noise source may be generated by the receiving system in addition to the power system.
There are many types of noise. The analog noise used in this study is white noise, also known as Gaussian noise. White noise is a random signal with a constant power spectral density, that is, the power of this signal is the same in each frequency band, and its expected value is zero. The mathematical expression is shown as where E is the expected value and W is the random vector.

Data fitting and regression analysis (RA)
Curve fitting is a method that derives the parameters of a mathematical model for approximating the input and output of the data. To utilize the curve fitting method for identifying the power system fundamental frequency, a power system signal model is required. Conventionally, RA is applied to identify the parameters of a given model.

Power system signal model of curve fitting
For AC signals, when the frequency of the power system changes, the stationary power signal model cannot be used to describe the characteristics of the power system signal since the signal is not periodic. In this study, the sinusoidal function is used to represent the power system signal, i.e., voltage. The parameters are the amplitude A m , frequency ω, phase φ, and rate of change of frequency (ROCOF). The general sinusoidal signal that represents an AC power system analysis is defined on the basis of IEEE Standard C37.118.2 as (13) x(t) = A m cos(ωt + φ).
The sinusoidal signal can be expressed as where A m is the amplitude and Φ is the angle vector. The frequency function can be defined as (8) ROCOF is defined as From Eqs. (6) and (9), if the frequency is changed at a fixed rate, the phasor equation can be rewritten as (12,14,15) where f c is the ROCOF.

RA
In the conventional curve fitting approach, RA is applied to identify the parameters. The signal frequency of the power system model is considered nonlinear; therefore, a nonlinear regression approach is applied.
According to Eqs. (6) and (10), the power system frequency signal model can be described as where Y is the power system signal vector and f(X) is the mathematic model. X is the parameter vector of the power system signal model. In general, Y is not equal to f(X). Thus, an iterative approach is required to find the optimal parameters by minimizing the sum of squared error (SSE) defined as where y i is the element of the power system signal, x i is the fitting output, X is the parameter vector of the power system signal model, i is the ith sampled point of the power system signal, and m is the total number of sampled data. The gradient descent approach can be used to find the minimum SSE. The gradient descent equation can be written as where t is the number of iterations, γ is the learning rate, and ∇ is the gradient operator. An iteration is terminated when the SSE is converged. Otherwise, another iteration of the fitting procedure is performed.

GA
Although the parameters used in models described in Eqs. (6) and (10) can be obtained by RA, they can also be identified by applying GA. GA is a metaheuristic method developed based on the Darwin's theory of natural selection. (16)(17)(18) By removing weak creatures and retaining more adaptive organisms, the most powerful creatures can be obtained eventually.

Chromosome representation
The variables used in the power system frequency model are encoded in GA as genes in chromosomes. In this paper, amplitude, frequency, frequency variation, harmonic amplitude, and noise are the variables that must be determined. Two approaches in GA, namely, real number encoding and binary encoding, can be applied to encode these variables. In binary encoding, variables are encoded in binary string forms. The longer the binary string, the higher the accuracy. However, a longer execution time is required for longer binary strings. Since the time to obtain these parameters is critical, the binary string encoding approach is not used. For the real number encoding approach, each parameter is represented by a real number. Since the real number is both a solution and a gene representation, no decoding procedure is required. Compared with those of binary coding, the calculation time of real number encoding can be greatly shortened and its calculation accuracy can be increased if a double precision representation is used.

Population
When generating chromosomes, restriction on the parameters must be considered. For example, when the nominal frequency of a power system is 60 Hz, a reasonable range of 55-65 Hz is used. The gene that represents the frequency parameter in chromosomes will have a value between 55 and 65 Hz. The remaining variables, such as amplitude, phase, frequency variation, harmonic amplitude, and noise, are randomly generated in the given range as well. It is critical to determine the variable range. On one hand, it is desired that the searching space can be as large as possible. On the other hand, the calculation time of the algorithm is greatly increased when the search space is increased. A larger search space may also lead to an incorrect solution.

Fitness
Adaptability is an important indicator for determining the fitness of chromosomes. The fitness function is a method used to describe the performance of a chromosome. The fitness function is usually derived from experience or observation. When chromosomes are generated, the fitness function is used to evaluate them. Generally, the higher the fitness of a chromosome, the higher the quality of the chromosome. However, if the fitness of a chromosome is much higher than those of other chromosomes, it is very likely that the chromosome will dominate the evolutionary process and converge to an undesired solution. According to Eq. (12), the fitness function used in this study is expressed as (14)

Crossover
Crossover is a natural biological behavior. By mating, the gene pool can be exchanged between individuals in a population. Different crossover strategies will result in different performance characteristics during the evolutionary process. Note that crossover does not guarantee that a higher quality chromosome is produced.

Mutation
Mutation is another natural biological behavior. During the evolutionary process, the allele of a gene may change owing to some external stimulation. The mutation process during GA is designed to prevent convergence to a local region, which is not a good solution for the problem.

Selection
In reality, individuals with a lower survivability will be eliminated. GA also embeds such a behavior. The algorithm relies on the fitness to evaluate each chromosome. Fitness is similar to the ability of organisms in nature to adapt to the environment. During the selection procedure, a chromosome with a higher fitness has a higher probability to be selected for the next generation.

Simulation process
The mathematical models to be used are Eqs. (6) and (10). The variable range is selected as follows: amplitude = [0.8, 1.2], frequency = [58, 61], phase = [−π, π], and ROCOF = [−5, 5]. A reasonable range of variables can avoid the divergence of RA and GA. The measured window length will determine the characteristics of the curve fitting process. When the window length is small, the calculation time will be reduced. However, a shorter window makes the fitting result difficult to converge and probably cannot find the best solution. When the window length is very large, the probability of successful fitting increases and the residual value can be reduced. However, the frequency tracking ability decreases and the calculation time increases greatly when a longer window is used. Generally, the window length is between 8 and 12 cycles. The IEC 61000-4-7 standard has recommended the 5 Hz frequency resolution on the basis of the DFT technique. That is, the analysis information with a time length of 0.2 s is applied to harmonic and interharmonic analyses. Therefore, 12 cycles are used in this study. After the parameter ranges and window length are determined, RA and GA are applied to find the model parameters such that the model is closest to the input signal. The system frequency can be calculated using the parameters obtained. For each window, a set of model parameters is averaged by executing RA and GA several times.

Simulation Results
Four different power events are considered. Equations (6) and (10)

Standard power signal measurement
In this case, the sampling frequency is 960 Hz, the window length is 12 cycles, and the simulation time is 0.2094 s. Equation (15) is used to represent the input signal.
In Eq. (15), f is the fundamental frequency and t is the time. The frequency range is set to 58.5-60.5 Hz. The results are shown in Figs. 3 and 4 for the fundamental frequency of 59.8 Hz. The root-mean-square errors (RMSEs) (19,20) for both models are shown in Tables 1-4 with different frequencies.

Power system signal with harmonics
In this case, the sampling frequency is 960 Hz, the window length is 12 cycles, and the simulation time is 0.2094 s. The following equation is used to represent the input signal: ( ) cos 2 0.02 cos 2 , 3 9 where x(t) is the input signal, f is the fundamental, t is the time, and N is the harmonic order. The frequency range is set to 58.5-60.5 Hz, and the frequency calculation results are shown in Figs. 5 and 6. The RMSEs for both models are shown in Tables 5-8.

Power system signal with harmonics and noises
In this case, the sampling frequency is 960 Hz, the window length is 12 cycles, and the simulation time is 0.2094 s. Equation (17)

Frequency variation power signal measurement
In this case, the sampling frequency is 960 Hz, the window length is 6 cycles, and the simulation time is 0.25 s. The frequency of the input signal is changed from 60 to 59 Hz at 1 to 1.1 s. The calculation results are shown in Figs. 13 and 14. The RMSEs are shown in Table 21.

Conclusions
In this study, the power system fundamental frequency is calculated using Eqs. (6) and (10). The experimental results in Sect. 3.1 show that the frequency estimation variation of Eq. (6) indicates a smaller RMSE than that of Eq. (10) when the signal is in the steady state. According to the results in Sects. 3.2 and 3.3, the model using Eq. (6) obtains a more accurate frequency estimation than that using Eq. (10) for RA, when signals involve harmonics and noise. In addition, GA is used instead of the conventional RA. It is found from the experimental results that the frequency estimation accuracy using RA decreases when the frequency offset increases. Therefore, RA is not suitable for use in situations where the frequency variation is large. The results of using GA show that the measurement accuracy does not change markedly with the frequency offset. It is found from Sect. 3.4 that when the power signals are used, the RMSE of GA is only half of that of RA, and that the curve is smoother. The overall performance obtained using Eq. (6) is as good or higher than that obtained using Eq. (10) for RA and GA for a steady state. On the other hand, GA performs better than RA in terms of frequency tracking. From the obtained results, it is found that Eqs. (6) and (10) are not perfect mathematical models to represent the frequency variation of power systems. These equations can be further improved to handle more complex signals, e.g., flicker. In the future, it may be necessary to design a model and a more accurate parametric learning algorithm that can better match a waveform under frequency variation so that the residual can be lower and the accuracy of the frequency estimation can be further improved.