Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Triangle wave generator for pwm

Status
Not open for further replies.
That site wants £14!!!!!! is the rest of the content worth £14??
 
Hello,

In a feedback system this effect will usually be minimal because the loop gain is large to begin with, so as long as the triangle is not too curved it works just fine (just like an op amp circuit with internal gain that is uncontrollable).
It's only in the feed forward only system that there could be a marked effect due to the change in ratio between the input and averaged output. If the triangle slope was different near zero as compared to near the peak then the modulated output would be distorted in a similar manner.
Hello Sir,
If i wanted to amplify a triangle wave lets say for example the Triangle wave based on the Schmit Trigger how would i go about it.
 
If i wanted to amplify a triangle wave lets say for example the Triangle wave based on the Schmit Trigger how would i go about it.
A Schmitt trigger cannot produce a triangle wave and it cannot amplify a triangle wave.
A Schmitt trigger has an extremely high voltage gain so its output is a saturated squarewave with almost any input signal.
 
I have just watched a video, the guy mad a triangle wave with a simple resistor DAC a few bits and a pic, would that help?
Great video i think the aim was to make a arbutary wave form generator.
I dont have the exact page now, but go here **broken link removed**

then go to main site, and poke around his video's, actually they are all pretty good.
 
Hello Sir,
If i wanted to amplify a triangle wave lets say for example the Triangle wave based on the Schmit Trigger how would i go about it.

Hi,

If you want to amplify a triangle then you can use an op amp set with some gain that you need. There are many ways to set this up, and you need an op amp that is fast enough to handle your triangle frequency.
If it is low frequency then you can use a general purpose op amp, but if it is high frequency then you need a much better op amp.
 
A Schmitt trigger cannot produce a triangle wave and it cannot amplify a triangle wave.
A Schmitt trigger has an extremely high voltage gain so its output is a saturated squarewave with almost any input signal.
it may not be schmitt trigger but i was talking about a triangle wave made with 2 opamps like the circuit involving the guy who wanted to make a 200MHz triangle wave. Can we amplify or buffer that triangle wave to increase its amplitude.
 
Hi,

If you want to amplify a triangle then you can use an op amp set with some gain that you need. There are many ways to set this up, and you need an op amp that is fast enough to handle your triangle frequency.
If it is low frequency then you can use a general purpose op amp, but if it is high frequency then you need a much better op amp.
Hello sir
do you have circuits for setting the gain up to show several ways on how to amplify and will a TL082 be able to handle amplifying up to 15Khz.
 
Hi,

I think TL082 can handle that but what is your output voltage peak going to be so we can be sure?
Looking at the data sheet is appears that 15kHz should be doable even with an output triangle that goes from -10v to +10v. The min slew rate should be around 5v/us so that means 2us up, 2us down, 2us down again, 2us up again for one complete cycle, and that totals 8us and that equivalent to a 125kHz symmetrical triangle, assuming that's what you have. If one slope is twice the other the max will be less but unless it is very very unsymmetrical you should get 15kHz without any problem, and that is with the supply voltages of +15 and -15 volts and output signal from -10v to +10 which is probably the maximum output obtainable.

The attached drawing shows an Amplifier and a Bias network. The bias network can be used when using a single supply such as +15v instead of plus and minus supply voltages.

If using the bias network, connect A to C and use B as the input. The gain is then R2/R1, and use capacitor coupling on the input to B. Make R4 equal to R3.

If not using the bias network (dual supply voltages available) then connect A to ground (0v) and use B as input and use capacitor coupling on the input to B if needed.
 

Attachments

  • GeneralPurposeOpAmpAmplifier-1b.gif
    GeneralPurposeOpAmpAmplifier-1b.gif
    8.3 KB · Views: 230
Last edited:
You do not need an amplifier to increase the level of the triangle wave. The ratio of two resistors in the triangle wave generator circuit adjust the output level.
 

Attachments

  • triangle wave generator.png
    triangle wave generator.png
    34.4 KB · Views: 255
Hi,

He originally said he wanted to "amplify" a triangle wave, so i gave an amplifier.
I agree however that if he is using that particular circuit then your suggestion should work just fine.
I am happy you posted that circuit as that makes it easier to read rather than going way back and searching the thread for the circuit again.
 
Why do you keep on insisting of using a triangle wave to generates a PWM when there were suggestions of using simple linear ramp, cost effective and efficient??!!
 
Hi,

I agree that a ramp can be made simpler. I assumed that this was a new question though where he was just asking about a triangle generator perhaps for a reason other than PWM.

In any case here is an updated drawing for the triangle generator showing the design formulas.

