High side Current Sensing with opamps

Thread Starter

SteelCircuit

Joined Aug 5, 2022
6
1659947979711.png
1659948562839.png , I am trying to make overcurrent protection circuit using opamps with shunt resistor. But when I increase my main voltage my current must directly increase and comparator opamp compare the input voltage and Vref voltage if Vin greater than Vref than my mosfet must be triggered and close the current entry. My purpose is Current protection with high side current sensing what am I doing wrong ? I am waiting your advices.
 

Alec_t

Joined Sep 17, 2013
13,077
For the RH1028 opamp the input voltage range is only ±11V when the supply is ±15V. You need an opamp with a rail-to-rail input voltage range for high-side working.
The Absolute Maximum supply voltage for the RH1028 is ±16V, so +24V would kill the opamp.
 

Thread Starter

SteelCircuit

Joined Aug 5, 2022
6
Ok. It can be done with op-amps, but why does the current limit need to track the voltage?
Is it homework?
I try to simulate overcurrent reaction. You can think like latch-up protection circuit. When my current increase up to the 22mA I trigger the mosfet and open the switch. Do you give me an advice for current sesnsing with shunt ? Did I draw the circuit right ?
 

Thread Starter

SteelCircuit

Joined Aug 5, 2022
6
For the RH1028 opamp the input voltage range is only ±11V when the supply is ±15V. You need an opamp with a rail-to-rail input voltage range for high-side working.
The Absolute Maximum supply voltage for the RH1028 is ±16V, so +24V would kill the opamp.
If you can give me an advice for opamp and also generally of circuit it would be great for me .
 

Alec_t

Joined Sep 17, 2013
13,077
You haven't answered Ian's question (post #7). If this is a School/College project we can give guidance, but not design a complete circuit for you. If you are constrained to using opamps rather than a dedicated IC you can check datasheets to see which opamps might be more suitable than the RH1028.
Edit: If your load is being driven by the 5V supply only, then the RH1028 would be suitable for the high-side sensing, but the rail-to-rail requirement would not be met if the load driver were the 12V supply.
 
Last edited:

Ian0

Joined Aug 7, 2020
5,945
You need a op-amp where the common mode input range includes the positive supply. These are generally JFET op-amps. The good old TL071 can do the job if you can live with the 4mV maximum offset error.
You could even use the offset null pins. (Does anyone use them any more, or do we all just buy precision op-amps?)
 

ag-123

Joined Apr 28, 2017
259
I once tried, difficult. So in the end I searched part numbers
https://www.ti.com/product/INA169
https://www.ti.com/product/INA186
https://www.ti.com/product/INA199
https://www.ti.com/product/INA219
(there are lots of 'compatible' parts)
and apparently, the problem of high side "current" measurement is so onerous, and the demand so high, that the whole industry the whole world over
run out of exactly all these parts now.
When these parts are cheap, they are so *competitive* (price wise), nobody *ever* looked for another solution.

you can "cheat" by doing low side current measurements, for that an ordinary LM358 or LM321 would do.
the only thing is just make sure it isn't quite possible to short that +ve supply to another GND somewhere else.
i.e. your GND has to be that monopoly where it measures the currents.
I'd always take it that milliohms shunt resistances can be "ignored", they are good as GND. Only trouble is if that V+ supply gets shorted to somewhere else, then you measure 0A, where elsewhere it could be 100s of amps.

I think I once try to think in terms of using a pnp transistor, but I didn't work out a good solution.
Then I googled and stumbles into some nice articles like this:
https://www.ednasia.com/high-side-current-sensing-methods/

I always naively, thought "current sense", should be 'easy' right? it turns out it seemed "high side" current measurements breaks all the rules.
no 'easy' circuits, is that true? generic op amps (e.g. LM358 *won't work*) or at least I didn't figure out a 'smart' way to do it lol
edit:
the circuits in that article
https://www.ednasia.com/high-side-current-sensing-methods/
is probably worth trying with 'cheap' op amps like LM358, LM321 I'm not sure if it'd after all work, but it seemed fairly possible that it works with 'cheap' op amps. there is something a little puzzling about that op amp placed in an 'inverting' config.
I did a little thinking, and kind of figure that Vout of the LM358 should be pushed towards saturation (i.e. to V+ minus the voltage drop), LM358 isn't rail to rail. Then if current flows in Rsense, it should reduce from this saturation voltage.
I'm not sure if it is after all that way.

next I looked at the other circuit and substituted it with 'cheap' parts:
highside.pngAssuming that this works, how do I analyse this circuit? LM321 is half of LM358, single supply op amp (not rail-to rail, the Vout is always lower than V+ by some voltage. The curious thing here is assuming that R load is open circuit (infinity ohm), then Vsense (V across Rsense) = 0.
At the op amp, v+ = V- so the transistor is off, I'd guess.

Next, if some current flows in Rload, so that there is current across Rsense so there is Vsense.
Assuming no current flows into terminal 3 (-) input of OpAmp, (-) input would be +V - Vsense = 9v - Vsense.
Assuming that the NPN transistor is just about forward biased.
given the 'usual' op amp assumptions, that due to the high amplification, voltage at the (+) input equals the (-) input.
so the difference voltage between the (+) and (-) input could be say Vsense.
It would seem then that the voltage at the collector (terminal 3) of the transistor would be like +V - Vsense = 9v - Vsense.
So Vout = 9v - Vsense - Vce
... well I'm confused.
... it turns out it is partly explained in the datasheet for this:
https://www.st.com/en/amplifiers-and-comparators/tsc1031.html
the rational is that Vrg1 = Vsense, due to the high gain (+) and (-) inputs are same.
so Irg1 = Vsense / Rg1
this same current flows through Rg3 , i.e. Irg3 = Irg1
so Vrg3 = Irg3 x Rg3 = Irg1 x Rg3 = Vsense x Rg3 / Rg1
This is interesting, so its gain = Rg3 / Rg1 !
well complicated, there is still the transistor that I ignored.
if this works, then it is a 'cheap' current sense amplifier with 'generic' op amps.
It seemed there should be some catch, I'm not sure what lol

I attached the KiCad project, with the generated netlist, just in case it helps.
 

Attachments

Last edited:

Thread Starter

SteelCircuit

Joined Aug 5, 2022
6
I think the problem is my mosfet is switching over and over when the main current is changed so the results are randomly changing. I can try add the capacitor for timing for solve this problem. Timing is neccessary for me ( 10-20 second) . Mainly same as my pass circuit but my purpose is :
---->Start the capacitor charging when latch-up occured.
---->When latch-up passed start the discharging process.
---->When my voltage decrease down to the 1V (Discharging time can be 10-20 second so given values must be available in this time range) I compare with comparator opamap (U6) an give my mostfet high and current flow again.

Thanks for your helps.
 

Attachments

crutschow

Joined Mar 14, 2008
30,463
op amps like LM358, LM321
t seemed there should be some catch, I'm not sure what
The catch is, those won't work, as their common-mode input voltage does not go to the positive rail (see their spec sheet).
You would need an op amp power supply about 2V greater than the power rail or 11V if the power is 9V as shown.

Otherwise you need an op amp with a rail-rail input range.
 
Last edited:

crutschow

Joined Mar 14, 2008
30,463
Below is the LTspice simulation showing the operation of the basic circuit in post #15 using a rail-rail op amp:
I left out the resistor values (except for the shunt as a starter value) as an exercise for you to calculate.
The resistor values are not unique, and depend upon the current range and the output resistance (impedance) you want.
Note that the output is a current, not a voltage, so the output voltage depends upon the output load resistance.

1660062414331.png
 
Last edited:

dl324

Joined Mar 30, 2015
14,924
I know there is more efficent ICs but I have to use opamps for my project. If you can help I would be thankfull.
It would be easier to help if you didn't have so much white space and unnecessary wire jogs in your schematic. Not that LTspice schematics would ever be considered pleasant to read. Personally, I can't stand the resistor symbol they use. I was taught exactly 4 humps on each side in my electronic drafting class...
 

crutschow

Joined Mar 14, 2008
30,463
I can't stand the resistor symbol they use. I was taught exactly 4 humps on each side in my electronic drafting class...
I agree that only 2 humps are seldom used.
You can edit the resistor symbol (res.asy) in LTspice to give you the ideal 4 humps, if you like. ;)

Below is my edit to have 3 humps (adequate for me, as 3 humps seem to be quite common, and 4 humps seems a little too busy) along with the attached modified file:
I also previously added a dot to show the positive current polarity for current going into that node.
1660070697040.png
 

Attachments

Last edited:
Top