Design validation: Constant current sink with digital controls (3rd try) - Page 1
Forum section: electronics / projects

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 02:25:18 pm
content: Well the two previous post attempts failed due to too big an attachment, and the board layout also failed. So I split the project into two boards, analog and digital sections.Here is the analog section of Arduload, an Arduino-compatible USB-powered dummy load. It is largely based on Dave's constnat current load design, but some compromises are made to make the project capable of handling 10 amps while still being USB bus powered. The maximum current rating of this design is about 12.5A and it is fused at 10A.The power resistors are 10 3W 1 ohm units in parallel, makes a 0.1 ohm resistor. This lower value is a compromise to the lower system operating voltage. Also a logic level power MOSFET in TO-247 package is used, which is also a compromise for the lower system operating voltage while keeping the same current sinking and power dissipating capabilities.The rest of the analog section consists of MC1403 2.5V reference, MCP41010 digital pot setting the constant current, and LMV358 rail-to-rail op amp as the error amp and the sense preamp. The preamplification is required since the resistor sense voltage is so low that neither the measurement ADC nor the error amp itself works well enough with that low sense voltage generated by the 0.1 ohm resistor.The board-to-board connector is based on 10-pin AVR ICSP pinout, if you are wondering.

author: Kalvin
author_rank: Super Contributor
timestamp: May 17, 2015, 02:51:38 pm
content: You may want to add a series resistor to IC1B output driving the mosfet's capacitive gate. I would add places for other loop stabilazing components as well. You can leave them unpopulated if the loop is stable without compensation. For example, seehttp://www.edn.com/Home/PrintView?contentItemId=4425713Edit: About the layout: I would move the connector X1 as close as possible to the mosfet, and keep the op amps as far from the high current part as much as possible. Now you pass the high current from one end to another on your pcb. So, if possible, you should move X1 very next to the mosfet. Also, the trace carrying 10A of current seems a bit thin.You haven't stated what the voltage of the source will be. For example, if you want to test a 12V power supply and drive 1A through the mosfet, the mosfet will get very hot. At 1A current the resistors will only dissipate 0.1W but the mosfet will need to dissipate almost 12W. At 10A the 0.1ohm resistor will dissipate "only" 10W, but the mosfet will need to dissipate 110W. Of course, if you use the load only in a pulsed mode to measure transient response, the heat may not be an issue.

author: Paul Price
author_rank: Super Contributor
timestamp: May 17, 2015, 02:57:34 pm
content: Maybe you have R12 connected to the wrong side of R11 and perhaps R12 should be 1K?The circuit amplification of current measured seems to be too low.You might need a very high power fan from what I see as my estimated size of the heatsink shown..don't burn your fingers!The LM358 shown in the schematic is very slow and current compliance will lag fast load changes..but the LMV386 audio amp is not a dual op-amp and that is what is shown on your schematic..so this circuit is quite a different story then what your schematic shows .All the 1 ohm resistors would better be placed in the same direction to a same ground point and a Kelvin connection would make the circuit less affected by ground loops in your circuit..if accuracy is your performance goal at all.

author: jt
author_rank: Regular Contributor
timestamp: May 17, 2015, 03:36:02 pm
content: Is there a reason to have IC1A inside the feedback loop? I would think it could only hurt the transient response and add offsets that will decrease your precision. Maybe worst case, add a phase delay that could affect your stability (you are probably okay here though).If you just want to buffer ASENSE, I'd connect IC1B's inverting input directly to the sense resistor network, and then connect IC1A as a voltage follower from that node (ie. take it out of the current control feedback loop). This also gives you the opportunity to add gain to your ASENSE output if you want. re-read your post... disregard my comment

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 04:16:22 pm
content: Quote from: Paul Price on May 17, 2015, 02:57:34 pmI do expect burning away 200W at the IRLP3034 with extra heatsinking since it is capable of maximum 340W. That is the reason why I put X1 opposite the MOSFET, just to avoid accidentally burning myself, making attaching extra heatsinking easier, and keep the MOSFET as far away from the digital components as possible. The digital board have a heatsink cutout in it so bigger heatsink can be fit. By default the software limits the current to 2A, and a 10A fuse is in place.The 2x amplification is chosen because of the low reference voltage: 2.5V. That means a full scale voltage drop across the resistors is half the reference voltage, or 1.25V, which means a full scale current capability of 12.5A. It is fused at 10A though. This entire dummy is powered off USB so 5V supply is a constraint.Also about the '386, I did not use that at all but made a mistake when writing this post. The op amp is LMV358 and I am also investigating using TLC2272 as a replacement.

