High-commonmode differencing amp design - Page 1
Forum section: electronics / projects

author: leonerd
author_rank: Regular Contributor
timestamp: August 14, 2016, 02:54:26 pm
content: TLDR summary: Can I buy a pre-made op-amp chip with laser-trimmed resistors at G=100 with 3:1 commonmode range over supply, or must I make it myself? If I make it myself which resistor ratios are considered "critical"?The problem backgroundI'm looking for a differencing op-amp circuit to put on a current shunt resistor, to amplify the shunt voltage and indicate current flow.The shunt resistor is 0.1R and sits in the high-side path (because I hate low-side shunts that interrupt grounding low-impedance return). The load might be anywhere up to about 500mA (so V = 50mV), and ideally I'd like to maintain good accuracy down to 1mA or so, so detecting 100µV would be nice. The load voltage could be anywhere from up to about 30V, down to 2.5V. I'd like the system as a whole to have a bandwidth of 2MHz or so, enough to indicate spikes and changes in current draw on the microsecond scale.I'd like to generate an output voltage signal, referenced to system ground, with a gain of 100 over the shunt resistor; i.e. outputting 10V per A of load. 500mA of load suggests 5V output indication, so if I still want this to work when the load is at a mere 2.5V, I'd best power the output sense amp independently rather than tap off from the supply input. A gain of 100 and a system bandwidth of 2MHz now suggests an opamp with GBWP of 200MHz. In order to be able to cope with that 100µV input detection then I'm definitely looking at something bipolar; given the application I don't feel that low bias current is a critical parameter here, so that's fine. A 2MHz signal is probably beyond what a chopper amp could do, so it's likely that we'll have to accept a bipolar opamp with low TCVos, and null out the offset voltage with a trimmer.So lets say I have +10V and -5V available for it (because I took a 5V input and did the cunning double-and-invert trick you can do with an ICL7660, diodes and four caps). This gives it plenty of headroom above and below, to be able to indicate a full 5V output at 500mA, down to outputting zero at no load.Except, there's another issue. If I'm powering the difference amplifier at +10V top rail, then it will only accept a common-mode input around that level. That's no good when the load supply is powered all the way up to 30V. I need therefore, a differencing amp that can cope with a larger common-mode input range than its own supply.The general circuitAs a background to those unfamiliar with the technique, my attached circuit diagram shows the standard 4-resistor "differencing" opamp configuration using R1 to R4, with the addition of two more resistors, R5 and R6 which shunt away most of the common-mode voltage down to the common ground, without affecting the circuit gain.To implement this circuit successfully, as with any differencing amp, requires precision resistors, or at least precision ratios between them. It is important that the ratio R1/R3 is close to R2/R4 to ensure good CMRR. Ignoring R5 and R6, if you want to implement the usual 4-resistor differencing amp, either you buy a dedicated amp chip that has laser-trimmed resistors built in (e.g. the INA105 or INA106), or you use a regular op-amp and apply precision trimmed resistor networks, for example getting two precision three-terminal devices to use for the R1/R3 and R2/R4 pairs.The actual questionMy problem here is that I don't entirely understand what effect adding R5 and R6 does to the criticality of resistor ratios. How critical is it that R5 and R6's values match? Furthermore, how critical is it that they compare in some fixed ratio to the R1/R3 and R2/R4 pairs?Additionally, how is the circuit complicated by the addition of an offset-nulling trimmer, to zero out the Vos of the opamp? I'd like to be able to trim it down to null out Vos to give a zero indication when the shunt resistor is passing no current. I don't know how the addition R5 and R6 affect this process.I'm aware that you can buy chips with precision trimmed resistors already set up for high common-mode range in this configuration; for example the AD629. However, that chip is configured for unity gain. In fact I've yet to find a single chip in that style that has a preset gain of anything other than G=1. Ideally I want to arrange for G=100. Otherwise, my circuit expands to needing two op-amps; a commonmode-rejecting G=1 difference amp, followed by a G=100 gain stage to give the required indication output. That just makes my Vos problems worse, because now I have two opamps to null the offsets from.So these appear to be my options:Find a pre-trimmed high-CM range differencing amp chip with G=100 and at least 3:1 CM acceptance over Vsupply. Are there any?Use a regular G=1 high-CM range amp and add a second G=100 stage, giving me an extra stage of Vos to have to null outBuild myself a G=100 high-CM range differencing amp from precision resistors. Which ratios are critical? What pre-trimmed R networks will help me?Anything else I've missed?

author: Kalvin
author_rank: Super Contributor
timestamp: August 14, 2016, 03:16:04 pm
content: There are lots of instrumentation amplifiers with adjustable gain (typically single resistor) that suits your needs available from different manufacturers (Analog Devices / Linear Technology, Texas Instruments etc.).Check the AD620 datasheet to get startedhttp://www.analog.com/media/en/technical-documentation/data-sheets/AD620.pdfThe AD620 is not a good choice for a single supply design that require common voltage down to ground. The datasheet has a nice comparison of the home brew solution vs. factory trimmed solution.The INA826 and similar are better suited for single supply designs:http://www.ti.com/product/INA826/description&lpos=Middle_Container&lid=Alternative_DevicesThere are also lots of high side current measuring amplifiers that suit your needs. For example INA225http://www.ti.com/product/ina225is one of such product with pin-selectable gains. There are lots of similar parts available from different manufacturers.

author: Kalvin
author_rank: Super Contributor
timestamp: August 14, 2016, 03:23:57 pm
content: If the GBW is an issue, you can add an additional op amp after the instrumentation amplifier and split the gains appropriately in order to get the required GBW.There is also AD8428 which has a fixed gain of 2000 with 3.5MHz bandwidth, but its common mode input voltage and output voltage don't go down to zero which may be a problem in a single-supply designs.http://www.analog.com/en/products/amplifiers/instrumentation-amplifiers/ad8428.htmlIf the Vos is an issue, there are op amps with low Vos. Some are factory trimmed and some use zero-drift/auto-zero designs.

author: Marco
author_rank: Super Contributor
timestamp: August 14, 2016, 05:05:34 pm
content: Why do you want to use a low side supply. With that restriction you are forced into a resistor divider differencing/instrumentation amp approach ... but why?

author: Kalvin
author_rank: Super Contributor
timestamp: August 14, 2016, 05:39:22 pm
content: The LT1999 has very high common mode input voltage range:http://cds.linear.com/docs/en/datasheet/1999fd.pdfThe offset voltage can be trimmed. The fixed gain is 50 with 2MHz BW. Check the input impedance from the datasheet.

author: leonerd
author_rank: Regular Contributor
timestamp: August 14, 2016, 08:28:11 pm
content: Quote from: Kalvin on August 14, 2016, 03:16:04 pmThat's OK - I specifically said in the opening that I have an ICL7660 or similar (maybe the MAX1044, which is higher spec) to generate a -ve rail for me below system ground. Single-rail is not a big concern here.Quote from: Kalvin on August 14, 2016, 03:16:04 pmThe INA225 looks interesting - common-mode capable to 40V while supplied at only 5V. Unfortunately, nowhere near enough bandwidth - only a quoted 125kHz at G=100. That feels a bit slow for what I wanted. Even lower, the INA826 quotes a mere 60kHz at G=100.

author: leonerd
author_rank: Regular Contributor
timestamp: August 14, 2016, 08:55:43 pm
content: Quote from: Kalvin on August 14, 2016, 03:23:57 pmYes, I mentioned that idea. But does that not now give me two lots of Vos to have to deal with? Needing to sense 100µV on the shunt resistor on the first amp, if the gain there is only 1, then we still have another 100µV to deal with on the gain buffer after it. Or can I effectively null out the effects of both at the same time?Quote from: Kalvin on August 14, 2016, 03:23:57 pmWow, an interesting chip. That 3.5MHz bandwidth really means that - not GBWP. Its GBWP is a huge 7GHz. However, again not a useful chip for this project because its input common-mode range only extends up to V+, not beyond it.Quote from: Kalvin on August 14, 2016, 03:23:57 pmAuto-zero tends to imply "chopper", which tends to imply a much lower bandwidth (tens of kHz) than my design target of 2MHz.

author: leonerd
author_rank: Regular Contributor
timestamp: August 14, 2016, 08:58:29 pm
content: Quote from: Marco on August 14, 2016, 05:05:34 pmAs I said:QuoteI'm building a unit that plugs in between a bench supply and the device under test, allowing you to watch its current consumption on on oscilloscope. Basically an improved version ofhttps://www.tindie.com/products/leonerd/oscilloscope-current-probe-adapter/I don't want the performance of it compromised by grounding loops caused e.g. by other oscilloscope probes attached to the DUT, bridging the ground and bypassing the effect of a low-side shunt. Using a high-side shunt to sense current consumption feels much less prone to that sort of accident.

author: leonerd
author_rank: Regular Contributor
timestamp: August 14, 2016, 09:23:10 pm
content: Quote from: Kalvin on August 14, 2016, 05:39:22 pmOooh, now that is an interesting looking chip. It solves my high common-mode range problem (to a specified 80V; nice) and has 2MHz bandwidth at G=50.As described in the data sheet, it sounds like it's going to be a little awkward to get the ground-referenced output from it. However it does have a REF pin, which leads to two possible ideas. Either I follow up with a second differential amplifier after it (which is now a much easier one to design because it doesn't have to handle high common-mode input, and doesn't need a lot of gain), or I nudge the chip down by 2.5V such that its REF pin is really at system ground, and its V+ and "GND" pins are at +2.5V and -2.5V with respect to system ground.I suppose at that point since I don't have my full 5V swing on the output to indicate 500mA of current through the shunt resistor, I'd need a gain 2 amplifier after it to provide that anyway. At which point, maybe keeping the thing at 5V to system ground and adding a gain 2 differential amplifier after it would be fine. The effect of Vos in that amp is now 50 times smaller than it would have been at G=100 so I can likely ignore it, or null it out.This chip may be on to a winner. I still have a two-stage opamp design, but the second one is a mere gain=2 difference amp, and likely I can find an easier laser pre-trimmed chip for that because common-mode isn't a problem any more.

author: Marco
author_rank: Super Contributor
timestamp: August 14, 2016, 09:57:26 pm
content: Quote from: leonerd on August 14, 2016, 08:58:29 pmYou misunderstand me, I meant why do you want to power the active circuitry of the current monitor from a low side supply below the high side voltage (ie. 3:1 CM acceptance over Vsupply). Takethe simple opamp+fet current mirror type monitor, it's fed from the high side voltage with a linear regulator creating a supply. This allows you to use a simple architecture for which resistor ratio matching is irrelevant for CMRR, it only affects a gain error for the current.

author: leonerd
author_rank: Regular Contributor
timestamp: August 14, 2016, 10:50:54 pm
content: Quote from: Marco on August 14, 2016, 09:57:26 pmAh, that shape. If I understand correctly, the technique involves building in effect an opamp current mirror, from the high-side supply, using the FET to create a current source that mirrors the current drawn down through the shunt resistor. You then feed that source into a resistor to ground, so that the top of that resistor is now at a voltage proportional to the current in the shunt, now referenced from ground.It's hard to see how I could apply that in my case, when I'm working at detecting down to 100µV of shunt. Are there any opamps I could power from the high side input which could cope with that level of input? I'm wanting true upper-rail input, unless I artificially raise the supply voltage of that high-side amp, similarly to using the ICL7660 to create a lower-than-ground like I am now.Then we have the question of what the currentflow in that mirror is. If we're copying 1:1 the current, then at 500mA of load we're sinking another 500mA down the monitor mirror, which is quite an extra load to be asking of the PSU. If we mirror current at any smaller ratio, then we have an even less than 100µV sense signal to have to deal with. We'll probably be wanting a second op-amp down at the ground-reference level to provide a high-impedance buffer of this sense signal to provide a robust output.All in all then, at two opamps, the top of which requires non-trivial power arrangements analogous to the arrangement I have anyway, and add a FET, and now sink the same amount of load current again down the sense chain. I don't see how this makes my life any easier.

