News:

SMF for DIYStompboxes.com!

Main Menu

I hate math

Started by arawn, September 08, 2011, 01:22:08 PM

Previous topic - Next topic

arawn

I had an idea for a cascading gain stage (trying to work with the stuff i have) but i am having a hard time with the math involved to establish the gain of the circuit. I built a common emitter using a 2n5089 on my breadboard (the schematic is below with the values i used) my pin voltages are emitter 3.020v, base .676v, collector 66.0mv, battery at 8.80v
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

Johan

if you want the collector to sit at 4.5volt, then you can use Ohm's law to figure out how much current will flow through the collector resistor. that same current will flow through the emiter resistor too, so Ohm again gives you a emiter voltage to aim for.
sort out the balance between R2 and R3 so that the base sits ~0.5-0.7volt (one diode voltage drop) above the aimed for emiter voltage before you worry about gain.



...if the emiter R wasn't bypassed by C1, gain would be close enough to R4 devided by R1. with C1 in place, gain will be as high as combinations of things like current and hFe allows for, and honestly, I suck at those calculations...

with a little luck, someone like R.G. or PRR will spot this thread and make things crystal clear for us both... :D

J
DON'T PANIC

runmikeyrun

I hate math too... I'd rather spend an hour subbing parts until it sounds right than pull my hair out trying to figure it out the "right" way.  I have to take some math classes in college starting this semester and I am NOT looking forward to it.
Bassist for Foul Spirits
Head tinkerer at Torch Effects
Instagram: @torcheffects

Likes: old motorcycles, old music
Dislikes: old women

Gurner

#3
Why do you guys always miss the 's' off the end of maths?   :icon_wink:

(hint: it's short for mathematics!)

& while I'm on....solder has an L in it.....kindly pronounce it!  (oh yeah, 'route' rhymes with toot not tout!)

There...I have exorcised the demons...this thread is cleeeeaaaan.  ;D

CynicalMan

#4
Your transistor is backwards.

To elaborate, you need to switch your collector and emitter pins. Your schematic is correct, but your measurments indicate a hfe of around 7. Also, you say that your collector is at a higher voltage than your emitter, which should be the other way around.

In this setup the gain is around 70, but I'm sure you want you'll want to calculate with normal hfe values. Also, you'll want a emitter bypass cap of at least 22uF for it to do a full-range boost.

arawn

The saga Continues, I replaced c1 with a 22uf electro, r2 with a 10k, and r4 with a 5.6k. my voltages are now 7.25v collector, .605v base, and 31.0mv emitter. I further duplicated the stage so to have 2 cascaded gain stages and I can report that it blows my bench amp away testing on better amps will begin after dinner tonight.
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

Quackzed

QuoteWhy do you guys always miss the 's' off the end of maths?   

(hint: it's short for mathematics!)

& while I'm on....solder has an L in it.....kindly pronounce it!  (oh yeah, 'route' rhymes with toot not tout!)

There...I have exorcised the demons...this thread is cleeeeaaaan.   

::) next you'll be telling us that we're saying aluminum wrong!   ;)
nothing says forever like a solid block of liquid nails!!!

arawn

Back on topic - I know i am reinventing the wheel kind of but i didn't see any designs like this and i been cruising schems for 5 years. But what i have found is 2 stages nice clean boost @ the values I am using. 3 stages starts overloading the preamp in my tube amp pretty nicely .  Now i just need to work out some comtrols and tame the high end a little. and I'd still like for someone to try and explain the maths to me.
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

R.G.

First: your circuit is incomplete. It is not in general possible to figure out the gain of a circuit without knowing what source impedance drives it and what load it has.

You do say "cascading  gain stage", which presumably means that there will be N identical stages. So for any stage with an identical stage preceding it and an identical stage following it, the input impedance of this stage may be taken as the load on the stage before and the output impedance may be taken as the source impedance of the stage following it.

But first, let's see what it does in isolation.
With 100K/100K for a base bias divider, the base sits at 9V/2 = 4.5V if the current gain of the stage is high enough to not load the 100K/100K. The base emitter drop will always be 0.5V to 0.7V for silicon, so the emitter will sit that much lower than the base.

And we reach the first conundrum. Is it possible for the transistor to pull the emitter up? The schematic is ambiguous whether the emitter is tied to ground or through a 100R resistor. If we say it's a 100R, then the base is trying to pull it up to about 4V or a little under. To do that, the resistor would have to have a current of 4V/100R = 0.04A, or 40ma flowing through it.

That same 40ma, minus a base current smaller by hfe, has to flow in the collector resistor. 40ma times 10k is 400V. Ooops. The 10K only has 9V to work with if it eats all the power supply voltage. In fact, between the 100R and the 10K, the 10K will eat 99% of the voltage used in the two resistors and the 100R will eat 1%. So if the transistor is fully saturated and can't amplify at all, the current will be 9V/10,100 = 891uA. If it's a 5089, it will have a gain of perhaps 400 minimum at 1ma, so it will need a base current of 8.91uA, and that flows out of the 100K/100K.

But we know that the emitter is clamped to a voltage of no more than 100*0.891ma = 0.0891V, and the base can't be any higher than 0.7V above that, so the base can't get more than 0.7891V high. At 0.791V at the base, the lower 100K has 0.791V/100K = 7.891uA flowing through it. The upper 100K has 9V on one end and 0.791V on the other, so it has a current of (9-0.791)/100K = 82.1uA flowing through it, of which 7,89auA goes into the lower 100K. Where does the other 7.42 uA go?

It goes into the base. When transistors saturate, their equivalent gain goes down, allowing them to eat up the excess gain pulling collector and emitter together.

The transistor is well and truly saturated, and does not amplify well at all for signals at its base that try to go up. Signals that go down and try to steal some of the base current. They may even pull it out of saturation.

The "gain" of this stage would be about 10K/100 = 100 if it were not running in saturation. As is, the actual gain is far, far lower. It has a biasing problem.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

arawn

Here are the current changes



To the ear it sounds surprisingly good
I want ed the bias voltage to be half supply but i have not found a configuration yet that gives me half of supply on the base
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

arawn

okay couldn't leave well enough alone newest changes r1 now 100k, r2&r3 also 100k.
I have bv at the collector (8.8v) 4.75 at the base and 1.5v at the collector and no signal passes
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

R.G.

Quote from: arawn on September 09, 2011, 08:45:38 AM
I want ed the bias voltage to be half supply but i have not found a configuration yet that gives me half of supply on the base
Quote from: arawn on September 09, 2011, 09:39:48 AM
okay couldn't leave well enough alone newest changes r1 now 100k, r2&r3 also 100k.
I have bv at the collector (8.8v) 4.75 at the base and 1.5v at the collector and no signal passes

You're running into a fundamental issue with bipolar transistors. The emitter is always one diode drop lower than the base voltage unless something forces them to be different from that. If something forces them to be different, the transistor cannot be amplifying.

If the base is at half the power supply, the emitter will be at half the power supply minus one diode drop. This works great for emitter followers, where you (usually) have the plate resistor being very small or zero, because the same current (minus a gnat's whisker) flows in the collector as the emitter, so a small resistor or zero resistance in the collector leaves voltage across the transistor.

This last issue, leaving voltage across the transistor, is a biggie. The only way a transistor can (voltage) amplify is by varying the current through it so the resistors around it turn the changing current into a changing voltage. If external stuff keeps the voltage from changing, the transistor may or may not be able to change the current through its collector/emitter, but it for sure can't change the voltage, so no amplification happens.

If you put the base near the middle of the power supply, the emitter is going to be just a diode drop lower, and the emitter resistor will conduct *exactly the current that holds the emitter up to the voltage the base wants it to be at*. You set the current in the *collector* by fixing the base voltage; this fixes the emitter voltage, and then the emitter resistor sets the collector *current*.

From there, the value of the collector resistor sets the collector voltage down from the power supply. Any voltage left over is what the transistor can vary to amplfy with.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

arawn

The towel has been thrown

we live on to fight another day
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

R.G.

Quote from: arawn on September 09, 2011, 05:58:33 PM
The towel has been thrown
Pick up the towel. The same issues can be used *backwards* to do a design.

That same business about how much current goes across the collector resistor, emitter resistor and transistor is where a design could start.

(1) Decide how big a signal you need out, or (since this is about distortion pedals) whether you want the signal to limit on either positive or negative first. Let's say we want biggest signal. That means that for an idle voltage, we want the transistor voltage and the collector resistor voltage to be about equal. The voltage across the emitter resistor changes things a little, but can often be ignored.
(2) Decide how much gain you need. If you want gains of about 5-25, you can often do that with an unbypassed emitter resistor. If you're thinking 3-4 iterated stages, then you may not mean much. Three cascaded X10 gain stages is a gain of 1000. If you need more, you can get it by adding more stages, or by bypassing the emitter resistor. Let's use a gain of 15 as an example.
(3) You now know the ratio of the collector and emitter resistors. It's 15. For the same (very nearly) current through the collector resistor and the emitter resistor, a collector resistor 15X the emitter resistor will have a voltage 15X as big.
(4) Pick a collector current. You get to choose. Or pick a collector resistor, and let the current come out where it will. Let's say we want a 15K collector resistor and a 1K emitter resistor, just to make things easy. 

Notice we could just as well have said a 15K collector resistor and a 100R emitter resistor for a gain of 150. That ...probably... works, mostly. The gain will come out a little lower than we expect, because some of the gross approximations we'll make will not come true, but it'll be close.  But let's use 1K.

(5) About those voltages again: we want the voltage across the collector/emitter to be the same as the voltage across the collector resistor. The voltage across the emitter resistor is 1/15 the voltage across the collector resistor. So there's 15 parts of the voltage across the collector resistor, another 15 across the transistor, and one part across the emitter resistor.
(6) If the supply voltage is 9V, 1/31 of that is 0.29V; that's the voltage across the 1K emitter resistor. The voltage across the collector resistor is 15*0.29 = 4.35V, and so is the voltage across the collector/emitter.
(7) We now know the collector and emitter currents. The collector current is 4.35V/15K = 290uA. The emitter current is the same, plus 1/hfe of base current. If hfe is over 100, we can ignore the base current in the emitter with an error less than 1%. That's less error than using 5% resistors is likely to give us.
(8) We know the emitter voltage. That means we know the base voltage, mostly. It will be 0.5 to 0.7V higher. Always (for an NPN). At such low currents, it's probably on the low side. So we'll guess that the base is at 0.29V + 0.5V = 0.79V.

And this is one reason that putting the base at half the power supply is hard to get to work. It forces the emitter to be at half the power supply too. That's OK for an emitter follower, but disaster for a gain stage.

(9) How do we get the base to be at 0.79V? A divider string is the easiest. But how much current, what size resistors? For a divider to work well, it needs ten times as much current through it as comes in or out at the divider node. We think the base current is 290uA/hfe. Hfe is slippery, but probably big. For a 5089, I doubt it's less than 400-500. Could be over 1000. Let's guess 500. So the base current is approximately 290uA/500 = 0.58uA (that's 580nano-amps). We want the divider current to be more than 10X that, so it's more than 5.8uA.
(10) 9V/5.8uA = 1.517 megohm. Any two resistors which add up to less than 1.5M works. Notice that if we make them add up to less than 150K, we can ignore the base current altogether with errors less than 1%.
(11) The junction of the two needs to be at 0.79V, the sum is less than 1.5M. We have just hit the first math worthy of the name. We can do this as two equations in two unknowns, or by eliminating a variable, but there's another way: ignore the base current and say that the two resistors have the ratio of 0.79/(9-0.79) = 0.096.
That means that if the big resistor is 1 ohm, the little resistor is 0.096. Or if the big resistor is 1M, the little resistor is 96K. Hmmm. 1M +96K is less than 1.5M. Works. We could also use 100K and 9.6K.
(12) 96K is not a standard value. Rats.  Oh, wait. 120K in parallel with 470K is 95.593K. Probably good enough. So is 100K parallel with 2.4M. In fact, 1M and 91k is probably good enough, as is 1M in series with 91K and 4.7K. Notice that all the math problems are figuring the input voltage divider. You could us a trimmer pot too.

So the resistors are 1M, 96K, 15K and 1K. The output impedance of the transistor circuit is about equal to the collector resistor, 15K. The input impedance is 96K parallel with 1M and paralleled with the hfe times the 1K, which is biggish, probably half a meg. It's about 75K when this gets calculated.

The gain of one of these stages driving another of these stages is lower than 15, because the input of the next stage is in parallel with the collector resistor for AC signals. So the gain will be (15K || 75K) divided by 1K, or about 12.5 instead of 15 because of the lower input impedance it drives. You can fix that by cutting down the collector resistor and emitter resistor in the same ratio; 7.5K and 510 ohms restores you to a gain of about 14.

Now we're down to math anxiety or dislike or whatever. Here's what you needed to know about math to do all that.
1. Ohm's law, all the possible ways. If you know any two of voltage, current, or resistance, the other one is also known.
2. Arithmetic.
3. The fact that the collector and emitter currents of an NPN are very nearly the same.
4. The fact that the base-emitter voltage of an NPN is nearly always 0.5-0.7V.
5. Calculating resistors in series and parallel.
6. Some standard resistor values.

There is almost no way to avoid some math. But it's the easy kind, the multiply/divide kind and not partial differential equations, hardly even algebra.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

PRR

This should be cleaned and posted on your website for posterity.
  • SUPPORTER

arawn

Thank you, it makes a lot more sense now and seems manageable even
+1 to what prr said needs to be a technology of or something
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

arawn

okay this is what i have on the breadboard, i used rgs formulas and decided i wanted a gain of 10 for each stage or something close. but when i power it up and check voltages I get nothing like i expected to see as a matter of fact I was expecting 4.2v @ the collector and .92v @ the Base and somewhere around .42v @ the emitter. what I got was quite different q1 c-8.13v b-.607v e-74.1mv, q2 c-2.265v b-1.352v e-.737v, q3 c-2.514v b-1.327v e-.713v.  It's kinda tripping me out
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

Johan

swap places, R2 and R3
...off to work now, I have to install fire allarm for 8 hours before I have more time with this one...
J
DON'T PANIC

arawn

switching r2 and r3 in the first stage got me better
"Consistency is the Hobgoblin of Small Minds!"

Gus Smalley clean boost, Whisker biscuit, Professor Tweed, Ruby w/bassman Mods, Dan Armstrong Orange Squeezer, Zvex SHO, ROG Mayqueen, Fetzer Valve, ROG UNO, LPB1, Blue Magic

Projectile

Strange design for an amplifier. And it's not really a common emitter circuit at all. What exactly are you trying to do here? I can't make any sense on why you would choose those values or why you would expect to get the voltages you listed. None of this is  really making a whole lot of sense. It seems like you are just randomly throwing around components without any real idea of what you are doing or what you are trying to achieve. Transistor biasing is not difficult math. It's just basic high school level arithmetic and algebra, but you have to understand what you are doing first. It's like baking bread: you have to get the ratios of ingredients right, or it will flop. It's really great that RG would post so much helpful information to try to get you on the right track (he's a godsend!), but this isn't something you can learn from just reading posts on a forum. If you want to take this seriously, I suggest picking up the "Electronics Principles" textbook by Malvino. Read chapters 7 through 12 and do some of the homework problems. It's not written for engineers, so there is no math beyond basic algebra. This should give you a solid foundation in BJT biasing. Here is a PDF of the book to get you started:

http://www.speedyshare.com/files/30280064/Electronic_Principles.pdf