Modular DC Load -- design critique - Page 1
Forum section: electronics / projects

author: Aeternam
author_rank: Unknown
timestamp: April 14, 2016, 10:08:55 am
content: Hey gang.Not a week goes by without someone showing off his or her DC load project, and I'm afraid this is one of those posts. For that I am sorry. Nevertheless I'd be happy if you could spare a couple of minutes and have a look at my design. Like Dave would put it, I'm a young player. Apart from tinkering with an Arduino starter package this is my first real project. This is not meant as an excuse for sucky design but more as a favour I'd like to ask of the old hands: please check for obvious traps that I might have fallen into.I'm especially interested in your thoughts about the modularity of this thing. Decoupling seems to be a thing with all of my circuits, so that's another point I'd like you to look at. Finally, I'm well aware that my drawing skills stink. If you see "horrible" things, be sure to point them out. I'm eager to learn, so don't hold back. "Rip the thing apaaarrt."Design goalAn electronically controlled DC load that can draw up to 3A with milliamp resolution.Modular design: the number of load control subcircuits is variable. This gives the option to add more oomph to the appliance by adding more load control subcircuits.Circuit explanationThe microcontroller sets the DAC (MCP4725) to a set voltage which is then fed into the regulating subcircuitry which, using a couple of N-channel MOSFETs (IRF640), draws the amount of current needed for the feedback loop to stabilize at the input voltage.Current drawn = set voltage / 0.1 * number of load control subcircuitsAs configured, the input voltage is attenuated by 99.8% (divider R4/R5) to give it a range of 0-0.15V (4095 steps). With two regulation subcircuits having a 0R1 sense resistor bank each, the load can pull 0.15 * 10 * 2 = 3A with a theoretical resolution of 0.75 mA.Each regulation subcircuit has a sense line which feeds into an ADC (ADS1115) that is then read out by the microcontroller and processed (compared to desired current, sent to the appliance's display, logged, <insert fancy stuff here>.) The ADC input lines are protected by operational amplifiers with a +5V supply in order to stay below the VDD+0.3V limit on the input lines.Communication between the microcontroller, DAC and ADC is handled via I2C. The bus is operating at +3.3V, pullup resistors are 470R each.Reverse polarity protection of the load input is handled by a P-channel MOSFET and a Z-diode. An ADC sense line on the load input enables the MC to calculate the dissipated power at any given time.Power supplyThe appliance should be run off a +15V wall wart.+12V and +5V are regulated by a 7812 and a 7805 respectively.The negative supply for the operational amplifiers comes from a MC34063 configured as voltage inverter (not sure about the values of the controlling components here, will have to breadboard it first).A divider on the +5V rail supplies the +3.3V needed for the I2C bus.What's missingA temperature control subcircuit. I will probably go with a variable fan with simple diodes as temperature sensors. Placement will be below IRF640 heatsinks.A decent user interface. 132x4 OLED display, connected to the I2C bus. Keybad for mode selection and data input, rotary controller with pushbutton for further control functionality. Soft Load ON/OFF switch, hard mains switch.USB and/or RS232 port, programming capability. I'd like to be able to upload a "load curve" into the MC. Will have to spec this out first though.Architectural thoughtsI'm thinking about putting the load control subcircuits on riser boards. This way they would be easily replacable and -- given enough free slots on the main circuit board -- the appliance would be really extendable.So there you have it. My next steps will be the integration of the stuff that is still missing, and once that is done I plan on designing a PCB for this thing.

author: krish2487
author_rank: Frequent Contributor
timestamp: April 14, 2016, 11:03:54 am
content: Just a cursory glance, nothing in detail.I think you mixed up the AREF and VCC voltage regulators.Secondly, the AREF pin cannot be higher than the 5V give or take. I don't think you can use a 7812 to power the AREF pin as an external reference

author: sleemanj
author_rank: Super Contributor
timestamp: April 14, 2016, 11:33:37 am
content: Not looked in detail, but these jump out at me..ATmega Vcc can't be 12vYou do not appear to be using any of the ADC of the Atmega, so connecting AREF is not of any useAVcc and AGnd is not connected but will need to be because (from memory) it provides for PC0 through 5 (even for digital output)You don't have any reset circuitry or programming headersYou should add also header or at least testpoints for serial output to help your initial developmentNo decoupling on Vcc/AvccThose pullups on SDA/SCL seem awfully strongYou are driving two fets from a single op-amp+sense resistor network and expecting them to equally share current, you almost certainly will be disappointed. Each load fet should have it's own sense resistor and op-amp driving it's gate. ).You are using a 16bit ADC but you are using a bunch of resistors paralleled as the sense resistor, if you are going for super precision (16bit!) then you need to be using a super precision sense resistor.

author: mij59
author_rank: Frequent Contributor
timestamp: April 14, 2016, 11:59:09 am
content: Do not parallel mosfets (Q1, Q2 etc.), use separate controls for each one.C3, C9 too big, to be connected between the output of the opamp and the inverting input.Current sensing resistor 10 m Ohm ?, gives about 15mV as input voltage to the adc .Why 3.3V for the I2C bus ?, using a voltage divider as a bad idea.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 14, 2016, 02:16:00 pm
content: Ar least the read back of the current would need a more precise amplifier. Usually a rather small shunt for the measurement is good to keep self heating small. But the regulation tends to be more stable with larger resistors.The capacitor in the feedback at the output stages is at the wrong place.The output usually needs an RC combination to ensure stability with complicated (e.g. inductive) loads.

author: daqq
author_rank: Super Contributor
timestamp: April 14, 2016, 09:15:07 pm
content: C3 and C9 is directly connected between ground with a very low impedance. This might affect the stability of the op amp.

author: Kleinstein
author_rank: Super Contributor
timestamp: April 15, 2016, 08:50:48 am
content: C6 and C9 are at the wrong place - the lower and should go directly to the inverting input. They are way to large too - this makes regulation rather slow.The IRF640 are also not a really good choice for linear operation. It's hard to cool a TO220 and with more than 10-20 V there is the danger of thermal instability. I would suggest something like IRFP240 / IRFP250.The sense resistors are way to small for LM324 with a high offset voltage. So likely larger resistors and better OPs are a good idea.One of the ADC inputs should be used for a precise read-back of the actual current - the OPs and the DAC are not that good to really get the value you set. This channel needs precise amplification.One can get away without the switched mode regulator for the negative side, by using a shunt regulator. The drawback is having the output ground different from input ground, but this should not be a problem here.Interfacing the µC running at 5 V and an ADC running from 3.3 V can be tricky. There is little room for the high level from the 3.3 V device.

author: Aeternam
author_rank: Unknown
timestamp: June 27, 2016, 09:47:51 am
content: Belated thank you for all the tips and ideas. I considered all of them and implemented most of themBelow you will find an image of the first prototype board. Considering it is my first ever self-designed PCB I'm pretty happy with the result.And I will be even happier once I debugged it because it looks like something's not right with the DAC (it's not reacting to I2C commands.) But that's for another day (or even another post)

author: prasimix
author_rank: Unknown
timestamp: June 27, 2016, 10:09:51 am
content: Quote from: Aeternam on June 27, 2016, 09:47:51 amMaybe you should also add four mounting pads for M2.5-M3 screws/spacers on the next PCB revision if you don't want that everything "levitate" on power mosfet.

author: bktemp
author_rank: Super Contributor
timestamp: June 27, 2016, 10:23:26 am
content: Quote from: Aeternam on June 27, 2016, 09:47:51 amCan you show us the bottom layer of the board?The traces between the current sense resistors look much too small to carry any significant current. Unless there is something hidden on the other side of the board, I expect the total resistance of the current shunt being much higher because of the small traces. If you want a precision current feedback, 4 wire connection should be used. But this does not work with many resistors connected in parallel, therefore the connection between the resistors must have the lowest possible resistance.

author: yngndrw
author_rank: Regular Contributor
timestamp: July 06, 2016, 12:11:56 pm
content: I have a couple of resources which may be of use to you.The first is a set of PCB design guidelines by Mariss Freimanis from Geckodrive, he designs high powered stepper motor drivers and the information is very-much applicable here:http://yngndrw.hostilezone.net/uploads/PCB%20layout%20technique.pdfThe second is the HP 60504B service manual which contains the schematics and parts list for their now obsolete 600W / 60V / 120A electronic load module which may be helpful to take the load section from, see pages 38 onwards:http://ridl.cfd.rit.edu/products/manuals/Agilent/power%20supplies/CD1/service/60504ser.pdf