Electronics-Related.com
Forums

Colpitts crystal oscillator in LTSPICE

Started by bitrex July 25, 2015
On 7/25/2015 11:07 PM, John Larkin wrote:
> On Sat, 25 Jul 2015 21:17:32 -0400, bitrex > <bitrex@de.lete.earthlink.net> wrote: > >> On 7/25/2015 7:46 PM, John Larkin wrote: >>> On Sat, 25 Jul 2015 17:14:35 -0400, bitrex >>> <bitrex@de.lete.earthlink.net> wrote: >>> >>>> On 7/25/2015 12:12 PM, John Larkin wrote: >>>>> On Sat, 25 Jul 2015 10:56:05 -0400, bitrex >>>>> <bitrex@de.lete.earthlink.net> wrote: >>>>> >>>>>> I'm trying to simulate a low frequency Colpitts oscillator in LTSpice >>>>>> using an NPN darlington and a crystal, and I'm having a lot of trouble >>>>>> getting it to start up. Does anyone have a working one of these? I'm >>>>>> just using a capacitor to simulate the crystal, the parameters I am >>>>>> working with are something like: >>>>>> >>>>>> motional capacitance: 5.3ff >>>>>> ESR = 11k >>>>>> ESI ~ 4500 henries >>>>>> EPR = 100 meg >>>>>> EPC = 1.5pf >>>>>> >>>>>> Does this seem plausible? >>>>> >>>>> Select "skip initial operating point" in the transient analysis, or it >>>>> will never start. Or goose it as Phil suggests. >>>>> >>>>> XOs are terrible to sim in time domain. The sims take forever and >>>>> there's no reasonable way to measure the frequency to PPM resolution. >>>>> Once I get one running, I cut over to AC loop analysis to fine-tune >>>>> things. >>>>> >>>>> Post your netlist so people can play with it. >>>>> >>>>> >>>> >>>> Here's a Dropbox link to the files: >>>> >>>> https://www.dropbox.com/sh/txmcmhn6p7fhuh2/AACKLnAh-41bI2jO7UT4wjCza?dl=0 >>>> >>>> I'm actually attempting to use the Darlington buffer inside a LM13700 >>>> section to build a Colpitts crystal oscillator, which will then be 2 >>>> quadrant multiplied by an external signal within the transconductance >>>> amp itself... >>> >>> I'd guess that C2 and C3 are way too big. >>> >>> >> >> Lowering C2 and C3 to 470p, making the emitter resistor 4.7k, keeping >> the feedback cap the same and setting the crystal resonant frequency to >> 500kHz makes it start up. > > Don't quit now; keep going. > > And maybe make the upper one a bit smaller than the lower one. But I > never understood Colpitts oscillators. > > I did recently design one using a coaxial ceramic resonator, at 600 > MHz. It works fine even if I don't understand it.
Wes Hayward's book "Radio Frequency Design" has a pretty good section on analysis of the various LC oscillator topologies on pages 265-290, and how to plot the gain and phase angle as a function of emitter current. The book is very math-heavy in general, it's like the anti-AoE.
On 7/25/2015 11:07 PM, John Larkin wrote:
> On Sat, 25 Jul 2015 21:17:32 -0400, bitrex > <bitrex@de.lete.earthlink.net> wrote: > >> On 7/25/2015 7:46 PM, John Larkin wrote: >>> On Sat, 25 Jul 2015 17:14:35 -0400, bitrex >>> <bitrex@de.lete.earthlink.net> wrote: >>> >>>> On 7/25/2015 12:12 PM, John Larkin wrote: >>>>> On Sat, 25 Jul 2015 10:56:05 -0400, bitrex >>>>> <bitrex@de.lete.earthlink.net> wrote: >>>>> >>>>>> I'm trying to simulate a low frequency Colpitts oscillator in LTSpice >>>>>> using an NPN darlington and a crystal, and I'm having a lot of trouble >>>>>> getting it to start up. Does anyone have a working one of these? I'm >>>>>> just using a capacitor to simulate the crystal, the parameters I am >>>>>> working with are something like: >>>>>> >>>>>> motional capacitance: 5.3ff >>>>>> ESR = 11k >>>>>> ESI ~ 4500 henries >>>>>> EPR = 100 meg >>>>>> EPC = 1.5pf >>>>>> >>>>>> Does this seem plausible? >>>>> >>>>> Select "skip initial operating point" in the transient analysis, or it >>>>> will never start. Or goose it as Phil suggests. >>>>> >>>>> XOs are terrible to sim in time domain. The sims take forever and >>>>> there's no reasonable way to measure the frequency to PPM resolution. >>>>> Once I get one running, I cut over to AC loop analysis to fine-tune >>>>> things. >>>>> >>>>> Post your netlist so people can play with it. >>>>> >>>>> >>>> >>>> Here's a Dropbox link to the files: >>>> >>>> https://www.dropbox.com/sh/txmcmhn6p7fhuh2/AACKLnAh-41bI2jO7UT4wjCza?dl=0 >>>> >>>> I'm actually attempting to use the Darlington buffer inside a LM13700 >>>> section to build a Colpitts crystal oscillator, which will then be 2 >>>> quadrant multiplied by an external signal within the transconductance >>>> amp itself... >>> >>> I'd guess that C2 and C3 are way too big. >>> >>> >> >> Lowering C2 and C3 to 470p, making the emitter resistor 4.7k, keeping >> the feedback cap the same and setting the crystal resonant frequency to >> 500kHz makes it start up. > > Don't quit now; keep going. > > And maybe make the upper one a bit smaller than the lower one. But I > never understood Colpitts oscillators. > > I did recently design one using a coaxial ceramic resonator, at 600 > MHz. It works fine even if I don't understand it. > >
There's also apparently a variation on the Colpitts where the crystal is inserted in the feedback path instead of parallel to the capacitors, to resonate at the series resonant frequency. I may try that one as well.
On Sat, 25 Jul 2015 23:53:34 -0400, bitrex
<bitrex@de.lete.earthlink.net> wrote:

>On 7/25/2015 11:07 PM, John Larkin wrote: >> On Sat, 25 Jul 2015 21:17:32 -0400, bitrex >> <bitrex@de.lete.earthlink.net> wrote: >> >>> On 7/25/2015 7:46 PM, John Larkin wrote: >>>> On Sat, 25 Jul 2015 17:14:35 -0400, bitrex >>>> <bitrex@de.lete.earthlink.net> wrote: >>>> >>>>> On 7/25/2015 12:12 PM, John Larkin wrote: >>>>>> On Sat, 25 Jul 2015 10:56:05 -0400, bitrex >>>>>> <bitrex@de.lete.earthlink.net> wrote: >>>>>> >>>>>>> I'm trying to simulate a low frequency Colpitts oscillator in LTSpice >>>>>>> using an NPN darlington and a crystal, and I'm having a lot of trouble >>>>>>> getting it to start up. Does anyone have a working one of these? I'm >>>>>>> just using a capacitor to simulate the crystal, the parameters I am >>>>>>> working with are something like: >>>>>>> >>>>>>> motional capacitance: 5.3ff >>>>>>> ESR = 11k >>>>>>> ESI ~ 4500 henries >>>>>>> EPR = 100 meg >>>>>>> EPC = 1.5pf >>>>>>> >>>>>>> Does this seem plausible? >>>>>> >>>>>> Select "skip initial operating point" in the transient analysis, or it >>>>>> will never start. Or goose it as Phil suggests. >>>>>> >>>>>> XOs are terrible to sim in time domain. The sims take forever and >>>>>> there's no reasonable way to measure the frequency to PPM resolution. >>>>>> Once I get one running, I cut over to AC loop analysis to fine-tune >>>>>> things. >>>>>> >>>>>> Post your netlist so people can play with it. >>>>>> >>>>>> >>>>> >>>>> Here's a Dropbox link to the files: >>>>> >>>>> https://www.dropbox.com/sh/txmcmhn6p7fhuh2/AACKLnAh-41bI2jO7UT4wjCza?dl=0 >>>>> >>>>> I'm actually attempting to use the Darlington buffer inside a LM13700 >>>>> section to build a Colpitts crystal oscillator, which will then be 2 >>>>> quadrant multiplied by an external signal within the transconductance >>>>> amp itself... >>>> >>>> I'd guess that C2 and C3 are way too big. >>>> >>>> >>> >>> Lowering C2 and C3 to 470p, making the emitter resistor 4.7k, keeping >>> the feedback cap the same and setting the crystal resonant frequency to >>> 500kHz makes it start up. >> >> Don't quit now; keep going. >> >> And maybe make the upper one a bit smaller than the lower one. But I >> never understood Colpitts oscillators. >> >> I did recently design one using a coaxial ceramic resonator, at 600 >> MHz. It works fine even if I don't understand it. > >Wes Hayward's book "Radio Frequency Design" has a pretty good section on >analysis of the various LC oscillator topologies on pages 265-290, and >how to plot the gain and phase angle as a function of emitter current. > >The book is very math-heavy in general, it's like the anti-AoE.
Spice has made all sorts of math unnecessary. Math tends to sputter out when things get nonlinear anyhow. -- John Larkin Highland Technology, Inc lunatic fringe electronics jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
On Sat, 25 Jul 2015 11:02:56 -0400, Phil Hobbs
<pcdhSpamMeSenseless@electrooptical.net> wrote:

>On 7/25/2015 10:59 AM, Phil Hobbs wrote: >> On 7/25/2015 10:56 AM, bitrex wrote: >>> I'm trying to simulate a low frequency Colpitts oscillator in LTSpice >>> using an NPN darlington and a crystal, and I'm having a lot of trouble >>> getting it to start up. Does anyone have a working one of these? I'm >>> just using a capacitor to simulate the crystal, the parameters I am >>> working with are something like: >>> >>> motional capacitance: 5.3ff >>> ESR = 11k >>> ESI ~ 4500 henries >>> EPR = 100 meg >>> EPC = 1.5pf >>> >>> Does this seem plausible? >> >> The crystal has to be in its inductive region for a Colpitts to work. >> > >Oh, and you can make simulated oscillators start faster by putting a >current source in parallel with the inductor. Make it 1 uA or >something, and drop it to zero near the start of the simulation. That's >the SPICE equivalent of plucking a guitar string.
To satisfy the Barkhausen requirements, shouldn't you model the startup condition as a linear amplifier and a frequency selective feedback network ? Inject some low level white noise (thermal noise) into the amplifier input and for each cycle around the feedback loop, the amplitude at the peak frequency will grow, while the relative noise bandwidth decreases drastically and soon or later you will have a single spectral line. Finally the amplifier runs in a saturated state with constant amplitude output. The amplifier should initially be biased into Class-A so that it will amplify the weak thermal noise, but of course, when the maximum amplitude has been reached during startup, it can/will run in Class-C. If the oscillator is initially biased into Class-C, it is not capable of amplifying the weak thermal noise and you need some external kick-start, e.g. rapidly applying the power supply voltage. This also explains why some oscillators starts nicely, when battery power is applied, but fails to start when connected to a mains power supply, which takes a while to start when the storage capacitors are slowly charging, after plugging it into mains socket.
>To satisfy the Barkhausen requirements, shouldn't you model the >startup condition as a linear amplifier and a frequency selective >feedback network ?
Sure. That's why I suggested using a much smaller current step omce the sim looks OK, to check for startup problems. If the initial transient dies away rather than continuing, the gain is too low. Thing is, being an iterative ODE solver, SPICE uses all sorts of heuristics and fairly coarse convergence checks that make it flaky and unreliable for very small signals. You have to supply an initial amplitude big enough to not get ignored if you want reliable (simulated) startup. When not using ALC, it's a good idea to arrange the bias so that amplitude limiting happens due to cutoff, which is clean and fast, rather than saturation, which is neither. Cheers Phil Hobbs
On Sun, 26 Jul 2015 01:48:27 -0700 (PDT), Phil Hobbs
<pcdhobbs@gmail.com> wrote:

> >>To satisfy the Barkhausen requirements, shouldn't you model the >>startup condition as a linear amplifier and a frequency selective >>feedback network ? > >Sure. That's why I suggested using a much smaller current step >omce the sim looks OK, to check for startup problems.
Trying to start a (simulated) oscillator with external transient either relies on: a.) the transient puts the amplifier momentarily from Class-C to Class-A and amplifies everything during startup b.) the startup transient contains so steep waveforms containing frequencies in the feedback filter bandwidth that then can be amplified
> If the initial transient dies away rather than continuing, the gain is too low.
In case b.) the amplifier gain would have to be as high as 100 dB, if you have a crystal in the feedback path :-)
>Thing is, being an iterative ODE solver, SPICE uses all sorts of heuristics >and fairly coarse convergence checks that make it flaky and unreliable for > very small signals. >You have to supply an initial amplitude big enough to not get ignored if >you want reliable (simulated) startup.
Have you tried to "unwind" the startup with a number of cascaded stages ? You would require a noise source (say a resistor at room temperature generating -174 dBm/Hz noise temperature) followed by your amplification stage (transistor with fT limitations) followed by your oscillator feedback frequency response. Instead of using feedback, connect the output of the filter to the next identical amplifier/filter stages. With 20 dB stages, you would need 10-30 stages, until the amplifier stages are overdriven.
>When not using ALC, it's a good idea to arrange the bias so that amplitude limiting happens due to cutoff, which is clean and fast, rather than saturation, which is neither.
That is an other kettle of worms how to handle the steady state situation (phase noise etc.)
> >Cheers > >Phil Hobbs
On Sun, 26 Jul 2015 13:57:46 +0300, upsidedown@downunder.com wrote:

>On Sun, 26 Jul 2015 01:48:27 -0700 (PDT), Phil Hobbs ><pcdhobbs@gmail.com> wrote: > >> >>>To satisfy the Barkhausen requirements, shouldn't you model the >>>startup condition as a linear amplifier and a frequency selective >>>feedback network ? >> >>Sure. That's why I suggested using a much smaller current step >>omce the sim looks OK, to check for startup problems. > >Trying to start a (simulated) oscillator with external transient >either relies on: > >a.) the transient puts the amplifier momentarily from Class-C to >Class-A and amplifies everything during startup > >b.) the startup transient contains so steep waveforms containing >frequencies in the feedback filter bandwidth that then can be >amplified > >> If the initial transient dies away rather than continuing, the gain is too low. > >In case b.) the amplifier gain would have to be as high as 100 dB, if >you have a crystal in the feedback path :-) > > >>Thing is, being an iterative ODE solver, SPICE uses all sorts of heuristics >>and fairly coarse convergence checks that make it flaky and unreliable for >> very small signals. >>You have to supply an initial amplitude big enough to not get ignored if >>you want reliable (simulated) startup. > >Have you tried to "unwind" the startup with a number of cascaded >stages ? > >You would require a noise source (say a resistor at room temperature >generating -174 dBm/Hz noise temperature) followed by your >amplification stage (transistor with fT limitations) followed by your >oscillator feedback frequency response. Instead of using feedback, >connect the output of the filter to the next identical >amplifier/filter stages.
Of course, this simulation doesn't solve the other Barkhausen criterion regarding the phase shift in the feedback loop. If for some reason (a resonator on the collector side in frequency multipliers) causes a negative feedback phase on the resonator frequency, the oscillator doesn't oscillate. As the old practical wisdom goes, amplifiers oscillate, oscillators don't oscillate :-)
On 7/25/2015 5:13 PM, krw wrote:
> On Sat, 25 Jul 2015 11:02:56 -0400, Phil Hobbs > <pcdhSpamMeSenseless@electrooptical.net> wrote: > >> On 7/25/2015 10:59 AM, Phil Hobbs wrote: >>> On 7/25/2015 10:56 AM, bitrex wrote: >>>> I'm trying to simulate a low frequency Colpitts oscillator in LTSpice >>>> using an NPN darlington and a crystal, and I'm having a lot of trouble >>>> getting it to start up. Does anyone have a working one of these? I'm >>>> just using a capacitor to simulate the crystal, the parameters I am >>>> working with are something like: >>>> >>>> motional capacitance: 5.3ff >>>> ESR = 11k >>>> ESI ~ 4500 henries >>>> EPR = 100 meg >>>> EPC = 1.5pf >>>> >>>> Does this seem plausible? >>> >>> The crystal has to be in its inductive region for a Colpitts to work. >>> >> >> Oh, and you can make simulated oscillators start faster by putting a >> current source in parallel with the inductor. Make it 1 uA or >> something, and drop it to zero near the start of the simulation. That's >> the SPICE equivalent of plucking a guitar string. > > I used to ramp the supplies to get oscillators to start (and the > simulator converge). > >> Try it with 1 nA when you're done, to check for startup problems. >> > Does that really tell much, given component tolerance? >
Sure. The amplifier has to be in normal class-A bias with adequate gain to begin with. It's all the ABSTOL and RELTOL and VOLTTOL and convergence hacks and stuff, related to SPICE being an iterative solver, that makes starting up from roundoff noise flaky. A real oscillator just needs a loop gain larger than 1.0, because it builds up exponentially from noise. A SPICE oscillator does too, but it takes awhile and doesn't always succeed unless you get it out of the mud to start with. There's nothing wrong with using a (sufficiently small) transient to get it going. All you care about for startup purposes is the gain in the small signal regime, not necessarily at 0.000000000000000000... volts. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net
On 7/26/2015 6:57 AM, upsidedown@downunder.com wrote:
> On Sun, 26 Jul 2015 01:48:27 -0700 (PDT), Phil Hobbs > <pcdhobbs@gmail.com> wrote: > >> >>> To satisfy the Barkhausen requirements, shouldn't you model the >>> startup condition as a linear amplifier and a frequency >>> selective feedback network ? >> >> Sure. That's why I suggested using a much smaller current step omce >> the sim looks OK, to check for startup problems. > > Trying to start a (simulated) oscillator with external transient > either relies on: > > a.) the transient puts the amplifier momentarily from Class-C to > Class-A and amplifies everything during startup
It had better be Class A at startup, or you're guaranteed a lot of midnight phone calls. Have you ever shipped an oscillator that wasn't Class A in quiescent conditions?
> > b.) the startup transient contains so steep waveforms containing > frequencies in the feedback filter bandwidth that then can be > amplified > >> If the initial transient dies away rather than continuing, the gain >> is too low. > > In case b.) the amplifier gain would have to be as high as 100 dB, > if you have a crystal in the feedback path :-)
No, you misunderstand what I'm proposing. If you put a current source in parallel with the inductor, then at t=0 the full current is going through the crystal inductance. When you turn that off, the crystal rings strongly at its series resonance. A microamp of crystal current in a watch crystal is probably full amplitude, or nearly.
> > >> Thing is, being an iterative ODE solver, SPICE uses all sorts of >> heuristics and fairly coarse convergence checks that make it flaky >> and unreliable for very small signals. You have to supply an >> initial amplitude big enough to not get ignored if you want >> reliable (simulated) startup. > > Have you tried to "unwind" the startup with a number of cascaded > stages ?
No. What would I learn from that?
> > You would require a noise source (say a resistor at room temperature > generating -174 dBm/Hz noise temperature) followed by your > amplification stage (transistor with fT limitations) followed by > your oscillator feedback frequency response. Instead of using > feedback, connect the output of the filter to the next identical > amplifier/filter stages.
But they wouldn't be indentical. The phases would be independent, so there would be nothing to enforce the oscillation criterion. All you'd get would be filtered white noise, whereas a good oscillator has a much, much narrower line width than the crystal.
> With 20 dB stages, you would need 10-30 stages, until the amplifier > stages are overdriven.
20 dB is too much stage gain for a good oscillator anyway--the resonator amplitude will be too small.
> >> When not using ALC, it's a good idea to arrange the bias so that >> amplitude limiting happens due to cutoff, which is clean and fast, >> rather than saturation, which is neither. > > That is an other kettle of worms how to handle the steady state > situation (phase noise etc.)
Phase noise is the main reason you do it. If the amplifier is nonlinear, all of its baseband crap and 1/f noise gets intermodulated with the output signal. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net
On 7/26/2015 12:17 AM, John Larkin wrote:
> On Sat, 25 Jul 2015 23:53:34 -0400, bitrex > <bitrex@de.lete.earthlink.net> wrote: > >> On 7/25/2015 11:07 PM, John Larkin wrote: >>> On Sat, 25 Jul 2015 21:17:32 -0400, bitrex >>> <bitrex@de.lete.earthlink.net> wrote: >>> >>>> On 7/25/2015 7:46 PM, John Larkin wrote: >>>>> On Sat, 25 Jul 2015 17:14:35 -0400, bitrex >>>>> <bitrex@de.lete.earthlink.net> wrote: >>>>> >>>>>> On 7/25/2015 12:12 PM, John Larkin wrote: >>>>>>> On Sat, 25 Jul 2015 10:56:05 -0400, bitrex >>>>>>> <bitrex@de.lete.earthlink.net> wrote: >>>>>>> >>>>>>>> I'm trying to simulate a low frequency Colpitts oscillator in LTSpice >>>>>>>> using an NPN darlington and a crystal, and I'm having a lot of trouble >>>>>>>> getting it to start up. Does anyone have a working one of these? I'm >>>>>>>> just using a capacitor to simulate the crystal, the parameters I am >>>>>>>> working with are something like: >>>>>>>> >>>>>>>> motional capacitance: 5.3ff >>>>>>>> ESR = 11k >>>>>>>> ESI ~ 4500 henries >>>>>>>> EPR = 100 meg >>>>>>>> EPC = 1.5pf >>>>>>>> >>>>>>>> Does this seem plausible? >>>>>>> >>>>>>> Select "skip initial operating point" in the transient analysis, or it >>>>>>> will never start. Or goose it as Phil suggests. >>>>>>> >>>>>>> XOs are terrible to sim in time domain. The sims take forever and >>>>>>> there's no reasonable way to measure the frequency to PPM resolution. >>>>>>> Once I get one running, I cut over to AC loop analysis to fine-tune >>>>>>> things. >>>>>>> >>>>>>> Post your netlist so people can play with it. >>>>>>> >>>>>>> >>>>>> >>>>>> Here's a Dropbox link to the files: >>>>>> >>>>>> https://www.dropbox.com/sh/txmcmhn6p7fhuh2/AACKLnAh-41bI2jO7UT4wjCza?dl=0 >>>>>> >>>>>> I'm actually attempting to use the Darlington buffer inside a LM13700 >>>>>> section to build a Colpitts crystal oscillator, which will then be 2 >>>>>> quadrant multiplied by an external signal within the transconductance >>>>>> amp itself... >>>>> >>>>> I'd guess that C2 and C3 are way too big. >>>>> >>>>> >>>> >>>> Lowering C2 and C3 to 470p, making the emitter resistor 4.7k, keeping >>>> the feedback cap the same and setting the crystal resonant frequency to >>>> 500kHz makes it start up. >>> >>> Don't quit now; keep going. >>> >>> And maybe make the upper one a bit smaller than the lower one. But I >>> never understood Colpitts oscillators. >>> >>> I did recently design one using a coaxial ceramic resonator, at 600 >>> MHz. It works fine even if I don't understand it. >> >> Wes Hayward's book "Radio Frequency Design" has a pretty good section on >> analysis of the various LC oscillator topologies on pages 265-290, and >> how to plot the gain and phase angle as a function of emitter current. >> >> The book is very math-heavy in general, it's like the anti-AoE. > > Spice has made all sorts of math unnecessary. Math tends to sputter > out when things get nonlinear anyhow. > >
Oscillator and high frequency amplifier design are special cases, where grinding out the math is important. Even in a classical Colpitts, the choice of collector current, tank impedance, the ratio of the tank caps, and the size of the emitter and base coupling caps have a lot of influence on frequency stability and phase noise. That's a 5-D search space, so getting it right can take awhile numerically, and you can never really be sure you're not on a local optimum. You only have to do it once for each topology, then you just use Mathcad or Mathematica or something to apply it to the case at hand. Cheers Phil Hobbs -- Dr Philip C D Hobbs Principal Consultant ElectroOptical Innovations LLC Optics, Electro-optics, Photonics, Analog Electronics 160 North State Road #203 Briarcliff Manor NY 10510 hobbs at electrooptical dot net http://electrooptical.net