author: Someone
author_rank: Super Contributor
timestamp: August 14, 2016, 11:16:46 pm
content: Quote from: leonerd on August 14, 2016, 08:55:43 pmYou can null both of their offsets with a single control, but they will still have a temperature drift that will appear. You can find very tight offset and drift specifications on opamps such as the OPA2192 and with that I got to 14uV noise at 100x gain and 500kHz bandwidth:https://www.eevblog.com/forum/projects/diy-100mhz-differential-probe/You could hit your desired bandwidth with a similar sequential gain stage using both channels of an OPA2211 or OPA2228. CMRR is trimmed like offset with a variable resistor.

author: Marco
author_rank: Super Contributor
timestamp: August 14, 2016, 11:19:42 pm
content: The output voltage is not dependent on the ratio of the current mirror, lets say you do Rshunt = 0.1, Rg = 10 and Rf=100, then you get 1V/A but with 1/100 the current. You do need indeed need a second opamp if you want 10V/A final output, because otherwise it wouldn't work down to 2.5V high side voltage.MCP6V81 would be a good opamp to use, rail to rail, autozero, decent bandwidth (MCP6V91 has a little more if you need it). As for why you would want to use something like this, just for instance the LT1999 has 8 uV/°C input referred offset drift.

author: leonerd
author_rank: Regular Contributor
timestamp: August 14, 2016, 11:23:03 pm
content: Quote from: leonerd on August 14, 2016, 10:50:54 pmOh hang on, my thinking was upside down here. You're copying the voltage across the shunt into the mirror side of things. If you use much larger resistors in the mirror line you're using the same offset voltage but a much smaller current, so you can run that copy at a much lower current budget and still remain accurate.Would it still remain nicely accurate if you were using, say, 100 or 1000 times smaller signal current down that mirror line? Would mean maybe 5mA or 500µA when at full 500mA shunt range, down to an indicator current of 5µA or 500nA when the shunt is at 500µA. I'm not familiar enough with very low-current work to know if that's an issue, or if it's going to be complicated to work with.

author: danadak
author_rank: Super Contributor
timestamp: August 15, 2016, 12:50:05 am
content: Useful ap notes on CMRRegards, Dana.

author: exmadscientist
author_rank: Frequent Contributor
timestamp: August 15, 2016, 03:32:58 am
content: Quote from: leonerd on August 14, 2016, 02:54:26 pmThis is a surprisingly subtle point and one that is often overlooked. What works at DC or 1kHz to get you good CMR will often break down by 1MHz. Right now I am facing a very similar design problem, where the CMRR of an AD8421 in-amp is not cutting it at 1MHz. Given that I have severe power and space limitations, this is actually not an easy problem to solve! So be careful that your final design will meet performance requirements at all frequencies, not just DC.Quote from: leonerd on August 14, 2016, 02:54:26 pmZero-drift amps do go beyond 2MHz these days. ADA4522 and ADA4528 will get you to about 4MHz GBW, which is good but obviously not sufficient on its own.Quote from: leonerd on August 14, 2016, 02:54:26 pmIf the system is sufficiently linear (in particular no headroom issues), often you can just trim the whole thingoncenear the end of the chain. Of course "no headroom issues" is easier said than done.Quote from: leonerd on August 14, 2016, 02:54:26 pmVishay and Susumu are my go-to vendors for these. Vishay ACAS series in particular is a nice balance of precision, size, cost, and availability.

author: leonerd
author_rank: Regular Contributor
timestamp: August 15, 2016, 09:30:55 am
content: Quote from: exmadscientist on August 15, 2016, 03:32:58 amAhyes, a fair point. Whatever circuit I pick, it seems likely it will be an op-amp, some resistors, and very little else. It'll be made with 0603 on a PCB with a tight layout, so traces should be nicely short. Stray capacitance is likely to be so small that given the impedance of my resistors I can basically ignore it, so the feedback network should contribute nothing to CMRR; it will be down purely to the op-amp in question. If I'm aiming at 0.1% precision, I guess that means I'm looking for a chip that still has at least 60dB of CMRR at 2MHz.Quote from: exmadscientist on August 15, 2016, 03:32:58 amOK well that makes that easier at least. It also suggests I can trim out offset "later" towards the end of the chain rather than up close to the shunt resistor, which already has a complex layout of 3 resistors around each op-amp input pin.Quote from: exmadscientist on August 15, 2016, 03:32:58 amGood to hear a recommendation of a brand there, but I meant more in terms of which ratios in my circuit diagram?The traditional 4-resistor diffamp has critical ratios in pairs - it's important R1/R3 is the same as R2/R4 (in my diagram), but the exact values matter a little less, so for that arrangement you can get away with buying two 3-terminal precision pairs - e.g. Maxim make a lot of SOT-23 style resistive dividers in given ratios like 9:1 or 10:1.But my expanded 6-resistor network makes this more complicated. I don't know if I could continue to use just two precision dividers for R1-R4, and have R5 and R6 be simple 0.1% individual parts, say, because they're only going to affect the null offsetting anyway, and so any difference between R5 and R6 only adds to the underlying Vos of the op-amp, so there's no point tuning those to high precision.

author: leonerd
author_rank: Regular Contributor
timestamp: August 15, 2016, 10:19:46 am
content: Quote from: leonerd on August 15, 2016, 09:30:55 amExcept, having thought this one over on the bus, it isn't true.In absolute worse case, I'd need to be able to reject 30V of common-mode against a shunt voltage of 100µV, if I'm to detect 1mA of current flow. That's a ratio of 300thousand to 1, a CMRR of 109dB.

author: leonerd
author_rank: Regular Contributor
timestamp: August 15, 2016, 10:29:11 am
content: Quote from: leonerd on August 15, 2016, 10:19:46 amNo wait, now I'm getting myself into even more of a muddle. My common-mode (that I wish to reject) is a DC power source. The small signal (that I wish to amplify) is the current sense shunt voltage across the resistor, for which I would like to detect pulses in the microsecond range, perhaps to 2MHz.Since the commonmode signal is DC here, is it only the DC CMRR I care about? If so, 109dB seems quite achievable by most of these chips. If instead I do actually need to worry about CMRR at 2MHz, then I have quite a problem. The LT1999, for example, quotes a CMRR at DC of around 100dB but drops to a mere 45dB at 2MHz.Is my analysis correct here? I'm not quite sure how I interpret CMRR at a given frequency, when my signal and common-mode have different frequency shapes.

author: Marco
author_rank: Super Contributor
timestamp: August 15, 2016, 11:00:34 am
content: Temperature dependent offset is more important than CMRR. High frequency common mode rejection ratio is only important if the power supply voltage fluctuates, so you can always mitigate that by better decoupling of the high side voltage.PS. I still think you are barking up the wrong tree with the divider + difference/inamp approach though.

author: leonerd
author_rank: Regular Contributor
timestamp: August 15, 2016, 01:29:38 pm
content: Quote from: Marco on August 15, 2016, 11:00:34 amOK that's good. That means I should be able to use prettymuch any opamp here, because the common-mode is just the DC bench supply - I'd expect that has good ripple control (it's a Siglent SPD 3303)Quote from: Marco on August 15, 2016, 11:00:34 amSo you think the split design of an op-amp "floated" up to the high-side so it can ignore common-mode offsets and using the current mirror line to level-shift that to ground reference is a better bet? I'm willing to entertain options.Attached is what I think the rough arrangement should look like. I have deliberately omitted the power supplies into the op-amps because I'm not sure what those ought to be. But absent of those, let me see if I understand its arrangement:Opamp U1 acts with FET Q1 to control the current flowing through the FET channel to create a voltage drop down Ra that is equal to the voltage drop across the shunt resistor. This current also flows through Rb, creating a potential difference above ground, which the second opamp, U2 buffers for the circuit output. I don't currently understand the function of R1, nor what value it ought to have. I -think- it has to do with injected bias current from U1's inputs, and so ought to be equal to Ra, but I'm not sure.I've chosen some values fairly arbitrarily. These values mean that the mirror current through Q1 is 100 times smaller than the sense current. Our circuit draws 5mA extra from the PSU when the load is at 500mA - I'm sure that's well within the supply's ability. 5mA through Rb is 5V of drop across it. Unless the bus voltage is at least 6V or so, that's not going to be enough. Certainly, this unit as designed wouldn't be able to indicate 500mA on only 2.5V of bus voltage. So maybe lets pick a 10:1 resistor ratio for Rb:Ra, so now we only need 0.5V there to indicate the 0.05V drop down across Rshunt, and we'll pick up a further x10 of gain elsewhere. This might make implementation easier, because there's commercially available twin-resistor packages in 10:1 ratios that are matched much better than 0.1% to each other.Now lets look at the low-current end of things. With 1mA through the shunt, we have 10µA through Q1. That puts Rb a mere 10mV above ground. Furthermore, this node of the circuit now becomes very sensitive to bias currents from U2. We'd do best to find a nice FET-input opamp that's quoted down below 1nA of bias current if we're to maintain 0.1% accuracy. We probably also need to offset-null at this point. Are we asking for the impossible here? <1nA of Ibias and trimmable Vos, working at 2MHz.Finally, lets now consider how we power these op-amps. U2 is easy enough - armed with our 5V of separate utility power (which is independent of V+ but shares a ground), we just feed that +5V and -5V from our ICL7660 inverter. This gives U2 plenty of headroom on top and below to indicate close to ground.How do we power U1? I feel it needs a positive rail above V+, to give it headroom to sense that shunt properly. Furthermore, do we not have more of a problem as V+ gets lower - this chip is powered by something derived from V+, not the 5V utility power. If V+ is allowed to be as low as 2.5V, we'd need to ensure the amp is still powered appropriately. What if V+ drops even smaller?The problem of powering U1 at least, disappears with the "6 resistor diff-amp with CMR extension" arrangement I posted initially. There's only one op-amp there powered by utility, not bus power. Furthermore that circuit has no nA-critical nodes in it, thus avoiding a need for FET input opamps.This sensing by current mirror feels a good approach to some problems, but given mine includes the high dynamic range of shunt current and bus voltage, I'm not convinced this design works for me.

author: leonerd
author_rank: Regular Contributor
timestamp: August 15, 2016, 01:56:25 pm
content: Given as it seems I can null out the Vos from two stages of op-amp at once, I begin to wonder if that's the best option.Use a high-CMR differencing amp (such as the LT1999-10) to "level-shift" the shunt voltage to a reference within the range of the 5V utility power and apply some of the gain, and then apply a second separate stage after that to provide me the rest of the gain (for full 5V=500mA of indication current) and ground-referenced output. This second stage doesn't have the common-mode to worry about so there's a better selection of parts available to choose from. This arrangement does have a nice appeal - it means the critical resistor ratios for CMR are pre-trimmed by that ready-made LT1999 part. It does seemslightlyodd to be designing a circuit with two cascaded 10x gain differencing amplifiers, but it looks to be close to ideal shape. Certainly the best idea I've seen thus far.Powered on utility 5V power via the ICL7660, I have +10ish and -5ish rails to power the second stage from, which gives me plenty of headroom above 5V and below 0V for a clean stable output, without needing to find true to-rail-output opamps. Furthermore, I believe I can perform offset nulling of both opamps in one place, say in the gap between the two stages; this means I don't have to introduce offset nulling support into that already complex 6-resistor arrangement in the first differential stage.

author: Kalvin
author_rank: Super Contributor
timestamp: August 15, 2016, 03:32:22 pm
content: What is your target measurement resolution / dynamic range? You write above that 5V = 500mA. It is typically quite easy to get 60dB of dynamic range ie. 1:1000 giving 500uA measurement resolution (requiring at least 10-bit ADC). In order to get 80dB dynamic range ie. 1:10000 giving 50uA resolution (requiring in practice at least 14-bit ADC) you have to be very careful with the design so that the noise doesn't corrupt your signal. Interesting and very challenging project.

author: leonerd
author_rank: Regular Contributor
timestamp: August 15, 2016, 04:37:40 pm
content: Quote from: Kalvin on August 15, 2016, 03:32:22 pmOh, possibly dynamic range is the wrong word. I'm aiming at being able to detect/measure to the order of half an mA or so, up to range maximum of 500mA. The main output will be towards an oscilloscope, so this project itself doesn't involve an ADC directly.I mean I'll happily take more accurate small-signal measurement if I can get it, but this level is fine for me.

author: Kalvin
author_rank: Super Contributor
timestamp: August 15, 2016, 04:48:47 pm
content: Quote from: leonerd on August 15, 2016, 04:37:40 pm500uA would be doable as it is only 1:1000 (60dB), although you are going to have hard time making it viewable on the oscilloscope's screen if the measurement range is from 500uA ... 500mA. Probably you need a selectable gain so that you can see the smaller current values on the oscilloscope. Then of course the higher current values will be clipped/saturated, but it may not be an issue if you know that some of the measurement values will be clipped and your op amps will recover fast enough.Having said that, there are log amps available which allows you to display both the small values and the large values on the oscilloscope screen. Of course you need to interpret those log values properly on the display, but the log view will squeeze the measurement range into a smaller range. Just hook the log amp after the last op amp stage and you can select whether you display the linear measurement values or log measurement values on the oscilloscope. (If you have multi-channel scope, you can output the linear and log values to different channels at the same time if you want to).Just my 2c.

author: Zero999
author_rank: Super Contributor
timestamp: August 15, 2016, 08:42:04 pm
content: Are you sure you need such a large bandwidth?What's the maximum expected amplitude of the current ripple?How about processing the AC and DC signals separately?Set the cut-off frequency to the high side current amplifier to something low, preferably under the mains frequency in your area. This will give you the DC part of the signal.Now, AC couple the high frequency part and amplify it separately. If you like, you could add it back to the DC signal but if it's going to be viewed on an oscilloscope it would be pointless because you won't have dynamic range to be able to see it superimposed on a large DC signal.

author: leonerd
author_rank: Regular Contributor
timestamp: August 30, 2016, 11:30:50 am
content: An update:I tried an LT1999-10 with a 0.1R shunt resistor; this seems quite accurate. I then stuck an AD8271 after it in G=1 configuration, to level-shift the LT's differential output back down to ground-reference (with the AD powered by my generated split +5/-5 supply).Turns out: this is terrible. There's a significant current flow between the LT's REF pin and the feedback network of the AD, causing about a 12% error in the indicated output. Remove the AD chip, and watching just the LT chip on its own, that chip remains accurate.So my next plan involves using a full inamp after the LT chip - perhaps the AD8253. This chip has the advantage of having digitally-controlled gain, switchable between G=1, 10, 100 or 1000. That could be handy indeed.Except, at least on the data sheet, there's another problem. According to the sheet on the LT1999, that has a possible input offset voltage anything up to 1.5mV (over full temperature range), or 750µV at 25C. Using my 0.1ohm shunt resistor that's an implied reading error of up to 15mA full range, or 7.5mA at 25C. A much larger error than I was hoping to have. I suspect I may have got lucky with my breadboarded chip, having a much smaller error on it than that.So i'm still somewhat stuck for ideas here. Should I:Try to trim out the Vos of this first stage chip. Indeed; is this even possible, to work over a range of commonmode input?Find a different chip with much better Vos. It's rare to find difference amps that can cope with extended commonmode input range anyway; this was so far the only one I've found with a bandwidth as fast as I'd likeAdopt a new approach. For example, the FET-based current mirror to level-shift the high-side shunt down to a load-side, before using an in-amp to detect that.This latter idea might not be so bad actually, if I used a DC-DC converter to power the upper opamp, the one sensing the shunt resistor. That would allow it to cope with any bus voltage. A high bus voltage would just level shift the sensing opamp up but it will still function just fine, the FET just has to drop a larger voltage. A low bus voltage (maybe even below 5V) would mean that the sensing opamp still has 5V to play with, because its lower end is now negative with respect to output ground. The only trick then is to ensure that the FET still has positive headroom.Probably the most demanding circumstance I could foresee in this scenario is about 500mA through the shunt, at 2.5V bus voltage. That's a 0.05V shunt drop, so at a 10:1 ratio on the mirror line, we're at 0.5V leaving still 1.95V to drop over the FET. At that ratio, it does mean at the low-current end, the bottom mirror resistor might only be at 500µV when indicating 500µA through the shunt. The inamp I have in mind (AD8253) has a Vos of 150µV max, so it's within ability, but not very accurate here. But it still might be in the realm of doable.Does this sound like a good bet?

author: Siwastaja
author_rank: Super Contributor
timestamp: August 30, 2016, 12:05:30 pm
content: Quote from: leonerd on August 30, 2016, 11:30:50 amLT1999 indeed has a rather poor offset voltage spec. Still, the spec includes process variation between the chips manufactured. If you could keep the temperature stable (i.e., it's in the room temperature, the shunt is not heating up too much, too quickly), you could still detect order of magnitude smaller currents if you simply zero it before reading.

author: leonerd
author_rank: Regular Contributor
timestamp: August 30, 2016, 12:56:23 pm
content: Quote from: Siwastaja on August 30, 2016, 12:05:30 pmI expect given the range and the common-mode support, the chip is probably designed for much higher current flows and larger powered systems than I'm aiming it at.Quote from: Siwastaja on August 30, 2016, 12:05:30 pmYes; I did consider some sort of offset-trimming ability. How would that work here? I don't quite understand where in the circuit I'd attach some sort of nulling trimmer. It's not just an offset in the output voltage, as it would vary with the common-mode too. I guess you'd have to trim out the zero for some given common-mode voltage, which would then need resetting again if the common-mode changes.

author: mk_
author_rank: Regular Contributor
timestamp: August 30, 2016, 01:00:58 pm
content: Quote from: leonerd on August 14, 2016, 02:54:26 pmTake a look for something like Avago ACPL-C78A or similar from Analog or TI. With those Opamps you can measure your 100uV even on very high sides...Maybe the bandwith isn`t high enough.Michael

author: Siwastaja
author_rank: Super Contributor
timestamp: August 30, 2016, 05:05:09 pm
content: Quote from: leonerd on August 30, 2016, 12:56:23 pmIs a potentiometer hooked up to the REF pin too crude? The user would adjust it to read zero, which would take a few seconds, and needs to be done every time the common mode or temperature condition has changed significantly.