Spice simulation far from actual circuit behaviour

I am trying to use the TLV2241 DIP package IC to make a relaxation oscillator(square wave oscillator using positive feedback). I first simulated the design in spice (both ORCAD PSPICE and WINSPICE). I used the SPICE model of the TLV2241 provided in the data sheet provided by TI.COM . Please see the spice circuit file below.

Problem: In the simulated version I get an oscillation period of approx

6.2ms. However when I built the circuit using the chip I actually got a frequency of 19Hz(Period approx 52ms) I have made sure that all components are close to the specs as specified in the spice simulation Question) Is the model provided by TI, as shown below, adequate to accurately model the opamp. Please suggest why is there such a disparity between spice simulation(s) and the actual circuit? Thanks SPICE CIRCUIT FILE FOR SQUARE WAVE GENERATOR USING TLV2241

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

*Relaxation oscillator using a single supply opamp
  • connections: non-inverting input
  • | inverting input
  • | | positive power supply
  • | | | negative power supply
  • | | | | output
  • | | | | | ..SUBCKT TLV2241 1 2 3 4 5 C1 11 12 9.8944E-12 C2 6 7 30.000E-12 CEE 10 99 8.8738E-12 DC 5 53 DY DE 54 5 DY DLP 90 91 DX DLN 92 90 DX DP 4 3 DX EGND 99 0 POLY(2) (3,0) (4,0) 0 .5 .5 FB 7 99 POLY(5) VB VC VE VLP VLN 0 61.404E6 -1E3 1E3 61E6 -61E6 GA 6 0 11 12 1.0216E-6 GCM 0 6 10 99 10.216E-12 IEE 10 4 DC 54.540E-9 IOFF 0 6 DC 5E-12 HLIM 90 0 VLIM 1K Q1 11 2 13 QX1 Q2 12 1 14 QX2 R2 6 9 100.00E3 RC1 3 11 978.81E3 RC2 3 12 978.81E3 RE1 13 10 30.364E3 RE2 14 10 30.364E3 REE 10 99 3.6670E9 RO1 8 5 10 RO2 7 99 10 RP 3 4 1.4183E6 VB 9 0 DC 0 VC 3 53 DC .88315 VE 54 4 DC .88315 VLIM 7 8 DC 0 VLP 91 0 DC 540 VLN 0 92 DC 540 ..MODEL DX D(IS=800.00E-18) ..MODEL DY D(IS=800.00E-18 RS=1M CJO=10P) ..MODEL QX1 NPN(IS=800.00E-18 BF=27.270E21) ..MODEL QX2 NPN(IS=800.0000E-18 BF=27.270E21) ..ENDS

XOP1 3 1 4 0 2 TLV2241 Cout 2 6 0.033uF RF 1 6 9.99K CF 1 0 10uF R2 6 3 1.001K R1 3 0 19.97K VS1 4 0 5V ..TRAN 0.01ms 100ms ..PROBE ..PLOT TRAN V(2) ..END

Reply to
mister.steve.smith
Loading thread data ...

[snip]

Why don't you post a schematic on a.b.s.e, or an LTspice .asc listing here, so we can visualize your circuit?

Working from a netlist we can only see the same result as you got, without the ability to visualize and find mis-use of the device.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

I am posting the LTSpice.asc listing. Please excuse the poor drawing.Thanks

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

Version 4 SHEET 1 880 680 WIRE -112 160 -112 48 WIRE -112 256 -112 224 WIRE -80 416 -80 304 WIRE 32 160 -112 160 WIRE 32 208 32 192 WIRE 32 304 0 304 WIRE 32 304 32 208 WIRE 64 160 32 160 WIRE 64 192 32 192 WIRE 96 48 -112 48 WIRE 96 112 16 112 WIRE 96 144 96 112 WIRE 96 240 96 208 WIRE 96 304 32 304 WIRE 192 176 128 176 WIRE 256 48 176 48 WIRE 256 96 256 48 WIRE 256 176 256 96 WIRE 256 304 176 304 WIRE 256 304 256 176 FLAG -80 416 0 FLAG -112 256 0 FLAG 96 240 0 FLAG 32 160 1 FLAG 32 208 3 FLAG 160 192 2 FLAG 256 96 6 FLAG 16 128 Node4_5V SYMBOL Opamps\\UniversalOpamp 96 176 R0 SYMATTR InstName TLV2241 SYMBOL res 16 288 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R1 SYMATTR Value R1 = 19.97K SYMBOL res 192 288 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R2 SYMATTR Value R2 = 1.004K SYMBOL cap -96 224 R180 SYMATTR InstName C1 SYMATTR Value CF = 10µF SYMBOL cap 256 160 R90 WINDOW 0 0 32 VBottom 0 WINDOW 3 32 32 VTop 0 SYMATTR InstName C2 SYMATTR Value Cout = 0.033UF SYMBOL res 192 32 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R3 SYMATTR Value RF = 9.99K

