Generating Triangle Waves

So. Hopefully someone can help me. I've been trying to build:

formatting link

With R1=R2=1k, and RT=2.2k, and C=0.01uF

I'm using 0V as the V- for the opamps, and 5V as the V+. Then, in the circuit, where it says to ground the inverting input on the one and the noninverting input on the other opamp, I just use a voltage divider to give it 2.5V.

So by that logic, I should be getting a triangle wave that goes from ~0V, to ~5V

In pspice, if I use the u741s for the circuit, I get a pretty nice output that shows roughly what I want. The peaks of the wave are rounded, but I'm pretty sure it'll still work for what I'm using it for. If I use OPAMPS instead of u741s, I don't get any output, but I'm not very good with pspice yet, so I could just be setting up the generic 'opamp' part incorrectly.

I've constructed it, and it fails. I simply get a constant voltage output from both the schmitt trigger and the integerator. (Different voltages, but not square/triangle waves, like I should.)

I've tried using u741s, and a single LM358 to built it, but both gave the same results. I've also tried building it exactly like stated in the schematic, with the two inputs grounded, and applied -10V, and

+10V to v-, and v+, but it still didn't work.

I can't figure out if maybe I'm just providng R/C values that won't work for some reason, or if I'm missing something else entirely.

Oh, and interestingly enough, if I model this in pspice with 741s, there is something like 50ms of a flat output, followed by the waves I want. It doesn't matter, because 50ms of garbage output is completely irrelevent for me when I end up building this, but I thought it was interesting.

And if anyone can think of a better way to generate a triangle wave with stuff I'd probably have lying around, that'd work too....

I'm controlling a 4 different motors with h drivers, and I'm using a quad comparator and 4 pots to adjust the duty cycle of the square wave given to each motor, so I can drive it all with just one input triangle wave to the comparator. I've never really done this before, but I figured somewhere between like 5 and 20 kHz is the right frequency to drive a small DC motor at (Please correct me if I'm wrong, I could very well be. I just got those numbers from a few minutes of googling), and just plugging in random values, I came up with 11kHz, so I stuck with that.

Reply to
Mio
Loading thread data ...

--
Norton alerted me to a worm coming from that site.  Be careful.
Reply to
John Fields

You probably are using too low value resistors, and a 741 can't supply enough current.Scale them up by a factor of 5 or so. On a 5V rail, the

741 won't swing more than a couple of volts, and it's slew rate isn't that great

Martin

Reply to
Martin Griffith

R1 and R2 form a voltage divider between the output of the Schmitt trigger and the integrator output. The center tap of this divider must reliably pull the + input of the leftmost opamp past ground. A real-life 741 can't pull it's output more than a volt or two away from it's supply, so you'll "never get there from here". A voltmeter on the intersection of R1 and R2, plus some reasoning about op-amps may have told you this.

Increase the value of R2. You have to trade off how close the triangle wave will pull to the supply rail vs. reliability, and that will depend on the opamp's ability to pull the triangle wave where you want it to go. Different opamps will give different results, a "rail-rail" opamp will go almost all the way to the supply rail (but with it's own quirky problems

-- you may find some older rail-rail designs will have trouble in the comparator role).

--
Tim Wescott
Control systems and communications consulting
http://www.wescottdesign.com

Need to learn how to apply control theory in your embedded system?
"Applied Control Theory for Embedded Systems" by Tim Wescott
Elsevier/Newnes, http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

text -

Thanks for the help. I won't have access to a scope until monday to start playing around with it, but I have some u741s, LM358s, and a HA1745B lying around....As well as a few LM339 comparators. Any idea will be the best (And why, I'm trying to learn.)

Reply to
Mio

Sorry, I mean HA17458

Reply to
Mio

Try this.

formatting link

Good linearity, high bandwidth, extremely wide range. About 3Vp-p output at some bias. You can fix that by biasing the differential to GND and using a bipolar supply (+/-5V, say).

Tim

-- Deep Fryer: A very philosophical monk. Website @

formatting link

Reply to
Tim Williams

formatting link
Look there.

--
"I\'m never wrong, once i thought i was, but was mistaken"
Real Programmers Do things like this.
http://webpages.charter.net/jamie_5
Reply to
Jamie

I tried out the one from national with an LM358....I used V+ = 5v, and for the input, I put a pot on it to vary it from 0 to 5V. (The input voltage to that says it can go higher, but I don't have a power supply on hand right now.)

I know the rest of my circuit works, when I put a triangle wave from a waveform generator on it, and I adjust the pot on my comparitor, I get a nice variable duty cycle square wave -- So my test LED varies in brightness. However, it's acting as an on/off switch now, so I can only assume the output is constant, not a triangle wave.

I'm honestly not sure what I'm going wrong.

Oh, I'm using a 2n2222 for the transistor.

Reply to
Mio

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.