Apr 04

Fully Programmable Modular Bench Power Supply – Part 12

It took a while to decide on the final form factor, I wanted to consider cost and ease of mechanical construction before committing to a layout for the PCB. My original design goal was to make a completely self-contained module for a single fully isolated channel of programmable DC power and my thinking was extending to thermal management. My original idea was to rely on the module to be thermally fixed to a heat sink which could be decided upon by the builder. However, heat sinks are expensive usually and construction would depend on what heat sinks you may have to hand so I thought it would be nice to make this more flexible and use components that are easy to find and obtain for very little money. As a general rule, if you can buy something off the shelf this is always going to be cheaper than making your own, and if you can use off the shelf components that are mass-produced then all the better. I got to thinking about the heat sink I needed – force air cooled and able to handle 100 watts of dissipation in a small space that is mass produced, with a built in fan that can be controlled for quiet and efficient operation, is commonly and easily available, is of standard physical construction, good quality and cheap to buy – enter the common PC CPU Cooler, which meets all of those criteria.

So thats what I have done, I have built the PSU module into a form factor that easily accommodates the CPU cooler and still remains 100% self-contained. The built module with all required power components, mechanical construction with heat sink and cooling fan measures only 150mm wide by 80mm deep by 90mm tall. All you need to make it work is a mains transformer, four 4mm banana output jacks and something to control it via a serial interface.

The Schematic

I have updated the article to include the schematics which I had previously omitted.


The PCB is made with 2oz Copper to handle current and provide better thermal mass. The high power path is run 5mm thick tracks (minimum) and run on both sides of the board. Where possible the top and bottom tracks are joined at the through-hole pads for the power components which is everywhere except at the current shunt resistor. For this I have many small via’s connecting the top and bottom traces to handle current and thermal bonding.



In laying out the PCB I forgot to pay attention to the star earthing I had set out in the previous post. The impedance of the ground path makes a big difference when you are looking at the lower 1mV of the range. Using DipTrace I had to use a ZERO ohm resistor to properly segregate GND and GNDANALOG nets, but I physically routed to the GND side of that resistor to the wrong point. I done a pretty similar thing on the low-side current sense connection. As a result there are two bodge wires on the board (see photo below). The first is the GNDANALOG to GND connection – Instead of installing R79 (which is ZERO ohm) I have taken a wire from the bottom pad down to the low-side of the current sense resistor array. The second is slightly more difficult to do, I had to cut the track from the top pad of R82 and then again take a wire down to the low-side of the current shunt resistor.

Thermal Management

In order to manage the thermal properties of the module, the firmware simply uses the temperature measurement of the heat sink to set the fan speed calculated on the following basis: –

  • below 25 degrees centigrade – FAN is idle at its lowest speed (0% PWM)
  • 25 to 50 degrees centigrade – FAN is driven with variable PWM 25 degrees = 1%, 50 degrees = 100%, which is a rate of 4% per degree of temperature rise
  • more than 50 degrees centigrade – FAN is driven at 100%

Controlling a 4-wire fan is pretty easy, the specification developed by Intel describes the electrical interface and requirements for both fan control as well as fan manufacturers. I have added it as a download on this page for convenience. The fan I tested and used in the video above runs at about 1500 RPM to 3400 RPM with a 0-100% duty cycle on the PWM control signal. The taco output is open collector and provides 2 pulses per revolution.

Next time I am going to *try to* characterise the PSU. I don’t have much experience doing this which is why I say I am going to *try* – none the less I should be able to pull together some basic specs and test conditions.

Following that I am going to design and make a front panel controller for the PSU. Although I am making this specifically for this project I am thinking about making this more generic so it can be used in other systems and/or test equipment. The basic goal is to create a single PCB front panel with a 4×20 VFD display, some buttons and controls, a micro controller (PIC32 or maybe ARM) with RS232, USB, Ethernet (and possibly a GPIB interface module) with 3-4 independent TTL level internal serial interface channels (to connect to PSU modules for example). Don’t know, all just thoughts at the moment, we shall see…

Thanks for watching.

If you found this post useful or interesting, please consider giving me a tib.
Tibs are pocket-change for the internet™.
Feb 16

Fully Programmable Modular Bench Power Supply – Part 11

Here is the latest Revison 0.4 schematic which represents the power supply design as described in this blog and videos with the latest round of prototyping and testing.


The headline changes from last time are as follows: –

  • I have added -Ve supply using a simple charge pump and a PWM drive from the micro controller.
  • I have added a difference amplifier to correctly handle remote voltage sensing for both PSU voltage control and output voltage read back
  • I have modified the design to use low-side current sensing instead of high-side current sensing. In doing so I have dropped the use of the high side current sense amp MAX4080 and made use of a spare op amp element instead. This saves a $3 part and replaces it with half of a $2 part
  • Removed dedicated buffer amp previously added to drive the ADC, the new design removes the need for this because the voltage and current monitoring are better buffered now. This saves another $2 part.
  • Moved to a faster micro controller PIC18F46K22 which has more memory, more PWM outputs and more I/O pins. No real reason apart from I needed a second PWM output. The firmware is pretty much compatible.

Here is a video overview of the design changes and latest prototype hardware and test setup as well as some basic tests showing load regulation and programmable voltage accuracy benchmarked against a calibrated HP 34401A bench meter.

NOTE: I used a different mic setup and the sound is really poppy and crappy! My apologies…..My dustbin now has a new microphone in it!

You can download the hand-drawn illustrations used in the video here:

So I am working on the final PCB now, in Part 12 I should have a finished module….whoop whoop….Please do comment and like the videos if you find them interesting. Thank you for watching.

If you found this post useful or interesting, please consider giving me a tib.
Tibs are pocket-change for the internet™.
Jan 14

Fully Programmable Modular Bench Power Supply – Part 10

Well It’s been over three months since my last post so for those of you that have been following the project I am sorry to have kept you waiting. Work events have taken over recently; I have been really busy and as a result have not had much time to dedicate to the project. I have not been idle though, in those three months I designed and had made two revisions of PCB, have built them up and done lots of testing and as a result now have a clear view of an end design save a for a couple of minor things that still need to be done.

First of all, here is the latest schematic which represents the power supply design as described in this blog and videos with what I believe are the modifications required from the latest round of prototyping and testing.


Here is a video overview of the prototype hardware and test setup as well as some basic tests including load regulation and programmable voltage accuracy benchmarked against a calibrated HP 34401A bench meter.

Here is a video using the software to demonstrate basic set volts, output read-back tests and a benchmark against HP 34401A

I still have the following outstanding issues I want to address before committing effort to laying out a final PCB.

  • The “Output Off” circuit needs to be verified to resolve the glitch shown in the video when turning the PSU output on
  • Verify remote sense circuit and approach
  • Create and test a charge pump to generate a negative supply with a simple regulator, and specifically making sure the diode switching noise does not affect the ADC’s accuracy or stability
  • Create a minimum load constant current source for the regulator, and deal with measuring output current and compensating for the current source
  • There is currently no output protection of any kind, I need to deal with reverse polarity input (connect a battery the wrong way around to the input terminals), power feedback (connect a battery the right way around and power down the PSU), connect mains AC voltage into the output terminals. Apart from passing thoughts I have not looked at circuit protection at all.
  • Verify the accuracy of the current limiting and ADC read-back

In Part 11 I will make further refinements to the design addressing the outstanding items and get a board designed and ordered ready for Part 12 (the final part I hope).

Please do comment and like the videos if you find them interesting. Thank you for watching.

If you found this post useful or interesting, please consider giving me a tib.
Tibs are pocket-change for the internet™.
Aug 17

Fully Programmable Modular Bench Power Supply – Part 8

After my initial tests there are two things I now know for sure. The first is I cannot treat the DAC like a programmable voltage source, it’s not going to be accurate enough and secondly, because of the INL of the DAC the resolution needs to be high enough to give me headroom to “trim” the DAC to the correct voltage. On this basis there really are only two practical options to achieve the goal.

The first option is to use a mapping table. Assuming I have a DAC with enough resolution it would be feasible to build some form of calibration rig which could step through each desired voltage then trim the code written to the DAC to get as close as possible for the resolution of the DAC and store that number in a table which can then be written to micro controller as a lookup table. The problem with this approach is its messy, and it would mean that if the calibration was lost in use it would need the calibration rig to re-calibrate it. This is not an ideal solution.

The second option, and the one I will take forward is to build a system where I have an ADC and a DAC and the system is configured so I can read the DAC output. When a given voltage it programmed the ideal DAC code is written to get within a few millivolts of the desired output; and then a software loop is used to trim the DAC code up or down as required to get as close to the required output voltage as possible. If the PSU is to measure up (no pun intended) then it needs a metering function regardless so all I need to do is design the system so I can switch the ADC’s inputs to the DAC for the calibration cycle.

The ADC needs a good resolution, it needs to be accurate and it needs to be low cost. The conversion speed is also important, if its too slow the calibration cycle would take too long to complete. I found a good part for this in the form of the LTC2402 Delta Sigma ADC device from Linear Technologies. I must say at this point that Linear Technologies design support is really great, they have been kind enough to furnish me with sample devices which I have been testing in the design. I have also tested a couple Analog Devices parts too and they were also kind enough to furnish me with sample devices, and these were very close in performance and a bit cheaper too (so not excluded just yet) but for performance in this application Linear Technologies parts so far have the edge – I will talk more about that later on and in future articles because I have tested a few different DAC’s and ADC’s. The following schematic shows the digital control circuitry which is extended to include the ADC chip and a 74HC4053D analogue switch which is used to switch the input of the ADC from monitoring the PSU regulator outputs to monitoring the outputs of the DAC for calibration read-back.

One of the interesting attributes of the ADC chip is it’s a two channel ADC, but in reality though it is actually a single channel ADC with a two channel multiplex on the front end so it samples each channel alternately. This made for an interesting problem to solve because the calibration loop needs the conversions from the ADC to be as fast as possible. The chip its self can only perform a maximum of 6.2 samples per second according to the data sheet, but because of the input multiplexer it can only actually achieve 3.1 samples per second per channel. For normal monitoring three updates per second is acceptable but for calibration I wanted better performance. I configured the analogue switch so in calibration mode I can use both inputs of the ADC to monitor a single channel of the DAC which gives me a calibration loop speed of 6.2 trim and read back per second.

Unlike the DAC, the INL of the ADC is significantly better mainly due to the nature of how it works. The architecture is a switch capacitor system which unlike laser cut resistor strings the charging and discharging of current into a capacitor is significantly more predictable and linear.

PLEASE NOTE: The LED flash is continuous but the video frame rate make it looks like it stopes and starts – which is does not.

In software I have tired two different calibration schemes. The first is the simplest, it sets the ideal code for the target voltage, measures the output of the DAC and does a calculation to determine the difference between the ideal code and the actual code required, then applies this. The second scheme is more complicated. It is the same as the first scheme but then with a second phase of micro trimming which essentially sets a window around the centre point and then adjusts the codes in steps re-reading the output; you can think of this as an electronic/software version of someone turning a variable resistor while watching a meter to get a precise voltage. The second scheme also takes more time as it needs to perform multiple read-backs in order to complete the trim cycle. I have limited the trim cycle to a maximum of eight iterations, in practice it seems to take between 2 and 7 most of the time.

(P.S. The command ‘pr’ means “property read”, it reads the EEPROM configuration of the module)

I re-tested with the spot voltages in the previous blog post and the bottom line is, 14-bits is not enough. The MCP4922 is great for the $$ but its not good enough for this project so I will not bother creating another spot voltage table for this variation, that’s a waste of time given we have established the DAC is just not up to the job. In the next article I will try out two 16-bit DAC chips, one from Analog Devices and the other from Linear Technology.

Thanks and keep watching….

If you found this post useful or interesting, please consider giving me a tib.
Tibs are pocket-change for the internet™.