Author Topic: How to tune this current buffer?  (Read 4564 times)

0 Members and 1 Guest are viewing this topic.

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
How to tune this current buffer?
« on: May 25, 2023, 04:51:38 pm »
Hello,

I recently came across this circuit for a current buffer, and I've been trying to understand how part of it works. When working properly, this circuit should output the same amount of current being input.

I think I understand the output stage of the circuit: that appears to be a voltage-controlled high side current source, but I'm confused about the circuit that drives the output stage.

After simulating the circuit in spice, my version works "okay", but not awesome. I think I need to tune the values of R3, R4, and R5, but I'm not sure how. Also, I don't understand why there is a diode, but I think it's important and changing the diode used greatly changes the output of the circuit.

Assuming D1 is important, how would I go about picking an appropriate diode?

Spice file and picture of circuit is attached.
 

Online moffy

  • Super Contributor
  • ***
  • Posts: 1721
  • Country: au
Re: How to tune this current buffer?
« Reply #1 on: May 25, 2023, 11:28:43 pm »
I agree the circuit looks messy and its gain because of no feedback is dependent upon setting a number of resistor values just right, not a good solution. The diode is important as it matches the Vbe drop across Q3 to help linearise the circuit. There are other ways to do the same thing, it would be best to choose one of them.
 
The following users thanked this post: AJ528

Online moffy

  • Super Contributor
  • ***
  • Posts: 1721
  • Country: au
Re: How to tune this current buffer?
« Reply #2 on: May 26, 2023, 12:14:43 am »
Here is a simple example, I am not proposing you use it, but it is much simpler as it depends upon current mirrors and matched transistors, the emitter resistors help deal with any mismatch between the matched pairs. The traces are the input current and output current.
 
The following users thanked this post: AJ528

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1535
  • Country: au
Re: How to tune this current buffer?
« Reply #3 on: May 26, 2023, 01:07:09 am »
Assuming D1 is important, how would I go about picking an appropriate diode?
Diode D1 is to track the VBE of Q3, so usually that would be a diode connected Q3, and in the same package.
Usually you would also pick Q1,Q2 in the same package, as their VBE need to nominally track.
Change that in spice to be a Diode connected BC856B

I think I need to tune the values of R3, R4, and R5, but I'm not sure how.
Spice lets you change things easily.

The current gain here is the ratio of  R5:R1 x ratio of R3:R4

A simple circuit like this will not track well at low currents, or over a wide range of currents, and has modest PSRR - but that may be fine for your needs.
 
The following users thanked this post: AJ528

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: How to tune this current buffer?
« Reply #4 on: May 26, 2023, 01:59:02 am »
Q1 and Q2 operate as emitter followers, meaning that the voltage at their emitters follows the voltage at their bases.  The voltage at the base of Q1 comes from current Iin through resistor R1.  This voltage is duplicated at the emitter of Q2 because the Vbe voltages of Q1 and Q2 cancel.

The voltage at the emitter of Q2 causes a current through R4, which is duplicate at Q4's collector.  This current flows through D1 and R3.  The Vbe of Q3 is the same as the voltage across D1, so the voltage across R3 is the same as the voltage across R5.  This voltage across R5 causes a current which shows up at the emitter of Q4.

So it is indeed a current to current converter, but the current input to ground is equal to the current out from the positive supply to ground.  The ratios of the various emitter resistors control the current gain.

For best accuracy the various Vbe voltage should be matched, including D1.  Nothing can be done about Q1 and Q2 since they are a PNP and NPN transistor, however D1 could be the base-emitter junction of a BC856B to closely match Q3.  With discrete transistors their Vbe voltages would need to be matched manually but this is not difficult.  D1 and Q3 could be a dual matched transistor.
« Last Edit: May 26, 2023, 02:01:59 am by David Hess »
 
The following users thanked this post: AJ528

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1535
  • Country: au
Re: How to tune this current buffer?
« Reply #5 on: May 26, 2023, 04:49:56 am »
If you want real performance on a current Mirror, you are better off using opamps and mosfets, as per the example attached
This has high PSRR, wide dynamic range and no VBE temperature issues.

 
The following users thanked this post: AJ528

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3244
  • Country: us
Re: How to tune this current buffer?
« Reply #6 on: May 26, 2023, 01:12:35 pm »
Here is a simple example, I am not proposing you use it, but it is much simpler as it depends upon current mirrors and matched transistors, the emitter resistors help deal with any mismatch between the matched pairs. The traces are the input current and output current.

Here's an interesting derivative of this that has an output current that is somewhat independent of the input current over a range. We utilized this for tree biasing in various ICs under development way back.

Edit: Replacing the Input current source with a Voltage source and series Resistor also works. Using a 2.7K resistor and Sweeping Input Voltage source from 0 to 5 volts yields the last two plots of output current, showing somewhat independence of input voltage.

Best,
« Last Edit: May 26, 2023, 01:49:55 pm by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: PartialDischarge, AJ528

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #7 on: May 26, 2023, 05:34:37 pm »
Q1 and Q2 operate as emitter followers, meaning that the voltage at their emitters follows the voltage at their bases.  The voltage at the base of Q1 comes from current Iin through resistor R1.  This voltage is duplicated at the emitter of Q2 because the Vbe voltages of Q1 and Q2 cancel.

The voltage at the emitter of Q2 causes a current through R4, which is duplicate at Q4's collector.  This current flows through D1 and R3.  The Vbe of Q3 is the same as the voltage across D1, so the voltage across R3 is the same as the voltage across R5.  This voltage across R5 causes a current which shows up at the emitter of Q4.

So it is indeed a current to current converter, but the current input to ground is equal to the current out from the positive supply to ground.  The ratios of the various emitter resistors control the current gain.
Thank you for this explanation! That really helps solidify my understanding.

For best accuracy the various Vbe voltage should be matched, including D1.  Nothing can be done about Q1 and Q2 since they are a PNP and NPN transistor, however D1 could be the base-emitter junction of a BC856B to closely match Q3.  With discrete transistors their Vbe voltages would need to be matched manually but this is not difficult.  D1 and Q3 could be a dual matched transistor.
How would you go about manually matching Vbe voltages? Just buy a bunch of transistors and measure the diode drop across b and e with a multimeter? And if you didn't match the Vbe voltages, what's the worst-case error that could introduce? Is there an easy way to calculate that? Or would you have to simulate it? For reference, the BC856 has a Vbe range of 600-750 mV at 25C.
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #8 on: May 26, 2023, 06:04:20 pm »
Diode D1 is to track the VBE of Q3, so usually that would be a diode connected Q3, and in the same package.
Usually you would also pick Q1,Q2 in the same package, as their VBE need to nominally track.
Change that in spice to be a Diode connected BC856B
Why is it important to have these transistors in the same package? Especially when it's an NPN and PNP in the same package. Is that just so that they remain the same temperature? Or is there another advantage? I can't imagine two discrete BJTs on the same PCB would differ that much in temperature; maybe a couple degrees C? Would that change the accuracy by more than a couple percent? I'd like to get a feel for how much benefit one should expect from making certain design decisions.

Spice lets you change things easily.

The current gain here is the ratio of  R5:R1 x ratio of R3:R4

A simple circuit like this will not track well at low currents, or over a wide range of currents, and has modest PSRR - but that may be fine for your needs.
I updated my simulation so that D1 is now a diode-connected BC856 (it kind of looks like a current mirror now? probably not a coincidence), and I changed R5 to match the ratio of R3:R4, and that made a huge difference! The circuit works almost perfectly now. But, as you predicted, it doesn't track well at low currents. What made you realize the circuit would behave like that? Is the primary source of that error due to the ratio of base:collector current flowing out of Q2's emitter? And at low currents you can't assume Ic = Ie?
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #9 on: May 26, 2023, 06:18:25 pm »
Here is a simple example, I am not proposing you use it, but it is much simpler as it depends upon current mirrors and matched transistors, the emitter resistors help deal with any mismatch between the matched pairs. The traces are the input current and output current.
This is interesting. How do the emitter resistors help deal with mismatch?

Also, something that has previously turned me off from using pure current mirrors is their inefficiency. I feel like I'm wasting half my current just to create a current-source. I do like the simplicity of this and the fact you can make it with discrete transistors. Do you know of a way to easily turn it from a mirror/buffer to an amplifier? Something like a 10-100x current gain would be much more efficient. I know that in IC-land, they can accomplish a 10x gain by having 1 input transistor and 1 output transistor with 10x the ratio of...something, but in PCB-land I only know how to do that with 1 input transistor and 10 output transistors, and that's very space-inefficient.
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #10 on: May 26, 2023, 06:24:56 pm »
Here is a simple example, I am not proposing you use it, but it is much simpler as it depends upon current mirrors and matched transistors, the emitter resistors help deal with any mismatch between the matched pairs. The traces are the input current and output current.

Here's an interesting derivative of this that has an output current that is somewhat independent of the input current over a range. We utilized this for tree biasing in various ICs under development way back.

Edit: Replacing the Input current source with a Voltage source and series Resistor also works. Using a 2.7K resistor and Sweeping Input Voltage source from 0 to 5 volts yields the last two plots of output current, showing somewhat independence of input voltage.

Best,
Interesting...
In that example, why are there resistors on the bases of the current mirrors? And they seem like pretty specific values, how did you calculate that?
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #11 on: May 26, 2023, 06:26:22 pm »
If you want real performance on a current Mirror, you are better off using opamps and mosfets, as per the example attached
This has high PSRR, wide dynamic range and no VBE temperature issues.
I'm definitely interested in looking at this in more detail at some point, but I don't have a great intuition on how that circuit is supposed to work. Also, does it require multiple voltage rails?
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: How to tune this current buffer?
« Reply #12 on: May 26, 2023, 07:59:55 pm »
For best accuracy the various Vbe voltage should be matched, including D1.  Nothing can be done about Q1 and Q2 since they are a PNP and NPN transistor, however D1 could be the base-emitter junction of a BC856B to closely match Q3.  With discrete transistors their Vbe voltages would need to be matched manually but this is not difficult.  D1 and Q3 could be a dual matched transistor.

How would you go about manually matching Vbe voltages? Just buy a bunch of transistors and measure the diode drop across b and e with a multimeter? And if you didn't match the Vbe voltages, what's the worst-case error that could introduce? Is there an easy way to calculate that? Or would you have to simulate it? For reference, the BC856 has a Vbe range of 600-750 mV at 25C.

That is how I do it.  I take a bunch of the transistors and measure the Vbe voltages at a current which is representative of the application circuit.  Matching to better than 100 microvolts is not too difficult.

Transistors from the same lot typically match to within 10s of millivolts.

Why is it important to have these transistors in the same package? Especially when it's an NPN and PNP in the same package. Is that just so that they remain the same temperature? Or is there another advantage? I can't imagine two discrete BJTs on the same PCB would differ that much in temperature; maybe a couple degrees C? Would that change the accuracy by more than a couple percent? I'd like to get a feel for how much benefit one should expect from making certain design decisions.

Having the transistors in the same package yields better thermal tracking.  Some designs use separate manually matched transistors and then mount them together on the same heat sink.

I'm definitely interested in looking at this in more detail at some point, but I don't have a great intuition on how that circuit is supposed to work. Also, does it require multiple voltage rails?

U1 and T2 form a voltage controlled current sink.  The inputs to the operational amplifier are at the same voltage by definition, so the input voltage is the same as the voltage across RSET, which generates a current proportional to voltage through RMIR, producing a voltage across RMIR proportional to the input voltage.

Now the same thing happens with U2 producing a current source at the drain of U2 proportional to the input voltage.

This circuit can operate with a single supply, however U1 must have inputs which go to ground, and U2 must have inputs which go to the positive supply.  The OPA376 is a rail-to-rail input and output operational amplifier so meets these requirements, however it only operates up to 5 volts.
 
The following users thanked this post: AJ528

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3244
  • Country: us
Re: How to tune this current buffer?
« Reply #13 on: May 27, 2023, 02:01:41 am »
Here's an interesting derivative of this that has an output current that is somewhat independent of the input current over a range. We utilized this for tree biasing in various ICs under development way back.

Edit: Replacing the Input current source with a Voltage source and series Resistor also works. Using a 2.7K resistor and Sweeping Input Voltage source from 0 to 5 volts yields the last two plots of output current, showing somewhat independence of input voltage.

Best,
Interesting...
In that example, why are there resistors on the bases of the current mirrors? And they seem like pretty specific values, how did you calculate that?

Edit: Originally referenced the wrong quote!!

See the notes in the article, the resistor values are calculated based upon where the derivative of collector current goes thru zero. Note the resistors are displaced by e^1, thus the pair of "Peaking Sources" are displaced by e^-1, which is where the output current becomes somewhat independent from the input current over a range of inputs. Also note with aluminum resistors the overall TC is very low.

Another way of thinking how this works is as the input current increases, which is the collector current of Q1, neglecting base currents, the CE voltage begins to drop at higher currents due the R1 drop. At lower currents the CE voltage is ~ Vbe because the voltage drop across R1 is low. Because the CE voltage of Q1 is the Vbe of Q2, the collector current of Q2 mirrors Q1 at lower currents, then begins to taper off as Q1s collector current increases due the the drop across R1. So you have an initial rise in Q2 collector current, followed by a peak (thus name Peaking Source), then a decline in current. An analysis of this Peaking Source shows the output peaks at input current Vt/R1, where Vt is kT/q. The output of Q2 feeds another Peaking Source based upon PNP Transistors Q3 and Q4, further analysis shows that displacing the two Peaking Sources by e^-1 one achieves a flattened overall output response as shown.

Best,
« Last Edit: May 27, 2023, 03:19:59 am by mawyatt »
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 
The following users thanked this post: AJ528

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1535
  • Country: au
Re: How to tune this current buffer?
« Reply #14 on: May 27, 2023, 03:20:18 am »
Why is it important to have these transistors in the same package? Especially when it's an NPN and PNP in the same package. Is that just so that they remain the same temperature? Or is there another advantage? I can't imagine two discrete BJTs on the same PCB would differ that much in temperature; maybe a couple degrees C? Would that change the accuracy by more than a couple percent? I'd like to get a feel for how much benefit one should expect from making certain design decisions.
These days, dual/double transistors are cheaper to mount than two singles and take up less PCB space.
Thermal tracking helps, but you also get both parts from the same vendor, and some vendors do hint at attempts to match the nominal specs. So your production spread is expected to be less.

eg https://assets.nexperia.com/documents/data-sheet/BC847BPN.pdf
shows 655mV(typ) for both PNP an NPN VBE at 2mA , and the BC847BPNH-Q data gives the same typical HFE of 300 for the pairs.
Of course, the curves have differing shapes, for NPN vs PNP, so the match is not a perfect tracking match.
LRC give the same typical HFE of 290 for their LBC846BPDW


.... But, as you predicted, it doesn't track well at low currents. What made you realize the circuit would behave like that?
Experience  8)


Is the primary source of that error due to the ratio of base:collector current flowing out of Q2's emitter? And at low currents you can't assume Ic = Ie?
Simple transistor circuits are good for fixed operating points, but there are many sources of error, and you can improve things by throwing more parts at it. (see above)
eg I can also get better dynamic range from an input stage that has 7 transistors, and starts to look a lot like a LM358 input stage, but at that point you have moved away from practical to too-many-discrete-parts.

What exactly do you need this current buffer to manage - what current range and what precision ?

 
The following users thanked this post: AJ528

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #15 on: May 27, 2023, 06:03:03 am »
What exactly do you need this current buffer to manage - what current range and what precision ?
Truthfully, I don't have an application for this circuit yet. It caught my eye because it's simple, uses all discrete parts, and operates with the accuracy/range that I normally worry about.

Usually, my needs for any kind of amplifier or current source are in the range of hundreds of microamps to hundred of milliamps. Probably a precision of 5 or 10%. I'm not building a cutting-edge amplifier or anything; as far as I'm concerned, nanoamps don't exist haha.

Here's a good example: one time the circuit I was designing had an expected input voltage range of 5-10V, and we were driving an LED directly off that rail. I thought, "you know, it would be nice if that LED always shined at a consistent brightness regardless of input voltage", so I decided to add a couple components to keep the LED current constant-ish (4-6mA instead of 5-10mA). My final design accomplished this using a RRIO op-amp, but it kind of felt like overkill.

I like the simplicity of a solution using discrete components, but if I design something like that, I know there's going to be 0 effort put towards matching the transistors: the board house is just going to throw on the parts as it gets them. So, if I want to be confident in using a solution like this, I need to be able to figure out the worst-case error, so I can determine if that's acceptable.

These days, dual/double transistors are cheaper to mount than two singles and take up less PCB space.
Thermal tracking helps, but you also get both parts from the same vendor, and some vendors do hint at attempts to match the nominal specs. So your production spread is expected to be less.
Absolutely, I agree there's almost never a reason not to use a dual transistor package. I'm just curious how big a difference that makes, and/or how to calculate the worst-case scenario where the Vbe are on opposite extremes.

eg https://assets.nexperia.com/documents/data-sheet/BC847BPN.pdf
shows 655mV(typ) for both PNP an NPN VBE at 2mA , and the BC847BPNH-Q data gives the same typical HFE of 300 for the pairs.
Of course, the curves have differing shapes, for NPN vs PNP, so the match is not a perfect tracking match.
LRC give the same typical HFE of 290 for their LBC846BPDW

Transistors from the same lot typically match to within 10s of millivolts.

...

Having the transistors in the same package yields better thermal tracking.  Some designs use separate manually matched transistors and then mount them together on the same heat sink.

When it comes to BJT amplifiers, I've frequently heard about the importance of matching transistors to each other, and how to accomplish that and keep them the same temperature. What I don't really understand yet is "how much better does your circuit become when you carefully match transistors to each other?" Or, in other words, "if I don't match anything, and the transistors have a 10 or 20C difference between them, what's the worst that could happen?"

I'm trying to improve my intuition about these kinds of circuits so I can feel more comfortable using them in the future.


That is how I do it.  I take a bunch of the transistors and measure the Vbe voltages at a current which is representative of the application circuit.  Matching to better than 100 microvolts is not too difficult.
A lot of analog circuit design feels like black magic to me, so it's nice to hear that at least 1 part is pretty straightforward. If you need to know the Vbe of transistors, measuring them and matching them makes total sense.
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #16 on: May 27, 2023, 06:25:09 am »
An analysis of this Peaking Source shows the output peaks at input current Vt/R1, where Vt is kT/q. The output of Q2 feeds another Peaking Source based upon PNP Transistors Q3 and Q4, further analysis shows that displacing the two Peaking Sources by e^-1 one achieves a flattened overall output response as shown.
Interesting.... usually, my use case would involve discrete transistors and be in the range of tens of milliamps. Are the benefits of a Peaking Source still noticeable if the resistor is only 2 or 3 ohms? What if the BJTs involved in the mirror don't perfectly match (e.g. a Vbe difference of 100mV)?
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #17 on: May 27, 2023, 06:34:25 am »
U1 and T2 form a voltage controlled current sink.  The inputs to the operational amplifier are at the same voltage by definition, so the input voltage is the same as the voltage across RSET, which generates a current proportional to voltage through RMIR, producing a voltage across RMIR proportional to the input voltage.

Now the same thing happens with U2 producing a current source at the drain of U2 proportional to the input voltage.

This circuit can operate with a single supply, however U1 must have inputs which go to ground, and U2 must have inputs which go to the positive supply.  The OPA376 is a rail-to-rail input and output operational amplifier so meets these requirements, however it only operates up to 5 volts.
Thank you again for the explanation David! That makes perfect sense.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1535
  • Country: au
