Dangerous Prototypes

In development => Project development, ideas, and suggestions => Topic started by: bearmos on January 09, 2012, 05:13:14 am

Title: Simple programmable load
Post by: bearmos on January 09, 2012, 05:13:14 am
Here's a link to a *really* simple linear constant current sink i put together:
http://http://twilightrobotics.com/prototyping/constantcurrentsource

This design is about as simple as it gets. . .multi-turn pot controlled and readout done by a voltmeter:)  The good news is that it works quite well for moderate loads. It was put together to regulate current flowing through a copper electroplating tank.  Due to the monstrous Pentium II (or maybe III?) heat sink, it isn't noticeably warm when eating 9A of current.

Here's a shot of the important part of the schematic:
[attachment=1]

Here's a pic of the milled PCBA:
(http://http://twilightrobotics.com/images/stories/constantCurrent/preview/constCurrentCCA.jpg)

As well as one with the ridiculous heat sink mounted:):
(http://http://twilightrobotics.com/images/stories/constantCurrent/preview/constCurrentAssembly.jpg)

Component selection is discussed a bit on the web page - as it is, the components should handle up to at least 15A without issue (I can't remember off-hand what the traces are sized to handle)

Eagle SCH are BRD files:
[attachment=1]

Hopefully someone can get some use out of it - it's served me well so far:)
Title: Re: Itead overload v1.1 unboxing
Post by: bearmos on January 09, 2012, 05:16:55 am
hmmm...just realized this probably should have been included over here (http://http://dangerousprototypes.com/forum/viewtopic.php?f=19&t=2339&p=22873&hilit=+constant+current#p22873)...sorry about that - feel free to move it. . .
Title: Re: Simple programmable load
Post by: ian on January 09, 2012, 11:53:25 am
Nice, thank you for sharing. I made a new thread and will post it on the blog too.

This, and studying the overload, makes the current sink seem really easy. I want to whip one up like yours now :)
Title: Re: Simple programmable load
Post by: bearmos on January 09, 2012, 04:21:05 pm
[quote author="ian"]Nice, thank you for sharing. I made a new thread and will post it on the blog too.

This, and studying the overload, makes the current sink seem really easy. I want to whip one up like yours now :)[/quote]

Thanks Ian!  I started out thinking I was going to do full MCU control, etc - then realized that for a simple (purely resistive) load that an op-amp could probably control it directly, so I just fed the voltage on the current sense resistor back to the op-amp - DONE :)

This whole thing can be bread-boarded in a matter of minutes as a low-current proof of concept - and of course components can be reselected for any current range you'd like.  Another simple improvement would be to use the extra op-amp to put some gain on the feedback signal - that way you'd have the entire 0-5V range translated to whatever current range you'd like, while still having the convenience of simple math (multiply by 10) for voltage-current conversion (when reading the voltage across the 0.1 ohm load resistor).
Title: Re: Simple programmable load
Post by: tayken on January 09, 2012, 06:56:10 pm
I just wrote my review for a TI power experimentation board (http://http://www.element14.com/community/roadTestReviews/1209). One of the guys wanted me to test it out under load so I guess I'll go ahead and build this once I get the parts.

Also it is pretty easy to control it by PWM I guess. Dave made a power supply where he uses PWM to set the voltage. I guess I can add that stuff later once I built the manual one. :)
Title: Re: Simple programmable load
Post by: bearmos on January 10, 2012, 05:06:22 am
[quote author="tayken"]I just wrote my review for a TI power experimentation board. One of the guys wanted me to test it out under load so I guess I'll go ahead and build this once I get the parts.[/quote]
Interesting - I wonder if  this a result of TI's acquisition of National.

I took a quick look at the dev kit and noticed it stated that it had an active load on board:
Quote
The kit contains a 2-rail DC-DC evaluation board using TI PowerTrain™ modules, on-board digital multi-meter and active load for transient response tuning.
I guess the on-board load is for transients only and can't sustain a load for long periods?  If you're planning on using this as a spring board for something a bit more dynamic, you should just be able to replace the POT with a DAC (or PWM channel with an RC circuit - or just straight PWM if you don't care about the transients (kind of defeats the point of having a linear load though;-)). 

If you're planning on logging actual current, there is an unused op-amp on-board already - it would be a good idea to re-purpose the channel as a non-inverting input, scaled to whatever current you plan on sinking.  Currently, the output is 0-1V for 0-10A (which looks to be the range of the C2000).  If you were planning on running between 0 and 10 amps and you ADC reference voltage is say, 3.3V, you'd want to configure the unused op-amp to scale the feedback voltage by 3.3 before it goes into the ADC - to maximize the scale.  My apologies if all this is obvious to you already, tayken:)

