Fasores
Fasores
Consider a constant input signal x(t) at the nominal frequency of the power system
f0, which is sampled at a sampling frequency Nf0. The sampling angle θ is equal to
2π/N, and the phasor estimation is performed using Eqs. (1.25)–(1.27).
xn ¼ Xm cosðnh þ /Þ ð2:2Þ
It is to be noted that the summation of the sin(2nθ) term over one period is
identically equal to zero, and that the average of the cos2(nθ) term over a period is
equal to 1/2.
Xm Xm
X N1 ¼ XcN1 jXsN1 ¼ pffiffiffi ½cosð/Þ þ j sinð/Þ ¼ pffiffiffi ej/ ð2:5Þ
2 2
The two windows are shown in Fig. 2.1. Phasor 1 is the result of phasor esti-
mation over window 1, while phasor 2 is calculated with the data in window 2. The
first sample in window 1 is lagging the peak of the sinusoid by an angle ϕ, while the
2.2 Formulas for Updating Phasors 31
φ
φ+θ
n = N -1
n=0 n=N phasor 2 phasor 1
θ
n=1 φ
window 1
window 2
(a) (b)
Fig. 2.1 Update of phasor estimates with N sample windows. Phasor 1 is calculated with samples
n = 0, …, N − 1, while phasor 2 is calculated with samples n = 1, 2, … N. θ is the angle between
successive samples based on the period of the fundamental frequency
first sample of window 2 (n = 1) lags the peak by an angle (ϕ + θ), θ being the
angle between samples.
It should be clear from Fig. 2.1 that in general, the phasor obtained from a
constant sinusoid of nominal power system frequency by this technique will have a
constant magnitude and will rotate in the counter-clockwise direction by angle θ as
the data window advances by one sample. Since the phasor calculations are per-
formed fresh for each window without using any data from the earlier estimates,
this algorithm is known as a non-recursive algorithm. Non-recursive algorithms are
numerically stable but are somewhat wasteful of computation effort as will be seen
in the following.
Figure 2.2 is another view of the non-recursive phasor estimation process. As
newer samples are obtained, the table of sine and cosine multipliers is moved down
to match the new data window. In this figure, the multipliers are viewed as samples
of unit magnitude sine and cosine waves at the nominal power system frequency.
The new data window has N − 1 samples in common with the old data window. In
actual computation, these are simply stored as tables of sine and cosine, which are
used repeatedly on each window as needed.
The formulas for calculating the (N − 1)th and (N)th phasors by the non-recursive
algorithm are
32 2 Phasor Estimation of Nominal Frequency Inputs
Input
signal phasor 2
New sample,
window 2 φ2 = φ1 + kθ
t phasor 1
φ1
Fig. 2.2 Non-recursive phasor estimation. There are 12 samples per cycle of the power frequency
in this example. Fresh calculations are made for each new window as new samples are obtained.
The phasor for a constant input signal rotates in the counter-clockwise direction by the sampling
angle, in this 30°
pffiffiffi N 1
2 X jnh
X N1 ¼ xn e
N n¼0
pffiffiffi N 1 ð2:7Þ
2X
X ¼
N
xn þ 1 ejnh
N n¼0
The multipliers for a given sample are different in the two computations. For
example, the multiplier for (n = 2) sample in the first sum is e−j2θ, while the
multiplier for the same sample in the second sum is e−jθ.
It should be noted that samples xn: {n = 1, 2, …, N − 1) are common to both
windows. The second window has no x0, so that it begins with x1, and it ends with
xN, which did not exist in the first window. If one could arrange to keep the
multipliers for the common samples the same in the two windows, one would save
considerable computations in calculating XN. If we multiply both sides of the
second equation in (2.6) by e−jθ, we obtain the following result:
pffiffiffi N 1
_N 2X
X ¼ ejh X N ¼ xn þ 1 ejðn þ 1Þh
N n¼0
pffiffiffi
2
¼ X N1 þ ðxN x0 Þejð0Þh ð2:8Þ
N
where use has been made of the fact that e−j(0)θ = e−jNθ, since N samples span
exactly one period of the fundamental frequency. The phasor defined by Eq. (2.7)
2.2 Formulas for Updating Phasors 33
When the input signal is a constant sinusoid, xN+r is the same as xr, and the
second term in Eq. (2.8) disappears. The phasor estimate with data from the new
window is the same as the phasor estimate with data from the old window when the
input signal is a constant sinusoid. In general, the recursive algorithm is numerically
unstable. Consider the effect of an error in the estimate from one window—for
example, caused by a round-off error. This error is always present in all the phasor
estimates from then on. This property of the recursive phasor algorithms must be
kept in mind when practical implementation of these algorithms is performed [1].
Nevertheless, because of the great computational efficiency of the recursive algo-
rithm, it is usually the algorithm of choice in many applications.
Unless stated otherwise explicitly, we will assume that only the recursive form
of the phasor estimation algorithm is in use (Fig. 2.3).
Fig. 2.3 Recursive phasor estimation. There are 12 samples per cycle of the power frequency in
this example. Fresh calculations are made for each new window as new samples are obtained. New
sine and cosine multipliers are used on the new sample. The phasor for a constant input signal
remains stationary
34 2 Phasor Estimation of Nominal Frequency Inputs
sampled at the rate of 12 samples per cycle, i.e., at a sampling frequency of 720 Hz.
The first 18 samples, and the non-recursive and recursive phasor estimates obtained
using Eqs. (2.6) and (2.8) beginning with sample no. 12 (at which time the first data
window is completely filled) are shown in the following (Table 2.1).
As expected, the non-recursive phasor estimates produce a constant magnitude
of 100/√2 with an initial angle of π/4 (45°), and then for each successive estimate,
the angle increases by 30°.
The input signals are rarely free from noise. A spurious frequency component
which is not a harmonic of the fundamental frequency signal may be considered to
be noise. One may also have induced electrical noise picked up in the wiring of the
input signal. Leakage effect caused by the windowing function has already been
discussed in Chap. 1, and it too contributes to an error in phasor estimation and
should therefore be considered as a type of noise in the input.
xn ¼ Xm cosðnh þ /Þ þ en ; fn ¼ 0; 1; 2; . . .; N 1g ð2:10Þ
½W ¼ r2 ½1 ð2:13Þ
the weighted least squares solution of Eq. (2.11) provides the estimate for the
phasor
_
½X ¼ ½ST W 1 S1 ST W 1 ½x ð2:14Þ
Using (2.13) for W, and calculating {STS]−1 for the S in Eq. (2.11):
_ 1 T
½X ¼ ½ST W 1 S1 ½ST W 1 ½x ¼ ½ST S1 ½ST ½x ¼ ½S ½x ð2:15Þ
N
36 2 Phasor Estimation of Nominal Frequency Inputs
Since the noise is a zero-mean process, the estimate given by (2.15) is unbiased,
and the expected value of the estimate is equal to the true value of the phasor. If X is
the true value of the phasor, the covariance matrix of the error in the phasor estimate
is
h_ _
i
E ½X X½X XT ¼ ½ST W 1 S1 ð2:16Þ
Substituting for [W] from Eq. (2.13), the covariance of the error in phasor
estimate is (σ2/N). The standard deviations of error in real and imaginary parts of
the phasor estimate are (σ/√N). We may thus conclude that higher sampling rates
will produce improvement in phasor estimates in inverse proportion of the square
root of the number of samples per cycle. Alternatively, if longer data windows are
used (multiple of cycles), then once again the errors in phasor estimate go down as
the square root of the number of cycles used. Thus, a four cycle phasor estimate is
twice as accurate as a one cycle estimate in with noisy input.
Example 2.2 Consider a 60 Hz sinusoid
in a noisy environment, with the Gaussian noise ε having a zero mean and a
standard deviation of 1. The source of noise could be electromagnetic interference,
quantization errors, or harmonic and non-harmonic components in the input signal.
If the phasing of the harmonic and non-harmonic signals is random, the noise model
may be approximated by a zero-mean Gaussian characteristic.
The signal is sampled at six different sampling rates: 8, 16, 32, 64, 128, and 256
times per cycle. The signal samples are created with appropriately modeled noise
input for 1000 cycles, and 1000 estimates of the phasor value are calculated. The
standard deviations of the errors in the 1000 phasor estimates as well as its theo-
retical value (σ/√N) are given in Table 2.2 and are also shown in Fig. 2.4.
These results show very good agreement with the expected results. As men-
tioned earlier, increasing the data window size at a fixed sampling rate, rather than
the number of samples in the same data window will produce similar results.
Another possible source of error in input data samples is the error in timing of the
sampling pulses. One possible source of errors is that the sampling clock is not precisely
at a multiple of the power system frequency. This case will be dealt with in the next
chapter, when we consider the phasor estimation problem at off-nominal frequencies.
In this section, we will consider the case where the sample times are corrupted by
a Gaussian random noise with standard deviation varying by up to 10% of the
sampling interval. Large errors of this type should not exist in modern measuring
systems. Nevertheless, when sampling pulses are generated with the help of software
clocks, it is possible to encounter random errors in sampling times. The following
numerical example considers errors of this type. The errors are truncated at 3 times
the standard deviation in order to eliminate impossibly large sampling clock errors.
Example 2.3 Consider a 60 Hz sinusoid
which is sampled at tn = nΔT + ε, where the Gaussian noise ε has a zero mean and
a standard deviation of bΔT, with the parameter b varying between 0.0 and 0.10.
The signal is sampled at a sampling rate of 32 times per cycle. The signal samples
are created with sampling time errors for 1000 cycles, and 1000 estimates of the
phasor value are calculated. The standard deviations of the errors in the 1000 phasor
estimates are given in Table 2.3 and are also shown in Fig. 2.5.
The weighted least squares solution technique developed in Sect. 2.2 is a conve-
nient vehicle for calculating phasors from fractional cycle data windows. It should
be remembered that fractional cycle phasor estimates are necessary in developing
38 2 Phasor Estimation of Nominal Frequency Inputs
0.1
0 ‘b’
0 0.02 0.04 0.06 0.08 0.10
high speed relaying applications, and not particularly useful in wide area phasor
measurement applications whereby measurement times of a few cycles are
acceptable. Nevertheless, it is instructive to include a discussion of fractional cycle
phasor estimation.
Consider the use of M samples of a sinusoid for estimating phasors, the sinusoid
having been sampled at a sampling rate of N samples per cycle. M < N produces a
fractional cycle phasor estimation algorithm.
As before, the input is set of noisy measurement samples
xn ¼ Xm cosðnh þ /Þ þ en ; fn ¼ 0; 1; 2; . . .; M 1Þ ð2:17Þ
where εn is a zero-mean Gaussian noise process with a variance of σ2. The sampling
angle θ is equal to 2π/N.
2 3 2 3 2 3
x0 cosð0Þ sinð0Þ e1
6 x1 7 6 cosðhÞ sinðhÞ 7 6 e2 7
6 7 pffiffiffi6 7 Xr 6 7
6 7 ¼ 26 cosð2hÞ sinð2hÞ 7 6 7
6 x2 7 6 7 Xi þ 6 e3 7 ð2:18Þ
4 5 4 5 4 5
xM1 cos½ðM 1Þh sin½ðM 1ÞhÞ eM1
2.4 Phasor Estimation with Fractional Cycle Data Window 39
As before, the weighted least squares solution of Eq. (2.17) provides the esti-
mate for the phasor
_
½X ¼ ½ST W 1 S1 ST W 1 ½x ð2:20Þ
Using (2.13) for W, and calculating {STS]−1 for the S in Eq. (2.11):
_
½X ¼ ½ST W 1 S1 ½ST W 1 ½x ¼ ½ST S1 ½ST ½x ð2:21Þ
Unlike in the case of the full cycle phasor estimation, [STS]−1 is no longer a
simple matrix:
2 3
P
M1 P
M1
It can be shown that for a half-cycle estimation, with M = N/2, the least squares
solution is very similar to the DFT estimator.
Phasor estimates obtained from a data window represent the fundamental frequency
component of the input confined to the data window. When a fault occurs on the
power system, there is a series of data windows which contain pre- and post-fault
data. This is illustrated in Fig. 2.6 for an assumed voltage waveform during a fault.
It should be clear that although a phasor estimate will be available for all data
windows (including the ones that are shaded in Fig. 2.6), only phasors which
belong entirely to the pre- or post-fault periods are of interest. The phasors com-
puted for the shaded windows of Fig. 2.6 do not represent any meaningful system
state, and a technique is needed to detect the occurrence of mixed states within a
data window.
A technique known as ‘Transient Monitor’ [2] provides a measure to indicate a
‘quality’ of the estimate and can also be used to detect the condition when a data
window contains mixed state waveforms. Consider the process of computing the
_
data samples ðx n Þ in a window from the estimated phasor which has been estimated
from a sample set (xn):
40 2 Phasor Estimation of Nominal Frequency Inputs
Pre-fault
Post-fault
Windows
with all
pre-fault data
Fig. 2.6 Transition from pre-fault to post-fault waveforms. The shaded windows contain mixed
waveform data
2 3
cosð0Þ sinð0Þ
6 cosðhÞ sinðhÞ 7" _ #
pffiffiffi6 7 Xr
½xn ¼ 26 sinð2hÞ 7
_
6 cosð2hÞ 7 _ ð2:23Þ
4 5 Xi
cos½ðN 1Þh sin½ðN 1Þh
where use has been made of the fact that N = 2π. The difference between the input
data and the re-computed sample data from the phasor estimate is the error of
estimation [tn]:
_
½tn ¼ ½xn x n
2 3
1 N2 N2 cosðhÞ N2 cosð2hÞ N2 cos½ðN 1ÞhÞ
6 7
6 N2 cosðhÞ 1 N2 N2 cosð3hÞ N2 cosð0Þ 7
6 7
¼66 N cosð2hÞ
2
N2 cosð3hÞ 1 N2 N2 cosðhÞ 7½xn
7
6 7
4 1 N2 5
N2 cos½ðN 1ÞhÞ N2 cosð0Þ N2 cosðhÞ 1 N2
ð2:26Þ
If the input signal is a pure sinusoid at fundamental frequency, all entries of [tn]
will be identically equal to zero. However, when the input signal is noisy or
contains a composite window of two different sinusoids, [tn] is not zero, and one
may use the sum (Tn) of the absolute values of its elements as a measure of the error
of estimation.
X
N 1
Tn ¼ jtk j ð2:27Þ
k¼0
This sum has been referred as a ‘Transient Monitor’ and can be used as a
measure of the ‘quality’ of the phasor estimate.
Example 2.4 Consider a composite 60 Hz voltage waveform samples described by
450
40
20
0 0
0 20 40 1 24 36 60 72
(a) (b)
Fig. 2.7 Result of phasor estimation in a data stream with mixed input signals. a Phasor
estimates. The transition from a solid phasor at 50 + j50 to a new phasor of 32.6641 + j13.5299 is
shown by open circles. b The transient monitor Tn. Note that it is high during the transition from
one phasor value to another. When the input signal is a pure sinusoid, the Tn becomes zero
i2 (t) l
e2(t)
r
This expression assumes that the current just before the occurrence of fault is
(A − C), and that the dc offset decays with a time constant T, which for the circuit
of Fig. 2.8 is equal to L/R seconds.
Consider a sample set of M data points obtained from this current waveform
where θ is the sampling angle equal to 2π/N, N being the number of samples per
cycle of the nominal frequency, and r is the decrement factor for the decaying dc
component in one sample time
r ¼ eDT=T ð2:30Þ
If we now assume that the decrement factor r is known, the only unknowns in
Eq. (2.30) are A, B, and C. Taking the overdetermined set of M data points,
2 3 2 3
i0 1 0 1 2 3
6 i1 7 6 A
6 7¼6 cos h sin h r 7 74 B 5
4 5 4 5 ð2:31Þ
C
iM1 cosðM 1Þh sinðM 1Þh r M1
As usual, the above equation can be solved for A, B, and C, and then by adding
(Cr−n) to each sample of the current, the dc offset can be removed from the
waveform.
It is possible that the value of the time constant T is not known exactly and an
approximate value must be used for ‘r’. The algorithm is tolerant of reasonable
errors in the value of ‘r’, as is seen by the following numerical example.
Example 2.5 Consider a fault current waveform with full dc offset given by
The current is zero before the occurrence of the fault. The dc offset decay time
constant is 50 ms.
2.6 DC Offset in Input Signals 45
assumed ‘T’ = 55 ms
-0.15
-0.15 0 0.15
The true value of the phasor must be (100/√2)(1 − j1). The dc offset is removed
by applying Eq. (2.31) for a window of one cycle at a time. It is assumed that an
error of ±10% is made in the decrement factor ‘r’ used in Eq. (2.31). The resulting
error in (√2 × phasor) is shown in Fig. 2.9.
It can be seen from Fig. 2.9 that the errors of estimation of phasors are less than
0.2% even though the time constant errors are of the order of 10%.
The least square solution described above is some times described as a ‘digital
mimic’ procedure. However, it must be pointed out that this process is not a
differentiator, and consequently, there is no amplification of noise in the current
signal in this process.
A number of papers dealing with the problem of computing phasors from sampled
data have been published over the last several years. Several papers consider
variations on the Fourier transform method, with special emphasis on the problem
of dealing with off-nominal frequency signals. We will consider such signals in the
next chapter, where the performance of the fixed frequency Fourier transform on
off-nominal frequency input signals will be discussed. Among the variations of the
basic Fourier technique, least squares methods, Kalman filter methods, and Prony
methods have been discussed. As the main thrust of these variations is to deal with
off-nominal frequency signals, we will defer their discussion to a later chapter.
References
1. Phadke, A. G., & Thorp, J. S. (1994). Computer relaying for power systems (pp. 127–129).
New York: Research Studies Press Ltd., Wiley.
2. ibid. pp. 151–152.
3. Mason, C. R. (1956). Art and science of protective relaying. New York: Wiley.
http://www.springer.com/978-3-319-50582-4