DSP and Power System Protection
DSP and Power System Protection
The good news is that the electrical power grid did not fail because of any
Y2K glitches. This we all know, but do you know why? It was because our
power systems have protection. This year I am on sabbatical with a company
that makes power system protective relays. For those outside the power
industry, power system protection is not money you pay to the godfather to keep
your lights on. It is the art and science of the application of devices that monitor
the power line currents and voltages and generate signals to deenergize faulted
sections of the power grid. The goal is to minimize damage to equipment and
property and maintain the delivery of electrical energy to the consumer.
Fifty years ago, electromechanical protective relays were used almost
exclusively. In general, these devices use torque generated by AC currents to
magnetically close a set of mechanical contacts. The contacts are held open or
“restrained” by a mechanical spring much like the common circuit breaker we use
in our homes. In reality, these devices were vastly more complicated.
Frequently the phase relationships of currents and voltages allowed the relay to
determine the direction of the fault relative to the relay. This makes the relays
selective resulting in deenergizing only the parts of the power grid that are
absolutely necessary to isolate the faulted section.
Computer based relaying was experimented with in the 50’s and 60’s but
were not commercially viable because of the size, expense, and reliability of
early computers. Along came the 70’s and the microcontroller revolution, which
of course, changed all of that. Believe it or not, the microprocessor-based relays
used those same torque relationships that their predecessor electromechanical
relays used. Instead of using magnetic flux to generate the torque, the
microprocessor relay computed the torque. Modern microprocessor-based relays
still use the magnitude and phase of the 60 Hz (50 Hz in Europe) fundamental
2
power voltage and currents to compute torque like quantities that determine the
existence of faults.
One of the challenges then (and continues to be today) is how to reliably
and efficiently convert sampled analog signals to magnitude and phase needed
for the torque equations. Since the fundamental component is the only signal of
interest, all other signals, whether they be harmonics, arcing noise or transients
generated by exciting the natural modes of the electrical network, are considered
noise that corrupts the signal of interest. Schweitzer and Houi reviewed seven of
the more common algorithms used to convert a time sequence to a time varying
complex vector. Only two of these algorithms are based on orthogonal basis set
decomposition similar to the Fourier transform. Discussion in the article will be
limited to only one of these algorithms because of its simplicity, efficiency, and
performance, the DFT.
Switching domains
Theory to application
So let’s try out the theory and see how it works. Lets assume that we are
dealing with a 60 Hz signal that is sampled synchronously. This means that the
sample interval is the inverse of an integer multiple of 60. We need to compute
the DFT for the fundamental using equation (1) where N equals to the number of
samples per fundamental cycle, k equal to one for the fundamental, and n is the
coefficient subscript. Because digital computers (like most of the world) don’t
really understand the concept of imaginary numbers, two digital filters are
required, one to get the real part and one for the imaginary part. Mathematically,
the coefficients of these filters are by determined using (2).
3
2 π nk (1)
− j
Ck n = e N
2 2 π nk 2π nk (2)
Ck n = cos + j sin = Ak n + jBk n
N N N
After computing the outputs of two filters using equation (3), we have the
desired complex vector shown in (4). Remember from a distant past math class
on complex variables that addition of complex numbers is easiest using
rectangular notation while multiplication is easiest using polar notation shown in
(5). For real-time applications, the conversion back and forth between the two
notations usually requires more time than can possibly be gained. Hence, the
complex variables are usually exclusively dealt with using rectangular form until
such time as a magnitude or phase is explicitly needed. This is particularly true
for processors that must use software routines for computing transcendental
functions (trig, log, and exponential functions). To further increase speed,
magnitude threshold levels are frequently left squared and angles kept as ratios.
N −1 N −1 (3)
Yn (re)= ∑ An X n , Yn (im) = ∑ Bn X n
0 0
Transition phase
The conversion process works fine when every thing is at steady state –
amplitude, frequency, and phase is held constant or is changing very slowly
compared to the frequency of interest. But faulted power systems happen in a
flash (pun intended) and these faults can be modeled as step changes as
illustrated in Figure 1. During the transition period, the DFT output changes at
each sample point until the algorithm processes a complete cycle’s worth of
steady state data. In this period, the algorithm-generated transient makes the
DFT results an inaccurate representation of both the magnitude and the phase
(Figure 2) for a signal that has already achieved steady state.
Figure 1 also illustrates a point made earlier. That being a whole cycles
worth of the steady data must be sampled and processed by the DFT before
steady state is achieved. This is true regardless of the sample rate. I will cover
more on this later. Another observation from Figure 1 is the magnitude scaling,
which for this case, it is not RMS but peak. To obtain the RMS value, you simply
make the multiplier in (2) √2/N instead of 2/N.
Looking at the phase output in Figure 2 is sure cause to wonder of what
value is it. Very little, in of itself, because phase has no value without a time or
phase reference. The difference between the two DFT phase results accurately
represents phase relationship of the two signals if they are at the same frequency
4
2π (6)
∆φ =
N
Figure 1. Sampled sine wave with four-point DFT magnitude response to a step
change.
5
FTs represent the spectrum of the sampled data with a set of discrete
frequencies evenly spaced between zero and half the sampling rate, FS, minus
one interval. The interval between the discrete frequencies is equal to the FS/2N
where N the size of the DFT or the number of coefficients determined by (1).
Figure 3 shows the frequency response of DFTs over the range of zero to 480 Hz
for N equal to four and eight. This figure also shows the effects of aliasing
around the fold-over frequency F1, F2, and F3 for the four-point filter sampled at
240 Hz and just F2 for the eight-point filter sampled at 480 Hz. The advantage of
the eight-point filter is that the filter response is zero at harmonics except the
fundamental and the (N-1)th harmonic. Odd harmonics of 60 Hz are of particular
concern because they are generated by power transformers saturation and
nonlinear loads such as switching power supplies.
6
D
Figure 3. Frequency response of a 4 and 8 point DFT with sampling rate of 240
Hz and 480 Hz respectively.
A colleague once commented that when your only tool is a hammer, every
thing tends to look like a nail. The same is true here. The DFT we are using is
looking only for 60 Hz and any energy that is passed by the filter characteristics,
regardless of the actual frequency, is aliased to appear that it is energy at 60 Hz.
But in this case, aliasing is our friend as well as our nemesis. The zeros at
harmonics on the high side of the Nyquist frequencyii (FS/2) work to our benefit.
Points to ponder
With the transient response time fixed by the fundamental frequency and
the errors resulting from harmonics eliminated by the zeros of the DFT filter
response, what’s left? Usually higher harmonics and high frequency oscillations
due to exciting natural resonance modes in the power system network are
removed by analog filtering prior to sampling. Even though the DSP filter has a
zero at DC, power system faults frequently generate other low frequency
components commonly called DC offset. It is not really DC but a slowly decaying
exponential superimposed on the AC signal as shown in Figure 5. Also shown in
this figure are the DFT magnitudes for the signal without the superimposed
exponential and the offset AC signal. If the DFT for the non-offset AC signal is
considered optimal then the other DFT is what we are stuck with.
For the power industry, it is certainly in their best interest to reduce the
response of the DFT due to the offset. One trick frequently employed is to use
only the coefficients to compute the real part of the DFT shown in (3) that are
generated by the cosine function. This is sometimes called a Cosine filter. Figure
7 shows the frequency response of the Cosine filter compared to the DFT filter.
Note that the Cosine filter favors higher frequencies and attenuates the
frequencies close to zero. This is good when trying to filter out a slowly decaying
exponential. There is also a computational advantage to eliminating the multiply
and accumulate instructions associated with imaginary term.
Note also from Figure 7 that the Cosine filter matches the response on the
DFT at 60Hz so there is no amplitude compensation required. However, off-
frequency signals will be more affected by the Cosine filter frequency response
than for DFT filters. One solution is to adjust the sampling rate to be an integer
number of the fundamental. This can accomplished by measuring the period
with a zero-crossing detector. Adjustments to the sampling period should be
slow so to track only the power system frequency changes and not frequencies
generated by transients.iii
most recent Cosine filter output the real term and the output that has been
delayed a quarter of the period of the fundamental the imaginary term as shown
in (10) and (11). Both the real and the imaginary terms now have identical
frequency responses.
N −1
2 2π n (10)
Yc n = ∑ An X n , An = cos
0 N N
Yn = Ycn + jYcn− N / 4 (11)
Since we know that the DFT of the pure sine wave is the desired output
we can make it our evaluation reference. By computing the absolute difference
between reference output and the outputs of the DFT filter and the Cosine filter,
we can see the improvement. This is done in Figure 7 labeled D1 and D2
respectively. The difference for the Cosine filter response has reduced
overshoot and achieves an overall smaller difference. The cost of the improved
offset rejection is that the filter transient is extended by the time equal to one
quarter of the period of the fundamental. This is not obvious from Figure 5
because it is difficult to differentiate the signal transient from the algorithm
transient.
Figure 7. Differences of a DFT and Cosine filter for an offset sine wave
compared to a pure DFT for a sine wave without the offset.
Wrap up
Remember the leader of the Jodi Foster movie, “Contact”. The camera is
supposedly starts at planet earth and the sound track plays what seems to be the
simultaneous audio from all radio and TV broadcasts. The camera take a path
through inter stellar space that leads further from our reality and all the while the
11
audio becomes more focused on fewer and fewer broadcasts. Finally, we’re left
with a single radio transmission of a young girl on a ham radio. I feel that this
article has taken a similar path.
The idea here is that we’re interested signals at one frequency only and
we needed an algorithm that quickly and accurately computes the magnitude and
phase of that signal. We can take advantage of aliasing to cancel harmonics if
we don’t expect that the signal will contain energy that is also passed by the
aliasing. DSP tricks can improve performance but always come at a price. It is
the responsibility of the designer to understand the application sufficiently to
know where compromises are tolerable to achieve the desired performance.
The voltages on lines that deliver power make them lethal. Relays cannot
operate fast enough to prevent serious injury or death to someone coming in
contact with an energized power line. In an emergency situation, never assume
that relays have operated and the lines are deenergized. One of the most
difficult conditions to detect is a distribution line that broken and fallen to the
ground. The fault current is so small that most relays cannot sense the fault.
Always assume power lines are energized and treat them accordingly.
i
E.O. Schweitzer and D. Hou, “Filtering for Protective Relays”, 47th Annual Georgia Tech
Protective Relay Conference, Atlanta GA. April 28-30, 1993. This article is available for
download in PDF format at http://www.selinc.com/techpprs.htm.
ii
Digital Filtering: an Introduction, Edward P. Cunningham, Houghton Mifflin Co., 1992, ISBN 0-
395-53989-7
iii
R.W. Wall and H.L. Hess, “Design of Microcontroller Implementation of a Three Phase SCR
Power Converter”, Journal of Circuits, Systems, and Computers, Vol. 6. No. 6. Mar. 1997, pp.
619-633.