Also, kind of ironic you were having power problems with a board for demoing power supply circuitry. . .
Title: Re: Simple programmable load
Post by: tayken on January 10, 2012, 04:58:46 pm
[quote author="bearmos"]I guess the on-board load is for transients only and can't sustain a load for long periods?  If you're planning on using this as a spring board for something a bit more dynamic, you should just be able to replace the POT with a DAC (or PWM channel with an RC circuit - or just straight PWM if you don't care about the transients (kind of defeats the point of having a linear load though;-)).  [/quote]
I guess so. I've never tried it with long periods, just some short trials (a few mins tops). Did you check out EEVblog? Dave was making a voltage-current source. I'm planning to use PWM+some filtering. Actually for starters I can just use it manually with a single turn pot to test transients. This is what I need initially.

[quote author="bearmos"]If you're planning on logging actual current, there is an unused op-amp on-board already - it would be a good idea to re-purpose the channel as a non-inverting input, scaled to whatever current you plan on sinking.  Currently, the output is 0-1V for 0-10A (which looks to be the range of the C2000).  If you were planning on running between 0 and 10 amps and you ADC reference voltage is say, 3.3V, you'd want to configure the unused op-amp to scale the feedback voltage by 3.3 before it goes into the ADC - to maximize the scale.  My apologies if all this is obvious to you already, tayken:)[/quote]
I can get the current from the buck converters, they have made that available on the GUI. I was planning to do a level conversion but thinking about 0-3 V for 0-10 A as it gives me some headroom if I accidentally go out of specs. I was not aware that there is another op-amp available on there, that can help. Just one question: Why did you put a 0 ohm resistor between op-amp and FET? And I thought you had to include a resistor between gate and ground while using FETs, I guess you can do without it.

[quote author="bearmos"]Also, kind of ironic you were having power problems with a board for demoing power supply circuitry. . .[/quote]
It was frustrating. I was furiously probing every connection to find the problem. I still don't know it yet.
Title: Re: Simple programmable load
Post by: bearmos on January 10, 2012, 05:44:09 pm
[quote author="tayken"]I was not aware that there is another op-amp available on there, that can help[/quote]
Yep - check out the lower left hand corner of the schematic, it's got  a bunch of resistors around it to bias the inputs, as well as a feedback resistor - you'll just need to populate the right ones with the correct values.  Also, there is no connection between the power resistor and the input of that op-amp - the extra amp is pretty much just floating in space, so you'll need to add routing for that signal when you modify the PCB, as well as a convenient place to grab the output.

[quote author="tayken"]Why did you put a 0 ohm resistor between op-amp and FET?[/quote]
Mainly in case I wanted to hack the board to be a PWM driven load (instead of linear), a resistor can be placed (instead of the shunt) to reduce ringing on the gate.

[quote author="tayken"]And I thought you had to include a resistor between gate and ground while using FETs, I guess you can do without it.[/quote]
I imagine this is just a pull-down resistor - probably included just to keep an n-channel FET from turning on during start-up if you have an MCU with pins initially configured as high-impedance in the mix - just a guess.  If this is something that is standard - I'd like to be corrected:)

[quote author="tayken"]Did you check out EEVblog? Dave was making a voltage-current source.[/quote]
I've seen EEVblog before and I like a lot of the projects Dave does - I think he did a similar load (originally based on a more complicated battery performance logger I think).  If I ever need something more flexible I'll have to check out his voltage/current source (I think MickM may have referenced this in the DP forum (http://http://dangerousprototypes.com/forum/viewtopic.php?f=19&t=2339&hilit=load#p22711) already).  Honestly, I don't really sit down and watch an entire episode too often (this isn't anything specific to EEVblog, it's very good) - I'd just rather read an article and scribble notes on it :).  I tend to absorb the useful bits a bit better if they're in writing.  I always mean to sit down and watch a couple of his episodes, I just never seem to get around to it. . .
Title: Re: Simple programmable load
Post by: tayken on January 10, 2012, 06:14:05 pm
[quote author="bearmos"]Yep - check out the lower left hand corner of the schematic, it's got  a bunch of resistors around it to bias the inputs, as well as a feedback resistor - you'll just need to populate the right ones with the correct values.  Also, there is no connection between the power resistor and the input of that op-amp - the extra amp is pretty much just floating in space, so you'll need to add routing for that signal when you modify the PCB, as well as a convenient place to grab the output.[/quote]
Oh, now checking the actual schematic, I see it. That is really nice.

[quote author="bearmos"]I imagine this is just a pull-down resistor - probably included just to keep an n-channel FET from turning on during start-up if you have an MCU with pins initially configured as high-impedance in the mix - just a guess.  If this is something that is standard - I'd like to be corrected:)[/quote]
Just a 1M ohm pull down resistor. I guess you are right about high impedance, as I've just seen them with either microcontrollers or simple push buttons.
Title: Re: Simple programmable load
Post by: bearmos on January 10, 2012, 06:25:29 pm
[quote author="tayken"]Just a 1M ohm pull down resistor. I guess you are right about high impedance, as I've just seen them with either microcontrollers or simple push buttons.[/quote]

It might be worth while to note that I haven't watched the transient response of this circuit during power up - so no guarantees there.  I wouldn't expect there to by any issue since the voltage into the op-amp is always at a known state.  I power it on at 0A (POT counter-clock-wise), then increase it to whatever current I need.  The ATX supply I'm using gets concerned that it is shorted if it has too much of a load during power-on.
Title: Re: Simple programmable load
Post by: bearmos on January 13, 2012, 05:27:54 am
[quote author="tayken"]Why did you put a 0 ohm resistor between op-amp and FET?[/quote]
There's also a bit of a potential issue here with gate capacitance and the stability of the op-amp.  The gate of the FET has some parasitic capacitance, op-amp's generally don't like driving capacitive loads.  To get around this, a resistor can be placed in series with the output.  If you take a look at page 13 of the MCP6292 datasheet (http://http://ww1.microchip.com/downloads/en/DeviceDoc/21812e.pdf) you'll find this graph:[attachment=1]

The input capacitance of the IRLB873 MOSFET (http://http://www.irf.com/product-info/datasheets/data/irlb8743pbf.pdf) is given on page 2 of it's datasheet as 5110pF:[attachment=0]

From these two pieces of information, it actually looks like an 11.5 ohm resistor would be ideal (not my original 0 ohm resistor).  So, if you wind up using the same components, add in a bit of resistance and you might avoid some potential headaches with oscillations on the output of the op-amp.

If anyone with a better explanation of this is reading, please chime in, I haven't ever delved too deeply into MOSFET drive design (although I'd like/plan to eventually).  There could also be a really good conversation about op-amp phase margin and loop stability here, since that's what we're trying to maximize/guarantee (I'm, unfortunately, just more of a digital guy that has a deep respect for true analog design engineers:)).

Here are some related references:
* http://http://ww1.microchip.com/downloads/en/appnotes/00799b.pdfMIcrochip App note on choose gate drivers for MOSFETS (this talks a bit about resistors used to limit peak current, which reduces EMI (ringing on the gate) - page 5
*http://http://www.irf.com/technical-info/appnotes/mosfet.pdf Explanation on the "real" parameters of power MOSFET's. It gets into gate charge and capacitance on pages 9-11
*http://http://www.analog.com/static/imported-files/tutorials/MT-033.pdf App note that describes phase margin and stability (pg6)

So, any thoughts? (if anyone made it to here. . .that was a lot longer than I intended. . .)
Title: Re: Simple programmable load
Post by: Zuph on January 18, 2012, 01:55:17 pm
I'm working on a nearly identical, but more complicated programmable load. I intend to include voltage and current sensing, fed back into an AVR controlling the load. A teeny scripting engine on top will allow the user to program various loads and duty cycles.
Title: Re: Simple programmable load
Post by: bearmos on January 18, 2012, 02:15:22 pm
Hi Zuph, welcome to DP!

[quote author="Zuph"]I'm working on a nearly identical, but more complicated programmable load. I intend to include voltage and current sensing, fed back into an AVR controlling the load. A teeny scripting engine on top will allow the user to program various loads and duty cycles.[/quote]
Sounds like fun, there are quite a few discussions here on various programmable loads if you're interested.  Also, feel free to start a project log if you'd like - there are lots of people that will provide great feedback here!  This one was quickly whipped up to complete another project, which was part of another project, etc etc:)
Title: Re: Simple programmable load
Post by: ian on January 18, 2012, 03:18:15 pm
Yes, we happen to have a little one up our sleeves too :) This uses a 12bit DAC to set the current. The second opamp is for current sensing. Voltage measurement would be good too, but we are out of pins.
Title: Re: Simple programmable load
Post by: bearmos on January 18, 2012, 03:35:57 pm
[quote author="ian"]Yes, we happen to have a little one up our sleeves too :) This uses a 12bit DAC to set the current. The second opamp is for current sensing. Voltage measurement would be good too, but we are out of pins.[/quote]
nice.

