Triangular wave forms

Thread Starter

John54321

Joined Apr 1, 2015
39
Hi Wbahn

I was having trouble doing what you said so did it using the phone. Yes it looks correct im just making sure before i work the other formulas out for the 3rd 5th and 7th harmonics. Like i said i never use Excel so its just piece of mind its ok.

Thanks

Hi Wbahn

I have put the other formulas in im not sure this is correct ?

Thanks
 

Attachments

panic mode

Joined Oct 10, 2011
2,761
Hi Veracohr

These were the calculations on the attached pic

3rd harmonic = A3 = 1/3sqt 100 sin (wt)
5th harmonic = A5 = 1/5sqt 100 sin (wt)
7th harmonic = A7 = 1/7sqt 100 sin (wt)

Yes, each harmonic will have amplitude but frequency also must change accordingly.

Hi Wbahn
I have put the other formulas in im not sure this is correct ?
Thanks
Why are you showing so many curves?
Create row or column for each harmonic as shown, then sum all harmonics and plot just one curve (sum). You should get something that looks not perfect but close to triangular wave....
 

Thread Starter

John54321

Joined Apr 1, 2015
39
Bec
Yes, each harmonic will have amplitude but frequency also must change accordingly.


Why are you showing so many curves?
Create row or column for each harmonic as shown, then sum all harmonics and plot just one curve (sum). You should get something that looks not perfect but close to triangular wave....

Because it shows each harmonic, as you can see in previous posts I never use excel. But when I've got the formulas sorted it will look better than drawn by hand.
 

WBahn

Joined Mar 31, 2012
30,084
Posting .doc files is frowned upon because (1) many people can't open them and (2) they can contain macros that are malware (though so can .pdf files, but it is much rarer).

The resolution you were table to achieve when you pasted your screen shot into your doc file makes it hard to read. Just paste it into Paint and save it as a .png file. To reduce the file size, crop the picture to the area you want and then resize it to be something on the order of 600 pixels wide.