Re: How to tune this current buffer?
« Reply #18 on: May 27, 2023, 09:37:38 am »
When it comes to BJT amplifiers, I've frequently heard about the importance of matching transistors to each other, and how to accomplish that and keep them the same temperature. What I don't really understand yet is "how much better does your circuit become when you carefully match transistors to each other?" Or, in other words, "if I don't match anything, and the transistors have a 10 or 20C difference between them, what's the worst that could happen?"
You can easily try offsets in Spice, with mV voltage generators.
Bipolar Transistors are roughly 60mV/decade, outside of resistive effects.
As mentioned above, in real world terms the data sheet spreads are never encountered in production, and many are simulated corners.

The matching effects is the same as offset voltage in opamps. Matching also helps drift effects.
In practical terms, a lower offset voltage can allow smaller sense resistors and less lost power.
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3244
  • Country: us
Re: How to tune this current buffer?
« Reply #19 on: May 27, 2023, 01:34:49 pm »
An analysis of this Peaking Source shows the output peaks at input current Vt/R1, where Vt is kT/q. The output of Q2 feeds another Peaking Source based upon PNP Transistors Q3 and Q4, further analysis shows that displacing the two Peaking Sources by e^-1 one achieves a flattened overall output response as shown.
Interesting.... usually, my use case would involve discrete transistors and be in the range of tens of milliamps. Are the benefits of a Peaking Source still noticeable if the resistor is only 2 or 3 ohms? What if the BJTs involved in the mirror don't perfectly match (e.g. a Vbe difference of 100mV)?

Well a 100mv mismatch in Vbe translates to a ~ 47.7 to 1 ratio in collector currents at room temperature!! So yes you want the devices to be somewhat matched, simple SPICE type simulations will show the effects of device mismatch if one doesn't want to drudge thru the analysis.

10ma input current would translate to ~ e^-2*10ma or ~ 1.35ma output. Under these conditions R1 would be Vt/10ma, or ~2.6 ohms and R3 would be ~7 ohms, so one would expect small signal device parasitic resistances to dominate, but surprisingly have little effect (because of the tight local feedback between device collector and base). Here's a simulation with those resistor values using the 2N3904 and 2N3906 transistors shown in original schematic earlier in this thread.

Please note you can scale the output current by integers, by simply replicating Q4, or have multiple outputs by replicating Q4. Here's an example of replicating Q4 6 more times thus the output current is 7 times higher or ~ 10ma. Note the scale factors between the two images, the last image is just scaled due to the additional replication of Q4.

Long ago when we developed this current source we needed an extremely high PSRR for a custom on-chip linear regulator, we couldn't use typical off chip decoupling capacitors, and one of the major noise sources were from switching regulator artifacts, so we also needed high bandwidths (originally implemented with ~10GHz NPN and 4.8GHz PNP in a Bell Labs Complementary Bipolar Process, which later became CBIC-V2). This source was utilized throughout as Tree or Fountain biasing schemes for various circuits, and utilized in multiple chip designs.

Anyway, hope this helps understand this current source's behavior.

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3244
  • Country: us
Re: How to tune this current buffer?
« Reply #20 on: May 27, 2023, 03:07:00 pm »

Long ago when we developed this current source we needed an extremely high PSRR for a custom on-chip linear regulator, we couldn't use typical off chip decoupling capacitors, and one of the major noise sources were from switching regulator artifacts, so we also needed high bandwidths......

If one studies this current source in detail it shows that the output current is somewhat independent of the input (see various plots) over a good range of the input, this implies a fundamental rejection of input variations and why it was developed to improve the supply rejection in various ICs. In actual use the input would likely just be a resistor to the supply, with the resistor chose for the mid range input current. Using this case and 2.7K input resistor to the +5V Vcc supply, and R1 set tp 26 ohms, with R3 at 70 ohms as shown one achieves a interesting plot of the output current in response to the input (Vcc) voltage variation.

Note this does not include any additional capacitors or inductors, just the 4 transistors and 3 resistors, yet achieves good rejection of the input source variations over a wide frequency range. This is what we called "Active Ripple Rejection" rather than the usual passive methods which we couldn't employ due to size & configuration limitations, and why this current source was developed way back when ;)

Anyway, hopefully some folks will find this somewhat unique current source useful, or maybe just fun to play with  :)

Best,
Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline David Hess

  • Super Contributor
  • ***
  • Posts: 16607
  • Country: us
  • DavidH
Re: How to tune this current buffer?
« Reply #21 on: May 27, 2023, 08:12:20 pm »
When it comes to BJT amplifiers, I've frequently heard about the importance of matching transistors to each other, and how to accomplish that and keep them the same temperature. What I don't really understand yet is "how much better does your circuit become when you carefully match transistors to each other?" Or, in other words, "if I don't match anything, and the transistors have a 10 or 20C difference between them, what's the worst that could happen?"

