Go Down

Topic: Arduino controlled lab variable power suply (Read 29650 times) previous topic - next topic

pgmartin

Arduino helped me to get back in touch with electronics as a hobby. I have completed some projects, and now I'm back to the beginnings I want to build a variable power supply.

I've found this examples that use an ATMEGA8, so I figured out that it can be done using Arduino (and this will also allow to develop further upgrades).

http://www.microcodes.info/project/Digital-DC-power-supply-using-Atmega8-391.html
http://linuxfocus.org/English/June2005/article379.shtml#379lfindex4

Since my knowledge of electronics is limited, I can't evaluate the pro's and con's of this design, and wether it wil be usefull as a part of a hobby laboratory.


retrolefty

Anyway you can supply a link that doesn't require the one has to register and log in ?

Lefty


pgmartin

#2
Jul 18, 2011, 10:28 pm Last Edit: Jul 18, 2011, 11:01 pm by pgmartin Reason: 1

Anyway you can supply a link that doesn't require the one has to register and log in ?


This is the circuit used:




And here is the code
http://tuxgraphics.org/common/src2/article10051/

More info about an improved version:
http://tuxgraphics.org/electronics/201005/bench-power-supply-v3.shtml

retrolefty

#3
Jul 18, 2011, 11:18 pm Last Edit: Jul 18, 2011, 11:24 pm by retrolefty Reason: 1
Quote
Since my knowledge of electronics is limited, I can't evaluate the pro's and con's of this design, and wether it wil be usefull as a part of a hobby laboratory.


There is no question that a programmable DC bench power supply can be a very useful thing to have around. I found a used industrial model on E-bay several years ago, 0-60 vdc, 0-6 amps, cost a couple of thousand new, but I think I paid like $25 + shipping for it, about the size of a large shoe box.

However that appears to me to be a pretty complex project to take on. Lots and lots of components, and of course you will have to 'port' the code over to arduino. Good luck if you do take it on. You might want to continue searching for a possible more modern design that uses IC regulator chip(s) to see if you can cut down on the component count and costs.

Keep in mind that the most difficult part of such a project will be in the troubleshooting as such things never work 100% at first. You will need a variable 'dummy load' so you can test at max to min voltage and current levels while you test out all the controls.


Lefty


Graynomad

Surely using a modern variable regulator and a DAC or digital pot would be easier, that's a heck of a complex circuit for what is essentially a simple problem.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Techone

That sound to me a very interesting project. I may be interested to make one myself.  Complex ? Well no if you brake-it down into block diagrams. To program the chip, put the chip on a board, remove the program chip, install into your project. Here a link about programing ATmega on a breadboard using Arduino IDE. I bough this system. http://www.dalewheat.com/ 

I see in the schematic it has a LCD display. That will be usefull to display info like : Voltage, current. The design need a better 5 volt section ( more current using a bypass transistor ).

I made myself a 5 volt using bypass transistor for my XM Radio for my car. ( 12 V in - 5 V out @ 1 A ) The only problem : Transistor get very warm. I heatsink it...do you worrie. Heh , it work very well.

Here an another link to help in electronics. It a free simulator using JAVA. The con side is cant not save or print the circuit. http://www.falstad.com/circuit/

I hope it help.

pgmartin

Besides the fun of building such a project, I live in Argentina and things like a bench supply are too expensive (about 200 dollars for a cheap one).

The thing of using an Arduino is having the possibility of including a Volt and Amp meter, plus having a short circuit protection, besides having a digital control.
Building the circuit or even making a PCB looks doable. I've been through other projects with a simmilar amount of components and even burned the code into an Atmega.

If I break the design into blocks things get easier. You have a 5V supply for the processor part, that might prduce up to 1A, so enough for every toy you connect as user interface (LCD, buzzers, etc).


The real thing is: is the electronic design a good solution, using an amplifier and a darlington array?
Quote
Surely using a modern variable regulator and a DAC or digital pot would be easier,

Can you handle an example of such a solution?
Regards

Graynomad

Well I'm thinking you could use a 3-pin adjustable regulator like the LM317



And replace R2 with a digital potentiometer.

This would replace 32 components with 5 and free up 7-8 processor pins.

I haven't tried this and an analogue guru may have a reason it won't work, but I think it would.

Another option may be to replace the R2R ladder with a DAC and keep the existing transistor arrangment, this replaces 20 components with 1.

______
Rob


Rob Gray aka the GRAYnomad www.robgray.com

pgmartin

I didn't know that there were things like this digital potentiometers. I have to investigate if I can get some of these arround here.

The LM317 solution migtht hve a current limitation, but this can be improvedby using a power transistor, like the 2n3055 right? (I hapen to have one in stock!)

This part will limit the voltag, how do you achieve a limited constant current?

retrolefty

#9
Jul 19, 2011, 06:01 pm Last Edit: Jul 19, 2011, 06:17 pm by retrolefty Reason: 1
Quote
how do you achieve a limited constant current?


By feedback control. Your processor will know what the current is at any given time by the current feedback measurement it reads. If the current raises above the set value then it reduces the voltage output of the regulator to keep the current at the set value.

Keep in mind that there can be up to three different possible control modes your power supply can be operated in if that is your desire, Constant current, current limited, and constant voltage.

In constant current mode, your program will either raise or lower the regulators output voltage to keep the current exactly at the desired current value. It can maintain a constant current only up to the maximum output voltage capacity of the voltage source. However it can maintain a constant current value into a direct short to ground by lowering the output voltage to just above 0vdc depending on the actual resistance of the 'short circuit'.

In current limit mode, your program will keep the regulators output voltage at the desired constant voltage unless the programmed current limit is reached, where it will only then reduce the output voltage by the amount needed to keep the current at the programmed limit.

In constant voltage mode your program will just keep the regulator's output voltage at the desired amount. Only if the current draw exceeds the maximum rating of the regulator where it should either shutoff or enter a current limit control mode where it reduces the output voltage as needed to keep the current at less then the supplies maximum limit.

Some bench supplies don't include the constant current mode, just the constant voltage or constant voltage with current limit mode. However working with high power LED circuits the constant current mode is a nice feature.

You will have to study the software program you are planning to port over to see which modes it supports and either add or take out any mode you don't wish to implement.

Lefty


Graynomad

Quote
The LM317 solution migtht hve a current limitation

There are higher current versions, the LM338 will do 5A. I would think the 3055 would work also though.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Techone

Don't forget the heatsink, it get hot. 

@ Graynomad
That is the basic LM317 circuit, for more currents, You will need a by-pass transistor. A LM338 will do. It will make the circuit simpler.

pgmartin

#12
Jul 19, 2011, 07:00 pm Last Edit: Jul 19, 2011, 11:03 pm by pgmartin Reason: 1
Thanks for all the answers!

Now I have a variety of configurations I can use. It's a matter of seeing what kind of components can I get here. The only easy part of te original design i that the components are cheap and easyto get. But I think that the R2R ladder is not only boring to build,but itca also be quite inacurate.

Any recomendations on a good DAC for this purpose? Or can I use a pwm port for this purpose?

pgmartin

Quote
By feedback control. Your processor will know what the current is at any given time by the current feedback measurement it reads


The example of the link is using timer interrupts to measure at a given frequency. How should I calculate the minimal frequency to have good results?

retrolefty


Quote
By feedback control. Your processor will know what the current is at any given time by the current feedback measurement it reads


The example of the link is using timer interrupts to measure at a given frequency. How should I calculate the minimal frequency to have good results?



That's a really hard question to answer. The electronic loads you are trying to power and protect need as fast a response as possible while still maintaining accurate control. This is more important for the constant current and current limit modes of operation, constant voltage mode is not as time critical I would think.

One problem is that most A/D conversions on arduino takes some time and often averaging of multiple readings are need to get 'clean' measurements, and all that will tend to slow the control response for your power supply. Again this is not a trivial project.

Lefty

Go Up