Crystal Oscillator Question (Transistor Based Amp)

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
mauifan
 
Posts: 174
Joined: Sun Aug 12, 2012 11:13 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by mauifan »

mauifan wrote:What am I forgetting?
Hmm.. is the answer "Math?" :) :oops:

Thinking out loud.... There should be very little loss in Stage 2. (Phase shift is about 4 degrees.) If I did my calculations correctly:

Vf = I*Xc2 = (Vi / ESR) * Xc2

So the gain of Stage 2 is really Xc2 / ESR = 14.6. Multiply this by the gain in Stage 1 and the total gain of the filter is more like 7. Therefore the amp gain needs to be around 1/7 = ~0.1.

Is this right, Mike? If yes, I am going to choose some different values... like maybe make Re closer to 1Meg?

User avatar
adafruit_support_mike
 
Posts: 67391
Joined: Thu Feb 11, 2010 2:51 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by adafruit_support_mike »

I pulled out some parts and built a 32kHz oscillator tonight to recalibrate my feel for the circuit.

I started with a design cribbed from App Note 12 by Jim Williams: http://cds.linear.com/docs/en/applicati ... an12fa.pdf (figure 1e), cheated a little, and played with the resistor values to get a feel for their effect on the signal.

The version I consider good enough to talk about looks like this:
xtal.jpg
xtal.jpg (21.49 KiB) Viewed 283 times
The structure on the left is a semi-advanced way to bias a transistor. When you short a transistor's base to its collector, the same rules for current gain still apply. It just forces the transistor to find the V.be where the ratio of CE current to BE current is exactly equal to beta (current gain). The exact value depends on the total amount of current flowing through the transistor, and in general behaves like a diode. In fact, that configuration is called a 'diode-connected' transistor.

If you have two transistors with similar V.be and beta specs, and set the second transistor's V.be close to the diode-connected transistor's V.be, roughly the same amount of current will flow through the second transistor. That arrangement is called a 'current mirror'.

If you have roughly the same amount of current flowing through two transistors, and R.c for the diode-connected one is twice as large as R.c for the mirrored one, the voltage drop across the larger one will be twice as large as the drop across the smaller one. Since the voltage drop across the diode-connected transistor's R.c is nearly all of VCC, the voltage drop across the mirrored transistor's R.c will be about VCC/2.

The upshot is that using a diode-connected transistor makes it really easy to bias a working transistor. And these days, when a general purpose transistor costs about the same as a 1% resistor, that biasing scheme not only works far better than the traditional network of resistors, it's also less expensive.

I started off using the same resistor values as Williams did, even though I knew they'd be too small and send too much current through the crystal. Sure enough, the thing oscillated like mad, but I was getting 192kHz out of a 32kHz crystal.. the surplus energy was forcing the crystal to oscillate at an overtone frequency (6th overtone, to be precise).

I started making the resistors larger to reduce the current through the crystal, and found that I had to go all the way up to 500k to keep the crystal down at the fundamental frequency of 32kHz.

While using lower values, I found that having a resistor between the bias transistor and the working transistor was essential. A strong bias network can swamp out any signal from the crystal, so there's simply no hope of oscillation under those conditions. Weakening the bias network gave the crystal more control over the signal going around the loop, and eventually made the output swing up into ocsillation every time.

The output waveform was decidedly ugly, but it did have an extremely consistent period.

I'll go into more detail tomorrow, but for now I'm falling asleep as I type.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”