Note that R1 can be increased to increase the output voltage of the triangle, but if it is made too large then the circuit will not oscillate because the integrator will not be able to output enough voltage to trip the comparator thresholds. With R2=100k the theoretical max for R1 is 100k, but that may have to come down a little in the real life circuit.

Also note that if R1 is increased by a factor K then the RC time constant must be reduced by the same factor in order to keep the same frequency. This means either R or C or both could be reduced. So for example if R1 was doubled then one solution would be to cut the value of R in half to keep the frequency the same. If cutting R in half is not acceptable then cut the value of C in half.
 

Attachments

  • TriangleWaveGenerator-1b.gif
    TriangleWaveGenerator-1b.gif
    24.9 KB · Views: 241
Hi,

I agree that a ramp can be made simpler. I assumed that this was a new question though where he was just asking about a triangle generator perhaps for a reason other than PWM.

In any case here is an updated drawing for the triangle generator showing the design formulas.

Note that R1 can be increased to increase the output voltage of the triangle, but if it is made too large then the circuit will not oscillate because the integrator will not be able to output enough voltage to trip the comparator thresholds. With R2=100k the theoretical max for R1 is 100k, but that may have to come down a little in the real life circuit.

Also note that if R1 is increased by a factor K then the RC time constant must be reduced by the same factor in order to keep the same frequency. This means either R or C or both could be reduced. So for example if R1 was doubled then one solution would be to cut the value of R in half to keep the frequency the same. If cutting R in half is not acceptable then cut the value of C in half.
is it really necessary to use a coupling capacitor and what does it do?
 
Hi,

You would use a coupling capacitor if you have a problem with the DC offset at the output. The wave is normally centered at zero, but if it is a little higher offset then using a coupling capacitor on the input if the offset is caused by the input signal, or on the output if the wave does not clip because of the offset.
 
Hi,

I agree that a ramp can be made simpler. I assumed that this was a new question though where he was just asking about a triangle generator perhaps for a reason other than PWM.

In any case here is an updated drawing for the triangle generator showing the design formulas.

Note that R1 can be increased to increase the output voltage of the triangle, but if it is made too large then the circuit will not oscillate because the integrator will not be able to output enough voltage to trip the comparator thresholds. With R2=100k the theoretical max for R1 is 100k, but that may have to come down a little in the real life circuit.

Also note that if R1 is increased by a factor K then the RC time constant must be reduced by the same factor in order to keep the same frequency. This means either R or C or both could be reduced. So for example if R1 was doubled then one solution would be to cut the value of R in half to keep the frequency the same. If cutting R in half is not acceptable then cut the value of C in half.
Hello Sir thanks for the xplanation on the amplifier circuit but now that you showed me this circuit i read the notes and i have a question which goes like this.
Assume that i use a TL082 Opamp.
1)lets say i increase R1 say to its theoritical max of 100k there by increasing the output voltage of the triangle which means that its amplitude is increased right?
2)Since R1 is now at its max of 100k does this mean that when we adjust the resistor R assuming its a variable resistor to change the frequency up or down lets say it was at 2KHz but i increase it to say 16Khz.Now with R2 = 100k and R1 = 100k(theoretical max or better still even if we come down a little in real life we should still get increased output voltage),Will the output voltage and thereby amplitude still stay the same since output voltage should translate to higher amplitude?
As i rotate the R variable thereby changing the circuits frequency, will its output voltage and amplitude still be the same no matter the frequency since i have increased the value of R1 to get max output voltage possible?
I am not an electronics major but i try my best so pardon me.
 
You cannot use 100k for R1 because the maximum output voltage from the TL082 opamp is not symmetrical plus and minus.
Yes you can vary R to change the frequency. The triangle output level will remain the same until the frequency gets too high for the TL082, about 20kHz then the output level will drop at higher frequencies.
 
Hello Sir thanks for the xplanation on the amplifier circuit but now that you showed me this circuit i read the notes and i have a question which goes like this.
Assume that i use a TL082 Opamp.
1)lets say i increase R1 say to its theoritical max of 100k there by increasing the output voltage of the triangle which means that its amplitude is increased right?
2)Since R1 is now at its max of 100k does this mean that when we adjust the resistor R assuming its a variable resistor to change the frequency up or down lets say it was at 2KHz but i increase it to say 16Khz.Now with R2 = 100k and R1 = 100k(theoretical max or better still even if we come down a little in real life we should still get increased output voltage),Will the output voltage and thereby amplitude still stay the same since output voltage should translate to higher amplitude?
As i rotate the R variable thereby changing the circuits frequency, will its output voltage and amplitude still be the same no matter the frequency since i have increased the value of R1 to get max output voltage possible?
I am not an electronics major but i try my best so pardon me.

Hi again,

Referring again to the drawing in post #52 and the design formulas there as well.

As audioguru said in post #57, there are practical limits on the resistor values R1 and R2, or at least the ratio of those two and their minimum values. But with R2=100k then R1=100k is the "theoretical maximum" which means in a perfect circuit with exact resistor values and with ideal op amps that would be the highest we could use, but in the practical real life circuit we need to make it lower like maybe 90k or something like that. That said, we can then turn to the design formulas presented in the drawing of post #52.

Note the formula vp=R1*V/R2 first. That tells us the peak of the triangle wave knowing the output of the op amp used as a comparator. We assume some value like 10v or 12v or 13v, etc., which depends on the power supply voltage levels and the behavior of the actual op amp in the real life circuit. So from that we see that by raising R1 we get a higher output (with the limit talked about above).
Next we see another formula for the frequency:
f=R2/(4*C*R*R1)

and we note that if we change R1 the frequency changes because R1 is in the formula for f.

We also note however that R is in that formula for f too, so if we change R1 we can change R to keep the same frequency yet get a higher or lower output amplitude with R1.

But what happens if we just change R, and not R1 or R2. Well, the resistor value R is in ONLY the formula for frequency f, so only the frequency changes. R is not in the formula for the output peak amplitude, so that does not change with R.

So you see the design formulas not only help to set the values of the circuit for what we need, it also helps us understand what each resistor (or capacitor) does.

There is also a lower limit on R as well. R should be high enough such that the output current of the op amp will always be able to drive it properly as well as feed the next stage resistance whatever that ends up being. Usually a lower limit of 1k is a good idea because if the output goes to 10v then the capacitor current will equal the resistor current at some point in time and that could mean up to 10/1000 amps which is 10ma and that is a good limit for the output stage in most cases although you may want to check the data sheet for the op amp. A lower limit of R as 2k would be better yet as that would only require 5ma at 10v to drive properly.
A good upper limit for R is 100k, although you may get away with maybe 300k max depending on the environment the circuit has to work in.
 
Hi again,

Referring again to the drawing in post #52 and the design formulas there as well.

As audioguru said in post #57, there are practical limits on the resistor values R1 and R2, or at least the ratio of those two and their minimum values. But with R2=100k then R1=100k is the "theoretical maximum" which means in a perfect circuit with exact resistor values and with ideal op amps that would be the highest we could use, but in the practical real life circuit we need to make it lower like maybe 90k or something like that. That said, we can then turn to the design formulas presented in the drawing of post #52.

Note the formula vp=R1*V/R2 first. That tells us the peak of the triangle wave knowing the output of the op amp used as a comparator. We assume some value like 10v or 12v or 13v, etc., which depends on the power supply voltage levels and the behavior of the actual op amp in the real life circuit. So from that we see that by raising R1 we get a higher output (with the limit talked about above).
Next we see another formula for the frequency:
f=R2/(4*C*R*R1)

and we note that if we change R1 the frequency changes because R1 is in the formula for f.

We also note however that R is in that formula for f too, so if we change R1 we can change R to keep the same frequency yet get a higher or lower output amplitude with R1.

But what happens if we just change R, and not R1 or R2. Well, the resistor value R is in ONLY the formula for frequency f, so only the frequency changes. R is not in the formula for the output peak amplitude, so that does not change with R.

So you see the design formulas not only help to set the values of the circuit for what we need, it also helps us understand what each resistor (or capacitor) does.

There is also a lower limit on R as well. R should be high enough such that the output current of the op amp will always be able to drive it properly as well as feed the next stage resistance whatever that ends up being. Usually a lower limit of 1k is a good idea because if the output goes to 10v then the capacitor current will equal the resistor current at some point in time and that could mean up to 10/1000 amps which is 10ma and that is a good limit for the output stage in most cases although you may want to check the data sheet for the op amp. A lower limit of R as 2k would be better yet as that would only require 5ma at 10v to drive properly.
A good upper limit for R is 100k, although you may get away with maybe 300k max depending on the environment the circuit has to work in.
a question aside
1)in sinusoidal PWM does it matter which pin the sine wave is fed into?
some ppl feed the sine wave to the inverting input and the triangle wave to the noninverting input,while some do the opposite.
Does it matter?
2)Can the TL082 opamp generate triangle waves up to 30Khz comfortably.
it seems to be the only opamp available and common here where i stay
 
Last edited:
1)in sinusoidal PWM does it matter which pin the sine wave is fed into?
Yes. Swapping the inputs will invert the PWM output.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top