{'fraction_non_alphanumeric': 0.028388436904967975, 'fraction_numerical': 0.013761467889908258, 'mean_word_length': 4.606501698204755, 'pattern_counts': {'":': 0, '<': 1, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Study on the DFT-based phasor estimation algorithm for removal of the decaying DC offset

Protection relays respond to the fault condition of power system using real-time voltage and current signals. Estimation of the voltage and current phasors is necessary. However, the decaying DC component contained in the signal causes overshoot and oscillations in the magnitude and angle of the phasor estimated by the traditional DFT algorithm. Two types of estimation algorithms removing effect of the decaying DC component are studied and compared in this paper. The two improved algorithms include an error estimation (EE) algorithm featured with estimating the decaying DC component characteristics and a differential DFT (DD) algorithm featured with prefiltering of the current signal prior to phasor estimation. Performance of the two algorithms is evaluated using simulated signals from Matlab and PSCAD software. Accuracy of the phasor estimation is improved and the DD algorithm has more excellent performance than the EE algorithm.


Introduction
Protection relays respond in time to different conditions of the power system by acquiring real-time voltage and current signals measured by instrument transformer. When a fault occurs, the relays will trip the circuit breaker to protect the power system. To identify the faults, phasor estimation algorithms are necessary for the relays. The estimation algorithms can extract the fundamental component from input signals that contain harmonic components and decaying DC component, caused by combined inductive and resistive nature of power system [1]. Conventional Discrete Fourier Transform (DFT) is the most commonly used [2]. Although harmonic components can be eliminated by the DFT algorithm, the decaying DC component cannot be attenuated effectively, which can lead to overshoot and decaying oscillations in the magnitude and angle of the estimated phasor. The estimation error of magnitude can reach up to 15.1%. The total phasor error will be larger due to the error of phase angle. Therefore, the decaying DC component should be well considered when the fundamental component is calculated [3].
Different algorithms estimating the fundamental component have been proposed to eliminate effect of the decaying DC component on the DFT algorithm. Reference [4] estimates the fundamental component using even and odd samples of the estimated phasor. A more accurate phasor value is obtained without parameters estimation of the decaying DC component. A new DFT-based phasor estimation method is applied in [1] to compensate the unwanted effect of the decaying DC component by employing two interim variables. A cosine filter is proposed in [5] to eliminate effect of the decaying DC offset. The cosine filter is as effective as a mimic filter. An iterative algorithm proposed in [6] only  [7] and [8] for fault current filtering, but they are not preferred for real-time implementation of relays.
In summary, the improved algorithms can be divided into two types of categories: estimating the decaying DC component characteristics and prefiltering of the current signal prior to phasor estimation. In this paper, an error estimation(EE) algorithm and a differential DFT(DD) algorithm are studied to obtain a more accurate DFT-based phasor estimation algorithm. The two algorithms correspond to the two types of categories respectively. The EE algorithm estimates and corrects the error caused by the decaying DC component. The DD algorithm applies a differential filter to the traditional DFT algorithm to eliminate effect of the DC component directly. Performance of the two algorithms are evaluated and compared using signals from Matlab and PSCAD software.

Error estimation (EE) algorithm
Traditional DFT algorithm obtains the phasor value by calculating real and imaginary parts first. The reason why errors are generated is that calculation process of the real and imaginary parts ignores the decaying DC component. In the EE algorithm, errors during this process are estimated first, and then the real and imaginary parts are corrected with the estimated errors. Thus the effect of the decaying DC component can be removed.

Estimation of the time constant
To calculate the error caused by the decaying DC component, the time constant should be obtained first [9]. The current signal x containing decaying DC component can be expressed as: where X 0 represents the initial value of the decaying DC component; τ represents the time constant; X k represents magnitudes of the fundamental component and harmonic components; ω is the angular frequency of the fundamental component; φ k is the initial phase angle of the fundamental and harmonic components. Take a sequence of sampling points during one cycle {x(i)| i = 1, 2, ..., N} as current data window and sum the 2m-1 (m=1, 2... N/2) points and 2m sampling points of the current data window separately as (2). The sum process can eliminate influence of periodic components. The 2m sampling points take one more sampling interval ∆T to decay compared to the 2m-1 sampling points. 2 2 Divide the two variables in (2). Then (3) can be obtained: Since logarithm calculation is difficult to realize in digital protection and needs to take a lot of computing time, e -∆T/τ can be expanded according to Taylor series to improve computing speed. At the same time, because the transient time constant of the power system has similar order of magnitudes to one cycle T, ∆T/τ is less than 1 [10]. Then reserve the first two items of the series and (4) can be obtained:

Error calculation
The DFT algorithm is used to calculate the real parts a 1 and imaginary parts b 1 of the fundamental phasor of the sampled values in the current data window.
Then the relationship between accurate real and imaginary parts (  ) and the errors is: where superscript 1 represents the current data window. Take a sequence of sampling points during one cycle after a sampling interval ∆T as the second data window, i.e., {x(i)| i = 2, 3, …, N+1}, and a similar equation as (6) can be obtained. In the same way, the corresponding error can be expressed as: where α = sinω∆T and β = cosω∆T. Besides, 1 b δ can be expressed as follow: Divide 2 a δ and 2 b δ in (7) and combine the equations above, and then (9) can be obtained:

Error correction
Error correction can be made based on (6) and (9), and the accurate value of fundamental component in the current data window is then obtained. It should be noted that the case that Sum 1 is equal to Sum 2 may arise when Sum 1 and Sum 2 are used to estimate the time constant. This case will lead to emergence of the singularity. Therefore, this algorithm makes a further modification to the singularity, namely, 1 1 0 a b δ δ = = is assumed when |Sum 1 -Sum 2 | < ε. Finally, according to the DFT algorithm, the magnitude and phase angle can be calculated using modified real and imaginary values. Then the phasor value of the fundamental component can be obtained with the decaying DC offset eliminated.

Differential DFT(DD) algorithm
The DC component is assumed to be constant in a very short time. The DC component can be eliminated by make a difference between adjacent sampled values and a differential signal can be obtained [11]. Since the magnitude and phase angle of the differential signal are changed compared with the original signal, it is necessary to modify the magnitude and phase angle to calculate the phasor value of the original signal. The detailed steps are as follows.

Difference of sampled values
Difference is made between the sampled values of adjacent original signals to obtain differential signal y as (10).

Calculation and correction of differential signal
Using the DFT algorithm to calculate the fundamental amplitude Y m1 and phase θ 1 of the differential signal, (12) and (13) can be obtained.
Furthermore, according to the relationship between fundamental phasors of the original signal and the differential signal as (14), the fundamental phasor of the original signal can be obtained with influence of the decaying DC component eliminated.

Performance evaluation of the two removal algorithms
Performance of the EE algorithm and DD algorithm is evaluated in this section. Two types of signals containing decaying DC component are generated. A composite signal is simulated by Matlab and a fault current signal is generated by PSCAD.

Simulation using the composite signal
The composite signal x(t) simulated by Matlab contains a fundamental component, a decaying DC component and three harmonic components as (15). Waveform of the signal is shown in Figure 1(a). Accurate magnitude and phase angle of the fundamental component should be 10 and 60°, respectively. Taking N = 24 as an example, the maximum magnitude error δ MM is 5.177% and the maximum phase angle error δ MP is 6.130% for the traditional DFT algorithm.  x t e t t t t τ ω π ω π ω π ω − = + + + + + + + When the EE algorithm is used to estimate the phasor value, the estimated value of the magnitude varies from 9.5716 to 10.3125 and that of the phase angle varies from 58.2129 to 61.1884, as listed in Table 1. δ MM is 4.284% and δ MP is 2.979%. Accuracy of the phasor estimation is improved, but the decaying DC component still cause errors.  When the DD algorithm is used to estimate the phasor value (M = 1), the estimated value of the magnitude varies from 9.9557 to 10.0618 and that of the phase angle varies from 59.7002 to 60.2203, as listed in Table 2. δ MM is 0.618% and δ MP is 0.500%. Accuracy of the phasor estimation is improved greatly, and its performance is more excellent than the EE algorithm.  Figure 1(b). N = 80 is taken in this case. The fault occurs at t = 0.3 s and a large DC component is generated. The magnitudes calculated by the traditional DFT algorithm, EE algorithm and DD algorithm are shown in Figure 2(a). It can be seen that oscillations are generated in the magnitudes which are calculated by the traditional DFT algorithm and EE algorithm. The oscillations attenuate and the errors decrease as DC components decay. It should be noted that the DD algorithm (M = 1) can reduce effect of the decaying DC component on the phasor estimation to the great extent. As for the phase angle estimated by the traditional DFT algorithm, the error is the largest and the time affected by the DC component is the longest, as shown in Figure 2(b). When it comes to the two improved algorithms, the estimated phase angle of the DD algorithm is affected in a shorter time than that of the EE algorithm, with the point of discontinuity ignored. In addition, the former is more stable

Conclusion
In this paper, two improved algorithms based on DFT are studied to remove effect of the decaying DC component on the phasor estimation. The two algorithms are the EE algorithm and DD algorithm respectively. The EE algorithm estimates and corrects the error caused by the decaying DC component. The DD algorithm applies a differential filter to the traditional DFT algorithm to eliminate effect of the DC component directly. Performance of the two algorithms is evaluated and compared using a composite signal from Matlab and a fault current signal from PSCAD. Errors of the magnitude and phase angle are reduced using the two algorithms. Accuracy of the phasor estimation is improved. Also, the oscillations and errors of the magnitude estimated by the DD algorithm can decay faster. The DD algorithm has more excellent performance than the DD algorithm and is more suitable for the protection relays.