LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Harmonics analysis with Pulse Width Modulation

I stuck in how to show the harmonics contents of the PWM Inverter.

 

Which is the right input connect to the  signal in port of FFT power spectrum component? and then that can show the PWM inverter harmonics contents.

 

Please help me , this is my final year project 😞

Download All
0 Kudos
Message 1 of 8
(3,264 Views)

Rather than using Build Array, which just produces an array with just one element, you need to accumulate the data using a shift register so that you have many points to connect to the FFT. An FFT of one point is meaningless. I am actually surprised that the Power Spectrum VI does not throw an error

 

Since this is a student project, I will leave it to you to learn how to do that. Post back if you get stuck.

 

Lynn

0 Kudos
Message 2 of 8
(3,244 Views)

Dear Johnsold,

 

As I am new user from Labview, I hope that I can get some hints in there 😞

 

In my program which is simultate the PWM converter and the fundamental output voltage is sinewave, but that make me confused.

 

Which signal should be the input signal to the FFT component for harmonics analysis? 

 

Dose I have to simulate the 3rd,5th,7th....etc harmonics contents for analysis ?

 

Jason

0 Kudos
Message 3 of 8
(3,234 Views)

Jason,

 

The input signal to the FFT needs to be an array with many data points. Your VI has an arry with just ONE data point. Put an array indicator on the line going into the FFT VI so you can see what is going in to it.

 

An easy way to get an array from your VI is to use the chart history data. Didn't know the chart kept a history?  Click on the Detailed Help link in the context help window when the chart indicator help is shown.  You do keep the context help window open while programming, right?  You can get the history data by context-clicking on the chart terminal and choosing Create Property Node, then choose the History Data property. Note that I disconnected the Build Array output in the image below. You do not need the to DBL conversion node because the data was already DBL.

 

Chart History.png

 

 

The time domain signal will have all the harmonics so you do not need to do anything special.

 

PWM Spectrum.png

 

Lynn

0 Kudos
Message 4 of 8
(3,220 Views)

Dear Lynn,

 

Thanks for your useful information. I was successful to obtain the power spectrum from the FFT component, But I would like to know how can I get the power spectrum exactly same as my attached picture?

 

 ( In my VI, all the parameters and type of  control and carrier signal are same as the picture, but the power specturm is not the same. )

 

Which is show the x axis and y axis  is modulation frequency ratio and modulation amplitude respectively, and the modulation amplitude will be changed in different harmonics frequencies.

 

The formula also is attached. I have no idea how to apply those equation in the FFT power spectrum analyzer. 

 

In the other hand, I would like to know how to use harmonics analyzer to get the THD, since I connected the wire from modulation output to singal input of harmonics analysis and then show error.

 

Thank You!!'Cat Sad

 

Jason 

 

Download All
0 Kudos
Message 5 of 8
(3,177 Views)

Jason,

 

The spectrum in your figure 1 is the ideal spectrum which is obtained mathematically. It is based on the assumptions that the signal extends from -infinity to +infinity in time, that the frequencies are perfectly stable and known, and that there are no numerical limits on the accuracy of the calculations.

 

When you calculate a spectrum numerically on a small segment of a signal, all of those assumptions are invalid.  So you get spectral leakage - broadened peaks rather than sharp spikes. You get round off and truncation errors. The amplitudes are not what you might expect because of the leakage and numerical errors.

 

If you look only at the largest peaks, you can see a strong resemblance to the patterns in figure 1. 

 

What does THD mean when applied to a PWM signal?  I do not get any errors but do get a warning about only using the second harmonic.

 

Lynn

0 Kudos
Message 6 of 8
(3,164 Views)

Lynn

 

okay, thanks for your reply. So in  my figure1 it is a ideal case, but how can I make  the Y axis and X axis become nearly with the ideal case.

In my VI, the x axis of spectrum is 0.0x , I supposed the value is nearly with the ideal case. Do I have to add some formula to achieve? 

 

Sine I would like to analysis different combanition betwween carrier signal and control singal to compare which conbanition is the lowest one .

THD.jpg

Jason

0 Kudos
Message 7 of 8
(3,138 Views)

Jason,

 

The explanation is rather complex to do correctly. The short version is that the finite length of the data set modifies the spectrum. You can think of the finite data set as being an infinite data set which has been multiplied by a rectangular pulse which has amplitude 1 from t = 0 to t = length of data set and zero amplitude elsewhere. The spectrum of the product of two signals is the convolution of the spectra of the  individual signals. The spectrum of a rectangular pulse has a sin(x)/x shape.  Search Wikipedia for "Window function".

 

One "fix" is to modify the ends of the data set to shape the spectrum of the "window" function so that the composite spectrum is "mostly" that of the data signal. I am using "quotation marks" to empahsize that this is a qualitative discussion which is only approximately correct from a mathematical perspective. This is  a topic which can easily take an entire semester of an upper level engineering or mathematics course to cover thoroughly.

 

The attached VI is an attempt to show some of the effects of windowing and that a pretty good approximation to the ideal spectrum can be obtained.

 

Lynn

0 Kudos
Message 8 of 8
(3,125 Views)