Author Topic: Opamp for amplifying low-side current sense?  (Read 12275 times)

0 Members and 1 Guest are viewing this topic.

Offline dumle29Topic starter

  • Regular Contributor
  • *
  • Posts: 83
Opamp for amplifying low-side current sense?
« on: July 24, 2013, 09:17:41 am »
I'm working on a PCB for a friend of mine who's decided he wanted to build a remote controlled lawnmower ;D
His intentions are to just control it with an rc remote in the beginning,but at some later time work on it to make it autonomous, he's been thinking linux + kinect, but that's far from now.

Currently I'm designing the Dual H-bridge board that we will be using for the motors (one dual H-bridge board per motor), and I've decided to implement current limiting.

The shunt I have chosen is a 0,01? and this means that for every amp of current, there's a .01v drop acros the shunt, great. Now I need to feed this into a comparator where I can set the max current with a 10k pot, and then the comparator will dissable my IR2110 chips when max current is reached, and reenable them when it drops below max current. Good.

My problem is, I'd have a very, very hard time getting resistors accurate enough for me to get a 22mV reference voltage, (2.2A steppers), especially because I want it adjustable in case of upgrades, therefore I need to amplify the 22mV I get. I was thinking an opamp would do the trick, but this is where I fall short.

This is the first time I've ventured into op-amp land, and I find it very very confusing. The op-amp should preferably be single supply, the comparator (lm393) is running on 5v from a linear regulator, but I also have 12v from a switching regulator available on board. The op-amp needs to be able to supply voltages on the output, that I can use with the voltages I get from the resistive divider, this divider is just a 5% pot, put will be set to the reference voltage with a multimeter, and thus won't need to be accurate.

So, how would I go about this. From what I've read, I'd need a rail to rail opamp, or at least an opamp that goes to the lower rail. I could go with a virtual ground design from a resistive divider, and use the 12v, but I'm not certain what the ripple would be on this rail, and would prefer to use the 5v rail.
I've been looking at the LM324, as it seems to go very close to ground. As the output is fed in to a comparator, I don't need the output to hit ground, but it has to be able to go as low as .25v as this would let me use a gain of 100 on the op-amp, and then with that, set the current limiting to 250mA. The board I'm designing won't go higher than 5A per channel, so a .25V to 5v scale is really what I need.

Would the LM324 be any good for this purpose, and what are the traps-for-young-players I need to look out for?

Thanks a bunch :)

Schematic included:
(uploaded to imgur because of big size)

P.S. I also have 24V available from two car batteries (so when charging this would reach upwards of 30v.
P.P.S. I am now considering if an INA* device would be better?
« Last Edit: July 24, 2013, 09:41:37 am by dumle29 »
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Opamp for amplifying low-side current sense?
« Reply #1 on: July 24, 2013, 10:34:17 am »
Trying to change a very small signal in to a large signal takes a good design as well as a good amp.
If you want to use a current sense resistor then then using chip built to do this will be better. It may not be as cheap as a lesser cost op amp, but you will have better results and less problems.



A better idea would be to use a better part that will be even easer to use.
http://www.allegromicro.com/en/Products/Current-Sensor-ICs/Zero-To-Fifty-Amp-Integrated-Conductor-Sensor-ICs.aspx
These parts let you measure currents in the low side or high side while getting a nice output

For a RC starting point I would pick one of the 5 Volt parts but not the ACS709.


C
 

Offline dumle29Topic starter

  • Regular Contributor
  • *
  • Posts: 83
Re: Opamp for amplifying low-side current sense?
« Reply #2 on: July 24, 2013, 11:27:22 am »
Thanks a lot for the suggestion. While waiting i poked around, and tried out the ina195. (well, fitted it on my board.) It seems to do what I need it to, but i might change it for your suggestion at a later point in time, if I deem it necessary to make another revision :)

Top side
Bottom side
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Opamp for amplifying low-side current sense?
« Reply #3 on: July 24, 2013, 01:17:41 pm »

You are cheating and it will get you !!

On the IR2110 the COM pin should connect just like the data sheet shows in Typical Connnection.
This is not the same as you have as very quick high currents flow between these two points.

Re check your use of this part, I see a lot of errors and missing parts.
I did not check you PCboard but this part should be next to mosfets

The same is true for the INA195
sense- is a direct connection to the sense resistor not as you show
again the closer to sense resistor the better


C
 