Some comments/questions after a cursory look:
1 The thermistor is certainly a worth-while addition for a "user safe" version:)  Although the heat sink on mine is so over-sized it doesn't seem to be an issue for me.
2 Are those bananna plugs? - again, nice
3 Why no values on the components?
4 I assume R4 is of sufficient power rating for it's value?
5 May also want to double check thermal dissipation ratings for the resistor (this becomes an issue for my design up around 20A - yes I realize Q1 is rated at 5A).
6 If you had the I/O, I would probably add a line to control the FET with PWM in case your don't need a truly linear load and want to sync higher current with lower heat - not sure if this pic even has PWM though - and you don't have the I/O:)

weird, couldn't get the bullet-ed list markup to work properly. . .
Title: Re: Simple programmable load
Post by: ian on January 18, 2012, 05:05:29 pm
R4 is somewhat in flux. It could be a barrel, heat-sinked type like the itead overload, or the to-220 type like you used. Still checking parts.

I'm really only aiming for 5A of load in v1. It is just to learn the basics and maybe make a usable board. I would just live with my overload, but the LCD is shot and it barely works.

No values on many parts because it is just a circuit sketch, we still need to figure out exactly what values to use.
Title: Re: Simple programmable load
Post by: arhi on January 18, 2012, 05:14:25 pm
There are some mchip mcu's with "lcd driver", I never used those but with some fairly cheap lcd's floating around (100+ * 200+ pixels, some color..) it might be a good idea to use those... anyone with some experience?
Title: Re: Simple programmable load
Post by: bearmos on January 18, 2012, 05:23:52 pm
[quote author="ian"]R4 is somewhat in flux. It could be a barrel, heat-sinked type like the itead overload, or the to-220 type like you used. Still checking parts.

I'm really only aiming for 5A of load in v1. It is just to learn the basics and maybe make a usable board. I would just live with my overload, but the LCD is shot and it barely works.

No values on many parts because it is just a circuit sketch, we still need to figure out exactly what values to use.[/quote]

The only thing to watch out for would be wire-wound resistors (this seems to be the underlying composition of most "barrel" types.  Wire-wound only matter because they'll add inductance - but this only matters if you're using it dynamically.  Motor applications generally advise against wire-wound resistors for current sensing because of this.  Again, not really sure what all the possible use cases will be.  Also, if you want to pulse the FET with PWM instead of driving it linearly this additional inductance could potentially cause some issues.  I haven't designed a PWM-based load, personally, so I'm just thinking out loud here.  . .
Title: Re: Simple programmable load
Post by: bearmos on January 19, 2012, 04:19:07 am
[quote author="arhi"]There are some mchip mcu's with "lcd driver", I never used those but with some fairly cheap lcd's floating around (100+ * 200+ pixels, some color..) it might be a good idea to use those... anyone with some experience?[/quote]
I've seen them, but that's about it.  I often wonder how specialized something like this is though - as well as how longer-term sourcing/pricing winds up comparing to "normal" MCU's - although, then again, what's "normal" mean anyway. . .
Title: Re: Simple programmable load
Post by: arhi on January 19, 2012, 10:03:37 am
well they are microchip so I would not worry about sourcing/pricing ... they are part of the normal pic mcu set ... I just never used them so not sure how the hack the "lcd driver" works