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

Triangular Wave Guidance

Discussion in 'Electronic Projects Design/Ideas/Reviews' started by blah2222, Aug 9, 2011.

  1. BrownOut

    BrownOut Banned

    Joined:
    Jun 10, 2009
    Messages:
    4,630
    Likes:
    60
    Location:
    Huntsville, Alabama USA
    In post #47 you had the follower in the correct loaction, but you were getting oscillations which I think were caused by the U3A/U4A loop with 1uF capacitor. You need a follower to prevent U5A from loading the output of U3A, but you also need to solve the oscillation issue. You'll have to do a stability analysis of the curcuit, particularly U3A and U4A to understand the source of the oscillations. I can't do that right now for you, maybe someone else has more time.
     
  2. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    Okay. I really appreciate your help through all of this! Thank you very much!

    JP
     
  3. BrownOut

    BrownOut Banned

    Joined:
    Jun 10, 2009
    Messages:
    4,630
    Likes:
    60
    Location:
    Huntsville, Alabama USA
    The key to preventing oscillation is to kill the loop gain at the frequency of oscillation, while not affecting the signal you want to observe. That's why you need a stability analysis. You'll use reactive components to attenuate the gain to less than unity. You can try out different capacitors and see if you can get someting to work. You're circuit is inherantly unstable however, and you might need to being that to the attention of whomever is specifying it. Anyway, good luck.

    PS, you might want to start another thread asking about stability. Some members might complain, but it seems that nobody else is interested in reading 7 pages to respond to this thread.
     
    Last edited: Aug 17, 2011
  4. dave

    Dave New Member

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


     
  5. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?

    haha good point. I really appreciate you sticking it out with me, though!

    Oh, and if you're curious, I went in and got a bit of help from a prof, but a couple things are still unclear. He told me to put a series resistor and parallel capacitor/resistor as feedback on U3A. He also told me to just take out the transimpedance amplifier as it was redundant. So we came up with this circuit, (I organized it so it's easier to understand what's going on):

    [​IMG]

    and here are the following transient traces that came about:

    [​IMG]

    He told me to pick a relatively low value for the series resistor Rfb1 and a high value for Rfb2. He said something about having the integration time on the capacitor Cfb to be at least 3 times longer than the delay from the feedback loop and also to have the delay to be at least three times faster than the triangular signal frequency (500 mHz), for the system to operate properly.

    I am not 100% on his guidelines, I will have to confirm tomorrow, but do you have any idea on what he is talking about? I basically want V(reference) to be the same magnitude as V(tri) but 180 degrees out of phase. V(counter) can do as it pleases and I have now tied V(working) to a bias source, virtual ground in this case.

    I tediously worked out the Laplace frequency response in terms of variables for the U3A feedback network, but I don't even know where to start for using limitations for giving Rfb1, Rfb2, and Cfb values.

    I guess my restrictions are:

    - V(reference) = -V(tri)
    - Rcounter and Rworking both range between ~10k to 50k and V(reference) should retain its form while in this range
    - Ccounter and Cworking both range between ~1uF to 10uF and " "


    Sorry to harp on this topic still, but the game has changed now that the circuit has been modified for the better, I think.

    Cheers,
    JP
     
    Last edited: Aug 17, 2011
  6. BrownOut

    BrownOut Banned

    Joined:
    Jun 10, 2009
    Messages:
    4,630
    Likes:
    60
    Location:
    Huntsville, Alabama USA
    Taking the load off U3A makes things much better. The last amp in the line did seem redundant. No, I don't really know what he's talking about. What I would have done is a bode plot of all the components in the feedback loop and made a composite bode plot of the resultant frequency plot from them. I suspect the prof has done this and is just using relative valules he has determined will work.
     
  7. LarsNor

    LarsNor New Member

    Joined:
    Mar 18, 2017
    Messages:
    20
    Likes:
    0
    Hello everyone. I have the same problem. I need to biuld triangle wave generator( range from 0 to 5 volts). I used this curcuit and many others, but i can't get triangle wave with good ramps. Another problem, that i have no LT1800( 1801,1802...) in my OrCAD. So, if somebody knows how to make circuit for triangle wave in PSpice, please help me.
    Circuit with IC 555 don't give triangle wave( it's more swatooth), i found many circuits in internet but it doesn't work in PSpice( can't get triangle wave in the end)
     
  8. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,623
    Likes:
    479
    Location:
    L.A., USA Zulu -8
    What frequency?
    So what op amps do you have available that you want to use?
     
  9. LarsNor

    LarsNor New Member

    Joined:
    Mar 18, 2017
    Messages:
    20
    Likes:
    0
    10-20 kHz, any op amps .
     
  10. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,623
    Likes:
    479
    Location:
    L.A., USA Zulu -8
    Below is the LTspice simulation of a triangle-wave generator that uses an LM339/393 comparator package to perform both the integrator and the comparator function.
    That avoids having to using a high frequency op amp to get sharp corners on the triangle wave and a fast rise-time on the square-wave output..

    upload_2017-3-18_19-43-50.png
     

    Attached Files:

    Last edited: Mar 18, 2017
  11. LarsNor

    LarsNor New Member

    Joined:
    Mar 18, 2017
    Messages:
    20
    Likes:
    0
    Thank for your help, but after few days in OrCAD( i must use this software) i couldn't get triangle signal with your circuit. I have just line
     
  12. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,125
    Likes:
    564
    Location:
    AZ 86334
    Post your schematic.

    Are you doing anything to initialize the nodes in the circuit?

    Note that Zapper used the "startup" directive in his simulation. That helps oscillators start oscillating.

    Try using an "initial condition" on one of the feedback nodes to displace it from the initial voltage found by the "DC bias solution" of the Spice simulator before it begins the time-based part of the simulation. Often, with oscillators, you have to introduce a bit of "noise" into the feed back loop of an oscillator to get it to start. Noise is present in real circuits; Spice is noiseless unless told otherwise.

    For example: Here is the oscillator. If I just "simulate" it, then all you get is flat lines = 0V for V(x), V(y), and V(z): (that is a stable condition found by the DC bias solution before the transient simulation begins; it is like a perfectly balanced child's teeter-totter. Google "metastability")

    36.png


    If I introduce even 1uV of "noise" at node V(z) by using the Spice directive .IC V(z)=1u, then the oscillator starts, and you get the expected waveforms... (that is like displacing the child's teeter-toter just a bit, and it over-centers and one end touches the ground)

    36a.png

    Also note that (my) R4 must be > R3 for it to oscillate.
     
    Last edited: Mar 24, 2017
  13. LarsNor

    LarsNor New Member

    Joined:
    Mar 18, 2017
    Messages:
    20
    Likes:
    0
    upload_2017-3-25_13-42-53.png

    upload_2017-3-25_13-41-57.png

    Now i have this
     
  14. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,125
    Likes:
    564
    Location:
    AZ 86334
    It is just sitting there in that balanced state where there is a bit of numerical "noise", but not enough to start the "oscillation". I see no evidence that you followed my advice and forced one of the nodes in the feedback path to a starting value away from what your simulation shows now.

    That is easy to do in LTSpice using the .IC directive. You will have to find out how to do this in ORCAD.

    RTFM
     
    Last edited: Mar 25, 2017
  15. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,623
    Likes:
    479
    Location:
    L.A., USA Zulu -8
    Add a pulse voltage source between U2A pin 2 and ground.
    Set it to output one 0-1mv, 1ms pulse at the start of the simulation.
     
  16. alec_t

    alec_t Well-Known Member Most Helpful Member

    Joined:
    Jul 10, 2011
    Messages:
    9,315
    Likes:
    1,230
    Location:
    Cardiff, Wales
    Did you intend C2 to be 0.1 FARADs ? That makes the R6C2 time constant 200 seconds, but your sim is running for only 200uS :rolleyes:.
     
  17. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,125
    Likes:
    564
    Location:
    AZ 86334
    Good catch; likely won't fix the meta-stability problem though. You can see that his plot is periodic, returning back to zero. If it was going to take off toward oscillation, then the node he plotted would have been monotonic away from the initial value.
     
    Last edited: Mar 25, 2017
  18. LarsNor

    LarsNor New Member

    Joined:
    Mar 18, 2017
    Messages:
    20
    Likes:
    0
    Did you mean this?
     

    Attached Files:

    • 3.png
      3.png
      File size:
      20.1 KB
      Views:
      28
    • 4.png
      4.png
      File size:
      13.2 KB
      Views:
      26
  19. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,125
    Likes:
    564
    Location:
    AZ 86334
    You fixed the capacitor value, but as I predicted, it is still not oscillating. Looks like you did not "Read The Flipping Manual" to determine how to add the .Initial Conditions directive as I asked you to...

    Here is a way to accomplish the start-up by including a pulse voltage source V1 in the feedback loop. Note that for the first 3ms, the pulsed source V1 makes a voltage of 1uV, and then at 3ms, it turns off to 0V thereafter; (see V(z)-V(w) in the lower plot pane). The little -1uV step at 3ms is enough to "kick" the oscillator into starting. Note that V(z), V(y), and V(x) are flat-line prior to 3ms, and show the oscillator behavior after 3ms.

    It is the dv/dt of V1 that begins the oscillation. A real circuit would easily have 1uV of noise at V(z) due to thermal effects, but the simulated circuit doesn't, so we have to add it artificially.

    Good example of why ORCAD is a crap simulator. It tries to hide all of the capability (and complexity) of Spice from the user.

    39.png
     
  20. LarsNor

    LarsNor New Member

    Joined:
    Mar 18, 2017
    Messages:
    20
    Likes:
    0
    Hei, what OP you used in the circuit?
     
  21. MikeMl

    MikeMl Well-Known Member Most Helpful Member

    Joined:
    Mar 17, 2009
    Messages:
    11,125
    Likes:
    564
    Location:
    AZ 86334
    Do you mean "what simulator" I used? I use LTSpice, free download from Linear Technology (now becoming part of Analog Devices).
     

Share This Page