Transcript
Introduction to Harmonic Calculations
Hello, everyone, and welcome to today’s webinar. Today we’re talking about harmonic calculations. How do you go from the time domain to the frequency domain? We’re gonna walk through what is the frequency domain and what that means, and then go into some more detail on mathematically how do you go from a waveform where you’re looking at a time series to something where you’re looking at the frequency components, and we’ll walk you through how that works.
The Frequency Domain and Sine Waves
When we talk about the frequency domain, we’re talking about sine waves. A sine wave is a function that has the characteristic shape shown here in the graph, and there are only three properties that uniquely identify a sine wave:
- Its amplitude, how big it is, which can be measured as an RMS value or a zero to peak value or even a peak to peak value.
- Its frequency, how many times per second it goes through its characteristic shape.
- Its phase angle, which you can think of as a time shift left or right, usually with respect to another sine wave, like phase A voltage sine wave.
These three numbers uniquely determine a sine wave. There’s no other information you can say about a sine wave besides its amplitude, its frequency, and its phase angle. There are a lot of properties that I won’t get into here that really govern why sine waves pop up in every branch of engineering, not just electrical engineering.
Harmonics and the Fourier Theorem
Harmonics are sine waves whose frequencies are an integer multiple of the power line frequency. We talk about these because of the Fourier theorem, which states that any distorted waveform, no matter what the distortion looks like, can be represented as a combination of harmonics or sine waves that are multiples of the power line frequency, provided that distortion is the same every cycle. It needs to be periodic.
So if you have a sustained waveform shape that’s distorted every cycle, you can represent that as a combination of harmonics that are added together mathematically. Each harmonic is just a pure sine wave, though when added together, they create a distortion pattern.
Time Domain vs. Frequency Domain
These are the two ways of looking at the data. You can look at the time domain or the frequency domain, what frequency components are present. We have the time domain representation shown here. We have voltage and current, voltage in red, current in blue, and there you can see distortion in both waveforms, but we’re looking at the points as a function of time. The x-axis here is time, and here we see the raw shape, and we can compute the RMS value in the time domain. We can do a lot of analysis in the time domain, but the frequency domain is also helpful.
In the frequency domain, we see what components are present, what harmonics add together to reproduce that same shape. Here we have a limited time plot in the top, and here we’re looking at voltage and current, and this is frequency on the x-axis rather than time. The harmonic number is effectively frequency. This is the fifth harmonic at three hundred hertz. We have the seventh harmonic. This fourth harmonic is one times sixty of the fundamental, and we can see what level all these harmonics are that add up mathematically to produce the same signal.
Equivalence of Time and Frequency Domains
We can look at a sine wave in the time domain, which has the characteristic shape. In the frequency domain, a pure sine wave is a vertical line whose height is the amplitude of that sine wave, and whose position on the x-axis depends on the frequency. Only one frequency component is present if it’s a pure sine wave.
Conversely, if we look at an impulse in the time domain, in the frequency domain, that has broadband energy. Something that has a very fast rise time or changes very sharply in the time domain has energy at many different frequencies in the frequency domain. These are both equivalent ways of looking at the same signal. You can go, without any loss, from one to the other and use the one that is most convenient for the analysis you’re doing.
As an example of how they’re equivalent, we can compute the RMS value from the points in the raw waveform in the time domain, or we can get the same mathematical number by using the amplitudes of the harmonics. We get the same RMS value in either domain.
The Discrete Fourier Transform
So how do you go from the time domain to the frequency domain? What’s involved mathematically when we do that? We use a tool called the discrete Fourier transform, the DFT, and that is this equation we’ve highlighted right here. This is the standard textbook form you’re gonna find.
Parts of the equation: big X sub k is the frequency domain bin. Your little x sub n is the point in each sample. So for a two hundred and fifty-six point waveform captured in the time domain, two hundred and fifty-six points along this shape, you’ll pass those in one at a time and multiply by this Euler constant here.
This Euler identity breaks out to e to the j anything is basically cosine of theta plus sine of theta, and that’s where this equation comes from. It’s a little bit easier to work with than the exponential. You take cosine of two pi kn over N, where big N is the number of points that you’re sampling in your Fourier transform. So if you’ve got two hundred and fifty-six or five hundred and twelve or sixty-four or a hundred and twenty-eight, that’s your big N.
K is your frequency domain, so that’s your harmonic number. We run from zero, which is your DC component, and one is your fundamental. On a sixty hertz electrical system, k of one is gonna be a sixty hertz component. K of two is gonna be your second harmonic or a hundred and twenty hertz. K of three is gonna be a hundred and eighty hertz, et cetera. It’s an integer multiple of the frequency that you’re looking at.
Fast Fourier Transforms
You’ll notice that we run the whole length of the points once, then we run them again. So it’s a really expensive computation. There are some techniques and implementations that you can use that speed this computation up. They’re called FFTs or fast Fourier transforms, and they reduce the number of computations in that loop by a whole order.
Bin Width and IEEE/IEC Definitions
Going down into some of the definitions of the IEEE and IEC definitions for harmonics and harmonic subgroups and harmonic groups. For the Fourier transform, we’re looking at the five hertz bins which are required by the IEEE 519 standard. You can compute your bin width by taking your sampling frequency F sub s and divide it by the number of points that you have available in your time domain. We can solve for BW, FS, or N. As long as we have any two of these, we can solve that.
If we want five hertz bins, which is what we need for a harmonic computation, let’s say five hertz and our sampling frequency is two fifty-six times sixty. Two fifty-six samples a cycle is sixty hertz, and then we can solve for N. N basically tells us we have to have twelve cycles. So two fifty-six times sixty times twelve divided by two fifty-six times twelve is fifteen three sixty over thirty seventy-two gives us five hertz.
The next equation here says if we wanna solve for the thirty-sixth index or the thirty-sixth bin in the frequency domain, here’s how it would look. X of n would take the point two times two pi times three n over thirty seventy-two, so you get the two pieces of this complex output.
Complex Output, Magnitude, and Phase Angle
Worth noting that for the DFT and the FFT, they’re mathematically equivalent. The outputs are always complex. Even if you have a real valued input, like all of PMI’s data that we’re gonna give you is real valued input, the output of a DFT is always complex.
When looking at the magnitudes, you can compute the magnitude. It’s your Pythagorean theorem. It’s your real squared plus the imaginary squared, square root. A squared plus B squared equals C squared. It’s the same identity there. And you have a normalization constant that helps get the magnitude back up.
The other cool part about getting the complex output is that you can get the actual phase angle, as discussed earlier. Remember we talked about the three fundamental parts of a sine wave: the amplitude, frequency, and the phase angle. You can extract all of that with a Fourier transform. The amplitudes come directly in the bin by computing with the norm. The phase angle we can get by taking the inverse tangent of the imaginary part of the output over the real part of the output, and that’ll actually give you the phase angle for each individual component. Each individual frequency, you can find phase angle for those bin by bin, k being the frequency domain output.
Harmonic Groups and Subgroups
The paper goes a little bit further in how we compute harmonic groups and subgroups. For instance, it’s a 15 Hz group, so we take three of them, take the RMS of those. We’ll take X sub one, two to N, however many it is over N, take square root, literally the root of the mean of the squares.
In summary, we have a good example of this. For instance, you wanna get the thirty-six. That group, you take thirty-five, thirty-six, thirty-seven, square them, sum them, and then divide by three to get the mean, and then you take the root of the mean of the squares and your RMS for that group.
That really is just kind of a primer on the tools you need, the DFT, and a couple of properties of complex numbers is really all you need to be able to compute the frequency domain and your harmonics from any time domain signal, which you can export from ProVision™ or PQ Canvass™ if you like.
Harmonic Analysis in PQ Canvass
To show you how you do this in PQ Canvass™, we have an example in the figure two. Here is PQ Canvass™, and we’re looking at a recording from a Seeker™. We can look at the time domain version of the waveform. We have three-phase voltage and current. And we can also go to the frequency domain version. If you click this little bar chart symbol, it will launch the FFT output.
We’re looking at the time domain at the top, and this rectangle that we’re moving around is one cycle long. PQ Canvass™ computes the frequency components and puts them in bar chart form here at the bottom. We have voltage, current, and harmonic power. We can turn the fundamental on where we can see we have mostly 60 Hz in voltage, which is always the case, and we still have a fair amount of harmonics that’s noticeable for current.
We can turn the fundamental off with the F hotkey to let the scaling bring out the details of the harmonics for voltage a little bit better. We see fifth harmonic voltage of some seventh harmonic. Those are characteristic of three-phase AC to DC rectifiers.
Transient Analysis Using the FFT Tool
Since the waveforms are mostly the same, this is a steady state harmonic situation. The harmonic levels are roughly the same no matter where we move this rectangle. If we had a disturbance in the waveform, then it would matter more where we’re gonna put this.
For example, here we have a disturbance, and if we put that over that oscillatory transient, now we’re looking at the ring frequency, and we can see that we’ve got peaks here at the 19th harmonic and the 22nd, 23rd harmonic. These aren’t really harmonics because it’s not periodic distortion. If you remember from the very beginning of this presentation, the harmonic representation is really only valid for steady state waveform shapes, where it’s the same distortion every cycle. That’s an inherent assumption when we take an FFT or a DFT.
Here we’re using this harmonic analysis tool to compute the ring frequency of this transient. This peaks here at certain harmonics, but that doesn’t mean we have those harmonics present on a steady state basis. This just means this is where the resonant frequency is for the circuit, and it’s a little bit different on phase C than it is for A and B in this situation. If we move the rectangle to before that transient, now we’re back to looking at steady state harmonic distortion, which is much better looking than during this transient.
Harmonic Power
We can discuss the power of harmonics magnitude in the bottom chart. With the harmonic representation, you can really only generate power with voltage and current at the same frequency. If you, for example, have 60 Hz voltage and 300 Hz current, the product of those two is power on an instantaneous basis, but there’ll be no net power over a 60-hertz cycle. In some instances, power will be positive, some will be negative. You can only generate power with harmonic voltage and currents at the same frequency.
So with that, that gives you a real and reactive power triangle at every harmonic. Here, there’s not enough voltage or current at any frequency to generate any significant amount of power. This is all zero or negative six watts, basically the noise. But if you had a significant amount of, say, third harmonic voltage and third harmonic current, you would then have third harmonic power, and that power would have a direction to it. It can be either going to the load or coming from the load. In some cases, that can be an indication of whether the load is injecting that harmonic current or whether it’s drawing that because the voltage is distorted.
Harmonic Phase Angles in ProVision
Most harmonic charts tend to show all harmonics starting at the same moment as their phase angle shift between harmonics. In general, each harmonic frequency will have its own phase angle that you can actually get to within the software, but that’s not normally that useful. That’s why the bar charts almost never show the phase angle component rather than showing the magnitude component, because in most cases, the phase angles of harmonics are not that useful.
I can show in ProVision™ how we do this. I’m gonna launch ProVision™ and show you how to look at harmonic phase angles. You can also record harmonic phase angles with a PMR recorder as strip charts, but in general, you typically don’t do that.
I’m gonna pick a random waveform, and hopefully this has some useful frequency components to it. I’m gonna jump to the harmonic graph in ProVision™. Now we have the same chart that we’re looking at in PQ Canvass™, but again, the phase angles for the harmonics are usually not that helpful, especially as you go up in frequency.
Here we’re now looking at ProVision™, where we’re seeing the phase angles of each of the harmonics as vectors. You can click on this up and down arrow to scroll through each of the components. And then back into the graphical view. I’ll do this again and launch a waveform. Just pick at random and look at the harmonic graph, and then right click and choose Launch Report to get to the numbers, where we’re seeing the magnitudes for each harmonic for voltage, current, and for real power, and also the phase angles.
How often is the real harmonic spectrum in phase shift? Pretty much always. There’s always going to be phase shifts from zero crossing a phase A voltage on the harmonics. But those phase shifts usually aren’t that useful for diagnostic purposes because it really depends heavily on the system impedance of those frequencies, which is changing pretty often. If I go back to the vector diagram, you can see the phase angles for each of the harmonics in there. As you go up in frequency especially, they’re kinda all over the place.
Wrap-Up
Well, that wraps up the presentation for this paper. If you have a question later, give us a call anytime at 1-800-296-4120, or send an email to support@powermonitors.com. Thanks for attending.