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.

200 MHz Triangular Wave

Status
Not open for further replies.
Yes, changing R2 or R3 will change the frequency in addition to changing the output level. The opamp slews faster when its output level is reduced.
I was thinking that stray capacitance was cutting the high frequency points off the triangle wave when the divider resistors were the high value of 10k ohms.
 
Hi,

Actually there are a few reasons why the triangle could have a rounded top.

First though is that the rounded top may be ok for use with PWM. It just means that the loop gain goes down for some pulse widths if you use feedback. If you dont use feedback it results in a small amount of distortion.

But another reason for the cause would be that the 'comparator' section of the circuit also acts as an integrator over a short time period when the polarity of the output is trying to change. In the ideal circuit the integrator section is designed with the idea that the comparator puts out a rectangular wave with very fast rise and fall times. But slow down those rise and fall times and what we end up with is the integrator section gets a ramp input for part of the time and rectangular for the remainder of the time. The ramp part happens because of the 'comparator' slew rate, so improving the slew rate would help get the triangle points sharper.
That's of course if you really needed them sharper, which you may not if you use feedback. If you dont use feedback, then the wider pulse widths will be a little wider than they should be relative to the other pulse widths, so there will be a little distortion near the peaks of a test signal like a sine wave which for a reconstructed wave would look like a sine wave with peaks that are a little too sharp. This somewhat smaller effect may still be acceptable though.

A second reason is the response of the op amp in the op amp section. The 'point' of the triangle is after all generated by the op amp too, and the point requires higher bandwidth than the ramping part. Higher bandwidth for the op amp should improve the pointedness of the triangle, provided the comparator section comparator slew rate is also improved.

Most of these problems can be helped also by reducing the signal amplitude within the circuit. For example, if the comparator as is has to slew from -8v to +8v, changing the circuit so that it only has to slew from -4v to +4v would be almost the same as having a comparator IC slew rate twice as fast as before. Reducing to a range of -2v to +2v would also improve another two times.

Same goes for the op amp section. If the output of the op amp IC (not the divider) can be reduced by 2 times, that could also improve the triangle points sharpness.

I dont know what the spec's are for your scope, but you could also check that to see if the scope bandwidth is affecting the triangle points too.
 
Last edited:
The scope is shown as a 60MHz one in post #15. It is digital and has a "bandwidth limit" switch and we do not know its setting.
 
Hi,

Actually there are a few reasons why the triangle could have a rounded top.

First though is that the rounded top may be ok for use with PWM. It just means that the loop gain goes down for some pulse widths if you use feedback. If you dont use feedback it results in a small amount of distortion.

But another reason for the cause would be that the 'comparator' section of the circuit also acts as an integrator over a short time period when the polarity of the output is trying to change. In the ideal circuit the integrator section is designed with the idea that the comparator puts out a rectangular wave with very fast rise and fall times. But slow down those rise and fall times and what we end up with is the integrator section gets a ramp input for part of the time and rectangular for the remainder of the time. The ramp part happens because of the 'comparator' slew rate, so improving the slew rate would help get the triangle points sharper.
That's of course if you really needed them sharper, which you may not if you use feedback. If you dont use feedback, then the wider pulse widths will be a little wider than they should be relative to the other pulse widths, so there will be a little distortion near the peaks of a test signal like a sine wave which for a reconstructed wave would look like a sine wave with peaks that are a little too sharp. This somewhat smaller effect may still be acceptable though.

A second reason is the response of the op amp in the op amp section. The 'point' of the triangle is after all generated by the op amp too, and the point requires higher bandwidth than the ramping part. Higher bandwidth for the op amp should improve the pointedness of the triangle, provided the comparator section comparator slew rate is also improved.

Most of these problems can be helped also by reducing the signal amplitude within the circuit. For example, if the comparator as is has to slew from -8v to +8v, changing the circuit so that it only has to slew from -4v to +4v would be almost the same as having a comparator IC slew rate twice as fast as before. Reducing to a range of -2v to +2v would also improve another two times.

Same goes for the op amp section. If the output of the op amp IC (not the divider) can be reduced by 2 times, that could also improve the triangle points sharpness.

I dont know what the spec's are for your scope, but you could also check that to see if the scope bandwidth is affecting the triangle points too.

Hi,

You were talking about using feedback but what feedback are you referring to? And what are the connections?
So other ways like reducing the output voltage also helps in shaping a better triangular wave?
The BW limit is around 60MHz
 
Hello again,

60MHz, is that the bandwidth itself or is it really 60MSPS (60 megasamples per second). If it is 60MHz that sounds good enough for now, but also check the samples per second spec.

Yes, reducing voltage often helps the bandwidth because of the slew rate which limits the rate at which the output can change relative to the voltage level. The output can go from 0 to 1v twice as fast as it can go from 0 to 2v, and it can go from 0 to 2v twice as fast as it can go from 0 to 4v, and so on.
The faster the comparator output can change the faster that curvy part completes and the triangle again ramps normally. This may or may not affect the wave that much depending on the speed and the frequency and also the modulation level. If the slew takes 10 percent of the time of one half of the cycle, it's going to show up in the output triangle wave as a curve, but if it takes only 1 percent of the time it wont show up as much.

Actually feedback is used in switching converters. The PWM generates the output voltage which in this case is DC. The DC is fed back to the controller which changes the pulse width based on the DC level as compared to a fixed reference voltage. If the output is not high enough for example, the controller makes the pulse width wider. That in turn makes the DC output go higher thus correcting the error. So in this case the shape of the triangle does not have to be perfect because if there is an error the controller makes up for it, as long as the triangle ramp itself is monotonically increasing, which is usually the case. The loop gain does change so there is a slight question of stability that comes up, but if the triangle doesnt deviate too much it works anyway. This means we can sometimes get away with using a triangle that is actually a sawtooth, and a poor one at that because even charging a capacitor through a resistor generates a pseudo sawtooth with the initial ramp increasing faster than toward the end of the ramp.

Since you are using AC though you'd have to use the AC source as the reference, and compare the filtered output of the PWM to the reference in order to generate an error signal. This would be more complicated than in a regular switching regulator made for DC output rather than AC, but it's the same principle. How well you can get this to work at 200Mhz though im not sure, it would take some work.

Using no feedback, if the triangle deviates from perfection then there is always going to be an error in the output PWM, but only near the 100 percent modulation level if the deviation is only near the peaks of the triangle, and this would be perceived as a distortion in the signal. With a small deviation though there should be no problem.

Another idea which is more simple is to simply keep the modulation factor below some known level where it begins to create too much distortion. This would be the point where the sine wave peak amplitude starts to get close to the triangle wave peak amplitude. The triangle wave chops up the sine wave (or other signal) through comparison in the output PWM comparator. If there is never a comparison done when the triangle is near it's curvy peak part, then there is never distortion caused by that curvy peak. So simply keep the modulation factor a little lower than 100 percent. That means keep the input signal maximum peak amplitude a bit lower than the triangle peak at all times. The only drawback here is that you can not achieve a perfect 100 percent modulation, but you can still get very close using a triangle that only curves a little near the top. Obviously if it curves for too long it will create a lot of distortion, but just a little should be ok like this.
 
Last edited:
according to the posted photos ... it's 60 MHz and 1Gs/s for that model oscilloscope.

Of course there is no way to know the last calibration date.
 
Hi Joe,

Oh ok that sounds good enough for now. Even 500MS/s would have been good i think.
 
Hi again,

Just a couple of questions, for the triangular wave circuit. If I were to remove the GND at the non-inverting and the inverting inputs and replace with a +6VDC, will it be possible to create a DC offset for the triangular waveform
 
Hi,

I think you can do that but it will upset the symmetricalness of the triangle wave. So the triangle would shoot up faster than it falls. The reason is because the comparator output goes to ground regardless what offset you use, so it's only symmetrical with a certain offset like zero.

We could look for ways to improve this action if you really need it, or you could just add an output op amp that changes the offset with an adjustment.
 
Hi,

I think you can do that but it will upset the symmetricalness of the triangle wave. So the triangle would shoot up faster than it falls. The reason is because the comparator output goes to ground regardless what offset you use, so it's only symmetrical with a certain offset like zero.

We could look for ways to improve this action if you really need it, or you could just add an output op amp that changes the offset with an adjustment.
So if I were to use something like a level shifter. I would have to pass my triangular wave into another op-amp. Lets say LM393. Then include a Vref at the input. Then the output of the LM393 will be a triangular wave with a DC offset?
 
So if I were to use something like a level shifter. I would have to pass my triangular wave into another op-amp. Lets say LM393. Then include a Vref at the input. Then the output of the LM393 will be a triangular wave with a DC offset?
No.
An LM393 is a dual comparator, not a dual opamp. A comparator cannot produce a linear triangle wave because its output switches high or low, never in between like a linear opamp can do.
 
No.
An LM393 is a dual comparator, not a dual opamp. A comparator cannot produce a linear triangle wave because its output switches high or low, never in between like a linear opamp can do.
Then if I use just a basic LM741?
And just to add on, when you say output switch to high or low. If the comparator is using dual supply, it won't switch to high to 0 right?
 
A 741 opamp was designed 46 years ago and has terrible performance today. It can make a 400Hz triangle wave fairly well but not a higher frequency.

If the comparator uses a dual supply then since it does not have a 0V (ground) pin then its output switches from almost the negative supply voltage to the positive supply voltage.
 
If thats the case, how do I go about using level shifter in a dual supply configuration to create a DC offset for my triangular wave?
Assuming that I uses a TL072 op amp. [The same opamp used to generate my triangular wave]
 
A level shifter is easy to make.
But I made a mistake on this one. See the corrections on my next post.
 
Last edited:
A level shifter is easy to make.
I tried out the schematic below. I insert a DC reference of 12V. This is the waveform I got.
 

Attachments

  • 2013-12-11 10.04.04.jpg
    2013-12-11 10.04.04.jpg
    1.3 MB · Views: 386
You forgot to post the schematic of your level shifter. It looks like its gain is more than 1. Is the shifting DC input +12V or -12V?
Your 'scope photos are useless because 0VDC is not marked.

It looks like your original triangle wave has a reference voltage of 0V, a peak voltage of 7.5V (15V peak-to-peak) and swings from -7.5V to +7.5V.
With a plus 12V and -12V supply, the maximum output from a TL072 is about +10V and -10V.
Then the level can be shifted only 10V - 7.5V= 2.5V, not 12V.

Since the opamp is inverting with a gain of 1 then a +12VDC input to the inverting input resistor is much too high. The output will be saturated as low as it can go (-10V) until the input voltage swings low for part of the triangle waveform. Then the output will be a positive part of the triangle waveform.

If the shifting input is +2V then the output triangle wave will have a reference of -2V and will be from -9.5V to +5.5V.
If the shifting input is -2V then the output triangle wave will have a reference of +2V and will be from -5.5V to +9.5V.

But what voltages do you want the output triangle wave to be?
 
You forgot to post the schematic of your level shifter. It looks like its gain is more than 1. Is the shifting DC input +12V or -12V?
Your 'scope photos are useless because 0VDC is not marked.

It looks like your original triangle wave has a reference voltage of 0V, a peak voltage of 7.5V (15V peak-to-peak) and swings from -7.5V to +7.5V.
With a plus 12V and -12V supply, the maximum output from a TL072 is about +10V and -10V.
Then the level can be shifted only 10V - 7.5V= 2.5V, not 12V.

Since the opamp is inverting with a gain of 1 then a +12VDC input to the inverting input resistor is much too high. The output will be saturated as low as it can go (-10V) until the input voltage swings low for part of the triangle waveform. Then the output will be a positive part of the triangle waveform.

If the shifting input is +2V then the output triangle wave will have a reference of -2V and will be from -9.5V to +5.5V.
If the shifting input is -2V then the output triangle wave will have a reference of +2V and will be from -5.5V to +9.5V.

But what voltages do you want the output triangle wave to be?

For the output triangle, I want it to shift from +/- 7.5 to [0v - 15V]
For my scope, the channel arrow represent the 0V ref.
 

Attachments

  • Triangular Wave offset.JPG
    Triangular Wave offset.JPG
    63.8 KB · Views: 406
  • 2013-12-11 10.04.04.jpg
    2013-12-11 10.04.04.jpg
    1.1 MB · Views: 401
I want it to shift from +/- 7.5 to [0v - 15V]
AG has already told you the maximum would be 10V.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top