Forums

Learning about oscillators in LTSpice

Started by Clifford Heath October 21, 2010
Hysteresis and oscillators work well for me, when they work at all.  I've 
discovered my fair share of simple yet "unsimulatable" circuits.

Tim

-- 
Deep Friar: a very philosophical monk.
Website: http://webpages.charter.net/dawill/tmoranwms

"Paul Keinanen" <keinanen@sci.fi> wrote in message 
news:8lh9c652ditl18on8n1h6iln2olpbrgnlm@4ax.com...
> On Fri, 22 Oct 2010 10:45:26 +1100, Clifford Heath > <no.spam@please.net> wrote: > >>I'm just getting started with LTSpice, and played yesterday >>with some Colpitts oscillators to my satisfaction. Today I >>tried a Hartley, and I can't understand some of the behaviour >>I'm seeing. > > Do current circuit simulators really work (produce usable results) > with oscillators (thermal noise amplifiers with frequency selective > positive feedback with voltage limitation, satisfying the Barkhausen > oscillation criterion) ? > > At least in the old days, positive feedback did cause a lot of > problems in most simulation packages. >
Paul Keinanen wrote:
> Do current circuit simulators really work (produce usable results) > with oscillators
Spice does not take a simplistic approach, and seems to model the noise and many other characteristics pretty well. You can see the effects of using different transistors, for example. That said, there are two possible questions implied: 1) Can a Spice simulation truly reflect real-world behaviour? 2) Do Spice simulations actually reflect real-world behaviour? My (newbie) feeling is that the answer to (1) is yes, it can. Whether or to what extent (2) is the case depends on how good your models are. I haven't built even a substantial fraction of the things I've simulated, but I think the models seem pretty good. I'd expect the results to mostly match up. Might need to adjust drive levels etc to get best purity, but Spice will get you into the right ball-park. Seeing as I don't have a spectrum analyser for final optimisation, that's pretty important. Even if the predicted behaviour doesn't match exactly, the *kinds* of behaviour still match, so I've still learned enough about oscillators to have a fair shot at debugging one in hardware without having a lot of expensive equipment. The other thing that makes me trust LTSpice is that many very experienced and learned folk here use it, a lot. They know when they can trust it and when not, of course - experience will do that to you. :-) Best of all, I don't need to use Windoze - it works fine under Wine on my Intel Mac, or on Linux. Clifford Heath.
On Mon, 25 Oct 2010 19:09:22 +1000, Clifford Heath wrote:

> Fred Abse wrote: >> I've not been able to reproduce your result, Are you sure it wasn't an >> artifact of aliasing in your displayed waveform? > > Yes, I'm sure, but nm, I can't do it again myself, despite fiddling > with this stuff for more than ten hours yesterday. > >> Oscillators squeg when the drive builds up, maybe over several cycles, > > I found a few more ways to do it yesterday too, and I have some > notion of how to handle it, though a few examples surprised me. > In particular this article from ED, which purports to show an > anti-squegging biassing for a Colpitts, but which will happily squegg > with even quite small changes (short url <http://bit.ly/d8nqxl> or > <http://electronicdesign.com/article/analog-and-mixed-signal/use-current-mirror-biasing-to-avoid-squegging-in-r.aspx> > Increase the 5.1K bias resistor, for example. > > The inductor in the emitter is the only innovation that improves > the Colpitts circuit I already had. And maybe temp compensation on > the biassing, from the transistor matching, but I don't know how > to Spice that. ColpittsEL.asc is attached below. > >> I've had trouble with fast transistors, where tracks were resonating, > > My circuits don't model track lengths, but there is lead inductance > and internal and external capacitance, so maybe that reaches 500MHz. > >> A 2N2222 will go quite nicely at over 100MHz > > Yes, but needs a lot more drive than the BFR93A because it has less gain. > The CA3046 suggested by ED is better, if you can use the extra transistors. > >> Try and keep the L/C ratio high, remembering that: > > Ahh yes, I'd discovered that. That makes sense. > >> That's because you're starving the transistor of drive with the smaller >> capacitor. > > But it's biassed, so never turns off, and oscillates. All of these > oscillators use the transistor to deliver short pulses of collector > current, with the transistor off-ish in between, so as long as it > starts, why should low drive cause impurity? >
Try stepping the value of C2 to see what happens.
> > ------------------- Cut Here for ColpittsEL.asc -------------------
Slow startup. Will need buffering - Try loading it with 10k and watch it squeg. Quite clean, though. -- "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." (Richard Feynman)
Fred Abse wrote:
> On Mon, 25 Oct 2010 19:09:22 +1000, Clifford Heath wrote: >> But it's biassed, so never turns off, and oscillates. All of these >> oscillators use the transistor to deliver short pulses of collector >> current, with the transistor off-ish in between, so as long as it >> starts, why should low drive cause impurity? > Try stepping the value of C2 to see what happens.
Low C2: bad purity. High C2: squegging. I thought that purity would increase as I lowered C2, until oscillation stops. I can see *what* is happening, but I still don't really know why. A lower C2 should reduce the load on the tank and let it ring more freely, shouldn't it? Also, the optimum C2 falls in a quite small range, which will depend on the actual transistor characteristics; unfortunate.
>> ------------------- Cut Here for ColpittsEL.asc ------------------- > Slow startup.
It got a lot slower as I reduced the base resister to lower the current consumption. The inductive load in the emitter seems to roughly halve the required current for a given tank amplitude, vs having a resister there.
> Will need buffering
I planned to do that anyhow - don't want any downstream circuitry introducing phase noise and pulling the frequency. This will be a VCO in a synthesizer, I just haven't put the tuning diode there yet - I wanted to understand the bare oscillator first. So frequency pulling shouldn't be a problem, but phase noise is.
> Try loading it with 10k and watch it squeg.
The attached circuit shows the original effect I was asking about, if you set C2 to 20pF. There's a 6-10MHz amplitude modulation on the 49MHz carrier. I can't see it in the FFT, I got it from the envelope. You'll need to set up the BFR93A yourself. Anyhow, it's clearly starting to squegg, and this discussion has educated me about why. Thanks! Clifford Heath. ------------------- Cut here for HartleySub.asc ------------------- Version 4 SHEET 1 884 680 WIRE 208 -176 32 -176 WIRE 432 -176 208 -176 WIRE 32 -128 32 -176 WIRE 208 0 208 -176 WIRE -208 48 -336 48 WIRE -112 48 -208 48 WIRE 32 48 32 -48 WIRE 32 48 -48 48 WIRE 144 48 32 48 WIRE 432 48 432 -176 WIRE -208 144 -208 128 WIRE -336 208 -336 48 WIRE -208 240 -208 224 WIRE 208 240 208 96 WIRE 208 240 -208 240 WIRE 576 240 208 240 WIRE -208 256 -208 240 WIRE 32 272 32 48 WIRE -336 400 -336 272 WIRE -208 400 -208 336 WIRE -208 400 -336 400 WIRE 32 400 32 352 WIRE 32 400 -208 400 WIRE 432 400 432 128 WIRE 432 400 32 400 WIRE 576 400 432 400 WIRE 432 448 432 400 FLAG 576 240 OscOut IOPIN 576 240 Out FLAG 576 400 0 FLAG 432 448 0 FLAG -336 48 Tank SYMBOL res 16 256 R0 SYMATTR InstName R11 SYMATTR Value 4k7 SYMBOL res 16 -144 R0 SYMATTR InstName R10 SYMATTR Value 47k SYMBOL voltage 432 32 R0 WINDOW 123 0 0 Left 0 WINDOW 39 0 0 Left 0 SYMATTR InstName V1 SYMATTR Value 9v SYMBOL ind -224 128 R0 SYMATTR InstName L2 SYMATTR Value .06u SYMBOL cap -352 208 R0 SYMATTR InstName C1 SYMATTR Value 22pF SYMBOL ind -224 352 M180 WINDOW 0 36 80 Left 0 WINDOW 3 36 40 Left 0 SYMATTR InstName L1 SYMATTR Value .4u SYMBOL cap -48 32 R90 WINDOW 0 0 32 VBottom 0 WINDOW 3 32 32 VTop 0 SYMATTR InstName C2 SYMATTR Value 10pf SYMBOL res -224 32 R0 SYMATTR InstName R1 SYMATTR Value 0.01ohm SYMBOL custom\\bfr93a 144 0 R0 SYMATTR InstName Q1 TEXT -480 -168 Left 0 !.tran 0 10u 0s 1ns TEXT -160 264 Left 0 ;K1 L1 L2 1
On Tue, 26 Oct 2010 19:26:48 +1000, Clifford Heath wrote:

> The attached circuit shows the original effect I was asking about, > if you set C2 to 20pF. There's a 6-10MHz amplitude modulation on > the 49MHz carrier. I can't see it in the FFT, I got it from the > envelope. You'll need to set up the BFR93A yourself.
I can see on the FFT. Sidebands at +/- 7.2Mhz about 30dB down. Noise floor ain't that good, either. Spectrum posted to A.B.S.E -- "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." (Richard Feynman)
Fred Abse wrote:
> On Tue, 26 Oct 2010 19:26:48 +1000, Clifford Heath wrote: >> The attached circuit shows the original effect I was asking about, >> if you set C2 to 20pF. There's a 6-10MHz amplitude modulation on >> the 49MHz carrier. I can't see it in the FFT, I got it from the >> envelope. You'll need to set up the BFR93A yourself. > I can see on the FFT. > Sidebands at +/- 7.2Mhz about 30dB down.
Right - but it's hard to see because, as you say, there's noise all over the floor ;-). IOW it's not a clean 7MHz modulation, it's a noisy modulation that contains more noise at 7MHz than elsewhere. Nice clean signal with 10pF instead, marginal oscillation with poor purity at 4pf. It surprises me that it only works over a 2:1 range either side of optimum. But then, I think the problem with a Hartley is this: the amplitude is limited by Q and the the "on" conductance of the active device (and the stiffness of the supply). That determines the peak current, and hence the amount of energy that can be pumped into the tank on each cycle. Multiply by Q to get the amplitude. In a Colpitts on the other hand, the energy is pumped into a capacitor, so amplitude is limited by Q and *voltage* rather than current. As long as the device turns on to a significantly lower impedance than the tank presents to it, differences in the device will have little effect on the amplitude. A collector resister will further degenerate device differences, if there's a wide spread. You can do that in a Hartley too, but you can get a subharmonic at the R/L TC, at least if it's anywhere near a harmonic relationship (try 50R for example). I think this shows why Hartleys are harder to tame than Colpitts. I'll go with the Colpitts for my VCO, with an inductive emitter load to reduce power consumption. Clifford Heath.
On Wed, 27 Oct 2010 22:54:38 +1000, Clifford Heath wrote:

> I think this shows why Hartleys are harder to tame than > Colpitts. I'll go with the Colpitts for my VCO, with an > inductive emitter load to reduce power consumption.
I'd go with the Hartley. It's got better behavior under load. See 5k, 10k, 20k load spectra in A.B.S.E. 20k up, it's clean. Starts much faster. Keep it around 50MHz and triple it. -- "For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." (Richard Feynman)
phase noise simulation possible with LTspice?if how?
On Fri, 25 Jul 2014 02:25:46 -0700, sk.yeahia been sayeed  
<yeahia14@gmail.com> wrote:

> phase noise simulation possible with LTspice?if how?
There is a way to combine .noise and .tran analyses into a single analysis I call, .tranoise The idea is to expand the models to appropriately include noise, then when tran runs the 'effects' from all those noise sources shows up and you get a very accurate picture of what is going on. For example, analog OpAmps show 'fuzz' on the time line plots, the spectrum analysis shows an accurate noise floor, when an OpAmp is driven into slew rate limit, you can see the noise floor jump, mixers/non-linear circuitry changes the noise, etc Perhaps, using .tranoise to simulate an oscillator would more realistically provide the 'starting' impetus AND once running accurately allow you to measure phase noise. ...To refresh my memory, doesn't phase noise cause what should be a line on the spectrum analyzer to spread slightly creating what's called, a 'skirt' at the bottom of the spectrum plot? Instead of a line, you get this teepee shaped output. I vaguely remember seeing little +/-60, 120Hz lines too.
On Fri, 25 Jul 2014 06:07:51 -0700, RobertMacy
<robert.a.macy@gmail.com> wrote:

>On Fri, 25 Jul 2014 02:25:46 -0700, sk.yeahia been sayeed ><yeahia14@gmail.com> wrote: > >> phase noise simulation possible with LTspice?if how? > >There is a way to combine .noise and .tran analyses into a single analysis >I call, .tranoise > >The idea is to expand the models to appropriately include noise, then when >tran runs the 'effects' from all those noise sources shows up and you get >a very accurate picture of what is going on. For example, analog OpAmps >show 'fuzz' on the time line plots, the spectrum analysis shows an >accurate noise floor, when an OpAmp is driven into slew rate limit, you >can see the noise floor jump, mixers/non-linear circuitry changes the >noise, etc > >Perhaps, using .tranoise to simulate an oscillator would more >realistically provide the 'starting' impetus AND once running accurately >allow you to measure phase noise. ...To refresh my memory, doesn't phase >noise cause what should be a line on the spectrum analyzer to spread >slightly creating what's called, a 'skirt' at the bottom of the spectrum >plot? Instead of a line, you get this teepee shaped output. I vaguely >remember seeing little +/-60, 120Hz lines too. > > > > >
Right. You'd have to build multiple independent time-domain noise generators and add them to all the resistors and semiconductors and power supplies in a time-domain sim. LT Spice doesn't include Johnson or shot noise in a transient sim. Version 4 SHEET 1 880 680 WIRE 320 64 128 64 WIRE 368 64 320 64 WIRE 400 64 368 64 WIRE 128 96 128 64 WIRE 320 112 320 64 WIRE 128 208 128 176 WIRE 320 208 320 192 FLAG 128 208 0 FLAG 320 208 0 FLAG 368 64 NOISE SYMBOL bv 128 80 R0 WINDOW 0 -198 53 Left 2 WINDOW 3 -336 104 Left 2 SYMATTR InstName B1 SYMATTR Value V=random(100*time) - 0.5 SYMBOL res 304 96 R0 WINDOW 0 -59 37 Left 2 WINDOW 3 -56 73 Left 2 SYMATTR InstName R1 SYMATTR Value 1 TEXT -96 64 Left 2 !.tran 5 is one way to make some noise. -- John Larkin Highland Technology, Inc jlarkin att highlandtechnology dott com http://www.highlandtechnology.com