Here is what we came up with for a programmable dummy load.
*PIC18F2550
*MCP4725 I2C 12bit DAC
*USB and UART
*Fuse
*2x16 HG44780 LCD..
*30V and 3A(probably more)
This is our initial test version, If you have any suggestions for future versions, plz leave them here.
Interesting work, few questions
- why not use poly-switch instead of glass fuse?
- why not use few 2W resistors instead of one to220 resistor? few 1% 2W are way more precise and way cheaper then precise low value to220 one (yes they take bit more board space but...)
- why not measure input voltage too? Without input voltage monitoring it's not nearly as useful.. almost all load's have input voltage monitoring feature (both ones from ITead for e.g.), for any case where I use electronic load one without voltage measurement is unusable..
- why lm358? Input offset is up to 7 mV !! Since most of the use with this devices is in the low current range that might be an issue
Some suggestions
- programmable or selectable gain op-amps
- microCurrent schematic from Dave (eevblog) for low end of the measurement scale
[attachment=0]
here is one i have been working on its super simple and not meant to exceed 2.5mA but could be adjusted for higher currents.
If you already have R1, why you need R2-R5 ?
[quote author="arhi"]If you already have R1, why you need R2-R5 ?[/quote]
r1 is meant for the current sense, r2-5 are the load resistors they are meant to set the full scale current as the npn darlington is regulating the voltage between the emitter and ground, r2-5 should be 1k for a max load of 2.5mA, @ 100 ohm it will max at 25mA
R1 should be 0.1 ohm for 1v/mA
the ts100 current sense amp will not work below ~1.5v that is why it is on the high side.
just add a resistor between the darlington and the op amp output, and you can drive the darlington to ground (remove the 4 resistors, they are superflus)...The op amp will change its output level depending on the difference between the ts current monitor and pot...this lever will increse or decrease on one end of the resistor, the other end of the resistor will always be at around 1-1.2V( the (the be voltage of the darlington)
my 2c...I'd like it to have, other then the already available prog load, input voltage monitoring, and another current and voltage monitor. something to be attached at the input of a PS, to calculate efficiency...also a handy thing would be to add a test pin on the DAC output..
this would allow you to drive the load with a preselected pulse signal, that could also be used as a trigger for the scope...showing you how the V-out changes when the load changes from 20mA to 500mA...in a pulse...
i have yet to bread board this/ at the low currents i can prob get away with a 2n3904.
i don't want to use the current sense resistor as the load resistor for stability reasons.
using a high value resistor on the emitter of the transistor will limit the max current across the transistor.
i'm going to test this today/ ill get back to you with results.
there is no load resistor on your schematic...It only serves the purpose to limit the NPN's base current from the op amp...it has the same function if you place it between the base and opamp as it doeas now...only you can use any cheap resistor and have no load on it...
on other Prog load designs that resistor is at the same time used as a feedback for the op-amp buffer, so the op-amp keeps the level on the resistor at the same level of the other input..Since you are using a different feedback routine...you don't need that resistor at all....the only load bearing device on your schematic should be the transistor...
The current sense resistor will have the exact same stability whether or not you remove those bottom "load"resistor..there will be absolutely no change to the way it acts, or functions...
[quote author="arakis"]The current sense resistor will have the exact same stability whether or not you remove those bottom "load"resistor..there will be absolutely no change to the way it acts, or functions...[/quote]
i will experiment with this, i am curious as to the diffrences
just be sure that if you remove the 4 bottom resistor, you replace them with one between the op amp and transistor...otherwise you could fry the transistor...
i have done some quick testing, i'm using a lm324 instead of an 321
the resistor on the emitter serves 2 purposes
1. to set the max current that the transistor can disparate, considering that i don't want massive currents and only to max at either 250 or 25mA. and could be changed to a single resistor since the resistor won't heat up that much at low currents.
2. most importantly it gives a more linear adjustment of the set current.
i did add the resistor on the base, just siple oversight.
i changed the v+ of the op amp to vbatt as the max output of the opamp is (V+ - 1.5) and was limiting the range.
and changed to a 0.1uf cap on the output of the current sense amp to help stability.
the values could still use some tweeking
[attachment=0]
use rail 2 rail op-amp
to set the max current that the transistor can disparate
You do that with base resistor. Max current trough collector-emmiter is base-emmiter current * hFE, and you know hFE for your transistor, base-emmiter current you set with the resistor (max voltage that op can output - 0.7V drop on the transistor) / base resistor ....
most importantly it gives a more linear adjustment of the set current.
how come?
Note that you are using BJT here and not FET so the current trough transistor is controlled by current trough base, not like with fet with voltage on "base"
I have a few thoughts:
You've placed single headers underneath the LCD footprint, I assume these are mainly for testing and debugging, but why not place then out from underneath the LCD. Might save you some trouble down the line.
The LM358 might not work well with lower voltage input, eg testing a 3v supply with 1A
a rail to rail would be more expensive, but would probably help immensely. Microchip have a bunch of really cheap 5v ones.
Not sure why that source trace has to be so large coming back from the FET. All the current should be going through the resistor. Unless it's just to reduce resistance...
figured it out, to much delay in feedback loop, and it turned into an oscillator.
update:
the resistor just made it harder to notice oscillation, it was basically acting like a switching regulator.
i need a cc source capable of regulating in the 1uA range for some testing. i can do away with the current sense amp and go conventional, plus it will cost less.
the 385 is a place holder for a 385LVM (?) or other cheap R2R op amp. TI's R2R version of the 385 was cheapest at mouser as I recall, but there were a number of soic-8 compat opamps available so we cheated an put the 385 footprint on the prototype :)
Sorry for the sort of thread jacking, but Ian, what footprint is that for the rotary encoder?
I have some encoders with button that look just like that footprint, is it custom or is present in the Eagle libs?
Nice project, when I finish my power supply I will look into this.
It's good to see this coming to life.
some suggestions:
-I'd get the NTC as close as possible to the source of the heat - preferrably you'd like it to mount directly on the body of the FET (or resistor, depending on which is going to die first) - haven't looked at it in detail.
-Get rid of the "wagon wheels" on the ground side of the resistor (and especially NTC) so you pass more heat to/from the ground plane and into those devices.
- I second the rail-to-rail amp with low offset
From the looks of things, at this point the feature-set is limited by MCU pins more than anything else.
- why not use few 2W resistors instead of one to220 resistor? few 1% 2W are way more precise and way cheaper then precise low value to220 one (yes they take bit more board space but...)
Really? Maybe this does make sense for lower power ratings (the last time I looked I was aiming for a pretty hefty resistor). I thought $3 was reasonable for the 35W 1% resistor (http://http://parts.digikey.com/1/parts/2038453-res-0-10-ohm-35w-1-220-pf2203-0r1f1.html) I used - and that's even at Digikey's inflated passive pricing. Granted, if your max current is only 3A, we're talking less than a watt dissipated across a 0.1 ohm resistor - so maybe something a little light weight makes more sense here.
There is certainly a trade off to be made between power dissipation of the current sense resistor and the voltage feedback you get from it. (lets get these out of the way. . .) P = I^2*R and V = I * R. The nice low value 0.1 ohm resistor is only going to give you 300mV at 3A. Scaling that for a 5V ADC (haven't looked to see what Vref of the MCU is yet) requires over 16x gain on the op-amp. Assuming the same op-amp is used (with up to 7mV offset error on it's inputs), this error will get amplified to be 112 mV. Assuming 3 amps will be amplified to get a full scale voltage of 5V, we have 600mA/V ( 3 amps / 5 volts). So that 112mV (on the input of the ADC, resulting from the offset error of the op-amp) winds up looking like 67mA of error in the current sensing.
If I even revisit this, I'll definitely be putting an ATX header on the board to get power from a computer PSU.
[quote author="Greeeg"]
Not sure why that source trace has to be so large coming back from the FET. All the current should be going through the resistor. Unless it's just to reduce resistance...[/quote]
??? Kirchhoff says you have the same amount of current going through the fuse, FET, and resistor. Maybe I'm misunderstanding something in the comment.
[quote author="bearmos"]
Really? Maybe this does make sense for lower power ratings (the last time I looked I was aiming for a pretty hefty resistor). I thought $3 was reasonable for the 35W 1% resistor (http://http://parts.digikey.com/1/parts/2038453-res-0-10-ohm-35w-1-220-pf2203-0r1f1.html) I used - and that's even at Digikey's inflated passive pricing. Granted, if your max current is only 3A, we're talking less than a watt dissipated across a 0.1 ohm resistor - so maybe something a little light weight makes more sense here.
[/quote]
I find 1% too low tolerance for a lab electronic load. With 10 resistors you get 10 times the power rating with at least 5 time better precision (if not 10 times the precision too), so 10 2W 1% resistors will be 20W 0.1% and will cost surely way less then 0.1% you can purchase.
Btw low value to220 resistors are seriously tricky to find "originals" that work. I was using some 40W and 50W ones 2R and 4R that were dying out like crazy at 30V (the burn out and instead of becoming open circuit they actually became short) .. after a serious issues with this to220 resistors (and one friend from UK had same experience and 2 other guy's in USA also) I decided never to use them ever again...
I mostly use these ones: http://uk.farnell.com/vishay-dale/rh050 ... dp/1653236 (http://uk.farnell.com/vishay-dale/rh0501r000fe02/power-resistor/dp/1653236) if I don't need more then 1%. They are cheap enough and powerful enough (there's also 80W, 100W ... in similar, only slightly larger package).
If I need more then 1% then I take 10 of something like this: http://uk.farnell.com/multicomp/mcknp0a ... dp/1903960 (http://uk.farnell.com/multicomp/mcknp0asf100kb00/resistor-wirewound-1r-1-10w/dp/1903960) and they work like a charm :D since they are 10W 1% 1R this means that 10 of them gives you 100W 0R1 0.1% ... you can't beat the price. Yes they take bit space on the pcb but who cares... waaaaaaaay better then to220 pieces of ...
[quote author="bearmos"]There is certainly a trade off to be made between power dissipation of the current sense resistor and the voltage feedback you get from it.
[/quote]
Great thing when you use 10 resistors 10W each and 1R each is that you can chose with a fairly simple electronics how many you want to use at any time so you can have sense resistor from 0R1 to 1R. You don't have to make all 10 ranges available, you can make 2 or 3 ranges for low, mid and high current measurements (As you don't care about uA's if you are measuring tens of amps :D )
In any case I strongly recommend not using TO220 resistors. Not all are bad but me and the UK guy were ordering different brand (and different values) from Farnell and both had same failure, the USA guy's were ordering from Digikey, got exactly the same problem. I had another project with TO220 I purchased in local store (noname resistors "made in PRC") that on the other hand worked like a charm ... so .. there's just too high risk of TO220 res not working ok. (we used initially to220 resistors as heaters for reprap print platforms, then I moved to nicr wire + fire cement and others went with pcb heater). Main problem with to220 is not that they fail, problem is that when they do, they don't create open circuit like what 99% of resistors do, but they short out.
Anyhow, the resistor is the smallest problem I see on the design, there's nothing really on that design that seems good to me :(, starting with voltage measurement, if I need to measure voltage with DMM, I don't really need a mcu and display, I will make a resistor + op amp + potentiometer electronic load and add two dmm's to measure current and voltage .. the whole point of mcu and display is to have some useful data there .. this schematic just don't allow you to gather any info other then current .. you get a 4$ amper meter from itead/ebay/any other online store + 4$ voltage meter and add pot + op + fet and you have device that works for 10$ in parts that's more useful then this mcu driven electronic load :(
actually the Resistance tolerance remains the same...example
10% tolerance
R1 and R2 are 10k, parallel connection gives 5K...
11k---5.5k (1.1*5)
9k----4.5k (0.9*5)
the range of values remains the same..
But where this does pay off is statistics.....chances are very low that all 10 resistors you place into a parallel network..will be 11K...thus if you adopt a uniform statistical analysis your actual values will be much lower then the tolerances of one of them....even with Gauss analysis the tolerance would be much better...
But then this is statistics, so there is a chance that you do place all 10 resistor at the same end of tolerance :D
then again there is also a chance that the single resistor is exactly the value it is supposed to be to a 0.000001% :D
Well you always expect a Gaussian distribution so in theory 10 resistors will give you at least order of magnitude higher precision in 90+% cases. I did this many times in my life and every single time I put 10 1R resistors in parallel I was better then 0.1% inside 0R1 and those were 5% cement resistors, not 1% ones !! With 2-3 resistors you can't expect much but when you move to 10 the statistics is just heavily on your side .. you really need to have something serious against the holy blue smoke to not get order of magnitude better precision :)
I'm not so sure you can assume a Gaussian distro. If I were making resistors, my production would end up with just such a distribution, but surely I would test them and sell the ones within one percent as 1%, and the ones that weren't as 5%...
my 2%
a Gaussian distribution will not get you to a perfect value in real life, however it will improve tolerances.
if you want to build something using 10x 1% resistors instead of one 0.1% resistor that costs 10+ times as much as a single 1% resistor, you will probably have very similar results.(unless other factors complicate things) in most cases it is mostly about cost, sometimes about space restrictions, and occasionally about part availability.
engineering's most simple definition is "finding the best compromise for a specific solution"
[quote author="sqkybeaver"]a Gaussian distribution will not get you to a perfect value in real life, however it will improve tolerances.[/quote]
The whole point is in improving tolerances. You will not be spot on but you will almost always end up closer to target value (did it many times, measured each time).
[quote author="sqkybeaver"]if you want to build something using 10x 1% resistors instead of one 0.1% resistor that costs 10+ times as much as a single 1% resistor, you will probably have very similar results[/quote]
In this case (high power resistors) - no it is not true since 10 1% resistors will give you 10 times the power, lower then 1% precision 1/10 the resistance. compared to "single 1% resistor". Now take into account that 10 times the power at same other specs will be probably ~10 times more expensive (actually 6-7 times more expensive) but 1/10 resistance + better precision will always be more then 10 times more expensive. Other then that 10 1W resistors will actually survive way more power then 1 10W resistor in peaks and will always be lot more linear then a regular 10W resistor.
In past many years I spent on the reprap project I built a lot of rigs to very precisely measure current as when testing stepper and servo motor drivers that is a seriously important thing to measure.. and since I have no current probe for my scope I was using all kinds of tricks, and I built drivers that push 1kW and some that push only 1W ...
[quote author="schazamp"]I'm not so sure you can assume a Gaussian distro. If I were making resistors, my production would end up with just such a distribution, but surely I would test them and sell the ones within one percent as 1%, and the ones that weren't as 5%...[/quote]
Even if you do that still some of those 5% will be below and some above the target so when you mix then there's a huge change you will get way closer to the target then 5%, in most cases you'll get it better then 3%
Anyhow about the "measure and paint the good one as 1% and bad one as 5%" story was famous online for a while few years ago.. I actually took a 100pcs roll of 10% el cheapo trough hole resistors marked 10 k 10%. I measured all 100 of them and I got pure gaussian distribution where more then 80% of the resistors were in the +-5% and more then 30% were in the +-1%. If that story was true I'd have a saddle distribution where there would be a gap in the +-1% range, and of course there wasn't one. Recently I purchased 10% 1R 2W resistors and I measured them all and they were all (only 20pcs) better then 1% !!! 1% ones were more then 10 times more expensive :D (ok I know I was just lucky but ..)
[quote author="arhi"]I find 1% too low tolerance for a lab electronic load. [/quote]
Part of the issue here is certainly defining what it is this board is suppose to be used for. I'm certainly not going to suggest getting into requirements definition/decomposition here ;-) that would *definitely* take the fun out of this forum very quickly! I was under the impression that this was mainly meant to simply gain some experience with a programmable load. Granted, for my application, this design won't pull enough current - for yours (arhi/sqlbeaver) it doesn't sound like it will be accurate enough. In reality, I think it's suppose to be a little less targeted and more of a general learning experience - although, as always, I reserve the right to be wrong ;-)
[quote author="arhi"]so .. there's just too high risk of TO220 res not working ok. (we used initially to220 resistors as heaters for reprap print platforms, then I moved to nicr wire + fire cement and others went with pcb heater)[/quote]
With this experience of T0220's, I probably wouldn't use them either. In all fairness though - they really don't seem to like heat, according to the de-rating on the datasheet - so it does seem like they would make poor heaters:
[attachment=0] I have seen plenty of T0220's in service for years running 24 hours a day without an issue - but they were/are kept well within their rated power dissipation.
One of the reasons I had mentioned saying away from wire wound resistors was because they generally have inductance. Taking a look at the datasheet in first link you provided makes mention of
Available in non-inductive styles (type NH) with
Aryton-Perry winding for lowest reactive components
I didn't know these were available, maybe it would be worth-while to look into wire-wound resistors - it is nice that they have built-in heat-sinking (to a certain degree). One of the main reasons I was suggesting staying away from wire-wounds was in case someone wanted to use this to test pulses - the additional inductance may wind up throwing things off a bit - I've seen advisories in stepper drives for staying away from wire-wound current-sense resistors for this reason.
[quote author="arhi"]
Great thing when you use 10 resistors 10W each and 1R each is that you can chose with a fairly simple electronics how many you want to use at any time so you can have sense resistor from 0R1 to 1R. You don't have to make all 10 ranges available, you can make 2 or 3 ranges for low, mid and high current measurements (As you don't care about uA's if you are measuring tens of amps :D )[/quote]
Hadn't thought of this - I like the idea!
[quote author="arhi"]
Anyhow, the resistor is the smallest problem I see on the design, there's nothing really on that design that seems good to me :(, starting with voltage measurement[/quote]
I'm guessing this was a matter of running out of pins.
[quote author="arhi"]the whole point of mcu and display is to have some useful data there .[/quote]
Lots of people do seem to like things that go blinky blink though ;-)
Interesting that you say these resistors go Short instead of open. I use these occasionally and haven't experienced that, but then haven't had any fail either. Were the ones you used thick film ceramic substrate types with insulated cases or the metal backed normal TO220 types? I use Vishay or similar. I may plonk one across a decent PS and cook one, see how it reacts. I've had normal carbon film and metal film 1/4W go short before - very rare, but I've had it. In one case I had a carbon 1/4W which was near dead short, yet had no visible signs of damage at all!
[quote author="bearmos"] Lots of people do seem to like things that go blinky blink though ;-)[/quote]
Yeah! you should design it with a big panel of 100's of nice blinking filament globes that do absolutely nothing, just like a 50's / 60's B grade sci-fi movie! :D
[quote author="bearmos"] I'm certainly not going to suggest getting into requirements definition/decomposition here ;-) that would *definitely* take the fun out of this forum very quickly! [/quote]
It's not too much fun to make something without any idea what is that you are making ... not having requirements... Now if this was the first open source / open hardware electronic load project it would make some sense but there are already 2 very good electronic load projects (both way better then this one, one based on '51 other on arduino..) .. I understand if we wanna upgrade those, make something better ...
[quote author="bearmos"]With this experience of T0220's, I probably wouldn't use them either. In all fairness though - they really don't seem to like heat[/quote]
They were supposed to hold the temp at 50C that is not too hot. The major problem was they way they failed not that they failed.
[quote author="bearmos"]
I'm guessing this was a matter of running out of pins.
[/quote]
so either a wrong mcu was chosen or pins were used for something that's not as important. I'm sorry but voltage is important feature on the electronic load, ability to change backlight brightness trough firmware ain't.
[quote author="Sleepwalker3"]Were the ones you used thick film ceramic substrate types with insulated cases or the metal backed normal TO220 types? [/quote]
They were both with metal tab (not the black insulated one) and with black insulated tab's (no idea if that black tabs are ceramic or just painted metal), metal ones were 2R2 IIRC and black ones were 14R and I got them from element14/farnell. Others got them from other suppliers, other brands and some were 22R, some 47R. Not sure what brand were the ones others used, I used Vishay ones.
the one i am building is for my own use, extremely low current testing, when boards are made there will be a few i can give out.
i'm going to use an sot23 transistor and it will only handle 100ma or so.
I'm personally satisfied with overload (since I fixed it). The only 2 issues I have with it are
- I want one more current and voltage reading (so I can measure in/out current)
- I want to use DAC instead of POT for the load current set value (no idea why ITead went with POT here when their old version with '51 uses DAC)
so I will be making a new electronic load just because of that. I might add "ranges" etc ... in any way I think I will go with at least 2 separate boards (one board with load resistors + switching transistors for few ranges, and another board with logic, io ... not sure where to put FET taking the load, probably with load resistors..)
Btw, I measured now the inductance of the 2R2 50 W and 100 W resistors (100 W are Tyco,50 W ones are Vishay) and they are below 1uH
Some pictures:
For a MySQL cluster engineer, you have really nice electronic equipment. :D
that is normal and actually expected... when you spend money on hobby you don't calculate if you really "need something" and "how fast would it pay itself" ... I'd never purchase something like this LCR if electronics was my "work" and not my "hobby" but I'd get some 100-200eur hand held one that "gets the job done" and that would "pay itself in a year" ... but when you purchase stuff for a hobby, the only characteristics are "how bad you like it" / "how much fun it is" and "can you afford it". Since it's a "lot of fun" and I "could afford it" I purchased it ..
Now I'm waiting for a good FLIR camera that I can afford ..
[quote author="arhi"]
They were supposed to hold the temp at 50C that is not too hot. The major problem was they way they failed not that they failed.[/quote]
I didn't realize the reprap heated beds were only 50C. Given the example I was using, the resistor would only be derated to 80%. Failing shorted does create a bit of an issue if things aren't fused though.
[quote author="arhi"]Btw, I measured now the inductance of the 2R2 50 W and 100 W resistors (100 W are Tyco,50 W ones are Vishay) and they are below 1uH[/quote]
Cool, I was definitely expecting something higher given the big deal that datasheet was making about avoiding them. 1uH doesn't seem too bad - I wonder what the numbers would look like for generating current pulses and what induced voltages would be (again, not sure what exactly this programmable load is going to be meant/expected to do - long term).
[quote author="bearmos"]I didn't realize the reprap heated beds were only 50C. Given the example I was using, the resistor would only be derated to 80%. Failing shorted does create a bit of an issue if things aren't fused though.[/quote]
Initial tests with resistors. Mine machine for e.g. goes up to 140C now on start and drops to 70C during print. Ambient temp is 70C also so .. it's more then 50C now... but those tests when they "blew up" were up to 50C
[quote author="bearmos"]Cool, I was definitely expecting something higher given the big deal that datasheet was making about avoiding them. 1uH doesn't seem too bad - I wonder what the numbers would look like for generating current pulses and what induced voltages would be (again, not sure what exactly this programmable load is going to be meant/expected to do - long term).[/quote]
you can see the measurement data on the display of that lcr ... under 1 uH on 10 kHz. On 1 kHz the inductance is bit higher, around 1.1 uH... but that's still too low to make it count for electronic load. And these resistors are a piece of wire wound on a ceramic case, and then sealed in the aluminium block with cement. I don't have any more TO220 ones to do the test (threw them all away after series of issues I had with them) but I assume they are made differently (not wound wire but some other material). What I remember was that TO220 were less stable on temperature then these ones I use now - don't remember where I read that and might be wrong so don't quote me on that :) but it can have something to do with material. If they are made out of filled ceramic they are surely not able to keep steady resistance over high temp range