Understanding triangle generator circuit

Discussion in 'The Projects Forum' started by andy24691, Nov 26, 2011.

  1. andy24691

    Thread Starter Member

    Nov 25, 2010
    42
    0
    Could someone explain to me how this circuit works, it produces a triangle wave of 250 kHz. Please make replies as simple as you can.

    cheers
     
  2. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
    I'm going to let you do some of your own research, the 1st part is an inverting Schmitt Trigger made with an op amp.

    http://www.allaboutcircuits.com/vol_3/chpt_8/12.html

    The second half is this is a classic Hysteretic Oscillator. It so happens a 555 can be made into a inverting Schmitt Trigger with ease, so this article will explain the oscillator section...

    555 Hysteretic Oscillator

    The triangle wave is more of a ramp function, it is not linear like a classic triangle wave generator, which is a kissing cousin of the Hysteretic oscillator (actually it is also a hysteretic oscillator, with a slight twist).
     
  3. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Hello Andy,
    Bill got to you first, but I'd already re-created the simulation to show you the wave forms.

    Have a look at the attached.

    1) When power is first applied to the circuit, C1 has no charge on it, and the junction of R1/R2 is ~1/2 of the supplied battery voltage - so the output goes high, pulling the junction of R1/R2/R3 aka "ref" even higher.

    2) Capacitor C1 charges through R4.

    3) Once C1 charges to the point where the - input is higher than the + input, the output goes low, so "ref" gets pulled lower, and the capacitor now starts discharging through C4.

    4) Once it discharges to the point where the - input is lower than the + input, the output goes high again, pulling "ref" up again, and we go back to step 2), repeating until the power gets turned off or something breaks.
     
  4. Yako

    New Member

    Nov 24, 2011
    245
    2
    The slew rate of the square is a shocker on that simulation.

    This would be close to real world though I guess.

    That circuit is called a Twin Tee I believe.
     
  5. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    I decreased the value of R3 to obtain closer to a 1/3 - 2/3 swing for the feedback; 500k was pretty ridiculous, and made for a very low-voltage triangle wave.

    The simulation with the original values was operating around 360kHz, which I'd take with a pound of salt. Changing R3 brought it down to ~100kHz.

    If you really want a square wave generator to operate in the 250kHz region, you really need a faster opamp than the TL07x/TL08x family.
     
  6. andy24691

    Thread Starter Member

    Nov 25, 2010
    42
    0
    Thank you that's very helpful, I simulated it with the 500K resistor and the amplitude was only 1V. I'm using a CA314DE op amp, would you say that this waveform would be sufficient for pwm of audio signals? Which is what I intend it to be used for.
     
  7. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Did you mean a CA3140?

    When you say "PWM of audio signals", do you mean that you are considering making a Class D amplifier? Or what did you have in mind?

    The larger R3 is in relation to R1 & R2, the more triangular the wave will be, but it will also be of lower amplitude.

    The smaller R3 will be, the greater the amplitude of the triangular wave - but it starts to resemble a sharks' dorsal fin instead of a triangle. The RC time is much more pronounced.

    If you want a real triangle wave, you will need a different circuit.
     
  8. Wendy

    Moderator

    Mar 24, 2008
    20,765
    2,536
  9. andy24691

    Thread Starter Member

    Nov 25, 2010
    42
    0
    Yes I would be using it as part of a class D amplifier, I'm not sure whether the waveform produced by this circuit is linear enough for this purpose though. Also I'm not sure what sort of amplitude I need it to be.
     
  10. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Andy,
    If you have Java installed on your computer, have a look at this simulation:
    http://www.falstad.com/circuit/e-triangle.html

    It's a rather simple triangle wave generator that actually generates a triangle wave.
    This simulator can be handy, as you can see how the current flows and what the relative voltages are as the simulation is running. It makes it easy to understand the basic functioning of a circuit. However, one really needs to use a more accurate version of SPICE to simulate a circuit before building a test circuit to see how it works with real parts.
     
  11. crutschow

    Expert

    Mar 14, 2008
    12,995
    3,229
    The circuit SW referenced will work with a fast comparator and op amp connected as an integrator to generate a very linear triangle wave.

    Here's a simulation of the circuit in LTspice with a high speed comparator and op amp, and modified for a single 5V supply.

    Triangular Wave Gen.gif
    View attachment Triangular Linear Gen 2.asc
     
    Last edited: Nov 27, 2011
    whatsthatsmell likes this.
  12. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    Almost any half-decent opamp like a TL081 or TL071 produces a triangle-wave if fed a high frequency square-wave due to slew rate limiting.
     
  13. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    You may want more of a precision triangle wave generator if this is for audio.

    There are several audio in, Class D output amplfier ICs available at low cost TI TPA3125D2 is an example of a stereo 10 Watt version contained within a 20 pin DIP

    Mono versions with external MOSFET switching for more power are also available, cost is $2-$3 ish.
     
  14. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    School teachers do not know about modern class-D amplifiers and amplifier ICs. The teachers want the students to design them like they did 20 years ago.
     
  15. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    I imagine that's why they are still suffering through the 16F84 in uC classes, it's the 741 of the micro world.
     
  16. andy24691

    Thread Starter Member

    Nov 25, 2010
    42
    0
    Thanks for all the input guys

    I simulated the circuit sgt.wookie suggested but I struggled to get a frequency higher then 100kHz without unacceptable distortion. Below is the circuit I simulated as well as the generated triangle wave.
    [​IMG]
    [​IMG]
    If anyone has any other suggestions on how I could obtain a 250kHz triangle wave I would be most grateful.
     
  17. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Try changing to TL074 op amps, they will be better with noise and higher frequencies.

    If the models are correct in Multisim.

    13v/uS slew rate, 15nV/Hz noise
     
  18. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    You really need a faster opamp, and to use a comparator on the left side.

    The TL07x/TL08x/LF35x series of opamps will have a hard time keeping up.
     
  19. Audioguru

    New Member

    Dec 20, 2007
    9,411
    896
    The TL071 and TL074 have exactly the same high frequency response and slew rate as the TL081.
    Their datasheets show that they have trouble above 100kHz.
     
  20. Ron H

    AAC Fanatic!

    Apr 14, 2005
    7,050
    657
    This may generate some controversy:
    I haven't done the math, but my gut tells me that the PWM from an exponential triangle generator will be as accurate as that from a linear triangle. This assumes that the rising and falling time constants are identical, and that the comparator's propagation delay is independent of input slew rate. I am referring to the comparator that generates the PWM, not the one involved in generating the triangle wave.
    OTOH, maybe I'm the only one who thinks that this might be controversial.:rolleyes:
    I am not implying that, with real-world parts, the exponential triangle is as good as the linear triangle for generating PWM.

    EDIT: My guts and my memory failed me. See post #23.
     
    Last edited: Dec 8, 2011
Loading...