Reply to
mister.steve.smith

THanks Jim No i did not run the simulation of the schematic in LTSpice , i just downloaded LT to make the schematic. I simulated the spice netlist(my first post) using ORCAD Pspice and winspice. I didnt choose any simulation setups, except for those mentioned in the spice netlist for transient time step. I simulated the spice netlist in LTSpice and got the same results as PSPICE and winspice thanks.

Reply to
mister.steve.smith

Jim My first post already has the PSPICE .cir file. I did not make/use any ..net file. I simulated using a .cir file only ill post it again . Thanks

..CIR SPICE CIRCUIT FILE FOR SQUARE WAVE GENERATOR USING TLV2241

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

*Relaxation oscillator using a single supply opamp
  • connections: non-inverting input
  • | inverting input
  • | | positive power supply
  • | | | negative power supply
  • | | | | output
  • | | | | | ..SUBCKT TLV2241 1 2 3 4 5 C1 11 12 9.8944E-12 C2 6 7 30.000E-12 CEE 10 99 8.8738E-12 DC 5 53 DY DE 54 5 DY DLP 90 91 DX DLN 92 90 DX DP 4 3 DX EGND 99 0 POLY(2) (3,0) (4,0) 0 .5 .5 FB 7 99 POLY(5) VB VC VE VLP VLN 0 61.404E6 -1E3 1E3 61E6 -61E6 GA 6 0 11 12 1.0216E-6 GCM 0 6 10 99 10.216E-12 IEE 10 4 DC 54.540E-9 IOFF 0 6 DC 5E-12 HLIM 90 0 VLIM 1K Q1 11 2 13 QX1 Q2 12 1 14 QX2 R2 6 9 100.00E3 RC1 3 11 978.81E3 RC2 3 12 978.81E3 RE1 13 10 30.364E3 RE2 14 10 30.364E3 REE 10 99 3.6670E9 RO1 8 5 10 RO2 7 99 10 RP 3 4 1.4183E6 VB 9 0 DC 0 VC 3 53 DC .88315 VE 54 4 DC .88315 VLIM 7 8 DC 0 VLP 91 0 DC 540 VLN 0 92 DC 540 ..MODEL DX D(IS=800.00E-18) ..MODEL DY D(IS=800.00E-18 RS=1M CJO=10P) ..MODEL QX1 NPN(IS=800.00E-18 BF=27.270E21) ..MODEL QX2 NPN(IS=800.0000E-18 BF=27.270E21) ..ENDS

XOP1 3 1 4 0 2 TLV2241 Cout 2 6 0.033uF RF 1 6 9.99K CF 1 0 10uF R2 6 3 1.001K R1 3 0 19.97K VS1 4 0 5V ..TRAN 0.01ms 100ms ..PROBE ..PLOT TRAN V(2) ..END

Reply to
mister.steve.smith

[snip]

Please include your simulation setups.

...Jim Thompson

-- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | |

formatting link
| 1962 | I love to cook with wine. Sometimes I even put it in the food.

Reply to
Jim Thompson

[snip]

Looks like LTspice is balking at "values" R1, R2...

Did you actually run this in LTspice?

...Jim Thompson

-- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | |

formatting link
| 1962 | I love to cook with wine. Sometimes I even put it in the food.

Reply to
Jim Thompson

Thanks Jim, Will wait for ure advice. The TLV2241 spice model was printed inside the datasheet (Page 16) of the device available at:

formatting link

Reply to
mister.steve.smith

Please post PSpice .CIR and .NET files

(Because a little poking around shows floating nodes in the LTspice schematics, misnamed values... RF=9.99K WRONG, just 9.99K CORRECT)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

OK. I'll load it into PSpice sometime this afternoon... have REAL work simulating right now ;-)

(Where did the TLV2241 model come from? BF=27.270E21 is a bit absurd :-)

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

mike i already mentioned in my first post that the circuit runs as an oscillator. My problem is that the spice simulation of the .cir spice netlist(first post) and the 'actual' circuit on breadboard do not run at the same frequency. I only made the LT .asc schematic so that readers could visualize the circuit.

Reply to
mister.steve.smith

[snip]

Most likely it's that the model doesn't properly reflect the true device operation when the inputs go below ground...

The OpAmp +IN has +/- 400mV of signal on it.

Redesign to have the inputs near supply mid-point and then it'll become predictable.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

His circuit swings below ground on both inputs.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

[snip]

See...

Newsgroups: alt.binaries.schematics.electronic Subject: Re: Spice simulation far from actual circuit behaviour (S.E.D) - RelaxationFromSED-Fixed.pdf Message-ID:

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

What does "CF=10\x{00B5}F mean?

You need to lose the "R1=" etc. from the component values, else LTspice barfs. just specify a resistor as, say "1.6K" or "1K6", or "1600", or "1.6e3"

You need to specify a voltage source for your 5V supply. Just writing it on the schematic won't work.

I took a blind guess that "10\x(00B5) meant 10^-5 Farad, ie. 1e-5F. With that value, I get 1.74 milliseconds low and 1.50 milliseconds high at node

002 (pin 2)

Guess what? I was right. I just took a look at your netlist, and CF is

10uF = 10e-6 = 1e-5.
--
"Electricity is of two kinds, positive and negative. The difference
is, I presume, that one comes a little more expensive, but is more
durable; the other is a cheaper thing, but the moths get into it."
                                             (Stephen Leacock)
Reply to
Fred Abse

Steve,

OK, I corrected a few circuit errors. Now it runs as a relaxation osciallator.

--Mike

Version 4 SHEET 1 880 680 WIRE -304 144 -304 112 WIRE -304 256 -304 224 WIRE -192 112 -304 112 WIRE -192 304 -192 112 WIRE -160 304 -192 304 WIRE -96 400 -96 368 WIRE -64 368 -96 368 WIRE -32 160 -32 48 WIRE -32 176 -32 160 WIRE -32 256 -32 240 WIRE 32 304 -80 304 WIRE 32 304 32 192 WIRE 32 368 16 368 WIRE 32 368 32 304 WIRE 64 160 -32 160 WIRE 64 192 32 192 WIRE 96 48 -32 48 WIRE 96 112 -192 112 WIRE 96 144 96 112 WIRE 96 240 96 208 WIRE 96 304 32 304 WIRE 256 48 176 48 WIRE 256 176 128 176 WIRE 256 176 256 48 WIRE 256 304 176 304 WIRE 256 304 256 176 FLAG -96 400 0 FLAG -32 256 0 FLAG 96 240 0 FLAG -304 256 0 SYMBOL Opamps\\UniversalOpamp 96 176 R0 SYMATTR InstName TLV2241 SYMBOL res 32 352 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R1 SYMATTR Value 10K SYMBOL res 192 288 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R2 SYMATTR Value 100K SYMBOL cap -48 240 M180 SYMATTR InstName C1 SYMATTR Value 10µ SYMBOL res 192 32 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R3 SYMATTR Value 10K SYMBOL voltage -304 128 R0 SYMATTR InstName V1 SYMATTR Value 5 SYMBOL res -64 288 R90 WINDOW 0 0 56 VBottom 0 WINDOW 3 32 56 VTop 0 SYMATTR InstName R4 SYMATTR Value 10K TEXT 88 376 Left 0 !.tran 1 startup

Reply to
Mike Engelhardt

Thanks much Jim. Am i Correct in understanding that the 10K resistor from Vcc to INP is to set up a dc offset of 2.5V in the Voutput? thanks again. I am currently trying to learn different opamp circuits by simulation and then breadboarding them. I get stuck sometimes :-)

Reply to
mister.steve.smith

Steve,

Sorry. The schematic I saw didn't run. Once you get the simulation issues cleared up, since you have hardware, scope out the real circuit and find what the difference is between the model and device at the inputs and outputs. Don't trust your average opamp macromodel over the full input and output ranges.

--Mike

Reply to
Mike Engelhardt

You were told 12 hours earlier on SEB how to fix your sloppy circuit which had a capacitor between the op amp output and both feedback circuits. If you want to ask a question about electronics that is one thing, but when you really want someone to troubleshoot your slipshod mistakes then that's another.

Reply to
Fred Bloggs

It biases the input (along with the feedback R) such that, when output is at 0V, input is at +1V, when output is at +5V, input is at +4V. This keeps the OpAmp within its guaranteed operating range.

Note that the chosen OpAmp is rather gutless, and SLOW... the output does not "snap" as I like to see in precision oscillators.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC's and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

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.