It depends on the application and how much performance is required.  If you have discrete differential pairs that can tolerate 10s of millivolts of offset, then no matching is required.  Some applications benefit from not only matching Vbe but also current gain.  This might be done in audio amplifiers to reduce harmonic distortion.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6761
  • Country: pl
Re: How to tune this current buffer?
« Reply #22 on: May 27, 2023, 09:08:32 pm »
And if you didn't match the Vbe voltages, what's the worst-case error that could introduce? Is there an easy way to calculate that?
That's simple, actually.


R1 and R4 voltages should be equal, and they are if Q1 and Q2 Vbe are equal. If the Vbe aren't equal, then R4 voltage is higher or lower than R1 by exactly ΔVbe and Q2 current is wrong by ΔVbe/R4.

No amount of transistor matching can be 100% effective here, because Q2 Vbe depends on circuit current, while Q1 Vbe is roughly constant. It may be possible to adjust R2 to match Q1 Vbe with Q2 at any particular chosen Q2 current.


Similar error occurs at D1 and Q3. Here Q3 current is very low, only the base current of Q4, and its Vbe is likely lower than D1's. This could be fixed - add a transistor which sinks the same current as Q2 from Q3's collector. Ignoring base current of Q4, D1 and Q3 bias currents will become equal then. Gain of this stage will decrease from 18x to 17x due to the current stolen away. At high current their Vbe may still be unequal due to different Vce and internal temperature; SPICE will not show this effect but it can be real.


All such errors can be reduced in significance by increasing the amount of voltage dropped on all those emitter resistors. Then ΔVbe will be relatively small and insignificant. That's why you are seeing larger relative errors at low currents than at high currents. Higher resistor values would help as well.
« Last Edit: May 27, 2023, 09:19:19 pm by magic »
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #23 on: May 27, 2023, 09:10:37 pm »
You can easily try offsets in Spice, with mV voltage generators.
That's a good idea. can that just be simulated by connecting a voltage source to the gate or emitter, and have the other end of the voltage source become the new "gate" or "emitter"? In the example we've been looking at, would the picture attached simulate if Q5 and Q3 has a Vbe mismatch of 200mV?
Bipolar Transistors are roughly 60mV/decade, outside of resistive effects.
I'm not sure I understand what you mean here. 60mV per decade of what?

As mentioned above, in real world terms the data sheet spreads are never encountered in production, and many are simulated corners.

The matching effects is the same as offset voltage in opamps. Matching also helps drift effects.
In practical terms, a lower offset voltage can allow smaller sense resistors and less lost power.
That's good to know, and a good analogy with opamps. I understand the voltage offset there pretty intuitively, so that helps.

It depends on the application and how much performance is required.  If you have discrete differential pairs that can tolerate 10s of millivolts of offset, then no matching is required.  Some applications benefit from not only matching Vbe but also current gain.  This might be done in audio amplifiers to reduce harmonic distortion.
Yeah, I'm trying to get a better intuition about when matching is required. With how often it's talked about, I always assumed it would make or break the amplifier you're making (which, to be fair, it absolutely can some times). But in this specific case, a 200mV mismatch between matched PNP's only makes it like 7 or 8% worse. Which could be totally fine sometimes. What I'm trying to figure out now is "how is the 200mV mismatch propagating through the circuit and causing the error?" I'm wondering if it's proportional to the resistance of R5?
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #24 on: May 27, 2023, 09:13:13 pm »

Long ago when we developed this current source we needed an extremely high PSRR for a custom on-chip linear regulator, we couldn't use typical off chip decoupling capacitors, and one of the major noise sources were from switching regulator artifacts, so we also needed high bandwidths......

If one studies this current source in detail it shows that the output current is somewhat independent of the input (see various plots) over a good range of the input, this implies a fundamental rejection of input variations and why it was developed to improve the supply rejection in various ICs. In actual use the input would likely just be a resistor to the supply, with the resistor chose for the mid range input current. Using this case and 2.7K input resistor to the +5V Vcc supply, and R1 set tp 26 ohms, with R3 at 70 ohms as shown one achieves a interesting plot of the output current in response to the input (Vcc) voltage variation.

Note this does not include any additional capacitors or inductors, just the 4 transistors and 3 resistors, yet achieves good rejection of the input source variations over a wide frequency range. This is what we called "Active Ripple Rejection" rather than the usual passive methods which we couldn't employ due to size & configuration limitations, and why this current source was developed way back when ;)

Anyway, hopefully some folks will find this somewhat unique current source useful, or maybe just fun to play with  :)

Best,

Thank you for the explanation! I will definitely play around with this later.
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #25 on: May 27, 2023, 10:00:20 pm »
Similar error occurs at D1 and Q3. Here Q3 current is very low, only the base current of Q4, and its Vbe is likely lower than D1's. This could be fixed - add a transistor which sinks the same current as Q2 from Q3's collector. Ignoring base current of Q4, D1 and Q3 bias currents will become equal then. Gain of this stage will decrease from 18x to 17x due to the current stolen away. At high current their Vbe may still be unequal due to different Vce and internal temperature; SPICE will not show this effect but it can be real.
How would you connect a transistor to match the current Q2 pulls and have it pull through Q3? Also, how did you calculate the gain to be 18x? What two values are you calculating the ratio of?

