Author Topic: Help with LTSpice: Op-amp astable multivibrator (square wave generator)  (Read 7988 times)

0 Members and 1 Guest are viewing this topic.

Offline TimNJ

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: us
Hi everyone,

I am trying to simulate a square wave generator that uses an op-amp configured as an astable multivibrator, but I cannot get an output and I am struggling to see why not.

My current results are attached. It is supposed to be a 1kHz generator. Is LTSpice not capable of this type of simulation?

Thanks in advance,
Tim
« Last Edit: April 06, 2015, 06:02:58 am by TimNJ »
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 8017
Post the .asc spice file so others can check it.  You'll need to either rename it to .asc.txt or zip it due to the restricted list of attatchment types accepted here.
 

Offline TimNJ

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: us
Thanks. I've attached it.
 

Offline Tac Eht Xilef

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: 00
For a start, you've got +V2 going to the positive supply rail of your op-amp - and +V1 going to the negative supply rail. Depending on the particular SPICE version it may ignore the -ve part of your -5v value & take only the absolute value. Best to set V1 to 5v & reverse it....
« Last Edit: April 06, 2015, 06:18:38 am by Tac Eht Xilef »
 

Offline TimNJ

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: us
Thanks. I didn't think SPICE cared about that, but I switched the polarity of the source and then made it a positive voltage. Still no output.
 

Offline tec5c

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: au
What op-amp model are you using? (This shouldn't matter but just to clarify)

Another thing, where are you probing? I created your circuit exactly (using the LT1001 model) and I had no problems. See below for results.

Hope this helps.

Edit: Okay, for some reason the forum isn't allowing me to insert the screen capture. It's now attached.
« Last Edit: April 06, 2015, 06:31:25 am by tec5c »
 

Offline TimNJ

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: us
Thanks tec5c,

I was using UniversalOpamp2, which I have used for many simulations with no problems. I was probing between the output and ground.

I just tried the LT1001 as you did, and surprise surprise...it worked!

Wonder what is missing in the UniversalOpamp2 model that makes it not work...

Thank you.
 

Offline tec5c

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: au
Glad you found the problem.

I didn't see that you had attached the .asc file to begin with, my mistake. The universal op-amp in LTSpice requires its attributes to be added in. Without looking too much into it, I say there's some specific parameters that need to be added in order for the op-amp to function correctly. Correct me if I'm wrong.
 

Offline TimNJ

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: us
Yeah UniversalOpAmp2 seems like it might require some additional configuration. Now, I'm using the LT1001 and it seems all fine and dandy, but when I calculate my values for R1, R2, R3, and C to find the period (T) of the square wave, T winds up being pretty far off from the values I got guessing and checking in LTSpice. If I change the model to a different op-amp, the period (and frequency of course) also gets changed.

Why should changing the model affect the frequency of the square wave?

Thanks.
 

Offline Refrigerator

  • Frequent Contributor
  • **
  • Posts: 834
  • Country: lt
Also did you notice how your test goes only up to 10ms while tec5c circuit started up on about 17ms.
Just started a blog at http://brimmingideas.blogspot.com/ . Not much in it as of now but more is sure to come :)
 

Offline tec5c

  • Frequent Contributor
  • **
  • Posts: 422
  • Country: au
Re: Help with LTSpice: Op-amp astable multivibrator (square wave generator)
« Reply #10 on: April 06, 2015, 07:44:59 am »
Also did you notice how your test goes only up to 10ms while tec5c circuit started up on about 17ms.

Well spotted, something I missed. Sorry, I did the simulation really quickly.

Upon changing the stop time for my circuit to 10ms, there is actually ~20nV increase from 0-10ms. Whereas the universal opamp2, has 0v output for no matter how long you run the simulation.
 

Offline TimNJ

  • Frequent Contributor
  • **
  • Posts: 784
  • Country: us
Re: Help with LTSpice: Op-amp astable multivibrator (square wave generator)
« Reply #11 on: April 06, 2015, 07:47:41 am »
Also did you notice how your test goes only up to 10ms while tec5c circuit started up on about 17ms.

Yes, I noticed that myself after posting that. I changed it to 100ms (which still showed no output).
 

Offline eetech00

  • Regular Contributor
  • *
  • Posts: 64
Re: Help with LTSpice: Op-amp astable multivibrator (square wave generator)
« Reply #12 on: April 08, 2015, 02:44:51 am »
Hi  :)

Sometimes you have to kick start the oscillator by using a "initial condition" statement on the schematic.

Notice on the attached schematic I placed a label "N", then used ".IC V(N)=5" to set the initial voltage condition.

(hope the graphic looks better on you system, doesn't look very good on mine)

eT
« Last Edit: April 08, 2015, 02:47:17 am by eetech00 »
 

Online T3sl4co1l

  • Super Contributor
  • ***
  • Posts: 13768
  • Country: us
  • Expert, Analog Electronics, PCB Layout, EMC
    • Seven Transistor Labs
Re: Help with LTSpice: Op-amp astable multivibrator (square wave generator)
« Reply #13 on: April 08, 2015, 03:45:13 am »
Transient simulations are perfectly noiseless, so after the engine finds the DC operating point, it will perfectly happily sit there forever and ever, even if it is an unstable operating point (as is the case here).

You can also set initial condition of the capacitor (setting the node voltage means the same thing*), or use different DC operating point methods in the simulation configuration, e.g., set to zero.

*There is a certain advantage to setting the capacitor, even if it may end up being a semantic difference: the capacitor is the only explicit component which stores "state" of the system.  That is, the operating frequency is ideally defined only by the capacitor (there are no other time-variable elements), and if you solve the differential equation of a system like this, you must input one other factor, the voltage at t=0, to find a unique solution.  Only this voltage matters; all others can be derived from it.

The other advantage may be practical; component "models" that include e.g. ESR, ESL, etc. won't set the SPICE capacitor voltage by .NODESET -- because there are nodes inside that you can't see.  You then have to enter the initial condition in the model dialog.

Tim
« Last Edit: April 08, 2015, 03:47:28 am by T3sl4co1l »
Seven Transistor Labs, LLC
Electronic design, from concept to prototype.
Bringing a project to life?  Send me a message!
 

Online Marco

  • Super Contributor
  • ***
  • Posts: 4367
  • Country: nl
Re: Help with LTSpice: Op-amp astable multivibrator (square wave generator)
« Reply #14 on: April 08, 2015, 06:23:20 am »
You made a metastable nonvibrator.
« Last Edit: April 08, 2015, 06:24:56 am by Marco »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf