Electronic Load Build Log - Page 1
Forum section: electronics / projects

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 03, 2013, 02:59:06 pm
content: Hi Everyone,Thought I would share a project I've been working on lately. I have been needed a load tester for some time, but I've been getting away with things like thisYeah, that's just a lot of power resistors mounted on a fanAnyway, I want to build this new load based on what parts I already have, the goal is not a precision instrument. But something better and easier to use than a lot of power resistors.Basic schematic, very simple:The use of LM358 will probably not let me go all the way down to 0mA, but that is fine for my use. And the IRL2203 is because I had a few of them from another project, should work fine for this project.I will use a 20x4 (HD44780 based) LCD display and a PIC24 micro, here a quick test setup for the control part:I'm aiming for 40-50W continuous and slightly higher short term. Low voltages only, maybe up to 20V, and features like constant current, constant resistance and constant power. I could do constant voltage as well, but I don't really like that feature. Also I'll try add some pseudo random noise feature.I have decided on 1 encoder to set the modes and values, and 2 buttons, one for selection and one to start and stop the load. Plus a single LED to indicate if the load is on or not.A low voltage cut out and a mAh counter would be handy for battery testing.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 03, 2013, 03:19:42 pm
content: I made the PCB as single sided, it's routed using my DIY cnc router, it's not so fast so it takes some time, but the results are good:It will be all old school through hole. I also added a USB connection using the standard FTDI uart to USB converter. (they only come in SMD packages, so I'll have to use a small converter board)I have some tinning solution, but I'm not going to bother. Instead I just cover all the copper using a flux pen right after cleaning the board.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 03, 2013, 03:56:33 pm
content: Populated board with some components for a quick test run, just to see how many mistakes I madeI use an LM35 to measure the temperature of the MOSFET, I would have just used a 10K thermistor, but I could only find some LM35 in my collection.Initial testing went well, only had to adjust a few resistor values.One thing to note is that I'm not protecting the micro's ADC inputs, ideally they should be protected, I don't think they will survive if the input voltage goes much above 3.3V. Anyway I hope I can get away with just adjusting the gains to safe levels.For cooling I will use one of these CPU fans that comes with all Intel CPUs, I never use them in my PCs, but they are nice little units, so I thought perfect for this projectThis is the reason I added 4 extra holes in the board. It will be nice and compact.I have added a 4 pin header with PWM to control the fan RPM proportional to the MOSFET temperature. Very simple, just a small transistor controlled by one of the IO pins. Fan got internal pull up.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 03, 2013, 05:39:16 pm
content: Fully assembled main board:I have been a bit lucky on heatsink clearance in a couple of places, but it's all good with at least a couple of mm space to USB socket. I did add a small piece of kapton over the mosfet for isolation, but I might remove that again for better heat sinking. No danger the heat sink will touch anything.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 03, 2013, 07:03:13 pm
content: Testing and writing code:I decided on ~26kHz PWM as it works for both fan and control. Gives me about 10.5 bits resolution.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 03, 2013, 08:17:37 pm
content: Display layout (Load not enabled)The actual mA should be 0, but as expected it will not go that low, 20mA minimum is fine for my use.Quick view of the various modes I have implemented so far:Current:Resistance:Power:At 40W it settles around ambient + 25C. While the MOSFET says max 175C (junction) in the datasheet, I don't think it's safe to run it much hotter than 70-80C (case) in the TO220 package. So I've added a safety cut off that will trigger at 60C.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 04, 2013, 02:06:27 am
content: Time to get everything into a nice case:Just enough space for the display:

author: george graves
author_rank: Super Contributor
timestamp: August 04, 2013, 03:09:01 am
content: Very nice Well done!Is it open source? Details? Schematics? Source code?I'm debating building something like this or buying one.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 04, 2013, 03:51:05 am
content: Quote from: george graves on August 04, 2013, 03:09:01 amThanks GeorgeIt's not quite finished yet. I'm working on the case right now, I hope to complete it this weekend.There isn't really much involved in building a basic one like the one I've made here. For a full design to be shared/published I would probably want to change a few components. This one is build purely based on parts I already had lying around

author: quantumvolt
author_rank: Frequent Contributor
timestamp: August 04, 2013, 04:06:03 am
content: Very useful build. Something I think a lot of people here (including me) could use, but do not prioritize to buy.Please explain how to set the different modes and a little bit about the program loop, PWM control and measurements/calculations to the display.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 04, 2013, 12:53:16 pm
content: Quote from: quantumvolt on August 04, 2013, 04:06:03 amYeah it is one of those devices that is nice to have, but if you have to buy one they seem to start around $500+. Of course much better specs than what I'm doing here, but still a lot of money if it's only for occasional hobby use.I'm building this one primarily because I need one I can control from my PC to do automated measurements of a few buck converters I'm playing with. I got tired of doing it manuallyI remember Dave did an episode on a very basic constant current load some time ago, if you haven't watched it, you should check it out.The code really depends on what micro you choose. I'm using a PIC24H (3.3V) because I had some already. I run it using it's internal oscillator at ~80MHz (~40MHz instruction clock) it's a bit overkill, but it does allow for a higher frequency PWM (26KHz) with more than 10 bits resolution, which also fits nicely with the PC fan PWM spec of ~25kHz for the 2nd PWM.I use 2 interrupts for the rotary encoder and just polling on a timer loop for the buttons. The same timer is used for sampling the ADCs and doing some rolling averages to smooth things out a bit. Plus things like fine adjustment of the PWM, checking temperature, low voltage, overload etc.All the main loop does is updating the display at regular intervals.For different PWM frequency you would probably need to adjust the passive low pass filter. And set the attenuation based on the load resistor value and desired max A. Once you know the max load/voltage over the load resistor, you can set gain on the sense opamp (not shown in basic schematic) to match your ADC reference.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 04, 2013, 01:05:25 pm
content: Time for the front panel, these are the posts, knobs and buttons I have:I think the layout will end up something like this:

author: robrenz
author_rank: Super Contributor
timestamp: August 04, 2013, 01:45:52 pm
content: Very nicely done and great pictures.I would be interested in your code if you have any plans to share it. I have abipolar power supplyand I want to make a module to control it as an Eload in CC, CV, CR, and CW modes. looks like your code would save me a lot of work and learning curve.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 04, 2013, 07:11:51 pm
content: Quote from: robrenz on August 04, 2013, 01:45:52 pmThanksThose are some very cool power supplieswhat kind of voltages does it take to control the sinking current?Almost finished my electronic load, but unfortunately I had a minor setback. I was being a bit lazy and wanted to temporarily use one of these little regulator boards for the 3.3V and 5V supplies and then just feed the unit from a 12V supply.But I should have measuredthe voltages before connecting it, what should have been 5V turned out to output 12V instead, probably a short on the board, never used it before. Now it's in the trash.So yeah, the 5V was for the display logic, it didn't like 12V. Now I need to get another display, hopefully I'll get a chance to pick one up next week so I can complete this thing and start using it.In the meantime I'll put together a working regulator board

author: robrenz
author_rank: Super Contributor
timestamp: August 04, 2013, 07:40:38 pm
content: Quote from: jaxbird on August 04, 2013, 07:11:51 pmDefault is 1V per amp and 0.5V per V but both are adjustable with an external resistor.

author: bug13
author_rank: Regular Contributor
timestamp: August 04, 2013, 08:58:10 pm
content: Very nice project.I am interested to know the ripple current in constant current mode, how does your device perform?Thanks for sharing.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 06, 2013, 12:05:58 am
content: Quote from: bug13 on August 04, 2013, 08:58:10 pmThanksI'll try do some measurements on it at various loads when I have it completed. So far I've only checked that it doesn't oscillateI don't expect the PWM to create much ripple, it runs at 26kHz and the low pass filter is fairly aggressive, but also somewhat slow, I think the rise time is as high as 10ms+ for full scale.Cheers

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 06, 2013, 02:32:08 pm
content: Quote from: robrenz on August 04, 2013, 07:40:38 pmI had a quick look at the datasheet you posted, it sounds like there is an RS232 port available for remote control. If that's the case then it should be very easy to add some nice features to those supplies.

author: robrenz
author_rank: Super Contributor
timestamp: August 06, 2013, 02:38:20 pm
content: Mine do not have that option. I have the schematics for the control boards but would still require re-creating their code and that would be way more work than just building your control/display system and driving them with a control voltage and . I think just using your control loops and interface to drive the BOSS would be easier.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 11, 2013, 09:09:42 am
content: Quote from: robrenz on August 06, 2013, 02:38:20 pmAlways good checking.. would be a bit of a Doh moment finding out that it could all be done over RS232 after building a complete analog circuitI guess it comes down to what ambitions you have on speed and precision, it wouldn't be hard doing something simple with an ADC capable micro reading the input voltage and then generate a control voltage based on settings to control the "PSU" load.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 20, 2013, 01:18:42 pm
content: Finally had a chance to pick up a new display after my mishap with the cheap regulator board giving out 12V on the 5V connection.Also built a new regulator board for 12V, 5V and 3.3V, just plain LM317 based, with a bit of extra filtering as my plan is to power it from a small 12V switchmode supply.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 20, 2013, 01:35:33 pm
content: After a lot of drilling and filing I got everything in place on the front and back panel:Takes a bit of time to make all the holes, luckily the front is just aluminium:And the back:The front looks a bit rough, so I'll try see if I can make a nicer looking front plate for it.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 20, 2013, 02:16:53 pm
content: I'll attempt to 3D print a front panel, it's a bit too wide for my printer, so I have to make it in 2 pieces.It should end up looking like this (well, except I'll print it in some white PLA)

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 20, 2013, 02:43:24 pm
content: Printing in progress (around 50% complete)Takes almost 30 minutes to print a couple of small pieces like these.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 20, 2013, 03:13:41 pm
content: And it's complete:IMO it looks much cleaner with the new front.Still a bit of work left to implement the USB/UART interface protocol, but it should be fairly simple, just need something to set the mode, values, enable/disable load and read all the measurements back.

author: hammy
author_rank: Unknown
timestamp: August 20, 2013, 09:34:50 pm
content: Thats a fine piece of work!

author: robrenz
author_rank: Super Contributor
timestamp: August 21, 2013, 12:50:12 am
content: +1

author: shailesh3t
author_rank: Regular Contributor
timestamp: August 21, 2013, 04:51:36 am
content: Hi i would like to know how did you match the output current to the setting pointam too building a dummy load using an arduino had it working but i have some oscillation on the mosfet i thinkthanks \shailesh

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 21, 2013, 07:06:40 am
content: Quote from: hammy on August 20, 2013, 09:34:50 pmQuote from: robrenz on August 21, 2013, 12:50:12 amThanksI think I'll implement the USB/UART commands as something simple like this:Command: Description:@MC# Set Current Mode (Value is mA)@MR# Set Resistance Mode (Value is Ohm)@MP# Set Power Mode (Value is W)@MN# Set Random Noise Mode (Value is mA)@START# Enable load@STOP# Disable Load@SV0000.00# Set Value (mA, Ohm, W depending on mode)@SC00.00# Set cut off voltage (Value is V)@READ# Returns mode, state and readings@HELP# Returns list of commandsI did have to slightly revise my ground routing in a few places. I guess I was being a bit optimistic when I did the single layer board. Precision improved with some star like grounding using a few extra wires.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 21, 2013, 07:29:31 am
content: Quote from: shailesh3t on August 21, 2013, 04:51:36 amHello, I am not 100% sure I understand the question, but this is how I do sampling and adjusting the duty cycle.I attenuate the input voltage so it fit's within the range of the ADC e.g. 30V => 3V, mine is max 25V input. I've set the attenuation of the PWM to give me a max of ~6000mA and then with a 0.1R shunt I know the voltage over that resistor will be 100uV per mA, then I amplify the voltage over the shunt to match the scale of the 2nd ADC for current measurements.The sampling, averaging and duty cycle adjustments are done on a timer interrupt that runs at 1kHz. The samples are averaged using 20 running averages.The duty cycle is adjusted by a line of code something like this:Code:targetPwm += ((targetCurrent - lastCurrent) * 0.005);This gives a nice self adjusting duty cycle without oscillation or overshoot.Note: targetPwm is not the duty cycle, it is the on time.If you have problems with oscillation, check that you have a configuration of the driving opamp and MOSFET similar to the one I posted in my partial schematic in one of the first posts. (Couple of resistors and a small capacitor) Power MOSFETs have significant capacitance on the gate.

author: dr_p
author_rank: Frequent Contributor
timestamp: August 21, 2013, 07:55:53 am
content: Nice, happy to see you putting all that equipment to good use.Minor suggestion: you could print (regular 2D) the front panel text and graphic labels on a transparent foil (mirrored on the back of it). Transparent paper is available in inkjet or laser variety. You then mask the LCD position with a temporary rectangular sticker and spray it all with white paint (also on the back side). Remove the sticker and you have a white background with text on top and a window for the LCD. Just glue it in place or cut it to go under the edges of the enclosure.Also, FWIW you can mount LCDs and other stuff directly on the enclosure's metalic/plastic front panel with sunken screws that get covered by the previously mentioned transparent panel.

author: shailesh3t
author_rank: Regular Contributor
timestamp: August 21, 2013, 08:18:30 am
content: Thanks jaxbird for the explanation,i will try to make a video and post it in a new post , else its a very nice one u made ,mine am using INA 219 to read the current and voltage out of the shunt, and am Using dac 4725 to set the voltage on op amps followed by the mosfet,

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 21, 2013, 11:34:24 am
content: Quote from: dr_p on August 21, 2013, 07:55:53 amSure, no point in building a small CNC and 3D printer if I wasn't going to use themQuote from: dr_p on August 21, 2013, 07:55:53 amThere are many ways to do this, this one I did the 3D printed front because the raw front didn't look so great with the display sticking out from behind and everything. I did consider adding some text, but I don't really need it. I could 3D print some letters and use hot air to melt them on there, but I like the look as it is.In my experience the best way I can make nice front plates is to use a piece of sign material (the stuff with a different color layer on top), then CNC engrave the text. That looks really great. I have also done a few really fancy ones in painted acrylic and then engrave and add some LEDs and the artwork/text will light up when switched on.

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 21, 2013, 11:41:39 am
content: Quote from: shailesh3t on August 21, 2013, 08:18:30 amYou can do the same kind of continuous feedback adjustment with a DAC. Anyway, looking forward to see your build.If I build another one I would probably make a few changes like using a small transformer for power supply, use some better opamps and be a bit more careful with my ground. Probably I would also use 2 MOSFETS instead of just one. And of course I should really isolate the USB from the device. But overall I'm pretty happy with the performance and features, it is a very useful little device.

author: shailesh3t
author_rank: Regular Contributor
timestamp: August 21, 2013, 12:28:04 pm
content: Jaxbird , would be Nice to have a video of your Dummy load in action , was trying to have some pictures of mine my camera battery went down, have been able to take some pictures will try to upload itregardsshailesh

author: shailesh3t
author_rank: Regular Contributor
timestamp: August 21, 2013, 03:54:44 pm
content: Quote from: jaxbird on August 21, 2013, 11:41:39 ami have posted the link for the dummy load i built,https://www.eevblog.com/forum/projects/dummy-load-digitally-controlled-by-arduino-328/

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 22, 2013, 09:43:46 am
content: Quote from: shailesh3t on August 21, 2013, 12:28:04 pmNah, I think I'll just stick to the old fashioned text and pictures for nowQuote from: shailesh3t on August 21, 2013, 03:54:44 pmGreat, I'll have a look

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 22, 2013, 09:59:37 am
content: Got the USB interface implemented, I can now control everything the load does from a PC, plus read all the values. That was really the reason I built it, I want to be able to easily test some programmable/variable buck/boost converters.I have sometimes used LogView to monitor my battery chargers, so I had a look at adding support for LogView.They have something they call OpenFormat, it's a bit quirky, but it works, just need to send values like this:Code:$1;1;0;1133;318;0;0;0;0;0;20;21;0;16<cr><lf>Details of the format can be found here:http://www.logview.info/cms/d_formatbeschreibung.phtml(mix of German and English) .. My German is getting a bit rusty, but google translate does a decent enough jobAnyway, here a capture of discharging a battery using the Load:

author: shailesh3t
author_rank: Regular Contributor
timestamp: August 22, 2013, 02:56:50 pm
content: Its very Nice the Graph, you have a smooth value read out,hmm which mosfet are you using in your design?regardsshailesh

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 22, 2013, 03:46:46 pm
content: Quote from: shailesh3t on August 22, 2013, 02:56:50 pmThanks.. actually I think the software is reducing my resolution a bit.I watched your video and I think Dave's example was a bit too simplified, it's best if you drive your MOSFET something like this: (Sorry for really bad drawing)My MOSFET is an IRL2203 (lowish voltage, high amps), but it's not particularly selected for this project, it's just what I had in my parts drawers.

author: shailesh3t
author_rank: Regular Contributor
timestamp: August 23, 2013, 07:11:30 am
content: Jaxbird, will try the dummy load cct u have done and see how it worksn will revert backElse today is my last day of holiday as will soon join another work so wont have time with projects now, and got a small baby to look after just turned 11 months.else i have tried it with the cct you have made and its better now in most range of the current , i added one component at a time to see its effect and the 1 k was the one who reduced most of the noise, could you tell me what did the 1 k resistor do ?thxShailesh

author: jaxbird
author_rank: Frequent Contributor
timestamp: August 25, 2013, 04:47:37 pm
content: Quote from: shailesh3t on August 23, 2013, 07:11:30 amHello Shailesh,You'll need all 3 components for the proper effect, the problem is that opamps cannot supply enough current on the output to drectly deal with the capacitance on the gate of a high power MOSFET. So by adding these resistors and capacitor, you can slow down the feedback and avoid oscillation. If you still have problems, you can try adjust the values until you achieve a good result.Anyway, best of luck on both the new job and your baby

author: shailesh3t
author_rank: Regular Contributor
timestamp: August 27, 2013, 05:16:02 pm
content: Hello Jaxbird,have joined th work and it seems to be going fine now, else will try with other values and see the results n THXn regardsshailesh

author: jaxbird
author_rank: Frequent Contributor
timestamp: September 04, 2013, 07:16:49 am
content: Quote from: shailesh3t on August 27, 2013, 05:16:02 pmThat is greatyou should be able to make a nice load device with the parts you have

author: brabus
author_rank: Frequent Contributor
timestamp: September 04, 2013, 09:59:34 am
content: Wow, that's really well made! My congrats!I really find the idea of using a P4 heatsink... pretty simple and strong! Well done!You know what? I may take inspiration from this, and improve my active load... thank you!