Author Topic: Having trouble simulating two multivibrators in LTspice  (Read 702 times)

0 Members and 1 Guest are viewing this topic.

Offline ledtesterTopic starter

  • Super Contributor
  • ***
  • Posts: 3084
  • Country: us
Having trouble simulating two multivibrators in LTspice
« on: May 13, 2024, 02:49:14 am »
In another post there was a discussion of modelling the classic two transistor oscillator in LTspice:

https://www.eevblog.com/forum/beginners/help-with-modeling-multivibrators-in-ltspice/

I'm trying to have two copies of the two-transistor oscillator in the same LTspice circuit but it's not working.

multivibrator-1.asc contains the multivibrator circuit and it simulates correctly.

multivibrator-2.asc contains two copies of the circuit but neither multivibrator oscillates. But if I delete the second copy the first multivibrator works.

Is there something I'm overlooking?

Also, if in the second circuit I detach R7 from the junction of C4 and Q3 the simulation works (i.e. the first MV oscillators).

 

Offline ArdWar

  • Frequent Contributor
  • **
  • Posts: 489
  • Country: sc
Re: Having trouble simulating two multivibrators in LTspice
« Reply #1 on: May 13, 2024, 03:11:13 am »
With oscillators it's usually timestep problem. Try explicitly specify some small timestep and see if things work. SPICE solvers usually by default relaxes the timestep and/or parameter integration when the circuit gets more complex.
 
The following users thanked this post: ledtester

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19861
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Having trouble simulating two multivibrators in LTspice
« Reply #2 on: May 13, 2024, 08:52:04 am »
What are the node voltages when it is not oscillating?

With simulation it is easy to achieve metastable behaviour during startup, and difficult to simulate it during normal operation.

Try changing one of the 10kohm/1µF components by a tiny amount, to see if that disturbs startup equilibrium, and allows oscillation.

Try connecting Q1 and Q3 collectors with a large resistor, to see if that changes the matrices sufficiently so the numerical solutions are changed sufficiently to allow oscillation.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: ledtester

Offline ledtesterTopic starter

  • Super Contributor
  • ***
  • Posts: 3084
  • Country: us
Re: Having trouble simulating two multivibrators in LTspice
« Reply #3 on: May 13, 2024, 08:55:45 pm »
Changing the max timestep to 250u makes the circuit work. In fact, this seems to be the largest maximum timestep that works.

The .tran line is:

Code: [Select]
.tran 0 1 0 250u uic
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19861
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Having trouble simulating two multivibrators in LTspice
« Reply #4 on: May 13, 2024, 09:20:10 pm »
That is too much of a "magic incantation" for my liking.

Why is 250 the "right" number? Why not 251 or 249 or ... Is it possible that 250 that in some strange way the number is also affecting the simulation in some unknown way?

I prefer, where possible, to identify a cause for a "simulation failure", e.g. a perfectly balanced circuit or disconnected node causing the matrix to become ill-conditioned.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline ledtesterTopic starter

  • Super Contributor
  • ***
  • Posts: 3084
  • Country: us
Re: Having trouble simulating two multivibrators in LTspice
« Reply #5 on: May 13, 2024, 11:04:48 pm »
That is too much of a "magic incantation" for my liking.
...

If I change R1, R3, R5 and R7 to 2K I need to reduce the max timestep to 4u... at 5u it doesn't work.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19861
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Having trouble simulating two multivibrators in LTspice
« Reply #6 on: May 13, 2024, 11:37:51 pm »
That is too much of a "magic incantation" for my liking.
...

If I change R1, R3, R5 and R7 to 2K I need to reduce the max timestep to 4u... at 5u it doesn't work.

What are the nodal voltages when it doesn't start? If each side is equal then it might be starting in a metastable state. That won't happen in a real circuit due to noise and non-ideal components.

Try making one of the capacitors 1% larger than the other, and see what happens.
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 

Offline ledtesterTopic starter

  • Super Contributor
  • ***
  • Posts: 3084
  • Country: us
Re: Having trouble simulating two multivibrators in LTspice
« Reply #7 on: May 13, 2024, 11:51:54 pm »
What are the nodal voltages when it doesn't start? If each side is equal then it might be starting in a metastable state. That won't happen in a real circuit due to noise and non-ideal components.

Try making one of the capacitors 1% larger than the other, and see what happens.

So I think the problem was that I thought using .ic V(C1)=... actually did anything. If I instead set the voltage of nodes n001 and n005 to 50m (DC analysis value is 33m) then I don't need the max timestep setting in the .trans directive.

I have another post asking why setting the initial voltage of a cap doesn't seem to do anything.
 

Offline tggzzz

  • Super Contributor
  • ***
  • Posts: 19861
  • Country: gb
  • Numbers, not adjectives
    • Having fun doing more, with less
Re: Having trouble simulating two multivibrators in LTspice
« Reply #8 on: May 13, 2024, 11:54:13 pm »
The other trick is to "kick" the circuit, to disturb any equilibrium. Instead of having a DC power supply, have a pulse with a risetime of, say, 1µs.

Then, with a 1% variation in capacitors, one side should rise slightly faster than the other, and that's all that's needed.
« Last Edit: May 13, 2024, 11:56:35 pm by tggzzz »
There are lies, damned lies, statistics - and ADC/DAC specs.
Glider pilot's aphorism: "there is no substitute for span". Retort: "There is a substitute: skill+imagination. But you can buy span".
Having fun doing more, with less
 
The following users thanked this post: ledtester


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf