Opamp for amplifying low-side current sense? - Page 1
Forum section: electronics / projects

author: dumle29
author_rank: Regular Contributor
timestamp: July 24, 2013, 09:17:41 am
content: I'm working on a PCB for a friend of mine who's decided he wanted to build a remote controlled lawnmowerHis 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 bunchSchematic 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?

author: C
author_rank: Super Contributor
timestamp: July 24, 2013, 10:34:17 am
content: 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.aspxThese parts let you measure currents in the low side or high side while getting a nice outputFor a RC starting point I would pick one of the 5 Volt parts but not the ACS709.C

author: dumle29
author_rank: Regular Contributor
timestamp: July 24, 2013, 11:27:22 am
content: 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 revisionTop sideBottom side

author: C
author_rank: Super Contributor
timestamp: July 24, 2013, 01:17:41 pm
content: 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 oferrors and missing parts.I did not check you PCboard but this part should be next to mosfetsThe same is true for the INA195sense- is a direct connection to the sense resistor not as you showagain the closer to sense resistor the betterC

author: dumle29
author_rank: Regular Contributor
timestamp: July 24, 2013, 03:23:02 pm
content: 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?

author: robrenz
author_rank: Super Contributor
timestamp: July 24, 2013, 03:27:14 pm
content: maybe this

author: C
author_rank: Super Contributor
timestamp: July 24, 2013, 06:21:26 pm
content: 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.QuoteSo 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.QuoteThat 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.QuoteNever 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.QuoteGOOD, you may want to read thishttp://en.wikipedia.org/wiki/Four-terminal_sensingFrom 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

author: dumle29
author_rank: Regular Contributor
timestamp: July 24, 2013, 10:22:10 pm
content: Thanks a lot for the helpI 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 INA195sI 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 cutterRemove COM from ground, connect it to correct side of shuntsAdd 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.

author: dumle29
author_rank: Regular Contributor
timestamp: July 24, 2013, 10:34:49 pm
content: Okay from the application notehttp://www.irf.com/technical-info/appnotes/an-978.pdfit 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

author: C
author_rank: Super Contributor
timestamp: July 25, 2013, 12:19:27 am
content: 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.QuoteI think I remember seeing 6A on one driver chip.Quotenormal motorA. 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.QuoteWhy 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 dothe 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-BridgeQuoteYou 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 goodC

author: dumle29
author_rank: Regular Contributor
timestamp: July 25, 2013, 09:23:47 pm
content: 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 homeHere's the updated files:Top PCBBottom PCBThanks a bunch for the help

author: fcb
author_rank: Super Contributor
timestamp: July 26, 2013, 10:53:06 am
content: 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.

author: C
author_rank: Super Contributor
timestamp: July 26, 2013, 04:13:37 pm
content: Schottky-type diodesQuoteD1 - D4 in imageGood link about H-bridge & the above diodes are called Catch Diodes at this linkhttp://www.modularcircuits.com/blog/articles/old-h-bridge-secrets/part-1/newer versionhttp://modularcircuits.tantosonline.com/blog/articles/h-bridge-secrets/Notethat 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 relatedC

author: M. András
author_rank: Super Contributor
timestamp: July 26, 2013, 08:31:13 pm
content: Quote from: C on July 24, 2013, 10:34:17 amhmm those chips looks damn nice, if you used them how comparable are they to a manganin type shunt? such as thesehttp://www.digikey.com/product-detail/en/3020-01096-0/811-1094-ND/1926137

author: C
author_rank: Super Contributor
timestamp: July 27, 2013, 01:12:52 am
content: M. Andráscomparing just shunt resistance is not a good true comparisonWith a shunt the error is not just the shunt, it is alsolow level signals picking up noiselow level amp errorspc 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 IsolationThe 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

author: dumle29
author_rank: Regular Contributor
timestamp: July 27, 2013, 02:16:32 am
content: 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 easierhttp://www.irf.com/technical-info/appnotes/an-978.pdfThe section where the diodes are suggested are on page 25.Usual images:PCB topPCB bottomEagle files:

author: C
author_rank: Super Contributor
timestamp: July 27, 2013, 04:42:47 am
content: Usual images: links bustedCapan-978 page 10 item 3bdo 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 systemWith 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 comparatorThink 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

author: M. András
author_rank: Super Contributor
timestamp: July 27, 2013, 09:02:48 am
content: Quote from: C on July 27, 2013, 01:12:52 amso 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.

author: C
author_rank: Super Contributor
timestamp: August 03, 2013, 09:41:16 am
content: Hi M. AndrásFrom 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

author: M. András
author_rank: Super Contributor
timestamp: August 03, 2013, 10:32:52 am
content: 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