Offline dumle29Topic starter

  • Regular Contributor
  • *
  • Posts: 83
Re: Opamp for amplifying low-side current sense?
« Reply #4 on: July 24, 2013, 03:23:02 pm »
Does it really make that huge of a difference if com is connected to one or the other side of the sense resistor? The resistor is only 0.01 ohms. As for missing parts I see none other than the capacitor from high side to COM.

The decoupling capacitors are missing, but that is because this board is gonna sit right next to my main board, where these rails are already sufficiently decoupled.

If you had checked the PCB, you'd see that I have placed the INA195 right on top on the shunts, and as for the IR2110s, these are fairly close to the fet's they are driving.

Would you care to tell me what missing parts and errors you've noticed?
 

Offline robrenz

  • Super Contributor
  • ***
  • Posts: 3035
  • Country: us
  • Real Machinist, Wannabe EE
Re: Opamp for amplifying low-side current sense?
« Reply #5 on: July 24, 2013, 03:27:14 pm »

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Opamp for amplifying low-side current sense?
« Reply #6 on: July 24, 2013, 06:21:26 pm »
Hi dumle29.

let's see if I can keep this short.
The faster you can turn on | off a Mosfet the less power waste & heat.
The Gate is a big cap.
The mosfet driver uses very high currents to charge and discharge the cap.
Long wires have inductance and will cause ringing.
Adding any resistance to Com connection will slow turn off.
 
Quote
Does it really make that huge of a difference if com is connected to one or the other side of the sense resistor? The resistor is only 0.01 ohms.
So Yes, big difference.  Including the sense resistor while bad has a second result, you now have the high current pulses turning off the mosfet also effecting your sense resistor, so your current sensor chip is also effected.
Quote
As for missing parts I see none other than the capacitor from high side to COM.
That is one and it is important, but you missed the two resistors in the gate connection.
So you know, These resistors dampen the ringing due to the high currents.

Quote
The decoupling capacitors are missing, but that is because this board is gonna sit right next to my main board, where these rails are already sufficiently decoupled.
Never a good idea to leave off the decoupling capacitors. Here you have high voltages and currents changing very fast with the added fun of the noise from the motors. Not a place to leave off caps.

I do not see extra high speed diodes across the Mosfet. Some mosfet's have good diodes built in while others are poor. The best idea is design the PC Board to have these extra diodes and leave them un-mounted if un-needed.

Quote
If you had checked the PCB, you'd see that I have placed the INA195 right on top on the shunts, and as for the IR2110s, these are fairly close to the fet's they are driving.
GOOD, you may want to read this http://en.wikipedia.org/wiki/Four-terminal_sensing
From pc board I see the sense resistors are setup for this. The two small tabs should only be connected to the sense pins of the  INA195. 

You said mower, remember that a motor can generate power when slowed. This can cause the +24 V to rise.
Some power sources do not like this. The needed power transfer could be more than what a battery can handle.
A lot of Trains put this extra energy in to a resistor load bank turning it in to heat.
Some Cars put this extra energy in to a capacitor bank & then use it or pump it back in to the battery bank at a slower rate.

On X2 & X3 it is a good idea to have a ground connection pin. A added logic level supply pin is also a good idea & makes it easer if you need to convert to a different logic level at some point.

Also at some point in the future you may like to know that over current shutdown is happening back to cpu.

Some things to think on.


C
 

Offline dumle29Topic starter

  • Regular Contributor
  • *
  • Posts: 83
Re: Opamp for amplifying low-side current sense?
« Reply #7 on: July 24, 2013, 10:22:10 pm »
Thanks a lot for the help :) I failed to understand just how high currents the IR2110 drives the gates of the mosfets at, (according to the datasheet, up to 3A! :O)
I have always regarded mosfet gates at being tiny capacitors, with an insignificant capacitance, and thus I've never considered using gate resistors, as I've seen gates as blocked paths, where once a potential had been build up, current stops (which it does, but danm the IR2110 works those gates).

The changes I will make tomorrow or in two days(will be on the road for the most of tomorrow, Just short of 2000km drive :S):

  • I have separated the ground sense pin and routed it to sense- on the INA195s
  • I will added the resistors to the gate drive lines.
  • I'll properly decouple the board. As a side note, this was something that I did feel iffy about leaving out, as it's gonna sit next to a large motor spinning a cylinder cutter
  • Remove COM from ground, connect it to correct side of shunts
  • Add cap between com and high side of load.

About the slowing down on the motor: Since the H-bridges are for controlling steppers that will be moving the mower around, the only other motor is the one for the cylinder cutter. This I don't really plan on slowing, I just plan on either A: disconnecting it, leaving it open circuit to slow down or B: shorting it out in case of an emergency stop. (blowing the fets if necessary) .

About over current shutdown status being sent to the cpu. This wouldn't be needed for this design, as overcurrent will always kick in, and it is more accurately described as current limiting.
As I've mentioned, the boards will be for stepper control, and in particular, I'll use it to drive some 2.2A@12v steppers at 24v, to improve slew rate. therefore this current sensing actually serves as a chopper circuit, but you bringing up the currents involved with the ir2110 gate drive, leads me to think that this implementation might give me a headache?

As it is right now, the +5v pin serves as a logic supply pin, as all the logic on the board is connected to this.
« Last Edit: July 24, 2013, 10:23:52 pm by dumle29 »
 

Offline dumle29Topic starter

  • Regular Contributor
  • *
  • Posts: 83
Re: Opamp for amplifying low-side current sense?
« Reply #8 on: July 24, 2013, 10:34:49 pm »
Okay from the application note http://www.irf.com/technical-info/appnotes/an-978.pdf it should be okay for me to use the sd pin for the chopping function. They mention on page 25 that at 500kHz, no noticeable heat generation occured in the ir2110, and with 2.2A coils, the slew rate won't allow anywhere near 500 kHz, so that should be good :)
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Opamp for amplifying low-side current sense?
« Reply #9 on: July 25, 2013, 12:19:27 am »
First, don't sell yourself short, you have a good basic building block that could be used many places and many ways. A few good blocks makes building new things easer.

 
Quote
Thanks a lot for the help :) I failed to understand just how high currents the IR2110 drives the gates of the mosfets at, (according to the datasheet, up to 3A! :O)
I think I remember seeing 6A on one driver chip.

Quote
I just plan on either A: disconnecting it, leaving it open circuit to slow down or B: shorting it out in case of an emergency stop. (blowing the fets if necessary) .
normal motor
A. While current is flowing will try to charge in to supply until the motor output drops below what is needed to make the diodes to conduct, This takes power from motor slowing it faster. When motor output voltage drops below the previous level the motor will slowly coast to a stop. Note that if you chop the current you will get an inductive kick that will still slow the at less then supply voltage levels.
B. Two low side mosfets on at same time will slow the motor fast. Switching one of these two on and off will make stopping take longer.

Quote
but you bringing up the currents involved with the ir2110 gate drive, leads me to think that this implementation might give me a headache?
Why you keep the ir2110 close with good traces. Doing this with good bypass caps and you should be fine. Also try to keep the logic traces away from the traces to the mosfets.

You are going to a lot of work here, with a little added thought and very minor changes this board changes from one specific use to a very useful building block. If you use ribbon cables for the logic connection you can have a lot of cheap logic level signal connections. Again nothing says you have to use them all, but if they are on the connector it's easy if you have a need in the future.
So thinking of possible future use here is what I would do
the drivers have three pins (Hin,Lin,SD) I would put these three from each driver to the digital logic connector. Add the OUT of the current sense chip & the output of the LM393 to the digital logic connector. Add a +5 volt Vdd pin and then one or more Vss ground pins.
I know you have some of this now, just thought be good to list it all together.
This puts every thing available on the connector for the future Use. Easy and cheap to do now. The only other thing would be an option to disconnect LM393 from the drivers.
These changes and you have a great block with the mounted mosfets limiting Voltage & current the H-Bridge can handle. You now have a block you can use any place you need a H-Bridge

Quote
I have separated the ground sense pin and routed it to sense- on the INA195s
You did not say if you connected the sense traces to the special pins on the shunt resistor. If you did not, you should.

Good application note. Check what you have with the application note and data sheet and you should be fine.

Your mosfets may not like 500kHz, check this.

Looking good

C
 

Offline dumle29Topic starter

  • Regular Contributor
  • *
  • Posts: 83
Re: Opamp for amplifying low-side current sense?
« Reply #10 on: July 25, 2013, 09:23:47 pm »
Okay, so I've completed most things. Still need some decoupling on the 5v rail.

I chose to cheat a little bit on the decoupling, by using only one set of caps (electrolyt + ceramic) per 2 ir2110, and placed this in between the two. The same for the cap from 24v to ground.

Still need to add some dip switches and connectors to turn it into a good block.

I haven't selected any values for the caps yet, I just copied some I had in the schematic, but for now it's bed time, before the last half of my trip home ;)

Here's the updated files:


Top PCB
Bottom PCB

Thanks a bunch for the help :)
 

Offline fcb

  • Super Contributor
  • ***
  • Posts: 2174
  • Country: gb
  • Test instrument designer/G1YWC
    • Electron Plus
Re: Opamp for amplifying low-side current sense?
« Reply #11 on: July 26, 2013, 10:53:06 am »
What are those diodes in the gate networks for?  You'll speed up the discharge of the gate capacitance, but risk a current spike in the drivers which could degrade them over time - especially with big mosfets.

Also, I would put some series resistors on the inputs to the INA195, and yes, I did read the datasheet.
https://electron.plus Power Analysers, VI Signature Testers, Voltage References, Picoammeters, Curve Tracers.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Opamp for amplifying low-side current sense?
« Reply #12 on: July 26, 2013, 04:13:37 pm »

Schottky-type diodes
Quote
I do not see extra high speed diodes across the Mosfet. Some mosfet's have good diodes built in while others are poor. The best idea is design the PC Board to have these extra diodes and leave them un-mounted if un-needed.


D1 - D4 in image

Good link about H-bridge & the above diodes are called Catch Diodes at this link
http://www.modularcircuits.com/blog/articles/old-h-bridge-secrets/part-1/
newer version
http://modularcircuits.tantosonline.com/blog/articles/h-bridge-secrets/

Note that your Schematic would be much easer to read, understand and check if your package drawings for LR2110 matched the data sheet. The left side pins are logic part, the lower right are low side drive related & the upper right are high side drive related

C
 

Offline M. András

  • Super Contributor
  • ***
  • Posts: 1014
  • Country: hu
Re: Opamp for amplifying low-side current sense?
« Reply #13 on: July 26, 2013, 08:31:13 pm »
Trying to change a very small signal in to a large signal takes a good design as well as a good amp.
If you want to use a current sense resistor then then using chip built to do this will be better. It may not be as cheap as a lesser cost op amp, but you will have better results and less problems.



A better idea would be to use a better part that will be even easer to use.
http://www.allegromicro.com/en/Products/Current-Sensor-ICs/Zero-To-Fifty-Amp-Integrated-Conductor-Sensor-ICs.aspx
These parts let you measure currents in the low side or high side while getting a nice output

For a RC starting point I would pick one of the 5 Volt parts but not the ACS709.


C
hmm those chips looks damn nice, if you used them how comparable are they to a manganin type shunt? such as these http://www.digikey.com/product-detail/en/3020-01096-0/811-1094-ND/1926137
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Opamp for amplifying low-side current sense?
« Reply #14 on: July 27, 2013, 01:12:52 am »
M. András

comparing just shunt resistance is not a good true comparison

With a shunt the error is not just the shunt, it is also
low level signals picking up noise
low level amp errors
pc board layout.
and many others.
Want to really mess up your shunt circuit. connect it to the motor leads instead before the of low side of the h bridge. A lot of current amps don't like the shunt bouncing up and down in voltage.

Will shunt circuit still work when connected to high side line?

What I am trying to say, with a shunt you have an unknown total error until actual test of the finished product, it could be better or much worse. And will likely have no Isolation.

The Isolation keeps a lot of errors creeping in while allowing more safe places you can use this type of part.

I like the Bidirectional high level differential output, 120 kHz Bandwidth with Isolation

The ACS716 for one at $4.88 vs shunt at $20 + amp + _____

So what comparison is fair?
You decide, I find an easy to use ACS716 at $4.88 wins Vs the mess.
I also use differential design more, trying to keep the return signal path off the rails and use differential output op amps when possible. It's a choice.

Probably not the answer you were looking for.
I think I recall these showing up in a few tear-downs if that helps.

C
 

Offline dumle29Topic starter

  • Regular Contributor
  • *
  • Posts: 83
Re: Opamp for amplifying low-side current sense?
« Reply #15 on: July 27, 2013, 02:16:32 am »
Diodes added, package rearranged.
The reason I hadn't added the diodes untill now, is that I plan to select my fets for the job (with proper diodes). However the whole block thing, turned me around in the end, and I found space for some smd schottkys.

As for why I have diodes on the gate drive. I added them there to speed up mosfet turn-off time, to inturn increase the deadtime of the bridge. The IR2110 does handle this just fine, and it is infact suggested in the application note that I linked higher up. I'll put it hear to make it easier :)

http://www.irf.com/technical-info/appnotes/an-978.pdf

The section where the diodes are suggested are on page 25.

Usual images:

PCB top
PCB bottom

Eagle files:

« Last Edit: July 27, 2013, 09:36:05 pm by dumle29 »
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Opamp for amplifying low-side current sense?
« Reply #16 on: July 27, 2013, 04:42:47 am »
Usual images: links busted

Cap
an-978 page 10 item 3b
do you have it an next to pin?

R4 & R5  the small pads, Think of R4 & R5 as a 4 pad device. This is a 4-wire kelvin connection, only sense current flows in little pads.

Power
+5 mostly logic
+12 gate drive
+24 motor power

+5 & +12 normally from control system

With the higher voltage & currents you normally see +24 & 24 ground on a septate high current connector. this is almost a direct to battery supply connection. The +24 due to currents will have a large cap & it is actually better to use many smaller caps to make the large cap ( lowers ESR).
This also lets you seperate the high current part for a better pc board.
 
Current sense comparator
Think you need some work here.
mosfets on, motor current rises, Lm393 switches,  fet driver shutdown, motor inductive kick, motor current decreases, Lm393 below current switches, fet driver on, fet's on, motor current builds. The only thing slowing this down is circuit speed & motor current change rate. Mosfets could spend a lot of time between switch states getting hot.

 C
 
 

Offline M. András

  • Super Contributor
  • ***
  • Posts: 1014
  • Country: hu
Re: Opamp for amplifying low-side current sense?
« Reply #17 on: July 27, 2013, 09:02:48 am »
M. András

comparing just shunt resistance is not a good true comparison

With a shunt the error is not just the shunt, it is also
low level signals picking up noise
low level amp errors
pc board layout.
and many others.
Want to really mess up your shunt circuit. connect it to the motor leads instead before the of low side of the h bridge. A lot of current amps don't like the shunt bouncing up and down in voltage.

Will shunt circuit still work when connected to high side line?

What I am trying to say, with a shunt you have an unknown total error until actual test of the finished product, it could be better or much worse. And will likely have no Isolation.

The Isolation keeps a lot of errors creeping in while allowing more safe places you can use this type of part.

I like the Bidirectional high level differential output, 120 kHz Bandwidth with Isolation

The ACS716 for one at $4.88 vs shunt at $20 + amp + _____

So what comparison is fair?
You decide, I find an easy to use ACS716 at $4.88 wins Vs the mess.
I also use differential design more, trying to keep the return signal path off the rails and use differential output op amps when possible. It's a choice.

Probably not the answer you were looking for.
I think I recall these showing up in a few tear-downs if that helps.

C

so even if these parts are rated for 150c operation looking at the graph on the output error vs temp graph these looks superior to the shunts 10ppm tempco typical, the lower parts rated for around 2-3% accuracy the bigger 1k amps ones to 5% if it wont shift during operation maybe 0.5% then its already a winner considering the self heating due to conduction elements resistance vs current,
the isolation is a pretty big bonus and the price of these its a better solution for me compared to any kind of shunts.
 

Offline C

  • Super Contributor
  • ***
  • Posts: 1346
  • Country: us
Re: Opamp for amplifying low-side current sense?
« Reply #18 on: August 03, 2013, 09:41:16 am »
Hi M. András
From your post it looks like you sold your self a closer look at these chips.
One place these fail is if you need more than the 120k bandwidth.

For the best use, you should keep the differential output going as far as possible.
fully differential input Op amps are not that expensive. And note also the better ADC's have a differential input just like the better driver chips for the ADC's have differential outputs. You can use differential all the way and keep one side of the signal path off the noise in the power planes.

C 
 

Offline M. András

  • Super Contributor
  • ***
  • Posts: 1014
  • Country: hu
Re: Opamp for amplifying low-side current sense?
« Reply #19 on: August 03, 2013, 10:32:52 am »
yeah i looked at them closer. and the info i found on the allegro's website states these can be reliable if you want mA resolution you are left with only dc response and the noise is still higher then the needed resolution. however those are avg figures. i may get 1 demo board from 1 of the sensors and test it
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->