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. blah2222

    blah2222 New Member

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

    For my current project that I am working on, I am in need of a positively and negatively ramping triangular wave voltage signal. This signal is to be symmetrical, sweep between +/- 2 V at a frequency around 500 mHz (slow).

    Ideally, I would like to use a single coin cell battery to power this signal. Is there a simple way to split say a 5 V battery into two +/- 2.5 V supplies?

    Here is the standard circuit that I am using to build the wave:

    [​IMG]

    I understand that the frequency can be found as:



    I am just not sure of how to interpret the voltage peaks for my triangular wave.

    Design:

    I decided on values for the components based on the above equation:

    R1 = 1 MΩ
    R2 = 2 MΩ
    Rt = 1 MΩ
    C = 1 uF
    Vss = +5 V
    Vee = -5 V
    Op-amp used = LF412CN (dual)

    Therefore, using the equation above: f = 0.5 Hz

    Results:

    After wiring this up on my breadboard and checking the scope, I noticed the follow:

    f = 460 mHz
    Vpeak(+) = 1.68 V
    Vpeak(-) = -2.16 V

    Appears to be symmetrical but is offset.

    My question is, what is the relation between the +/- supplies and my peak voltages, also how do I get rid of this offset?

    ***EDIT***



    Thanks,
    JP
     
    Last edited: Aug 16, 2011
  2. Brevor

    Brevor Member

    Joined:
    Feb 3, 2007
    Messages:
    528
    Likes:
    14
    Location:
    Chicago USA
    You cant make a 500 Mhz oscillator with an op amp.
     
  3. carbonzit

    carbonzit Active Member

    Joined:
    Mar 19, 2011
    Messages:
    1,958
    Likes:
    13
    Check the capitalization; the O.P. wants a 500mHz oscillator (which is, as they said, slow).
     
  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?

    Yeah, 500 milliHertz not megaHertz haha

    Another thing to note is that I will be replacing this chip for two LM324's as they can work under lower voltage requirements (3 V min) opposed to the (10 V min) for the LF412.

    Can anyone answer my question about the offset issue?

    Thanks!
     
  6. Mikebits

    Mikebits Well-Known Member

    Joined:
    May 24, 2008
    Messages:
    6,214
    Likes:
    174
    Location:
    San Diego, Ca
  7. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    So guys, I guess my confusion ultimately comes down to the lack of knowledge of Schmitt Triggers.

    Literally the only difference between a Schmitt Trigger and it's inverting/non-inverting counterpart is which terminal each input is connected to:

    Inverting Amplifier
    [​IMG]

    Schmitt Trigger - 1
    [​IMG]

    ---------------------------------------------------------------

    Non-Inverting Amplifier
    [​IMG]

    Schmitt Trigger - 2
    [​IMG]

    ---------------------------------------------------------------

    I still can't see why the normal ideal op-amp conditions, (input currents = 0, v+ = v-), work for the amplifier configurations, but not for the Schmitt Trigger configurations. Come to think of it, if I saw a circuit using a Schmitt Trigger configuration back in first year EE, I would have slapped the ideal conditions onto it and just solved the circuit as if it were an amplifier, completely disregarding the terminal signs, which now I know is wrong, but I still don't understand why.

    I just don't understand how they both have the same feedback resistors, yet their terminal configurations make them either positive or negative feedback.
     
    Last edited: Aug 10, 2011
  8. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    Okay, so after thinking about it for a bit longer, here's what I came up with for differentiating between an amplifier and a Schmitt Trigger.

    If we take a look at the Inverting Amplifier:

    [​IMG]

    Say initially Vout is at the negative supply, if we think about it, Vin can't be more negative than the negative supply, (or else the op-amp is useless), so the direction of current flow can be determined, therefore the voltage division can be determined as:



    With this equation, V- can never be less than zero, thus, Vout will remain negative and not change. For this reason, the amplifier will be stable and not oscillate. The same works if Vout was initially held at the positive supply voltage.

    In the case of the Schmitt Trigger, the output voltage doesn't not stay stable and it will oscillate.

    This more or less makes sense to me, but I'm still not sure where the ideal op-amp equations come into play with this, but it's a start.
     
    Last edited: Aug 10, 2011
  9. BrownOut

    BrownOut Banned

    Joined:
    Jun 10, 2009
    Messages:
    4,630
    Likes:
    60
    Location:
    Huntsville, Alabama USA
    Schmitt triggers don't oscillate. In the original circuit, oscillation is achieved by feeding back the output of the right-side amp into the schmitt trigger.
     
  10. Brevor

    Brevor Member

    Joined:
    Feb 3, 2007
    Messages:
    528
    Likes:
    14
    Location:
    Chicago USA
    Ah sorry my mistake, The hazard of reading posts at 12:40 AM.
     
    Last edited: Aug 10, 2011
  11. MrAl

    MrAl Well-Known Member Most Helpful Member

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

    Hi,

    Usually we can assume certain things about the op amp when used as an amplifier, and we assume other things when used with positive feedback. The trouble is, there is another variable and that is time. If we dont assume that it takes some finite time to reach some voltage level then we can find two solutions to the general circuit you have drawn as an 'inverting Schmitt Trigger" with Vin=1v. If we force the non inverting terminal to be positive when we start out we'll find some normal looking solution, but if we dont do that and we take time into consideration we find that the output swings negative and reached the negative supply rail and stays there. So it depends on the initial conditions as well as the inputs in reality. If the initial non inverting terminal voltage is zero (usually a good assumption) and we apply a 1v signal to the inverting terminal, the output RAMPS according to that initial condition which here means it would ramp negative. Since there is no solution with the non inverting terminal going negative because the non inverting terminal is always more positive, the output would continue to seek a more and more negative value and would reach infinity with an ideal voltage controlled voltage source. But if we assume other initial conditions we could end up with a more normal looking solution.
    In real life it becomes bistable.

    Very good observation there.
     
    Last edited: Aug 10, 2011
  12. BrownOut

    BrownOut Banned

    Joined:
    Jun 10, 2009
    Messages:
    4,630
    Likes:
    60
    Location:
    Huntsville, Alabama USA
    Post deleated.
     
    Last edited: Aug 10, 2011
  13. crutschow

    crutschow Well-Known Member Most Helpful Member

    Joined:
    Mar 14, 2008
    Messages:
    10,592
    Likes:
    477
    Location:
    L.A., USA Zulu -8
    The offset is likely cause by the op amp having different output saturation voltages between the plus and minus outputs (the output doesn't go all the way to the supply rail). If you use a rail-to-rail type op amp, such as the MCP6002 by Microchip, then the output should be more symmetrical.
     
    Last edited: Aug 10, 2011
  14. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    Hey, thanks for the detailed post! I guess it's safe to say that time does have its place in these circuits. The amplifier configurations seem to force their inputs to be equal using negative feedback and the Schmitt Trigger cannot be stabilized, so it goes to its extremes.

    I am just having a hard time understanding quantitatively how positive and negative feedback work in these configurations. They both have the same feedback loop, is it just the effect that the amplifier configuration seeks to close in on decrementing the input difference between the input terminals (v+ and v-) until they are roughly equal, while the Schmitt Trigger does the opposite in the sense that its feedback loop causes the voltages to become more and more spread apart in the current ramping direction?
     
  15. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    If you guys don't mind, I am going to try and trace through the system of creating a triangular wave and would like your feedback on how correct I am

    Okay so let's begin by assuming that the output of the Schmitt Trigger op-amp is at -Vsupply, as well as the fact that my supply voltages are +/- 5 V and the capacitor is initially discharged. So the output of the Schmitt Trigger is at -5 V. This voltage is held constant until the Schmitt Trigger flips and goes positive, so knowing this, and using the assumption that the V- terminal of the Integrator will be ideally at 0 V, a constant current is formed flowing in the direction of V- of the Integrator to -5 V at the Schmitt Trigger output. Since this is a complete circuit, this current flows all the way to the other side of the capacitor (at the output of the Integrator). Since it is a capacitor and it is being charged with a constant current, it's voltage will experience a positive charging ramp. Since the state of the Schmitt Trigger is very reliant on what the voltage is on its V+ terminal compared to the V- terminal, (0 V in this case), it can only wait for its V+ voltage to become more positive than 0 V for it to flip to the positive supply (+5 V). So as the +ve linearly ramping capacitor voltage is increasing, the V+ terminal voltage of the Schmitt Trigger is also increasing. Based on the resistors there is some threshold voltage that the capacitor linearly ramps to that makes the voltage seen at the V+ terminal equal to 0 V. Once it surpasses this voltage, the Schmitt Trigger then flips its output voltage to the positive supply (+5 V). Since the magnitude of current hasn't changed, only it's direction, the current will discharge from the capacitor from the Integrator's output and flow back to the V- terminal of the Integrator. It will do this until it reaches a threshold voltage on the triangular wave that causes the voltage at the V+ terminal of the Schmitt Trigger to become more negative than 0 V, thus flipping the output back to the negative supply voltage level (-5 V). Thus, the cycle repeats itself from there.

    That was a mouthful, but I am hoping that I got the functionality down. I know that the threshold voltage can be determined by a resistor divider network, but I am not sure if I am using the correct method to find it's value, but here goes:

    Let's go back to the situation where the capacitor is charging up linearly and the Schmitt Trigger output is at the negative supply voltage (-5 V). The threshold value that the triangular capacitor voltage peaks at will ensure that the V+ voltage of the Schmitt Trigger is at 0 V, ideally. So in that case, we have a constant current passing through resistors R2 and R1 leading to the capacitor.

    Vout(Schmitt) = -5 V
    V+(Schmitt) = 0 V

    The current direction immediately before the Schmitt Trigger flips goes from Vout(Schmitt) to Vout(Integrator). This sets up a voltage divider network:



    Knowing that Vout(Schmitt) = -5 V and V+ = 0 V, this simplifies to:



    Does that make any sense at all? I'm trying really hard to understand this stuff but it's tough and iterative. I also don't know how to even begin in the event that the Schmitt Trigger starts out at 0 V (not saturated).

    JP
     
    Last edited: Aug 10, 2011
  16. MrAl

    MrAl Well-Known Member Most Helpful Member

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

    Quantitatively you really only have to apply the initial conditions, but in real life the op amp acts more like a fast integrator anyway and since you are trying to understand it better in both configurations perhaps you should assume that the perfect op amp has a small capacitance from output to inverting input, and the inverting input has some resistance between the actual input and the capacitor (ie an integrator circuit). This will show how time enters the solution, and this would be a lot like it really behaves in real life except for the limited slew rate. If you wanted to you could even show the slew rate by using a value of capacitor that provides the correct ramp rate with a given step change in voltage on the 'input'.

    With a capacitor on the non inverting terminal (for example) and some initial bias (initial capacitor voltage) you may get a totally different solution. Some circuits have more than one solution for different initial conditions and this shouldnt be too much of a surprise.

    Also keep in mind that with positive feedback the circuit could be considered non linear so the solution(s) may not fit any nice neat textbook example.
     
    Last edited: Aug 10, 2011
  17. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    Ah, I see. So what you're saying is that my work above to calculate the threshold peak voltages of the capacitor triangular wave aren't really accurate?
     
  18. Warpspeed

    Warpspeed Member

    Joined:
    Sep 12, 2009
    Messages:
    182
    Likes:
    3
    Location:
    Melbourne, Australia
    The key to getting an exact even +/- triangle swing is setting the exact schmidt trigger thresholds at +2v and -2v.
    This can be difficult with the basic circuit as drawn, because the output of the schmidt trigger op amp cannot usually go fully and accurately rail to rail. That skews the schmidt trigger voltage thresholds.

    One simple solution to this is to use a non inverting CMOS buffer right at the output of the op amp. Even though the op amp struggles to approach rail to rail, the CMOS buffer will provide a fast hard full rail to rail output voltage swing. Take the feedback for the schmidt trigger from the output of the CMOS buffer, not from the output of the op amp, and you will then get a nice symmetrical triangle wave.
     
  19. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    Thank you for that idea, I will try that!
     
  20. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    Okay, another weird thing that you guys might be able to pick up on. I know my circuit works relatively to what I need after hooking up the breadboard and oscope, but when I ran a PSpice simulation on it, I got nilch.

    Here is my schematic:
    [​IMG]

    Noting the voltage probe, I wanted to see the capacitor voltage so I ran a transient simulation for five seconds, and received nothing buy nanoVolts...
    [​IMG]

    I am utterly stumped. Same op-amps, same source voltages, same resistances/capacitance. I tried my circuit on this neat applet http://www.falstad.com/circuit/ and it worked the way I wanted it.

    Any suggestions?
    JP
     
    Last edited: Aug 10, 2011
  21. blah2222

    blah2222 New Member

    Joined:
    Jul 29, 2011
    Messages:
    41
    Likes:
    0
    Location:
    Canada, eh?
    So, I figured that since I actually was able to get the circuit working on the breadboard, that something was up with the PSpice modelling, so I downloaded the trial version of Multi, which is A BAJILLION times better!

    Anyway, I also tried to get the CMOS buffer to work, but it had trouble railing the voltages on the squarewave, so I looked into low voltage rail-to-rail op-amps. I came across the LT1801CMS8 that works rail-to-rail and operates with voltages as low as +/- 2.6 V. That's great for the multivibrator, but for the integrator I really just need a low voltage linear op-amp. I used the 741 in this simulation and it worked, somewhat, but I need something that operates at a lower supply voltage than 10 V, maybe that's why the triangular peaks aren't consistent?

    Here are the schematic and simulation results:

    [​IMG]

    [​IMG]

    Does anyone have a clue what's going on with my triangular peaks?
    JP
     

Share This Page