author: Paul Price
author_rank: Super Contributor
timestamp: May 17, 2015, 04:21:53 pm
content: You won't be able to get the power MOSFET to dissipate 200W of power without a hurricane output fan, a heatsink the size of a liter coke bottle. unless you submerge the whole circuit board in liquid nitrogen.I still get that your circuit is ambiguous about the op-amp used and R10 and R11 are not likely to work to do what you intended as they are shown connected with the schematic values shown.

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 04:25:29 pm
content: Quote from: Paul Price on May 17, 2015, 04:21:53 pmI have clearly said that both a heatsink swap and a software unlock is required to allow this thing dissipate 200W. By default the current is limited to 2A by software. And since I do have one GPIO pin on the microcontroller spare, maybe I will also throw in a DS18B20 temp sensor on the analog board.

author: Paul Price
author_rank: Super Contributor
timestamp: May 17, 2015, 04:28:58 pm
content: A temperature sensor might best be replaced by a smoke alarm.

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 04:39:27 pm
content: Analog board, design changed:* Thicker power track* Added a LM35 temperature sensor to the heatsink to allow software-operated heat control

author: Kalvin
author_rank: Super Contributor
timestamp: May 17, 2015, 04:50:01 pm
content: If you cannot move the X1, consider creating a slot to the ground filling so that the X1 will be kept separate from the analog/digital parts up to the fuse. In that way, the 10A high current return path will not go straight through your sensitive analog/digital part of the design.

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 05:02:34 pm
content: Quote from: Kalvin on May 17, 2015, 04:50:01 pmDifficult: Both sides of the analog board and one of the sides of the digital board is ground plane, and all four mounting posts are connected to the ground plane, as well as the heatsink. This does mean that once the MOSFET run hot the entire assembly runs hot...

author: bktemp
author_rank: Super Contributor
timestamp: May 17, 2015, 05:04:10 pm
content: The IRLP3034 is probably the worst choice: Look at the SOA curve in the datasheet. At 2A the voltage must be limited to less than about 15V. At 10A it only tolerates less than 10V. Use a mosfet with a much higher voltage rating.The MCP41010 has 256 steps. Using a 2.5V reference and 0.1ohm sense resistore you get 97mA steps. I recommend at least a 10bit DAC.There are much better amplifiers than LMV358. Without any compensation this load will oscillate.

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 05:18:10 pm
content: Quote from: bktemp on May 17, 2015, 05:04:10 pmIRLP3034 is pretty much the only TO-247 logic level power NMOS I can find. TO-247 for the power dissipation, logic level to work around the USB bus power constraint. If IRL3034 is not a good idea, please suggest a part.The reference is effectively a 1.25V one because of the sense preamplifier. If I use higher sense preamplification gain (hence lower maximum current) I may go and use IRL540 as the main power MOSFET, although the TO-220 heat dissipation will be problematic.About compensation, how to do it?

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 05:19:55 pm
content: Digital section: Arduino-compatible controls, 16x2 LCD and a few buttons to operate, as well as USB interface for both operating power, calibration data and remote control.

author: Kalvin
author_rank: Super Contributor
timestamp: May 17, 2015, 05:34:06 pm
content: Quote from: technix on May 17, 2015, 05:02:34 pmActually, this is what I had in my mind. Now the high current 10A path is kept separate from your analog components ie. the 10A return current path doesn't go through the sensitive area. I also marked the mounting posts in the high current area to be separated, just in case in order to prevent ground loops. At least the low right mounting post should be kept separated from the high current path.

author: Kalvin
author_rank: Super Contributor
timestamp: May 17, 2015, 05:46:55 pm
content: The ground separating slot (marked as orange) should be made on the top and bottom sides, of course.

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 05:53:39 pm
content: Quote from: Kalvin on May 17, 2015, 05:34:06 pmHow about this: not actually routing slots into the board, high current return paths is given its own net and a thin sense wire is used to sample it off, like the high side.