Showing each harmonic is fine, but you also need to show the sum of the curves (and preferably show it is a darker, thicker curve that stands out.

You have some problems even before you touch Excel. What are the harmonics that you are getting? What do you know the even harmonics should be? Does it make sense that the amplitudes of your harmonics aren't changing?

Once you get to Excel, you have some more problems. You are only taking 20 data points over the entire period of the fundamental. But as you go to higher harmonics that is insufficient. You should sample the signals frequently enough so that you get at least ten data points per cycle even for your highest frequency harmonic. One of the nice things about a spreadsheet is that this is very easy to do. Instead of 20 data points, use 1000.
 

WBahn

Joined Mar 31, 2012
30,084
Your image capture is much better. Thanks.

Since you are trying to create harmonic signals that add up to a triangle wave, you need to make a column that adds up all the harmonics and then plot it to see if it is starting to look like a triangle wave.

In your next post, please put the spreadsheet away for a moment and give the equations you are using for your harmonics.

When you return to your spreadsheet, you also need to increase your sampling rate. Instead of 1 ms sampling period, use 0.1 ms.
 

WBahn

Joined Mar 31, 2012
30,084
Let's consider your waveforms and ask if they make sense.

Fourier.png
The amplitude of your triangle wave if 100 V, so it is unlikely that the amplitude of your fundamental will be 100 V since all of the other harmonics need to be added to the fundamental.

Since all of your harmonics are sine waves, you KNOW that they are zero at t=0 and also at the end of the period. Furthermore, you know that they will be zero at the middle of the waveform. Look at your plot for your third harmonic. It looks like it has been shifted by one millisecond.
 

Thread Starter

John54321

Joined Apr 1, 2015
39
Let's consider your waveforms and ask if they make sense.

View attachment 89315
The amplitude of your triangle wave if 100 V, so it is unlikely that the amplitude of your fundamental will be 100 V since all of the other harmonics need to be added to the fundamental.

Since all of your harmonics are sine waves, you KNOW that they are zero at t=0 and also at the end of the period. Furthermore, you know that they will be zero at the middle of the waveform. Look at your plot for your third harmonic. It looks like it has been shifted by one millisecond.

Im not sure why it has done that unless this formula is wrong

The formula for the 3rd harmonic

V3= voltage of the 3rd harmonic 100/(3*3)
100/9=11.1volts

=100/9*SIN(3*2*PI()*50*A5-PI)

thanks
 

WBahn

Joined Mar 31, 2012
30,084
Hi WBahn

Please look at the attached this looks better thanks.
You STILL won't show the summed waveform.

You STILL won't increase the sampling rate to something appropriate (and you can see the visible distortion in the higher harmonics that results).

You STILL won't provide the formula you are using to calculate your coefficients.

I can't force you to do any of those things, but I CAN choose to stop wasting my time trying.
 

JoeJester

Joined Apr 26, 2005
4,390
If you had MORE time increments, you wouldn't need to use the "smoothed line" function in excel. You were asked a few times by WBahn to change your time to increment by 100 uSec vice 1 mS. You would have had 200 measurement points, and using the copy down function, it would be a snap.

Your x-axis is not properly labeled. It is currently the sample number. This is why the start of the rise happens at 1 vice all the way to the left of the axis.

Your graph labeled Fundamental frequency has the fundamental frequency and all the harmonics present. You might want to change the name of that graph.
 

WBahn

Joined Mar 31, 2012
30,084
Hi WBahn


This is hopefully it. I have used this site for help if you think your wasting your time dont reply but thanks for guidance.
Thank you for FINALLY showing the summed waveform. You appear to be plotting that as a LINE plot and not an X-Y (scatter) plot.

You STILL won't increase your sampling rate to something reasonable. WHY NOT?

You are relying in the curve fitting algorithm of Excel to plot a smooth curve and that curve is not the sinusoid that you want it to be.

To see that this is the case, plot the points with straight lines between them.

Using 1.0 ms per sample:

Fouier_1000us.png

Do those look like acceptable sinusoids to you? If not, then don't rely on a polynomial curve fitting algorithm to turn them into ones.

If you increase the sampling rate to 0.1 ms per sample, like I've been trying to get you to do for some time, you get the following:

Fouier_100us.png
Again, those are with straight lines between data points.

Why do you insist on using 1 ms per data sample?
 

Thread Starter

John54321

Joined Apr 1, 2015
39
Thank you for FINALLY showing the summed waveform. You appear to be plotting that as a LINE plot and not an X-Y (scatter) plot.

You STILL won't increase your sampling rate to something reasonable. WHY NOT?

You are relying in the curve fitting algorithm of Excel to plot a smooth curve and that curve is not the sinusoid that you want it to be.

To see that this is the case, plot the points with straight lines between them.

Using 1.0 ms per sample:

View attachment 89466

Do those look like acceptable sinusoids to you? If not, then don't rely on a polynomial curve fitting algorithm to turn them into ones.

If you increase the sampling rate to 0.1 ms per sample, like I've been trying to get you to do for some time, you get the following:

View attachment 89468
Again, those are with straight lines between data points.

Why do you insist on using 1 ms per data sample?
I apologise I didn't understand what you meant. So rather than Ms I move the decimal point ? Thanks for your help
 

WBahn

Joined Mar 31, 2012
30,084
I apologise I didn't understand what you meant. So rather than Ms I move the decimal point ? Thanks for your help
I don't understand what you mean by "rather than Ms I move the decimal point".

Your spread sheet is using 21 sample points from 0 ms to 20 ms in 1 ms increments. This is too little for the higher harmonics. I am recommending that you use a couple hundred sample points over that same interval. If you use 0.1 ms increments then you will have 201 sample points. As indicated the first time I recommended this, a good rule of thumb is to use at least 10 samples per cycle for your highest harmonic. Your highest harmonic is 7*50 Hz = 350 Hz. This is a cycle period of 2.86 ms. So you should use a sampling interval of less than 0.29 ms. If we push this limit and set it to 0.3 ms, we get the following (using straight lines between samples):

Fouier_300us.png

Do you see how you can just start seeing the distortion in the waveforms?
 

Thread Starter

John54321

Joined Apr 1, 2015
39
Morning Wbahn

So to acheive your graph i need to continue the time (ms) down to 0.3? I did this and then tried the graph it looked nothing like your graph.

Thanks
 

WBahn

Joined Mar 31, 2012
30,084
Morning Wbahn

So to acheive your graph i need to continue the time (ms) down to 0.3? I did this and then tried the graph it looked nothing like your graph.

Thanks
No. It's the INCREMENT that you need to change.

You chart is based on 21 samples that go from t =0 ms to t = 20 ms in 1 ms increments (each row represents a time step of one millisecond past the prior row).

You need to go between the same time limits, namely t = 0 ms to t = 20 ms, but you need to go in smaller increments. I recommend using an increment of 0.1 ms (0.3 ms is the largest increment I would consider, but more is better and 0.1 ms is a nice value to work with, though so is 0.2 ms). This would mean that you would have 201 rows with each row being 0.1 ms past the row before.

There is a trivial way to make this easy. Pick a cell and put the time increment in it. Say this cell is A2 and you put 0.0001 in it (0.1 ms in seconds). Now your first row of data will have the value in the time column hard set to 0; let's say that this happens to be cell A5. The cell below this (A6, the time value for the next row) will have the equation "= A5 + $A$2", which will add the value in cell A2 to the value in the cell above it. If you then copy this cell downward, the A5 will change to always be the address of the cell above it while the A2 will remain the same -- that's what the dollar signs do, the force that part of the address to be "absolute" instead of "relative".
 
Top