Need help with bias network math, check my work.

Started by Zben3129, October 16, 2008, 10:10:36 PM

Previous topic - Next topic

Zben3129

After reading the article at geo I decided I wanted to learn about creating bias networks, and I figured the best way was to try out some circuits and see if the math ends up correct...

I started with the tubescreamer.

bias resistor of 10k, 4.5k Vb

so the current across that resistor, I=V/R,  I = 4.5v / 10k,  I = 450 uA

If this was 10% of the current in the bias network, that would make 4500uA there..

So to get 4.5mA across 9v, R=V/I,  R=9v / 4.5mA,  R = 2000



That is where I get stuck. I am missing a 0 as the R should be 20k, which would then get divided by 2 to give 10k, which is the value of the Bias resistors in the Vb chain.

Help me find the 0  ;D

Do I need to add up the current drawn from each individual connection to Vb to find the current needed across the bias network (e.x. Input 1 of IC + Input 2 of IC + Base of Q1 + Base of Q2) or is it just the current across the one bias resistor?

Zach

Zben3129

If it is the adding up scheme, you would get

45uA + 45uA = 90uA current drawn by IC1

510k bias resistor for each transistor,

4.5v / 510k = 8.8 uA

2 transistors, so roughly 18 uA drawn by transistors,

transistors + IC = 90 + 18 = 108uA

That would make current drawn from Vb 110uA (simpler math)

so x10 would give 1.1mA across the bias network

9v/1.1ma = roughly 8.2k ohms

but since its only half, this would give 4.1k

still not 10k  :(


Still stymied with this whole thing  :icon_eek:


Zach

dxm1

Quote from: Zben3129 on October 16, 2008, 10:10:36 PM
If this was 10% of the current in the bias network, that would make 4500uA there..

I don't know where this comes from - the article says that the current provided by the bias network must be ten times more than the current required to make the voltage variation 'insignificant'.  From this you could, I suppose, assume that the bias supply needs to provide 45uA.  If you start with that and work backwards, the numbers will jive.

Zben3129

I think (maybe  :P) I am starting to get this a little more...

First, all the Vb connections need to be added up.

So in the tube screamer, that would be the current pulled by the 2 + inputs on the opamp, and the 2 bases of the transistors.

On the datasheet for 4558, the input bias current is .5uA, so that would make 1uA for both the inputs combined. IC sorted.

For the transistors, I have no clue how to calculate there, but lets say 9uA per, to be safe. thats 18uA for both transistors combined. plus IC gives a total draw of 20uA on Vb.

which would mean that 200uA needs to be provided by Vb. 9v/200uA = 45k ohms, but since its only half, that would be 22.5k ohms

22.5k ohms per resistor is at least the correct amount of 0's, and I used math I understood to get there. I'm assuming 9uA of current by the transistors is way high, as they are not providing gain, just buffering. Taken that overestimate into consideration, I can see 22.5k being "correct"



Hopefully this is a little bit closer to correct :)

Zach

George Giblet

The tube screamer is a bad place to start.  Perhaps look at a silicon version of the rangemaster.

Honestly the bias network on most opamp based effects just use 2x10k to 47k and stuff a big cap on it.

If you want a rough idea how to start  the transistors in the TS have 10k emitter loads, and there are two transistors.  The emitters sit at *about* 4.0V (this is an intial guess, it is only this way because the bias network is designed properly).   The emitter current in one of those transistors is 4.0V/10k = 400uA.   The gain of the transistor is about 200 (or more), so the base current is 400uA/200 = 2.0uA.  There's two of these so you have about 4.0uA drawn from the bias network.  The current in the bias network is 4.5V/10k = 450uA, about 100 times.    Why so high?  because the circuit is biasing and doing other things.   That's why I'm saying this is a bad place to start.

FYI:  If you look a the 510k resistors these will have 2.0uA (or less depending on the transistor gain) and so will have a voltage drop of 510k*2.0uA or about 1V.   So now we go back and work out the emitter voltage   4.5V - 1V - 0.6V (emitter base drop) = 2.9V.  So my initial guess of 4.0V was wrong but it's too far off and it doesn't the fact the bias network has a lot more current than the transistor base currents.


R.G.

Quote from: Zben3129 on October 16, 2008, 10:10:36 PM
I started with the tubescreamer.
bias resistor of 10k, 4.5k Vb
so the current across that resistor, I=V/R,  I = 4.5v / 10k,  I = 450 uA
If this was 10% of the current in the bias network, that would make 4500uA there..
So to get 4.5mA across 9v, R=V/I,  R=9v / 4.5mA,  R = 2000

That is where I get stuck. I am missing a 0 as the R should be 20k, which would then get divided by 2 to give 10k, which is the value of the Bias resistors in the Vb chain.
Help me find the 0  ;D
Do I need to add up the current drawn from each individual connection to Vb to find the current needed across the bias network (e.x. Input 1 of IC + Input 2 of IC + Base of Q1 + Base of Q2) or is it just the current across the one bias resistor?
Design is often a game of divide and conquer, at least mentally.

The bias resistors can't tell who's getting the electrons, as all electrons look alike. The bias string only cares about the sum total of currents in/out of the center node. Let's see what that is. First, the two transistors. They each have a 10K to ground from the emitter, and the emitter will be something like 0.6V lower than the base. So the voltage across the EMITTER resistors is a bit less than 4.5V-0.6V = 3.9V. The current to make this be true is 3.9V /10K = 390uA. The transistor is usually a high gain one, so let's assume a gain of about 300, so the BASE current is about 1.3uA, total of 2.6uA (there are two of them). The bias string has to provide this.

Then there are two opamp inputs. Each is biased through a 10K resistor to the bias supply. But how much current goes into the input? We have to look at the datasheet for the 4558. This shows a bias current of typically 25nA. The schematic of the chip shows the inputs to be PNPs, and so this current comes OUT of the 4558.That's a total of 0.05uA back into the bias network.

The total current out of the bias node is 2.6uA - 0.05uA = 2.55uA.

This is different from your calculations because in addition to the bias resistors into the transistors and the opamps, you have to take into account the actual currents drawn by the active device. It's not just the bias resistor that sets these currents.

We have calculated the currents going in/out of the bias node, ignoring what provides it for the moment. Now let's ignore the loads and calculate the bias network, and then we'll add the two together.

The bias network on the stock TS is 10K + 10K, total of 20K from 9V to ground. Ignoring loads, the current through it is 9V/20K = 450uA. The load drawn from here is only 2.55uA, about 1/200th of the main load, so we get the idea that the load won't change the situation much.

We can in our mind's eye change the 2.55uA load into an imaginary load resistor of R = 4.5V/2.55uA = 1.765Mohm. That is, we could put a real 1.765M resistor across the lower 10K resistor, and the bias resistors and load would act the same as it will act in a real circuit. That imaginary load resistor caused by the currents into the transistors and opamps acts like it's parallel to the lower 10K. Let's see how much that changes the bias voltage.

The parallel combination of 10K and 1.765M is 9943.6 ohms. So the bias voltage is 9V * (9943.6)/(10,000+9943.6) = 4.487V. So the additional loading of the transistors and opamps has lowered the bias voltage from 4.5000V (if everything is perfect) to 4.487V, or about -0.28%.

I have made some approximations here. I did not go back and check for the effect of the drop in the base voltage because of the bias current through the bias resistors for the transistors, so there is some error there, and I simply guessed at a gain for the transistors. In practice, these don't matter much because transistor gain varies widely, and because the resistors involved have a +/-5% tolerance anyway.

So the trick is - calculate the loads; then calculate the effect of the loads on the network by itself.
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.

Zben3129

Okay, thanks, lets see what I got out of that and what I still need to learn  ;D

1. In order to find the current "available" of the bias network, its just the 9v/r1+r2

2. In order to find the load of the circuit, you must sum all of the loads together, npn "drawing current", pnp "replacing current"

   So say there are 2 npn transistors, they will each draw 2uA (meaningless number), so they load a total of 4uA

   There are also 2 opamp inputs, pnp inputs. These will draw .5uA each, however they are pnp, so they will "replace" this. Totaled together that is 1uA of replacement

   So 4 uA taken by the transistors, 1 uA given back by the opamp would make a total load of 3uA

3. To get a Vb +/- 10% of 1/2Vcc, the load must be 10% or less of the "available current" from the bias network.

4. Info on current draw for Opamps is found on datasheets. To be safe, look at maximum Input bias current. Also, check to see if it is PNP or NPN input so you know if it     

    is "sucking" current or "replacing" current in the load



Things I would like an explanation on:

1. How do you calculate the bias current load of a BJT? What about when they are providing gain? What about when they are acting as a buffer with a gain of 1?



Thanks!

Zach

3.

R.G.

Good! You're getting there.

Quote from: Zben3129 on October 16, 2008, 11:39:05 PM
1. In order to find the current "available" of the bias network, its just the 9v/r1+r2
I would say "in order to find the undisturbed current in the bias network". All of that current is not really available. More on this point at the bottom.

Quote
2. In order to find the load of the circuit, you must sum all of the loads together, npn "drawing current", pnp "replacing current"
   So say there are 2 npn transistors, they will each draw 2uA (meaningless number), so they load a total of 4uA
   There are also 2 opamp inputs, pnp inputs. These will draw .5uA each, however they are pnp, so they will "replace" this. Totaled together that is 1uA of replacement
   So 4 uA taken by the transistors, 1 uA given back by the opamp would make a total load of 3uA
Yes. Correct. Add up all the loads that connect there. For this purpose, capacitors act like open circuits, as they completely block DC. In fact, that is how SPICE and similar simulation programs establish initial conditions, they replace the caps with open circuits and calculate.

Quote
3. To get a Vb +/- 10% of 1/2Vcc, the load must be 10% or less of the "available current" from the bias network.
That is  a quick rule of thumb. I'll show you the real stuff at the bottom.
Quote
4. Info on current draw for Opamps is found on datasheets. To be safe, look at maximum Input bias current. Also, check to see if it is PNP or NPN input so you know if it is "sucking" current or "replacing" current in the load
Yep.

Quote
Things I would like an explanation on:
1. How do you calculate the bias current load of a BJT? What about when they are providing gain? What about when they are acting as a buffer with a gain of 1?
This part is a little tricky. From the output side (collector and emitter) you can usually calculate the current flowing in the transistor by knowing the voltage across either the collector resistor or emitter resistor and the resistance. Ohm's law tells you the current, and the transistor is what lets that current flow. Therefore you know the current through the transistor.

Knowing that, you have to approximate the base current. You do this by dividing the collector or emitter current by the current gain ( or beta, or hfe) of the transistor. As we know hfe varies all over the place. So the best you can do is to make a guess, calculate the result, then refine your guess a time or two if it turns out to make a difference. This is what I did. I guessed at 300 hfe. Do all tube screamer transistors have a gain of 300? Of course not. They vary from 100 to 800 or more. The point is that whether the gain is 200 or 400 and not 300 would have made almost no difference in the calculations because the sum total of the base currents was so small compared to the bias string currents. If it had come to about 1/10 or more of the total current in the bias string, I'd have had to go back and recalculate more carefully, perhaps using the minimum and maximum hfe specs for the transistor, not the typical.

To answer your question, it makes no difference to the base current at all whether the transistor is providing voltage gain or being a gain-of-one buffer; what matters is the collector current and the current gain.

The Real Story - Time to Step Up to the Big Leagues
A perfect voltage source is a thing that establishes a voltage which is constant, no matter what load is on it. If I had a perfect source of 12V, I could measure it with no load, it would be 12.0000V. When I hooked a 1K resistor across it (that's 12ma loading), it would be 12.0000V. When I hooked an inch-thick copper cable to it and welded with it, the voltage would still be 12.0000V, not sagging a microvolt. In many cases, a car battery can approximate a perfect voltage. Perfect voltage sources do not exist in the real world, of course. A perfect voltage source has an internal impedance of 0.000000 ohms.

Real voltage sources differ from perfect ones in that they have some impedance. This means that as you draw current, the current causes a voltage drop through the internal impedance. So for real voltage sources, the voltage sags somewhat with increasing load. With batteries, this is easy, you just measure the voltage with no load, measure it with some load, compute the change in voltage with load, and the result is the internal resistance. Another way to do this is to measure the open circuit voltage and the short circuit current. The short circuit current is the current that flows when an external conductor can hold the external voltage down to nearly 0V.

This is easy with a battery, even one we put a single resistor in series with. It turns out that we can do the same tests on a voltage-divider voltage source. Let's work on the tube screamer one. It has two 10K's in series, driven by a 9V battery. We know that if we have perfect resistors and a perfect 9.00000V battery, the open circuit voltage at the middle will be 4.50V. Now let's short circuit it. This short out the bottom resistor entirely, and we now have a current equal to 9V through only the upper 10K resistor. That's 900uA.

The 9V battery through a 10K/10K divider "seen" only at the connection of the two resistors looks like a 4.5V battery (open circuit that is) through some resistance. We know the voltage will sag when we load it. The short circuit test says that when it's dead shorted, it can produce 900uA, so we calculate that the internal impedance is 4.5V/900uA = 5000 ohms.

Hey! That's just the parallel combination of the two series resistors. Without dragging you through the math, ALL resistor divider networks work this way, even if the resistors are not the same. At the output of the two resistors, the result is exactly as though it came from a voltage source of the open circuit voltage through a resistor of the parallel combination of the two resistors making the divider chain.

This is called a THEVENIN EQUIVALENT circuit, after the fellow who figured it out. It is incredibly useful. For instance, in our divider problem, we can quickly say that the 10K/10K divider looks like a 4.5V source through 5000 ohms. That means that the output sags by 5K times the current pulled out of it. In my example that was 2.55uA, so the voltage sag would be V = 5000*2.55uA = 12.79mV. Subtracting that from 4.50V, we get 4.487V, the same as we did the other way.

If you dig much deeper than you are digging now, you will need to move past ohm's law and know the Thevenin and Norton equivalent circuits and how to use them. You're right on the edge of that now.
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.

George Giblet

I would hate to be anyone trying to learn this stuff from the web.  There's so many crappy articles for such a simple (and well known) thing.  Have a look at:

http://users.tpg.com.au/users/ldbutler/TransisVoltAmp.htm


Zben3129

Lots of GREAT info there, I think i have a good understanding now of how to figure out what is going on given a bias scheme, and also how to design a bias scheme using information from data sheets and equations (one of my bigger goals, being able to understand things not just to the point to know them but to be able to use them).

Now, I remember reading somewhere when I was searching this topic, that if you provide more undisturbed current via lower resistors, you will have a more stable Vb. This is good, but I believe it also said there is more thermal effect, creating noise. This would lead me to believe that an ideal Vb setup would provide just enough undisturbed current, no extra. Now, in the real world this isn't plausible, as there are tolerances / random error, so it seems the real world equivilant would be the lowest amount of undisturbed current you can guarantee will always cover the load on it. I can also see putting a small pad on this just for extra peace of mind, however I see circuits that don't seem to follow this setup

For example, the MXR Distortion +

The voltage divider consists of 2 20k resistors, providing 225uA of undisturbed current.

The circuit only has one connection to the Vb, which is the noninverting input of a 741 opamp. This has a maximum input bias current of .5uA, and is an NPN input, placing a load of .5uA on  Vb. Lets say we call it 1uA, just in case other variables arise. So that would mean the voltage divider would only need to supply 10uA of undisturbed current. In a perfect world, this would work, but say we make it provide 20uA (a very large "buffer zone"), and we wouldn't have to ever worry about the Vb sagging from the load of the circuit.

Now, what is the advantage behind creating a voltage divider that provides 225uA of undisturbed current, when 20uA is all that is needed (and even that would never all be needed)?

Wouldn't this induce excess noise, and/or waste battery life?




Also, I noticed that a 1m bias resistor connects Vb to the noninverting input of the 741 IC. This would provide 4.5uA of current. Some things that crossed my mind reguarding this:
     Even though 4.5uA is provided, the opamp will only "take" as much current as is needed, correct?
     The 1m resistor provides 4.5uA of current, yet it seems(from the datasheet) that .5uA would be the absolute worst case scenario. Is the reasoning behind profiding 4.5uA the same as  above? and also, would it pose the same disadvantages?




Sorry for the hoarde of questions   ;D



Thanks  

Zach

Zben3129

Also, I just tried making up a little scenario to test myself, here it is





Assume that these are the only connections to Vb in the whole circuit. 3 741's, with an input bias current (max) of .5uA. This would create a maximum load or 1.5uA. The voltage divider would need to therefore provide at least 15uA of undisturbed current, so as a safety I designed it to provide 20uA. This is achieved by 9v / 440k = 20.45 uA, close enough and uses the common 220k resistor.

Each IC requires an input bias current of .5uA, and I designed the circuit to provide 2uA of input bias current for safety. This is obtained by 4.5v / 2m2 = 2.045 uA, close enough and uses the common 2m2 resistor.

So in summary, a maximum load of 1.5uA is possible, requiring an undisturbed current possible of 15uA. To provide a safety zone, create a 20uA divider.

Also, 741 wants an input bias current of .5uA maximum, and I provided it with 2uA to be safe.


How does all the above look?



Thanks for the help

Zach

R.G.

Quote from: George Giblet on October 17, 2008, 12:40:52 AM
I would hate to be anyone trying to learn this stuff from the web.  There's so many crappy articles for such a simple (and well known) thing.
I would too. But I have this feeling that Professor H. Jack Allison is not going to come out of retirement to teach it. And worse yet, that most of the people here who have discovered they want to know this are not able to spend the time and money getting formal training. It's a shame.

Closer, but you're missing one important issue.

Quote from: Zben3129 on October 17, 2008, 01:06:13 AM
Each IC requires an input bias current of .5uA, and I designed the circuit to provide 2uA of input bias current for safety. This is obtained by 4.5v / 2m2 = 2.045 uA, close enough and uses the common 2m2 resistor.
If I understand you correctly, you cannot say that you provide 2.045 uA to the opamp inputs through 2.2M from 4.5V. If you tried this, with 4.5V on one end of the 2.2M resistor and an opamp that really did pull in 2.045uA at its input, you would find that the voltage at the opamp input sagged all the way to 0V.

The whole point of a bias voltage in the first place for opamps in this kind of circuit is to hold the + input at about the middle of the power supply voltage so that the output will also be held at about the middle by feedback action. The input of the opamp eats some current. If you put a resistor between the bias voltage and the input of the opamp, then the input current, small as it is, causes a voltage drop on the resistor.

An opamp (+) input will pull an input current that is remarkably constant over the whole range of working voltages. If you had a perfect 4.50000V bias voltage and connected an opamp that needs 0.5uA directly to it, the input would pull 0.5uA. If you put a 1K resistor in series between the two, the input would still pull 0.5uA (approximately).

If you put a 1M resistor in series between the two, the input would STILL pull approximately 0.5uA. This is equalivalent to saying that for a wide range of series input resistors, the resistor does not change the input current to the opamp. The resistor does however, cause a loss of bias voltage. A 1K resistor with 0.5uA through it will make the opamp (+) input sag to 4.5V-(1000*0.5uA)= 4.4995V. A 1M resistor will make the voltage sag to 4.5V-(1M*0.5uA)=4.0V. A 2.2M resistor will make it sag to 4.5V-(2.2M*0.5uA)=3.4V.

Ideally, you would not put a resistor in series with your inputs, as it changes the DC bias point. But you sometimes have to because you need to couple a signal into the (+) input, and the resistor isolates the (+) input from the bias voltage, which looks like a short circuit to AC and would prevent any signal from getting through. So you use a resistor and learn the limitations and corrections needed to use it.

In your made-up scenario, the Vb you have set up has the Thevenin equivalent circuit of a 4.5V voltage source in series with a 110K resistance. You are seeing 0.5uA from(or to) each opamp, for a total of 1.5uA. The 1.5uA will cause the Vb to change to 4.5V - 110K*1.5uA or 4.335V. That's what you would measure at the "Vb" terminal in your drawing. Then each opamp sees a lower voltage caused by the input bias current causing a drop through the 2.2M resistor. This is a further loss of 2.2M*0.5uA, or 1.1V, so the opamp (+) inputs sit at 4.335 - 1.1 = 3.235V, and that is the voltage you would measure (+/-) the opamp's offset voltage imperfections) at the opamp output terminal.

Notice that the internal impedance of the Vb resistors (220K + 220K) only caused a drop of 0.165V, but the 2.2M bias resistors on each opamp caused a loss of 1.1V each.

Questions?
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.