source-to-sink / positive-to-negative current mirror - Page 1
Forum section: electronics / projects

author: jeduffy
author_rank: Contributor
timestamp: March 23, 2025, 06:31:33 pm
content: Does anyone know of a circuit that can "copy"/measure a current coming from a positive supply rail, and sink that to the negative rail? It seems frustratingly similar to a regular 'ol current mirror, but everything I can find only talks about a mirror that operates solely on either the negative or positive rail.This would probably be fairly easy with a couple of opamps and mosfets/jfets or something, but I'm hoping for something more elegant - preferably a couple bjts or fets or something only. I've got a diagram attached, I'm looking for what the "measure" and "sink/mirror" should look like, to avoid loading the output of that opamp with the return current of the load.Specifically in my application, I've got an opamp making a mid-supply rail (3.3/2, so 1.65V), and separately, a boost converter powered by the same 3.3V rail. I want to connect the positive output of the boost converter, through a load, to that mid-supply rail for return, (I'll put a diagram below) BUT, without loading the rail significantly. Right now I'm using a fully isolated DC-DC converter with the negative output to that rail, and that works, but it's big and expensive and it seems like there *should* be an elegant solution to this. So I guess a way of setting up a non-isolated boost converter such that return current flows through a rail above ground, without otherwise loading that rail, would work too, might even be better.Thanks!

author: jeduffy
author_rank: Contributor
timestamp: March 23, 2025, 07:58:48 pm
content: Edit: Yeah looks like there is a reasonably good way to do this with a pair of current mirrors, a sourcing one and a sinking one, have the diode-connected pnp in a source one connected to the output, the mirrored current from that drives the input side of the sink-side mirror:Open to better solutions though! Might be a better/more accurate way, or to change the way the boost works

author: langwadt
author_rank: Super Contributor
timestamp: March 23, 2025, 08:31:57 pm
content: https://xyproblem.info/?

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 23, 2025, 08:46:01 pm
content: Quote from: jeduffy on March 23, 2025, 06:31:33 pmYour words do not match your problem.You do not need to measure the current at all, you simply need to sink the load current to maintain a 50% rail across the load.( A strange setup, but that is what you have drawn )If you are using the mid-rail elsewhere, this can be as simple as another OpAmp + PNP transistor as a current sink.The OpAmp drive the PNP device, to sink exactly what the load demands, it does not need to 'copy' anything.It's a simple shunt regulator (current sinking).

author: coppercone2
author_rank: Super Contributor
timestamp: March 23, 2025, 09:24:37 pm
content: of course its measuring it because how the hell can a control loop work without measuring something. What is it doing going out on a hunch?feedback = measurement

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: March 23, 2025, 10:12:31 pm
content: Hi,are you sure that your boost converter has a floating output, as shown in this diagram:This would require that the boost converter has a transformer. If this the case, the current will flow from the boost converter positive output back to the boost converter, negative connection. The boost converter current will not flow in the rail splitter.Why do you want to return the load current to the output of the rail splitter and not to ground?Here is an idea, the load current flows through Q1.Jay_Diddy_B

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 23, 2025, 11:05:29 pm
content: Quote from: coppercone2 on March 23, 2025, 09:24:37 pmThe opamp measures voltage, there is no current measurement and no current copying.

author: jeduffy
author_rank: Contributor
timestamp: March 24, 2025, 02:05:49 am
content: So to clear up a few things:The mid-rail is used by many other things in this overall design (it's the reference rail for an entire analog front end), I don't want this one thing to be loading it with, potentially, a few tens of mA from that boost converter. That may also put noise on the rail (boost converters tend to be noisy!), I do plan to have some filtering on it, but loading it in that way seems like it's just asking for trouble down the road.I need the load on the boost converter to return to the output of the rail splitter because that's my reference point for everything, this is measuring the voltage relative to that net, not the 3.3V power supply negative. No I cannot redesign the entire thing to be based on the power supply 0V, a lot of other stuff is bipolar (relative to the rail splitter).There is a little x-y problem here, but I laid out both the x and the y, and asked for solutions to either. The circuit I showed in the second post does solve my initial problem.The current, existing solution to the problem is to use a floating dc-dc converter; fully isolated, with a transformer. That's why it's big and bulky and expensive ("big" and "bulky" being relative to a couple smt parts, it's currently one of those 0305 style converters) I want to switch it to a simple boost converter with a single inductor (or even flying cap style) instead, to save size and cost. This also only needs to generate a couple tens of mA at most, almost every isolated one I can find is make for a couple hundred.The mid-rail must both source and sink current, so I can't use a single transistor (the boost converter is only active, and this particular load only present, some of the time). I could buffer the opamp with a pair of larger transistors set up as voltage followers, (like a standard AB output stage half bridge), but again I'd be worried about added complexity and effects on other aspects of the circuits performance. That also means that this load will, during transients, throw off this central rail (especially if it's switching from sourcing to sinking), since it would then have to measure an error to correct it. Not a huge problem, but again, might cause downstream problems. I'm aware that's what opamps do, but all the other loads are very small (<<1mA) and fairly static, so that rail has remained pretty stable in the current design.

author: PCB.Wiz
author_rank: Super Contributor
timestamp: March 24, 2025, 02:46:24 am
content: Quote from: jeduffy on March 24, 2025, 02:05:49 amThat's brand new information, so you now have x-y-z in play!If this source/sink load is tens of mA, you can get OpAmps that can manage that.If you want closer to 1 Amp peak, you could look at DDR regulators like TPS51200. Those can source and sink current, and work as tracking regulators.Or, small Audio amplifiers can do voltage following to 100's mA with a few mV of offset.Quote from: jeduffy on March 24, 2025, 02:05:49 amYou can always have two 'central rails', just like you have multiple grounds in a high current design, and avoid high load currents flowing in the sensitive side.You should give information on the source/sink currents, how fast they change and what tolerances you have on the low power central rail, and on the high power central rail?

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: March 24, 2025, 02:53:55 am
content: Hi,In this circuit the power that is dissipated in the load is also dissipated in Q3 in the current mirror. If the power is low enough that may be okay.Here is an alternative.The load current is connected to ground through two diodes. The voltage drop across the diodes is filtered by R1 and C1 and buffered by the op-amp to create a virtual ground. R2 provides bias if there is no load current.Jay_Diddy_B

author: magic
author_rank: Super Contributor
timestamp: March 24, 2025, 06:20:04 am
content: Perhaps the simplest solution is to have another unity gain buffer between the virtual ground and load negative, but I don't know what offset voltage is tolerated between load negative and the virtual ground.Quote from: Jay_Diddy_B on March 24, 2025, 02:53:55 amThis is what the OP requested, but in addition to the inefficiency, it also may not be accurate and fast enough to prevent AC current through the 1K load (for example due to boost voltage ripple) from flowing into the virtual ground.Quote from: Jay_Diddy_B on March 24, 2025, 02:53:55 amThis filters out noise, but it's not exactly a 50:50 split.

author: Jay_Diddy_B
author_rank: Super Contributor
timestamp: March 24, 2025, 09:06:11 am
content: Quote from: magic on March 24, 2025, 06:20:04 amA 50:50 split is not normally required. For example, most op-amps don't have a ground pin. There many cases where op-amps are powered from asymmetric supply voltages.I am working on a circuit at the moment where the rails are +5V and -3V. The -3V supply allows me to operate at ground without relying on rail-to-rail performance.In the OP's circuit, if you label the negative terminal of the 3.3V supply as ground and labelallthe virtual ground points as +1.65V. The circuit behavior will not change. The circuit does not change depending on what you label the connections.Quote from: magic on March 24, 2025, 06:20:04 amThe circuit that I proposed, is essentially the same as this. Instead of using a second op-amp (and transistors, if the current requires it). I am using two diodes as a shunt regulator. To avoid the offset I am using the voltage across the diodes as the reference for the second stage.Regards,Jay_Diddy_B

author: Terry Bites
author_rank: Super Contributor
timestamp: March 31, 2025, 05:19:45 pm
content: I have read this entire thread and I'm baffled. Why, is the question that troubles my mind (or what remains of it).Is this all to protect the puny ouput capability of your opamp? If not, then its your troubled mind not mine.Why not make a rail splitter that can boost the current capability of the opamp?Its easy. Here's a super simple circuit that can source/ sink at least 150mA from the mid rail while drawing less than 1mA from the splitter opamp.If you only need to sink small currents then use 3904/3906sIf it oscillates, add bit of compensation.Any low voltage rail-rail opamp should work. An LMV324 or LMV358 is good enough having only a few mV of offset.