Electronics > Beginners
High side current sense using differential opamp
<< < (4/5) > >>
Zero999:

--- Quote from: StillTrying on June 21, 2018, 01:11:26 pm ---
--- Quote from: npelov on June 21, 2018, 08:52:28 am ---So the output impedance will be a combination of Rdson and R2 depening on how much the tranasistor is turned on. With the transistor off the output impedance is 2k, but it shouldn't go higher than 2.5V so Rdson should be the dominating resistance here.
--- End quote ---

The large amount of gain and negative feedback makes the output impedance much lower than that, as long as there's still a reasonable amount of current flowing through the pull up or pull down resistor.

I've just measured the output impedance of my simulation with the 8k2 pull up, at 600mV output, supplying +/- 1mA at 1kHz the output impedance was ~0.025 ohm.

--- End quote ---
That's only when the loop is closed. The output still can't go lower than R8 and R2 would allow. With a single supply, the loop will be broken at output voltages near the supply rail, resulting in a high output impedance.
rstofer:

--- Quote from: npelov on June 21, 2018, 09:35:41 am ---So the whole high side could be avoided in this case (I don't really need common ground between battery, charger and load), but since I had a lot of problems before with high side current sensing I want to figure this out once and for all and never had to think about it again whenever I need high side current sensing.

--- End quote ---

Maybe that's why they invented high side current sense amplifiers.  Here's a design note from Maxim but there are many other devices on the market.

https://www.maximintegrated.com/en/app-notes/index.mvp/id/746

A typical shunt for industrial use drops 50 mV at nominal full current.  Even if we're measuring 200A, the drop is still only 50 mV

https://www.amazon.com/AMMETER-SHUNT-500-AMP-MILLIVOLT/dp/B005BHPG6K
npelov:

--- Quote from: Hero999 on June 21, 2018, 02:09:50 pm ---That's only when the loop is closed. The output still can't go lower than R8 and R2 would allow. With a single supply, the loop will be broken at output voltages near the supply rail, resulting in a high output impedance.

--- End quote ---

Can't go lower? Why? In this schematic it's enough to put few volts on the MOSFET gate and it'll go pretty low. R2 is pull up to 12V. The opamp inputs sit at 4/5*12V - about 9.6V, so the feedback resistor R8 pulls to 9.6. But they are quite high compared to how low the transistor's Rdson can go (2-5 ohms). To simplify things let's say that R8 and R2 are both connected to 12V. then they form divider with Rdson R2||R8 = 1875 + Rdson = 1880 / 5  => drop on transistor when fully on is Vds = 12V/376 = 0.032V. Well that's not perfect, but it's better than 0.8V

Current sense amplifiers are not the holy grail. I've seen some specifications and they are pretty bad. MAX4372 has maximum error 2.5% at 25 deg. C or 5.5% over the temp range. The 3-pin ones that use a resistor for the drop have bad accuracy at low currents because of current at Vsense = 0mV. The diff. amps are just precision opamps with precision resistors in an expensive package, but you only pick them if you need good accuracy, and if you do = you'll have to implement some software/hardware offset and gain correction anyway.

For me I think ZXCT1107 should do the job. It's relatively low price and I don't need much accuracy. But as I said my goal was to understand why the high side sensing didn't work, what are the issues that you face when sensing on the high side and how could you solve them. I can only decide if it's worth dicking around with a regular opamp or choose dedicated current sense chip if I knew the limitations.
bson:
You're making this overly complicated... did you rule out a subtracting amplifier for some reason?  Is the high side too high for the common voltage range?




Zero999:

--- Quote from: npelov on June 21, 2018, 11:03:29 pm ---
--- Quote from: Hero999 on June 21, 2018, 02:09:50 pm ---That's only when the loop is closed. The output still can't go lower than R8 and R2 would allow. With a single supply, the loop will be broken at output voltages near the supply rail, resulting in a high output impedance.

--- End quote ---

Can't go lower? Why? In this schematic it's enough to put few volts on the MOSFET gate and it'll go pretty low. R2 is pull up to 12V. The opamp inputs sit at 4/5*12V - about 9.6V, so the feedback resistor R8 pulls to 9.6. But they are quite high compared to how low the transistor's Rdson can go (2-5 ohms). To simplify things let's say that R8 and R2 are both connected to 12V. then they form divider with Rdson R2||R8 = 1875 + Rdson = 1880 / 5  => drop on transistor when fully on is Vds = 12V/376 = 0.032V. Well that's not perfect, but it's better than 0.8V
--- End quote ---
I was referring to the source follower configuration.
https://www.eevblog.com/forum/beginners/differential-opamp-behaviour/?action=dlattach;attach=460285;image

Yes, that circuit can go lower but is it stable? As I said previously, it's got a lot of gain. I notice you've got C1 to provide some frequency compensation but is it enough? I suspect not. It's extremely likely that circuit will oscillate.


--- Quote ---Current sense amplifiers are not the holy grail. I've seen some specifications and they are pretty bad. MAX4372 has maximum error 2.5% at 25 deg. C or 5.5% over the temp range. The 3-pin ones that use a resistor for the drop have bad accuracy at low currents because of current at Vsense = 0mV. The diff. amps are just precision opamps with precision resistors in an expensive package, but you only pick them if you need good accuracy, and if you do = you'll have to implement some software/hardware offset and gain correction anyway.

For me I think ZXCT1107 should do the job. It's relatively low price and I don't need much accuracy. But as I said my goal was to understand why the high side sensing didn't work, what are the issues that you face when sensing on the high side and how could you solve them. I can only decide if it's worth dicking around with a regular opamp or choose dedicated current sense chip if I knew the limitations.

--- End quote ---
Have you thought about using an op-amp which can work up to the positive rail, in a current mirror configuration?

The op-amp only needs to work up to 5V and 5V rail-to-rail op-amps are cheap.

The P-MOSFET could even be swapped for a PNP BJT, which will reduce the accuracy slightly, due to the base current, but it's chaper and possibly make it more stable, since it has less capacitance, than the MOSFET.

http://www.analog.com/en/analog-dialogue/articles/high-side-current-sensing-wide-dynamic-range.html
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod