Author Topic: LTspice oscillator sim settings?  (Read 2880 times)

0 Members and 1 Guest are viewing this topic.

Offline SylviTopic starter

  • Regular Contributor
  • *
  • Posts: 85
  • Country: eg
LTspice oscillator sim settings?
« on: March 11, 2019, 04:07:32 pm »
Hi

I'm trying to simulate a couple of 100kHz sinewave oscillators in LTspice but I cannot get them to run.

I assume it should run using the Transient analysis tab and have set the parameters the same way as when I do  THD test at 100kHz:
Finish time: 80u
start time: 40u
timestep: 0.0024u

On the schematic are the usual op-commands:
.op
.plotwinsize=0

I've tried two oscillator circuits right from National Semiconductor's Linear Applications book and neither run. I assume it is just my settings.

Thanks
 

Offline SylviTopic starter

  • Regular Contributor
  • *
  • Posts: 85
  • Country: eg
Re: LTspice oscillator sim settings?
« Reply #1 on: March 11, 2019, 06:40:32 pm »
Hi

At first I was using the library opamp LT1013/14 which is the same as the LM324 I would like to use in real life. LT does not even list a bandwidth for this unit, so I looked up the LM324 and it is a whopping 1MHz ! That made me suspect the opamp needs higher bandwidth to make a 100kHz oscillator, so I changed it to LT1028 which always works - and it did, sort of.

With LT1028 subbed in, one of the circuits oscillated but the output was far from being a sine wave.

Another oscillator option I found is a Colpitts, which is nice and simple: a 100kHz crystal in series with 1nF, with a pair of 1nFs in series across the cap/xtal with their junction tied to ground,tThis is in the feedback path a an n-jfet with 1M gate to ground and 4k7 drain to V+. I look in the miscellaneous parts folder and there is a crystal listed. However, the specs it wants are for its parasitic elements and does not ask for the frequency !

Are there actual spice models for crystals for timing circuits?

I still suspect the settings for the test are incorrect?
 

Online SiliconWizard

  • Super Contributor
  • ***
  • Posts: 14465
  • Country: fr
Re: LTspice oscillator sim settings?
« Reply #2 on: March 11, 2019, 06:44:40 pm »
Remove the ".op" statement on the schematic. Transient simulation will automatically start with an operating point solution anyway (unless you explicitely choose to skip it).
Is there a ".tran" statement on the schematic or not? If not, it will just run the OP. If so, an "operating point" window will pop up.

Post the .asc file so that it will be much easier to help than trying to guess.
 

Offline Ian.M

  • Super Contributor
  • ***
  • Posts: 12856
Re: LTspice oscillator sim settings?
« Reply #3 on: March 11, 2019, 07:03:18 pm »
What do you expect to happen with a total sim runtime of only eight cycles on the nominal oscillator frequency?   If the loop gain of the oscillator is too high before clipping/limiting cuts in to reduce it to unity, there will be a lot of distortion so most sinewave oscilators have an initial loop gain only slightly greater than unity, so it takes a looooooooooooong time for the oscillation to build up then settle at its final amplitude.   Crystal oscillators are a special case, due to the extremely high Q of the crystal, even though the initial loop gain is high, it takes thousands of cycles to excite the crystal resonance to its normal amplitude.
 

Offline Jay_Diddy_B

  • Super Contributor
  • ***
  • Posts: 2733
  • Country: ca
Re: LTspice oscillator sim settings?
« Reply #4 on: March 11, 2019, 07:19:27 pm »
Hi,

Can you attached your .asc file to your post?

Many (real) oscillator circuits require some noise, or some step to start. Simulated oscillators sometimes need a disturbance to start.

Jay_Diddy_B
 

Offline SylviTopic starter

  • Regular Contributor
  • *
  • Posts: 85
  • Country: eg
Re: LTspice oscillator sim settings?
« Reply #5 on: March 12, 2019, 12:35:57 am »
Hi

Thanks for the replies.

The good advice was to set a longer run time. That let me see the circuits do what they were doing even tho0ugh it was nt being a good oscillator. I switched to a completely different circuit which starts up quick and oscillates like it should. This one is not designed to be a sine output but a pulse output. However, taking the signal off the timing cap gives close to a sine, then filtering it makes it quite nice.

With the new circuit, I could have left the stop time at 80u but I just halt it when there are enough waves and magnify a section to check the period of the wave. I tried it with slow opamps and fast ones. The slow opamps actually made a very nice n nearly-sine wave right at the timing cap but it benefited from having the filtering. The different opamps needed different time constants to operate at around 100kHz while providing the proper sine shape at the final output. This seemed to be balancing against some limitations of the opamps, which is probably not reliable :)

I would still like to try the crystal oscillator, although this thing seems very stable.
 

Offline Warhawk

  • Frequent Contributor
  • **
  • Posts: 821
  • Country: 00
    • Personal resume
Re: LTspice oscillator sim settings?
« Reply #6 on: March 15, 2019, 12:02:10 pm »
make sure you set "skip initial bias point solution" in the transient analysis window

Offline HalFET

  • Frequent Contributor
  • **
  • Posts: 512
  • Country: 00
Re: LTspice oscillator sim settings?
« Reply #7 on: March 19, 2019, 12:55:38 am »
Don't forget that some oscillators their start behaviour can heavily depend on the noise in the circuit. So if the numerical noise and transients aren't enough to start it, manually add some noise to your power supply rail with the white() command ( http://ltwiki.org/?title=B_sources_%28complete_reference%29 ).
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf