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.
Locked
User avatar
mauifan
 
Posts: 174
Joined: Sun Aug 12, 2012 11:13 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by mauifan »

adafruit_support_mike wrote:Exactly.

Now.. I'm going to use a technique called 'unrolling the loop' to bring the concept of feedback into the picture.

Taking the 'X=10;Y=10%' example as our base circuit, imagine having two copies that are electrically identical. Connect the input of the second to the output of the first. If we feed the same 100mV sine wave into the first input, what do we get from the second output?
Again... not sure I follow your wording... but I think I see where you are going.

The output of Stage 2 should be identical to the input of Stage 1.

If you increase the amplification in Stage 1 to X=100, the "attenuation" in Stage 2 needs to be Y=.01 (aka 1%) to make the Stage 2 output match the Stage 1 input.

Note: I assume that you are talking about a hypothetical/theoretical situation where gain X has no physical upper bound?

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

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by adafruit_support_mike »

Okay, we're in sync.. and yeah, I'm talking about the case where there are no limits on the output. That makes things easier.

Now.. I'm going to creep up on the idea of feedback using the technique of 'unrolling the loop'. If we call the "X(gain)-to-Y(fraction)" unit a 'pair', imagine putting about ten pairs in series: the output from Y.0 goes to the input of X.1, the output from Y.1 goes to the input of X.2, etc.

It still isn't a feedback loop. X.0 gets its input from a signal that 'just happens' and Y.9's output just flaps in the breeze, but we've added the idea that the output from one pair goes to the input of another, electrically identical pair.

The payoff for doing this is that unrolling the loop converts time-based loop behavior to Nth-item behavior. The behavior of pair N is what you'd see from a signal making its Nth pass through a feedback loop.

I'll give you the baseline by saying "if a pair's output has exactly the same amplitude as its input, the output at Y.9 will have the same amplitude as the input to X.0." That's basically just a stretched-out version of what we've just established.

Let's make things fun though: give me the amplitudes at Y.3, Y.5, and Y.7 when each pair's output is 10% larger than its input. For the sake of simplicity, assume the input amplitude is 1v.

User avatar
mauifan
 
Posts: 174
Joined: Sun Aug 12, 2012 11:13 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by mauifan »

I am not entirely confident that I follow you, but I think you are talking about the following picture which attempts to depict 10 amplifiers in series. The input of Amplifier An is X.n-1 and its output is Y.n-1. The connections between amplifiers are labeled X.n|Y.n-1, in part to try to stay consistent with Mike's labeling, and in part because of the tool I used to create the picture. The values I calculated Y.n-1 = X.n = 1.1 * X.n-1 are shown below each label.
Diagram Depicting Mike's Scenario
Diagram Depicting Mike's Scenario
Unwrapped_Loop.jpg (65.93 KiB) Viewed 966 times

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

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by adafruit_support_mike »

Perfect!

The sequence of values you got was 1.1^N, where N is the position in the chain. It's an exponentially increasing function, which is exactly what that model should produce.

Now let's add the concept of time. Let's say it takes 1ms for a signal to move through each amp. Assume the input signal's amplitude is zero until time t=0, then turns into a sine wave whose amplitude is 1v.

Describe what happens in the chain of amplifiers before t=0, from t=0 to t=10ms, and after t=10ms.

User avatar
mauifan
 
Posts: 174
Joined: Sun Aug 12, 2012 11:13 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by mauifan »

Well...
For t<0, the voltage/amplitude will be zero.
For t=0, the voltage/amplitude will be 1v.
For t>=10ms, the voltage/amplitude will be 2.59v.

For 0>t<10ms, the voltages/amplitudes will be as shown in my last diagram... but I somehow doubt that the changes will be instantaneous. :wink: Rather, I would think that the output voltage Yn at stage An will start out at the corresponding input voltage Xn and quickly ramp up to the levels shown in my diagram.

Using stage A2 as an example, Y.1 will start out at 1.10v at time t=1ms and increase until it gets to 1.21v at time t=2ms. I would also think that the output voltages at stages A3, A4, A5, etc. will be zero for t<2ms because it takes time for these later stages to see non-zero voltages at their respective inputs.

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

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by adafruit_support_mike »

Spot on. There's a propagation delay as the signal moves along the chain. Amp N sees zero input until t=N, then after that its input and output will be the same as in the no-delay version.

Now.. the key insight for closing the feedback loop is to understand that the components don't have a global view of the circuit. A0's output doesn't know it's delivering signal to the next amplifier in a chain of 10. It doesn't even know it's delivering a signal to another amplifier. All it sees is an impedance. By the same token, A0's input doesn't know it's getting signal from an it-just-works-that-way external source. All it sees is a signal strong enough to drive its input impedance by a given amount.

One of our basic assumptions has been that all the amps are identical, which means A0's input impedance is exactly the same as A1's, and A0's output signal is strong enough to drive that impedance in a specified way.

So let's close the loop. Disconnect A0's output from the input of A1, and connect it to the input of A0. Keep the 1ms propagation time and the 1.1 gain through the amp the same as it was in the chain. Change the input signal so it delivers exactly one cycle of input from t=0 to t=1ms, then has no further influence on the circuit.

Describe the amp's output from t=0 to t=10ms.

User avatar
mauifan
 
Posts: 174
Joined: Sun Aug 12, 2012 11:13 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by mauifan »

Still not sure how this is going to answer my question, but in the spirit of continuing to play along....

If the input to A0 is 0v, the output will be at 0v forever.

If there is a "glitch" in the system (such as turning on the power switch) that causes the input of A0 to momentarily go to 1v, the output of A0 will rise to 1.1v in the span of 1ms. Since we are now talking about feedback, the input of A0 will also rise to 1.1v and will get amplified again to 1.21v at t=2ms. By the 10th time through the loop (i.e. at t=10ms), the voltage will be at 2.59v.

Again, I assume that the amplifiers have no real world limitations. If this continued for 100ms, the voltage would be at 13-14kV (1.1^100).

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

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by adafruit_support_mike »

All right. It sounds like you've internalized the behavior of the feedback loop. Let's go back to looking at the parts inside the loop.

If you recall, the loop gain is the product of "how much bigger the signal gets when it passes through the transistor amp" and "how much smaller the signal gets when it passes through the filter". For the signal to remain stable, the product of those two factors has to equal 1.

So now let's make some broad generalizations about the component values, starting with the transistor amp:

You can think of an NPN transistor as a voltage controlled current source. If you raise the voltage at the base, more current can flow from the collector to the emitter. If you lower the voltage at the base, less current can flow from collector to emitter. This circuit uses the transistor in common-emitter configuration. The transistor modulates the current through its collector resistor in response to the voltage at its base.

If the collector resistor is R and the voltage gain through the transistor is A, how do we make the voltage gain through the transistor 2A?

User avatar
mauifan
 
Posts: 174
Joined: Sun Aug 12, 2012 11:13 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by mauifan »

adafruit_support_mike wrote:If the collector resistor is R and the voltage gain through the transistor is A, how do we make the voltage gain through the transistor 2A?
Double the resistor value to 2R.

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

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by adafruit_support_mike »

Yep. Now looking at the attenuation through the filter, the voltage at the capacitor depends on the amount of current that flows into it. Assuming the voltage coming out of the gain stage stays the same, but we want to get half as much voltage across the capacitor, we have to cut the current by half.

How does Ohm's law tell us to halve the current that flows through a component if the voltage across the component stays the same?

User avatar
mauifan
 
Posts: 174
Joined: Sun Aug 12, 2012 11:13 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by mauifan »

adafruit_support_mike wrote:How does Ohm's law tell us to halve the current that flows through a component if the voltage across the component stays the same?
I assume that the component can be changed? If so, the answer is to double the impedance. If the component is a cap, you'll need to half its value, i.e. go from 100pf to 50pF. If the component is an inductor or resistor, you'll need to double its value, e.g. from 50uH to 100uH or 50k to 100k.

Impedance of capacitor = Zc = Xc = -j / (wC)
Impedance of inductor = Zl = Xl = jwL
where "w" = 2*pi*f

[Sidebar]
I suspect I may know where this is going. One of these days I will post it, but basically to cut to the chase I have some more "chicken scratch" that shows that the gain of the amp Rc/Re needs to be a hair above 1, which in turn means that the ratio Xc/Xl needs to be a hair below 1.

Said another way, the equation I derived shows that Rc should be a hair larger than the value of Re -- but I am confused because experimentally this does not seem to be the case.

Yes... yes... I know. Let's not get too far ahead of ourselves... I shall slap my own hands, ok? :lol:

[End Sidebar]

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:[Sidebar]
I suspect I may know where this is going. One of these days I will post it, but basically to cut to the chase I have some more "chicken scratch" that shows that the gain of the amp Rc/Re needs to be a hair above 1, which in turn means that the ratio Xc/Xl needs to be a hair below 1.

Said another way, the equation I derived shows that Rc should be a hair larger than the value of Re -- but I am confused because experimentally this does not seem to be the case.

Yes... yes... I know. Let's not get too far ahead of ourselves... I shall slap my own hands, ok? :lol:

[End Sidebar]
Ok.. ok... sorry if this jumps the gun, but I thought I'd post before I lost the piece of paper. This goes back to the proverbial drawing board to show the voltage across the cap. It also goes on to show that if this voltage equals 1 / Gain, then Rc needs to be a hair larger than Re. So if Re=100, Rc=102.
Chicken Scratch Assuming Voltage Drop Equals Inverse Gain
Chicken Scratch Assuming Voltage Drop Equals Inverse Gain
Chicken_Scratch_0002.jpg (424.96 KiB) Viewed 877 times

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

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by adafruit_support_mike »

I can't fault you for wanting to chase an idea down, but you did hop neatly over the point I was leading to. ;-)

The first part of your answer was dead on target: double the impedance, or reducing it to simpler terms, double the resistance. Halving the size of the capacitor, while indeed giving the correct result, was a red herring.

Take a minute to focus on the last two points we covered:

- to double the gain through the transistor amp, double the value of its collector resistor.
- to halve the current going from the amp to the capacitor, double the amp's output impedance.

Now, remember a point we hit some time ago:

- a common-emitter transistor amp's output impedance is equal to the value of its collector resistor.

This, as far as I can tell, is the cluster of ideas that hasn't completely clicked for you yet.

User avatar
mauifan
 
Posts: 174
Joined: Sun Aug 12, 2012 11:13 pm

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by mauifan »

adafruit_support_mike wrote:This, as far as I can tell, is the cluster of ideas that hasn't completely clicked for you yet.
You got that right! Welcome to my world! :lol: :? :(

But... after reading what you wrote a couple of times, I think you are saying that this is kinda/sorta the max power transfer problem I mentioned a few weeks ago. Perhaps I wasn't using the correct terminology, but as far as the filter stage is concerned, I really do need to include Rc when computing R in my last chicken scratch calculation? And since Rc is much greater than the inherent resistance in my test circuit's inductor, I can probably assume that R=Rc?

Again... this may not really be a max power transfer problem, but there is a value of Rc that maximizes both voltage and current. Since power=voltage x current, I called it a max power transfer problem.

Am I on the right track now? :?: :lol:

In terms of what I think you are trying to say... increasing the value of Rc increases voltage, but lowers current through the filter stage. Since there is less current flowing through the cap, there is less voltage drop through the cap. Less voltage across the cap means that less voltage feeds back to the input, and when that value gets close to zero, it is really hard to amplify it. :?:

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

Re: Crystal Oscillator Question (Transistor Based Amp)

Post by adafruit_support_mike »

Not quite, but you're closing in on it.

You're right that increasing the value of Rc increases the gain. You're also right that increasing Rc reduces the amount of current that reaches the capacitor... per volt of difference between the transistor's output and the cap's voltage.

It think that qualifier is the piece you're missing.

If you double the gain of the amplifier, you get more voltage swing at that point. If we just declare that the voltage swing across the cap remains unchanged, it follows that "voltage at the transistor's output" minus "voltage at the cap" will be larger.

So we have a larger voltage difference between the transistor and the cap, but less current per volt reaching the cap. Those two things counteract each other, allowing the voltage swing at the cap to remain largely unchanged.

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

Return to “General Project help”