All such errors can be reduced in significance by increasing the amount of voltage dropped on all those emitter resistors. Then ΔVbe will be relatively small and insignificant. That's why you are seeing larger relative errors at low currents than at high currents. Higher resistor values would help as well.
I'm having trouble understanding why emitter resistors help fix the error introduced by Vbe mismatch. You would still get the same mismatched Vbe voltage across each transistor, right?
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1535
  • Country: au
Re: How to tune this current buffer?
« Reply #26 on: May 28, 2023, 12:53:35 am »
I'm not sure I understand what you mean here. 60mV per decade of what?
If you look at any transistor plot, you can see the current changes about 10:1 or a decade ratio, for every ~60mV change in VBE

But in this specific case, a 200mV mismatch between matched PNP's only makes it like 7 or 8% worse. Which could be totally fine sometimes.
You are better to plot a linear transfer than using a sine wave source, if you want to properly check origin offset effects etc.
Sweep a current source, so you get current on the X axis helps. Then you can see the transfer more easily.

The very simply circuit here has quite a large origin or zero offset error, which gives big errors at low currents.
eg at about 175uA current in, you have crossed the 100% error point, and below that it rapidly gets even worse.
At 2mA the offset effect on the input stage is reduced to under 1.5%.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 1535
  • Country: au
Re: How to tune this current buffer?
« Reply #27 on: May 28, 2023, 12:57:51 am »
I'm having trouble understanding why emitter resistors help fix the error introduced by Vbe mismatch. You would still get the same mismatched Vbe voltage across each transistor, right?

Yes the VBE diff is the same, but the resistors drop voltage, and that means any difference results in a much lower current change.
eg a 60mV VBE diff gives a huge 10:1 change, but if you add resistors dropping 1V, the same 60mV difference across those two resistors, is now only 6%
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6761
  • Country: pl
Re: How to tune this current buffer?
« Reply #28 on: May 28, 2023, 06:46:54 am »
Similar error occurs at D1 and Q3. Here Q3 current is very low, only the base current of Q4, and its Vbe is likely lower than D1's. This could be fixed - add a transistor which sinks the same current as Q2 from Q3's collector. Ignoring base current of Q4, D1 and Q3 bias currents will become equal then. Gain of this stage will decrease from 18x to 17x due to the current stolen away. At high current their Vbe may still be unequal due to different Vce and internal temperature; SPICE will not show this effect but it can be real.
How would you connect a transistor to match the current Q2 pulls and have it pull through Q3? Also, how did you calculate the gain to be 18x? What two values are you calculating the ratio of?
Add Q2b and connect its base to Q2 base. Connect its emitter to ground with another 4k7 resistor. Now it sinks the same current as Q2, so simply connect its collector with Q3 collector.

18x is the ratio of R3/R5 (on the first version of your schematic, I see that you changed it later to 1800/135=13⅓). If we can ensure equal Vbe on D1/Q5 and Q3 then R3 and R5 have equal voltage on them and their ratio determines output/input current ratio exactly.

This calculation ignores Q3 base current being subtracted from R5 current and never reaching the output, but the error is 1/β so less than 1%. In practice you will have similar errors due to resistor tolerance.


I'm having trouble understanding why emitter resistors help fix the error introduced by Vbe mismatch. You would still get the same mismatched Vbe voltage across each transistor, right?
The error of this "current multiplier" is simply (Vbe(Q3)-Vbe(Q5))/R5. The larger R5 is, the less error. Of course R3 must be increased proportionally to preserve their ratio.

Or in other words, voltages dropped by these resistors become so high that a few mV is not making much difference anymore.


edit
And by the way, you don't need R6 to measure the final output current in SPICE. You can simply plot Ie(Q4) and it will be the same. In LTspice you can add this plot by clicking on the emitter of Q4.
« Last Edit: May 28, 2023, 06:56:42 am by magic »
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #29 on: May 28, 2023, 07:33:07 pm »
If you look at any transistor plot, you can see the current changes about 10:1 or a decade ratio, for every ~60mV change in VBE
Whoa, I never realized that before! I'm so used to thinking of BJTs as current-controlled devices.

Yes the VBE diff is the same, but the resistors drop voltage, and that means any difference results in a much lower current change.
eg a 60mV VBE diff gives a huge 10:1 change, but if you add resistors dropping 1V, the same 60mV difference across those two resistors, is now only 6%
It took me a while to wrap my head around this, but I think it finally clicked (at least partially). Assume the BJT is in forward-active mode. Then, thinking of a BJT as a voltage-controlled current source, if there is no Re, then Ic = gm*Vbe. gm is not a constant value, it's super finnicky, so a small change in Vbe (like 60mV) can have a huge change in Ic (10x current). But, if there is an emitter resistor (and it's a reasonable value like at least 10 ohms), then, Ic isn't gm*Vce anymore, it becomes Ic = (Vb - 0.7)/Re. If Rc is a large enough resistance, the BJT still tries to pull Ve/Re current through that resistor, but it can't, so Vc will equal Ve and you've entered saturation mode.

This is what I was hoping would happen. I feel like I'm getting a better intuition for BJTs.

You are better to plot a linear transfer than using a sine wave source, if you want to properly check origin offset effects etc.
Sweep a current source, so you get current on the X axis helps. Then you can see the transfer more easily.

The very simply circuit here has quite a large origin or zero offset error, which gives big errors at low currents.
eg at about 175uA current in, you have crossed the 100% error point, and below that it rapidly gets even worse.
At 2mA the offset effect on the input stage is reduced to under 1.5%.
Good idea, I will try this next!
 

Offline AJ528Topic starter

  • Contributor
  • Posts: 23
  • Country: us
Re: How to tune this current buffer?
« Reply #30 on: May 28, 2023, 08:20:31 pm »
Add Q2b and connect its base to Q2 base. Connect its emitter to ground with another 4k7 resistor. Now it sinks the same current as Q2, so simply connect its collector with Q3 collector.
Hmmm, I tried adding Q2b/Q6 per your suggestion, but initially, it appears to have made things worse (see attached photos). I don't have a good enough feel for this yet to know the issue, but I will poke around and see if I can trace back the issue.

18x is the ratio of R3/R5 (on the first version of your schematic, I see that you changed it later to 1800/135=13⅓). If we can ensure equal Vbe on D1/Q5 and Q3 then R3 and R5 have equal voltage on them and their ratio determines output/input current ratio exactly.

This calculation ignores Q3 base current being subtracted from R5 current and never reaching the output, but the error is 1/β so less than 1%. In practice you will have similar errors due to resistor tolerance.
That makes total sense and I love the simplification there. At this time <1% error is in the noise for me.

The error of this "current multiplier" is simply (Vbe(Q3)-Vbe(Q5))/R5. The larger R5 is, the less error. Of course R3 must be increased proportionally to preserve their ratio.

Or in other words, voltages dropped by these resistors become so high that a few mV is not making much difference anymore.
That's a great way to put it. Thanks for pointing that out! I just recently started wrapping my head around emitter resistors, so I will think on this more.
 

Online mawyatt

  • Super Contributor
  • ***
  • Posts: 3244
  • Country: us
Re: How to tune this current buffer?
« Reply #31 on: May 28, 2023, 08:31:42 pm »
If you look at any transistor plot, you can see the current changes about 10:1 or a decade ratio, for every ~60mV change in VBE
Whoa, I never realized that before! I'm so used to thinking of BJTs as current-controlled devices.

It's an intrinsic nature for all transistors.

Let Vbe1 @ Ic1, and Vbe2 @ Ic2 for a given transistor.

Vbe1 = Vt*ln(Ic1/Is) and Vbe2 = Vt*ln(Ic2/Is)

Where Vt is kT/q  (k ~1.38E-23J/K, q ~1.6E-19C, T ~ 300K at room temperature), Is is the Saturation Device current

Vbe2-Vbe1 = Delta Vbe = Vt*ln(Ic2/Is) - Vt*ln(Ic1/Is)

Thus Delta Vbe = Vt*ln(Ic2/Ic1).

Note this does not depend on Is and Directly Proportional to Temperature! Extremely important attributes which led the brilliant Bob Widlar to develop the band-gap voltage reference by canceling the negative TC of a bipolar Vbe with a + TC from a pair of ratioed collector current transistors!!!

So for Ic2/Ic1 = 10, then Delta Vbe ~ 0.05958V at 300K, thus the ~60mv/decade quoted.

For Ic2/Ic1 = 2 then Delta Vbe ~ 0.01794V at 300K.

Anyway, hope this helps understand how Vbe and differences affects transistor collector currents.

Best,

Curiosity killed the cat, also depleted my wallet!
~Wyatt Labs by Mike~
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 6761
  • Country: pl
Re: How to tune this current buffer?
« Reply #32 on: May 28, 2023, 08:41:19 pm »
Hmmm, I tried adding Q2b/Q6 per your suggestion, but initially, it appears to have made things worse (see attached photos). I don't have a good enough feel for this yet to know the issue, but I will poke around and see if I can trace back the issue.
Oops, I think Q6 BC junction becomes forward biased and drives high current into Q4 base when R1 voltage reaches ~0.7V and Q4 emitter is near ground potential.

I suppose one could try to fix it, perhaps by cascoding Q3 (which could also solve thermal mismatch with Q5), but then it's no longer a simple one-transistor tweak as I hoped.

(What I mean is: add another diode below Q5, add another PNP with its base to Q2 collector, emitter to Q6,Q3 collectors and collector to Q4 base).
« Last Edit: May 28, 2023, 08:47:07 pm by magic »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf