Dangerous Prototypes

In development => Project logs => Topic started by: NsN on April 13, 2014, 08:33:26 pm

Title: Power Bar - A small breadboard power supply
Post by: NsN on April 13, 2014, 08:33:26 pm
This project is still very much a work in progress, but I'm looking for some early feedback.

Power Bar(working title)
The power bar is a small breadboard friendly power supply with three independent voltage regulators and built-in current monitoring.
The target applications are small, mostly digital projects, which don't need a large 0-30V, 6A benchtop power supply, but at the same time want something more adjustable than the simple 5V USB voltage.

(http://http://imgur.com/ZuEEkaQ)

Features (probably already working):

Features (maybe in the future):

Schematic
(http://http://imgur.com/qaWGBWT)

The power bar uses three transistor based linear regulators and an Atmega32U4. The regulators are controlled from the Atmega via the 10-bit high speed PWM (64 MHz counter). Voltage and current are monitored via the Atmegas 10 bit ADC. The voltage is reduced by an 1:4 voltage divider, the current is measured through a Texas instrument INA214 amplifier.

(http://http://imgur.com/BV95bDp)
(http://http://imgur.com/QByVM1X)
(http://http://imgur.com/XDT7VTD)

board files (http://http://justgeek.de/additionalData/files/power-bar/power-bar.zip)
code (http://http://justgeek.de/additionalData/files/power-bar/power-bar.-.code.zip)

Evaluation
(http://http://imgur.com/AMhY0Z1)

The most limiting factor currently is the ADC. Due to the nature of the voltage regulators, their effective resolution depends on the input voltage. If V_in is 5V, each PWM step will change the output voltage by about 5mV. However, since the ADCs resolution is 10mV, this is the maximum precision theoretically possible. (In practice it is likely less).
For the current prototype, most resistors have a 1% variance, so current accuracy is even less.

While the PWM control is not entirely linear, it is fine enough to allow for a 10mV accuracy:
(http://http://imgur.com/TJTEbMi)

The PWM for voltage control works reasonably well, due to the high speed the signal is relatively smooth. However after a high-low transition, the voltage can oscillate by about 140mV for up to 120ns. After a low-high transition it can oscillate by about 260mV for up to 170ns. This seriously limits the usefulness, and will need to be investigated.



Future Work
There are quite a few things, that I would change in the next prototype

Warnings
This is a very hobby-unfriendly board:
If you want to test the regulator for yourself, I recommend using the breakout boards I designed during the development:

Small regulator (http://http://oshpark.com/shared_projects/MsrnvLGb)
Larger regulator (http://http://oshpark.com/shared_projects/M5XtM5nr)
SC70/6 breakout board for the INA214 (http://http://oshpark.com/shared_projects/omAgS0rT)
Title: Re: Power Bar - A small breadboard power supply
Post by: rockets4kids on April 14, 2014, 04:47:43 pm
My analog skills are poor, but it appears as if you are doing full regulation in software.  If this is the case, how well does this work under varying loads?

While it seems reasonable to generate a reference voltage via PWM w/ feedback, it seems as if you would do better to use this to drive an op-amp to perform the actual regulation.
Title: Re: Power Bar - A small breadboard power supply
Post by: NsN on April 14, 2014, 06:15:04 pm
Good question. The closest answer I have right now is "I'm not sure".

I'm not much of an analog guy myself, so I tried to stick with existing circuits. In theory the transistors should work reasonably well as regulators. And looking at it with my simple pocket osciloscope the change doesn't seem to extreme:



I basically connected the output of the regulator to a 56 Ohm load resistor and put a switch with a 10 Ohm resistor in parallel. The yellow signal shows the voltage on the 10 Ohm resistor, when I pushed the switch. The blue one is the output of the regulator.

However the measurements of the Atmegas ADC show some fluctuations of ~ 150-200mV when the additional load was switched:

(http://http://imgur.com/8Zhs7iC)

I'll have to check which one gives the wrong results.


For smaller loads, here is the log of an Arduino playing the standard "Blink" sketch with an extra LED:
(http://http://imgur.com/VK0P8se)
Title: Re: Power Bar - A small breadboard power supply
Post by: rockets4kids on April 14, 2014, 07:52:17 pm
Although transistors are just fine for the role of controlling voltage, you need to realize they are current devices, not voltage devices.  As such, in order to regulate voltage as current changes, you are going to need to adjust the input voltage.  This is why you see your PWM-generated voltage change with load.

The problem with this is two-fold.  First, the capacitance in your PWM voltage source is going to limit response time.  While you might not see any problems at low frequencies with low loads, switching higher loads at higher frequencies is going to result in a lot of noise on your output.  Even if you can get the response time if your PWM voltage source down to zero, you still have the time delay in the control loop on your MCU.

When you let an op-amp control the regulation, you don't need to worry about the response time of your PWM filter or control loop as you are just generating a fixed, constant reference voltage.

But again, this is coming from someone who isn't really an analog guy, and I'm speaking entirely from theory and little practice here.  Hopefully someone with stronger analog skills can jump in and school the both of us.
Title: Re: Power Bar - A small breadboard power supply
Post by: NsN on April 14, 2014, 08:22:23 pm
I would love some input from someone with more experience as well!

I'm trying to figure out where I got the circuit from, I'm fairly certain that it was some kind of DIY benchtop power supply. But that was a couple of month ago.

A quick LT-spice simulation gives me a 100mV difference between a 300mA load and a 30mA load at both 1.8V and 3.3V output. (with a steady PWM, no control loop). Of course this could be a lot better.

I'll add "investigating op-amp based design" to my ToDo list.

I can see a couple of different directions for this project. For a small breadboard-centric board, I would prefer to keep everything simple and cheap. But there is also room for a slightly larger version with its own display, dedicated controls and higher output current. (Not as big as usual supplies, but maybe in a SoB 5x5 size).

Another thing that I want to try are the STM32F2 series controller. The built-in DAC would eliminate the PWM worries and the 12-bit ADC would help as well. One reason I've stuck with AVR so far, is that the barrier to entry for people wanting to fork or contribute seems a lot lower.
Title: Re: Power Bar - A small breadboard power supply
Post by: Taniwha on April 14, 2014, 10:23:31 pm
I realize it makes it bigger but can I suggest adding a disk drive molex connector (or pins for one) so that people without a bench supply can power it from an old PC power supply
Title: Re: Power Bar - A small breadboard power supply
Post by: rockets4kids on April 15, 2014, 12:48:22 am
At that point a molex-usb adapter makes a lot more sense.  Not least of which because you'll want someplace to add a quick-blow fuse.
Title: Re: Power Bar - A small breadboard power supply
Post by: NsN on April 17, 2014, 12:54:25 am
I think the best way to make it more versatile is to have a small main board, and a well defined extension connector. One reason everything is so cramped, is to make it fit onto a breadboard. Just the USB connector and the barrel socket already take up 1/5th of the whole board. A molex connector would probably be another 1/5th.

At the moment it isn't very usable without an USB connection, but it would be reasonably easy to make an addon board with a display and some buttons to have a standalone version. Of course that wouldn't fit on a breadboard anymore, but maybe it would work with a Sick of Beige 5x5 size.

I've started looking into op-amp voltage regulators, and they seem reasonably simple. However I'm a bit lost trying to figure out which op-amp characteristics are important, so if anybody has some advice (or a good introductory text) I would appreciate it.

Oh, and at the moment both power inputs are fused with a generic 0.5 Amp polyfuse. But I'm not quite sure how fast that one is.

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01262081968session_write_close ( )...(null):0
20.01292213560ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01292214336Database_MySQL->query( ).../DatabaseHandler.php:119
40.05612353072Database_MySQL->error( ).../Db-mysql.class.php:273