### Lab Power Supply

In March 2015 I started designing a precision, low noise lab power supply. Sure I could buy one but where is the fun in that! I learned a lot about voltage regulation, and power circuits as well as ADCs,  DACs and designing with precision in mind.

This page provides an outline of the project and links to the various blog posts that I wrote as I was developing the power supply.

## Heat Management

As this is a linear supply managing waste heat is a big factor. Managing the heat achieved by:
• Using a low-frequency (low noise) pre-regulator circuit that cuts charging to the bulk capacitors. More on the pre-regulator below.
• Large heat-sinks
• Temperature controlled fan
• Use of MOSFETs as the pass element and pre-regulator switching element to reduce the dropout voltage of the regulator.
In addition the circuit switches transformer taps for different voltage ranges. This doesn't provide much over the pre-regulator but does allow higher current output at lower voltages (4.8A vs 3A above 15V).

## Pre-Regulator

Initially I experimented with using a circuit to switch on the power later in the cycle using an SCR based on the Jim Williams circuit detailed in Linear Technology AN32. See here for the first attempt.

The problem with this circuit is it generates considerable noise as it switches at the point where the current is maximal.

I found an alternative circuit on the EEVBlog forum that was reproduced by a member called BlackDog (from a design that came from elsewhere). In this design P-channel MOSFETs are used to switch off the current when the capacitor voltage reaches a target voltage. At this point the capacitor current is greatly reduced as the capacitors have charged.

In my version of this circuit I changed the voltage control to be a set level above the desired output and added circuitry to ensure the voltage didn't get thrown around too much if the supply goes into current limit mode.

The final design is documented here and the testing is here

## Voltage Regulator

The voltage regulation is built around an IRFP044N MOSFET. These proved to be pretty robust, had good thermal transfer and low enough gate charge to drive quickly for my purposes.

The problem is I need a gate voltage well above the output to make this work. Initially I used a voltage doubler circuit but this messed with the voltage waveforms under low-power enough that my pre-regulator wouldn't work.

In the end I decided to manually wind an additional winding onto the transformers and run this is series with the output winding. This gave the additional voltage I needed without much hassle.

I used LT1639 Op Amps to drive this as these could handle up to 44V supply voltage. In addition to the voltage control loop the circuit has differential voltage measurement from the output terminals to minimise the voltage differences due to internal resistances of tracks etc.

## Current Sense

The supply uses low-side current sensing via a small resistor and a LTC2050HV op amp. The LTC part has spectacularly low offset voltage and precision but is relatively slow. This is fine for current limiting however.

I was initially using Welwyn wire power resistors but had lots of problems with the readings wandering as the resistor heated up. I eventually figured out this was a thermo-electric affect. I switched to precision vishay 4 terminal sense resistors which allowed me to reach the 1mA precision I wanted.

## Digital Control and Reference

Each channel has an AD5689 DAC that sets the output voltage and current limit. I found some cheap AD780 references on ebay that are more than adequate for setting the DAC reference.

On the flip side the output voltage and current are read back by an AD7705 ADC.

Each channel has its own ATMEGA328P for controlling the DACs, switching transformer tap relays and reading back if the supply is in current limit. The microcontroller also handles linearization of the ADC/DAC using calibration tables stored in EEPROM,

The microcontroller communicates with the main system controller via an MCP2200 USB to serial converter. The serial signals are isolated from the rest of the channel using an ADUM1201 and the MCP2200 is powered from the serial bus.

## Powering the Raspberry Pi

The Raspberry Pi cannot be powered off but must be allowed to shutdown gracefully. As a result the Raspberry Pi has its own switching supply that powers it and the touch screen.

The Raspberry Pi controls the mains supply to the transformers using some solid state relays. In addition this circuit switches in a resistor temporarily to reduce the in-rush created by the transformers and then a second SSR short circuits the limiting resistor.

There is a bi-colour LED that indicates the power state of the whole system and a momentary switch the user uses to turn on or off the entire system. A power control circuit based on a p channel MOSFET powers up the Raspberry PI when the button is pressed. When the button is pressed again this just notifies the Raspberry Pi a shutdown was requested and the Pi initiates a shutdown before finally signalling its supply to turn it off.

The Raspberry Pi also measures the temperature of each channel via a set of DS18B20 temperature sensors chained together on a 1-wire BUS. A 5 to 12V switching converter provides power for a small fan and the raspberry PI uses PWM to control the speed of the fan in response to the temperature of the system.

## Raspberry Pi GUI

The user interface is built using the Kivy Pi Python toolkit. Python code polls the state of each channel and updates the GUI. Kivy Pi renders all of the buttons, text and other GUI widgets and handles touch events.

At the moment the GUI is pretty minimal and allows
• Each channel to be enabled/disabled,
• Displays the set voltage and current limit
• Displays the measured output voltage/current and power
• Displays the measured temperature
• Provides a tool to calibrate each channel using an LXI multimeter and to set the calibration table in EEPROM on each channel.
There is lots more that could be done here.

## The Good the Bad and the Ugly

So what I liked about the supply is:
• It's pretty reliable and powerful
• Very precise
• Low noise
• Relatively quick to respond to load transients.
• The GUI is simple but quite nice and I think could be made very nice with a bit of work.
What I don't like
• The GUI is really slow. It's not the GUI itself but the fact that the system is polling three channels over relatively slow serial links. This makes the time between making a change and the change occurring relatively long.
• There is a small overshoot when the voltage is set or when it comes out of current limit. I reduced this a lot but I didn't want to compromise the speed. It's small enough not to be a concert (mVs)
• The banana sockets have enough resistance that the measurement of the voltage at the back of the terminals creates a few mV of error at the front of the terminals. I tried using 4 wire outputs but had stability issues. I may re-visit this.
What could have been done better:
• If I was designing it from scratch I would have made the additional transformer winding into two series windings and configured them to float above/below the output voltage. Then the entire control system would have been floating above the positive output rail and I could have used lower voltage (cheaper) parts.

## Source Code and Schematics

All the source code and schematics are on Github and may be used for any purpose. If you decide to do something with my design consider buying me a beer!

The code was written in Atmel Studio. The PCBs were designed in KiCAD.

## List of Blog Articles

Voltage Regulator
Voltage Regulator Test
Pre-regulator
Pre-regulator
Progress!
Current sensing/limiting
Current Sensing/Limiting (Testing)
Current Sensing/Limiting (Testing)
Atmel Studio 6.2 and atmega328p Serial Comms
Printing/Reading floats on an AVR in Atmel Studio
Resistor Precision
AD7705 - Not having fun...
Pre-regulator re-design
Re-designed Pre-Regulator Testing
Transition to Ki-CAD and PCB
PCBs
ADC and Output Voltage
Lab Power Supply - Raspbery Pi Control
Thermoelectric effect
Pre-regulator re-visited
Board Redesign
New Boards, Input Power Control and the Case
Raspberry Pi Power Control
Lab Power supply Pi Control and Auto-Cal
Channel PCB Layout

Transformer Tap Switching, Gate Bias supply and auxiliary supplies

Pre-regulator

Voltage and current regulation. Output protection

Digital control

Raspberry PI power, temperature sensing and fan control

Pi Power Layout

Power Input Control

Raspberry Pi power control board

Kivy Pi User Interface

Response to load transient

Integrated into my lab

1. Hi first of all i must say that this is a real power supply and probably one of the most complete on the internet.
As a student i want to build one , probably a stripped down version without the preregulator..that isn't clear to me.
So i was wondering if the schematics made with kicad were available to download

2. Thank you! All the schematics and software are available on Github here (https://github.com/tom-biskupic/LabPSU). Happy to help answer any questions.

3. Yeha i've just googled it and i've found it on github it's strange that this psu isn't mentioned in forums because it could be the rival to an "industrial " power supply.
I'm also looking at your dummy load , surely you know what you're doing.
Thanks again for those well made projects

4. I've another question , on the voltage and cjrrent control schematics P1 the 4 pin connector at the end, as far as i can understand that is the output' but i cant uderstand what the voltage control op amp is measuring because its input are tied to earth

5. Alfa Chemistry energy analysis is a leading global testing service in composition and content analysis of energy. Oil is known as "the blood of industry" and gas is also an important energy source. They provide a powerful guarantee for the rapid economic development and the improvement of the quality of life. Energy testing

6. Having a raspberry pi that I have programmed on my own surely would be a great way to practice how to enjoy while learning! Anyways, before building my own raspberry pi project, I need right away an automatic voltage regulator for our refrigerator. Can you recommend the best one?

7. Outstanding as well as powerful tip by the writer of this blog are really handy to me. Packers And Movers In Banglore

8. Really great job,
on the web I find few professional projects like this ..
I begin the realization in the next few days and look forward to the developments for the graphic representation of V&A as Keysight

9. Thanks for sharing with us. We are the leading Distributors of Commercial Electrical Equipment parts.Get OEM replacement parts of excellent quality at a reasonable price.ElectricalParts And Supplies It is given Best price off every purchase.

10. Sounds Good,
I like to read your blog. You shared a wonderful information about power switches. Thanks for sharing this amazing stuff.

11. The blog seems to share interesting tips, Noble Gas Solutions offers the best lab gas, Medical gas regulator, and telemetry equipment to help and monitor gas supply levels. Call us today!
Medical Grade Nitrous Oxide