LTspice oscillator sim settings? - Page 1
Forum section: electronics / general

author: Sylvi
author_rank: Regular Contributor
timestamp: March 11, 2019, 04:07:32 pm
content: HiI'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: 80ustart time: 40utimestep: 0.0024uOn the schematic are the usual op-commands:.op.plotwinsize=0I've tried two oscillator circuits right from National Semiconductor's Linear Applications book and neither run. I assume it is just my settings.Thanks

author: Sylvi
author_rank: Regular Contributor
timestamp: March 11, 2019, 06:40:32 pm
content: HiAt 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?

author: SiliconWizard
author_rank: Super Contributor
timestamp: March 11, 2019, 06:44:40 pm
content: 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.

author: Ian.M
author_rank: Super Contributor
timestamp: March 11, 2019, 07:03:18 pm
content: 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.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: March 11, 2019, 07:19:27 pm
content: 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

author: Sylvi
author_rank: Regular Contributor
timestamp: March 12, 2019, 12:35:57 am
content: HiThanks 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 reliableI would still like to try the crystal oscillator, although this thing seems very stable.

author: Warhawk
author_rank: Frequent Contributor
timestamp: March 15, 2019, 12:02:10 pm
content: make sure you set "skip initial bias point solution" in the transient analysis window

author: HalFET
author_rank: Frequent Contributor
timestamp: March 19, 2019, 12:55:38 am
content: 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).