1. 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.
    Dismiss Notice

200 MHz Triangular Wave

Discussion in 'Homework Help' started by Ng Jing Xi, Oct 22, 2013.

  1. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    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.
     
  2. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ
    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: Nov 14, 2013
  3. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    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.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. Ng Jing Xi

    Ng Jing Xi Member

    Joined:
    Oct 1, 2013
    Messages:
    97
    Likes:
    0

    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
     
  6. Ng Jing Xi

    Ng Jing Xi Member

    Joined:
    Oct 1, 2013
    Messages:
    97
    Likes:
    0
    Yup. I checked and it's 60MHz
     
  7. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ
    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: Nov 15, 2013
  8. JoeJester

    JoeJester Active Member

    Joined:
    Nov 6, 2009
    Messages:
    699
    Likes:
    105
    Location:
    Grand Prairie, TX
    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.
     
  9. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ
    Hi Joe,

    Oh ok that sounds good enough for now. Even 500MS/s would have been good i think.
     
  10. Ng Jing Xi

    Ng Jing Xi Member

    Joined:
    Oct 1, 2013
    Messages:
    97
    Likes:
    0
    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
     
  11. MrAl

    MrAl Well-Known Member Most Helpful Member

    Joined:
    Sep 7, 2008
    Messages:
    11,029
    Likes:
    951
    Location:
    NJ
    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.
     
  12. Ng Jing Xi

    Ng Jing Xi Member

    Joined:
    Oct 1, 2013
    Messages:
    97
    Likes:
    0
    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?
     
  13. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    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.
     
  14. Ng Jing Xi

    Ng Jing Xi Member

    Joined:
    Oct 1, 2013
    Messages:
    97
    Likes:
    0
    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?
     
  15. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    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.
     
  16. Ng Jing Xi

    Ng Jing Xi Member

    Joined:
    Oct 1, 2013
    Messages:
    97
    Likes:
    0
    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]
     
  17. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    A level shifter is easy to make.
    But I made a mistake on this one. See the corrections on my next post.
     
    Last edited: Dec 11, 2013
  18. Ng Jing Xi

    Ng Jing Xi Member

    Joined:
    Oct 1, 2013
    Messages:
    97
    Likes:
    0
    I tried out the schematic below. I insert a DC reference of 12V. This is the waveform I got.
     

    Attached Files:

  19. audioguru

    audioguru Well-Known Member Most Helpful Member

    Joined:
    Mar 16, 2004
    Messages:
    32,444
    Likes:
    936
    Location:
    Canada, of course!
    ONLINE
    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?
     
  20. Ng Jing Xi

    Ng Jing Xi Member

    Joined:
    Oct 1, 2013
    Messages:
    97
    Likes:
    0
    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.
     

    Attached Files:

  21. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,254
    Likes:
    1,218
    Location:
    Cardiff, Wales
    AG has already told you the maximum would be 10V.
     

Share This Page