author: Kalvin
author_rank: Super Contributor
timestamp: May 17, 2015, 06:21:31 pm
content: Quote from: technix on May 17, 2015, 05:53:39 pmRemember, you are measuring the voltage across the resistors referenced to the common ground by the op amp IC1A and R12. But if I read the layout correctly, the resistors are not connected to the same reference ground any more.Just revert back to your good layout in your previous post:https://www.eevblog.com/forum/projects/design-validation-constant-current-sink-with-digital-controls-%283rd-try%29/msg675152/#msg675152and draw the new ground trace near where the resistors R5 and R10 are connected to the ground.Now, if you place your finger to the layout and follow the 10A current path from the X1 back to X1 ground connections, there should be only a single (but fat) area where the high current path is connected the GND.

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 06:30:40 pm
content: Quote from: Kalvin on May 17, 2015, 06:21:31 pmModified as such.BTW, how to fix the MOSFET oscillation? Or should I revert back to IRL540N and use 5x sense gain (full range current 5A instead of 12.5A)

author: Kalvin
author_rank: Super Contributor
timestamp: May 17, 2015, 06:45:38 pm
content: Quote from: technix on May 17, 2015, 06:30:40 pmThis looks fine now.When the op amp is driving a mosfet with a high gate capacitance, the op amp may start oscillating. I would add few extra components, something like in fig.3:http://www.edn.com/Home/PrintView?contentItemId=4425713At least you will have places for the necessary components, if your control loop oscillates. If your loop is stable without these extra components, you just leave them unpopulated.

author: bktemp
author_rank: Super Contributor
timestamp: May 17, 2015, 06:57:33 pm
content: Quote from: technix on May 17, 2015, 05:18:10 pmOlder mosfets are better for linear operation, because they are less optimized, therefore the energy density is much lower.But they do not work at 5V. IRFP054/064/140/150/250/260/264 are good for linear operation but they need at least 7V supply voltage.QuoteUsing 2 IRL540 should be better than 1 IRLP3034 because of the wider SOA, but each mosfet needs its own current control loop to equally share the current between both mosfets.I would replace the LMV358 and use a better amplifier with less offset voltage. Then you can lower the sense resistor.

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 08:59:26 pm
content: Revised the analog board again:* Two overlapping power MOSFET footprints: TO-220 or TO-247.* Analog temperature sensor at the heatsink for temperature monitoring.* Added footprints for frequency compensation.* Corrected the preamp error.* Power resistor voltage is tapped off 4-wire measurement style.

author: Kalvin
author_rank: Super Contributor
timestamp: May 17, 2015, 09:19:20 pm
content: Oops, you missed the capacitor between the IC1B - input to IC1B output, and the series resistor from the IC1B output to mosfet gate. See the link I gave once more.For extra protection, you may want to add 1k resistor in series between the IC1A + input and the current measurement resistors.

author: cellularmitosis
author_rank: Unknown
timestamp: May 17, 2015, 09:36:16 pm
content: You might try to create a combo footprint which suits both TO-220 and TO-247 at the same time (it's 5 pins with the outer pairs of pins shorted).This allows you use use a wide range of FETs, and allows you to create one board which can be populated differently to suit different load ranges, etc.Board re-use like that seems particularly useful when many PCB houses have minimum order quantities of 5 or 10.I used this trick on my TO-220 / TO-247 breakout board:https://github.com/pepaslabs/TO-220_breakout

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 09:41:38 pm
content: Quote from: Kalvin on May 17, 2015, 09:19:20 pmHow does this one look?

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 09:45:55 pm
content: Quote from: cellularmitosis on May 17, 2015, 09:36:16 pmAlready did that, using two overlapping TO-220 and TO-247 footprints in Eagle and "approve" a bunch of DRC errors. I just need to tell the board house to mill the center hole according to TO-247 (and let TO-220 pin bend a little bit)The TO-220 footprint is for IRL540 which is for the 5A version, and the TO-247 footprint is for the IRLP3034 which is capable of 10A but at a lower voltage rating. The rest of the board is identical but the 5A and 10A versions have different preamplifier gain settings. The digital section have identical circuitry but a slightly different firmware in the microcontroller.

author: Kalvin
author_rank: Super Contributor
timestamp: May 17, 2015, 09:56:13 pm
content: Quote from: technix on May 17, 2015, 09:41:38 pmYou almost got it right.The C4 should be connected to the mosfet gate (ie. the other end of the R15), not to the op amp output as it is now. R16 and C5 are good.

author: technix
author_rank: Super Contributor
timestamp: May 17, 2015, 10:14:01 pm
content: Quote from: Kalvin on May 17, 2015, 09:56:13 pmSo it should look like this?And what about the digital section?

author: Kalvin
author_rank: Super Contributor
timestamp: May 18, 2015, 07:07:26 am
content: Quote from: technix on May 17, 2015, 10:14:01 pmYou are still missing one resistor. If you take a look at the fig. 3 inhttp://www.edn.com/Home/PrintView?contentItemId=4425713there is a resistor R2 which is missing from your design. Otherwise you design looks good now.

author: technix
author_rank: Super Contributor
timestamp: May 18, 2015, 08:55:56 am
content: Quote from: Kalvin on May 18, 2015, 07:07:26 amI think I will leave R2 out and use TLC2272 as the op amp. CMOS parts like TLC2272 does not usually require gate resistors.

author: blackdog
author_rank: Frequent Contributor
timestamp: May 18, 2015, 10:26:36 am
content: Hi,It still will be a power oscilatorPut all your attention to the analog design, be shure to test the analog part first.Stop develloping the digital part, this wil come later.Put all your attention to the loop controle of the opamps and Fets, it is a messWhy is there a second opamp if you use it only as a 2x gain unit, the first opamp can do this whitout a problem...C5 wil NOT work, look how it is connected, between 2 opamp outputs, which opamp is going to win? do you think its a stable design?Just for a impression take a look @ this schematic, how i made a dummy load.It is a Max 100Watt design with good cooling and wide band modulation possible if you want to use it.This is the start of the topic on "Circuits Online" a Dutch Forum, use Google translate, there is no English version :-(http://www.circuitsonline.net/forum/view/121338/1/dummy+loadTwo powerfet is the Max fore driving by one opamp.If you want to design a higher power unit, give every powerfet its own driver opamp.Kind regarts,Blackdog

author: Kalvin
author_rank: Super Contributor
timestamp: May 18, 2015, 10:40:56 am
content: Quote from: technix on May 18, 2015, 08:55:56 amOf course you can leave the R2 out, but the loop will not be stable and you may find yourself in deep trouble. Read the blackdog's comment above and check his schematics for details.

author: technix
author_rank: Super Contributor
timestamp: May 18, 2015, 02:11:16 pm
content: Quote from: blackdog on May 18, 2015, 10:26:36 amThe first op amp have to be there because it is the sense preamplifier, whose output is not only used by the error amp but also the digital section (noticed that its output, ASENSE, is also tapped off to the board-to-board interconnect, and eventually into an ADC pin on the microcontroller?)This amplifier have to be there because of the low power rail voltage and its consequences. I have clearly written in the specs that this circuit works off the USB bus power and that leads directly to the choice of smaller sense resistors, restrictions on MOSFET choice, and the existence of this preamplifier. It also compensates my lack of a 10-bit or 12-but DAC by presenting a proportionally higher sense voltage to the error amp, and this point is also valid for the sense ADC in the digital section.

author: technix
author_rank: Super Contributor
timestamp: May 18, 2015, 02:20:01 pm
content: Quote from: Kalvin on May 18, 2015, 10:40:56 amPrincipals apply, but dues not work out of the box in my 5V single supply scenario.

author: Kalvin
author_rank: Super Contributor
timestamp: May 18, 2015, 02:34:53 pm
content: You need to have the R2 (see the picture below) in your circuitry, otherwise you may not be able to compensate the control loop if the loop should oscillate.http://m.eet.com/media/1202185/lab_equipment_fig3t.jpgYou can take the ASENSE signal from the output of IC1A even if you add the resistor between IC1A output and ICIB inverting input like shown in the link above.

author: blackdog
author_rank: Frequent Contributor
timestamp: May 18, 2015, 02:40:15 pm
content: Hi technix,This amplifier have to be there because of the low power rail voltage and its consequences. <=NO!1e rule, the design must be stable!You are putting a extra "time lag" in the feedback loop, it will oscilate!Get the second opamp out of the loop.Use the second opamp only as a gainstage for your AD.Again, al your attention to te loop control, if its realy OK, think about the wiring around the Fets.Use a low value Gate resistor, a 1K gate resistor gives much more phase lag, use about 33 to 100 Ohm direct on the Gate of the Fet.Build the analog section on copperclad board and a heatsink fore the Fet's, keep the wires short.If it realy OK, do the next step :-) (digital section as last)Do a lot of measurements, test with short wires to a powersupply, test with 0,5 meter wires, test with a series resistor say 5, 10 and 22 Ohm, @ different currents/different volgages.Test with a inductive load enz.Take a good look @ my schematic, there is a lot of usefull info on it.That you want to make it powerd of a 5V USB bus, does not make it a good design.Have you thought about the connection between the USB connector and the power supply under test.Maybe you need a isolated USB bus (power and data) Blown up your computer because you make a fault?Kind regarts,Blckdog

author: technix
author_rank: Super Contributor
timestamp: May 18, 2015, 05:11:46 pm
content: Quote from: blackdog on May 18, 2015, 02:40:15 pm1. I repeat, the 2nd op amp not only compensates the ADC, but also the digipot and reference voltage, or the DAC if I change to one of that. It serves too many purposes to be removed without significantly increase circuitry complexity and/or cost.2. I have too many battery packs with USB power jacks so the "USB as a power supply" is sort of a self-imposed standard design rule (all my projects, if not too power hungry to do so, should always be powered off USB or a single Li-ion cell) so blowing the connection is fiction if I power it off a USB battery pack. The serial connection in the USB is for remote control, calibration and firmware updating (it is wired up to be compatible with Arduino software, if you have noticed the digital board at all.) Consider this "USB bus power only" as a design constraint that must be worked around, just like your boss ordered so.I did not post the digital section here despite everyone is talking about the analog section out of the blue. The digital section have some serious impact on the analog section that have to be considered. For example, the sheer existence of the ASENSE line (which go to the digital board) will impact the placement of the op amps. I think you have focused too much on the analog section and put the digital section on the backburner, which will come back and bite you when you begin your work on the digital section. This is from a system engineering point of view, and the knowledge of what other sections is expecting will impact your decisions. Noticed the 10-way board-to-board interconnect and the slots cut on the digital board? that is the result of a system design on a larger level, which I think you have ignored.

author: blackdog
author_rank: Frequent Contributor
timestamp: May 18, 2015, 05:28:08 pm
content: Hi technix, :-)Later this evening i will make a design for you, with your components, maybe it wil be more clear than.Kind regarts,Blackdog

author: blackdog
author_rank: Frequent Contributor
timestamp: May 18, 2015, 06:29:25 pm
content: Hi technix,Maybe this drawing makes it more clear.Kind regarts,Blackdog

author: cncjerry
author_rank: Unknown
timestamp: May 18, 2015, 07:35:03 pm
content: Are you familiar with the Keithley 228? You might want to take a look at the schematic for ideas. I just bought one, looking for another, as with two you can do high power semiconductor curves under program control. It is billed as a programmable IV source/load. I think it is one versatile piece of equipment, especially if you get one for a great deal as I did two weeks ago. The unit only handles 100W (100v at 1A, 10V at 10A, etc). I've been using it to recondition batteries, test power supplies, etc. It allows you to set the voltage, current and dwell time from 20ms to about 999 seconds in up to 100 steps. If the voltage is lower than the load supplies (battery, power supply) it is in sink mode; higher it goes to source. Constant voltage and/or constant current are available so you can recondition 6000mah, 60A drain LIPO batteries (still working on a safety mechanism for that one). Lots of fun for the money.

author: technix
author_rank: Super Contributor
timestamp: May 18, 2015, 09:05:05 pm
content: Quote from: blackdog on May 18, 2015, 06:29:25 pmYour design won't work due to offending a design constraint of the digital portion of the system: this reduces the effective DAC resolution to 4 or 5 bits and that is definitely not enough. Remember the potentiometer you see in the schematic is a digital one and probably will be replaced with a DAC so digital resolution have to be considered in this design.Also, my design is not based on the star ground point topology but a "4-wire measurement" topology. Notice the two sense tracks, 1/10 of the power track thickness, tapping off the power resistors?

author: technix
author_rank: Super Contributor
timestamp: May 18, 2015, 09:07:31 pm
content: Quote from: cncjerry on May 18, 2015, 07:35:03 pmThis thing costs a grand (in US dollars) here so definitely out of my league. Schematics maybe if I can find a reference manual somewhere.

author: cncjerry
author_rank: Unknown
timestamp: May 18, 2015, 09:26:09 pm
content: It costs a grand in the US as well unless you find one for $299. I still can't find out why the guy sold it for that price. Works perfectly, as new condition.

author: technix
author_rank: Super Contributor
timestamp: May 18, 2015, 09:26:52 pm
content: Quote from: Kalvin on May 18, 2015, 10:40:56 amI put R2 back and the board layout around the op amp have to be overhauled...

author: technix
author_rank: Super Contributor
timestamp: May 19, 2015, 05:25:19 pm
content: Quote from: bktemp on May 17, 2015, 06:57:33 pmAbout that amp, will TLC2272 cut it?