Author Topic: Help with modeling multivibrators in LTspice  (Read 408 times)

0 Members and 1 Guest are viewing this topic.

Offline jj5Topic starter

  • Regular Contributor
  • *
  • Posts: 96
  • Country: au
  • Still learning about electronics...
    • In The Lab With Jay Jay
Help with modeling multivibrators in LTspice
« on: May 13, 2024, 12:09:22 am »
Hi there. I wonder if someone can help me, I am quite lost.

What I am trying to do is model a system of two multivibrators in LTspice. On the output I am expecting to see an audio frequency driving a piezoelectric buzzer, but the simulation just seems to show a constant voltage of 9V.

I wonder, can anyone explain what is wrong with my model? Following is a screenshot and the LTspice file is available here.

 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3084
  • Country: us
Re: Help with modeling multivibrators in LTspice
« Reply #1 on: May 13, 2024, 02:07:19 am »
I first just tried getting the two-transistor astable multivibrator to work in ltspice and here's what I had to do:

1. Use a real transistor model (e.g. 2n2222) instead of the generic one
2. Specify an initial condition on one of the caps
3. Add the "uic" option to the transient analysis directive.

#2 disrupts the symmetry in the circuit so that it will start to oscillate.

To set the initial voltage on a cap see this post:

https://www.eevblog.com/forum/beginners/ltspice-what-does-ic-v(c1)10-actually-do/msg5497798/#msg5497798

or you can set the initial voltage of a node on one side of the cap using the .IC V(...)=... directive.

Another way to disrupt the symmetry is to make one of the cap values slightly different from the other.

Note that the .asc file attached below is flawed in that it attempts to set the initial cap voltage using .IC V(C1)=... which seems to be quietly ignored by ltspice.

... and the LTspice file is available here.

It's better to upload the asc file as part of your post.
« Last Edit: May 14, 2024, 12:12:04 am by ledtester »
 
The following users thanked this post: jj5

Offline MathWizard

  • Super Contributor
  • ***
  • Posts: 1489
  • Country: ca
Re: Help with modeling multivibrators in LTspice
« Reply #2 on: May 13, 2024, 02:21:59 am »
I'll usually start the external sources at 0, if some circuit won't osc, but I'll have to remember to try setting some cap voltage or inductor current, if that doesn't work.
 
The following users thanked this post: jj5

Offline jj5Topic starter

  • Regular Contributor
  • *
  • Posts: 96
  • Country: au
  • Still learning about electronics...
    • In The Lab With Jay Jay
Re: Help with modeling multivibrators in LTspice
« Reply #3 on: May 13, 2024, 03:22:56 am »
I got it working! Thanks! :D

This is the first time I have successfully conducted a non-trivial SPICE simulation, so for me this is milestone.

I have attached a screenshot and my .asc file.

Thanks again!
 

Offline ledtester

  • Super Contributor
  • ***
  • Posts: 3084
  • Country: us
Re: Help with modeling multivibrators in LTspice
« Reply #4 on: May 13, 2024, 11:54:24 pm »
 
The following users thanked this post: jj5

Offline jj5Topic starter

  • Regular Contributor
  • *
  • Posts: 96
  • Country: au
  • Still learning about electronics...
    • In The Lab With Jay Jay
Re: Help with modeling multivibrators in LTspice
« Reply #5 on: May 14, 2024, 03:26:39 am »
Excellent. Thanks again! For the record I made a video about this over here:

 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf