Electronics-Related.com
Forums

Colpitts crystal oscillator in LTSPICE

Started by bitrex July 25, 2015
On 7/25/2015 11:37 AM, Jim Thompson 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? > > Here's a programmable crystal Spice model... > > ****************************************************************** > .SUBCKT MyXTAL 1 2 PARAMS: Fo=10Meg Cp=5pF Rs=100 Q=25K Series=0 > .PARAM P1={6.283185*Fo} > .PARAM P2={Q*Rs} > R1 1 3 {Rs} > C1 1 2 {Cp} > L1 4 2 {P2/P1} > C2 3 4 {1/(P1*P2-(1-Series)/Cp)} > .ENDS MyXTAL > ****************************************************************** > > For Fo the parallel resonance, set Series=0, for series resonance, set > Series=1 > > (You can often get all these parameters from the crystal datasheet.)
Filed away. Thanks! 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 Sat, 25 Jul 2015 12:21:40 -0400, Phil Hobbs
<hobbs@electrooptical.net> wrote:

>On 7/25/2015 11:37 AM, Jim Thompson 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? >> >> Here's a programmable crystal Spice model... >> >> ****************************************************************** >> .SUBCKT MyXTAL 1 2 PARAMS: Fo=10Meg Cp=5pF Rs=100 Q=25K Series=0 >> .PARAM P1={6.283185*Fo} >> .PARAM P2={Q*Rs} >> R1 1 3 {Rs} >> C1 1 2 {Cp} >> L1 4 2 {P2/P1} >> C2 3 4 {1/(P1*P2-(1-Series)/Cp)} >> .ENDS MyXTAL >> ****************************************************************** >> >> For Fo the parallel resonance, set Series=0, for series resonance, set >> Series=1 >> >> (You can often get all these parameters from the crystal datasheet.) > >Filed away. Thanks! > >Cheers > >Phil Hobbs
I'm inherently lazy... so I will spend days developing Spice gimmicks to save a few aggravating minutes time doing tweak, tweak, tweak... and Spice models... that's how I got into the Spice behavioral modeling game ;-) Here's one of several "tanks" I have built into my symbol libraries... L^@REFDES %pin1 %pin2 {@Zo/(6.283185*@Fo*@Q)} C^@REFDES %pin1 %pin2 {@Q/(6.283185*@Fo*@Zo)} R^@REFDES %pin1 %pin2 @Zo (PSpice can do math inside a symbol without needing a subcircuit call) In subcircuit jargon this would be: .SUBCKT TANK pin1 pin2 PARAMS: Fo=1Meg Zo=10K Q=10 ** Zo is impedance at resonance L pin1 pin2 {Zo/(6.283185*Fo*Q)} C pin1 pin2 {Q/(6.283185*Fo*Zo)} R pin1 pin2 {Zo} .ENDS TANK I also have tanks with inductive and capacitive taps... probably should do a tuned transformer with everything selectable... to emulate IF strips ;-) ...Jim Thompson -- | James E.Thompson | mens | | Analog Innovations | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | San Tan Valley, AZ 85142 Skype: skypeanalog | | | Voice:(480)460-2350 Fax: Available upon request | Brass Rat | | E-mail Icon at http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.
On Sat, 25 Jul 2015 10:56:05 -0400, 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?
Have you checked the thing in open loop to make sure it has a chance of starting? Is the transistor biased correctly? Why a Darlington? That seems to not just be asking for trouble, but sending a footman with an engraved invitation. You say you're just using a cap to simulate the crystal -- don't you mean a cap and an inductor, or (better) two caps and an inductor? Like John said -- post your circuit, maybe there's something obvious we can help you with. -- www.wescottdesign.com
On 25/07/2015 15:56, 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?
Those values would seem to indicate a 32.768kHz time-keeping kind of crystal. It might be even the darlington input Z and gain are too low? Perhaps try to get it to sim-osc with an op-amp first and then go descrete? piglet
On Sat, 25 Jul 2015 21:21:04 +0100, piglet wrote:

> On 25/07/2015 15:56, 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? > > Those values would seem to indicate a 32.768kHz time-keeping kind of > crystal. It might be even the darlington input Z and gain are too low? > > Perhaps try to get it to sim-osc with an op-amp first and then go > descrete? > > piglet
For that matter, why not choose a rail-rail op-amp in a SOT-23 or smaller that has known-good large-signal behavior? Just sayin' -- you can always do better with discretes, but it may take lots of work to get there. -- Tim Wescott Wescott Design Services http://www.wescottdesign.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.
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?
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...
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. -- John Larkin Highland Technology, Inc lunatic fringe electronics jlarkin att highlandtechnology dott com http://www.highlandtechnology.com
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. The waveform is nothing to write home about, however.
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. -- John Larkin Highland Technology, Inc lunatic fringe electronics jlarkin att highlandtechnology dott com http://www.highlandtechnology.com