Go Down

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

pgmartin

So I'm not able to get the digipots arround here. The ones available are pretty expensive and have small resolution, plus they have a limited lifetime of 50K writes into their memory.

I've found some 12-bit DACs. I guess they can be used as an input for the LM317 (ADJ), since it's just a voltage divider, right? Or first I can try using PWM as an input for the voltage regulator.

Techone

Quote
I've found some 12-bit DACs. I guess they can be used as an input for the LM317 (ADJ), since it's just a voltage divider, right? Or first I can try using PWM as an input for the voltage regulator.


Yes, but...  1st. Expiriment with the LM317 as stand-alone <--- Test it out without the DAC and Ardiuno. Just check if it work first. ( check datasheet of LM317 )
2nd. PWM ? no. a LM317 work in linear PSU circuit. A PWM work with a switching PSU.

Question ? Do you have a big transformer to generated 30 V ac @ 2 A ? What type of transformer & Volt @ current you have ?


graynomad

If you run the PWM through a low pass filter it will produce a stable(ish) DC voltage. The RC time constant may have to be pretty large to smooth the PWM out and this will impact the response feedback time and therefore it will be slightly harder to handle in the software. Also there may be impedance issues so you may have to buffer with an opamp.

Personally I would go for the DAC.

As to wether either will work on the 317, I don't think so but this is getting a little analogue for me. The 317 tries to maintain a small voltage on the middle pin I think, and it does that by adjusting the output voltage. Maybe you could simulate that small voltage with a DAC, i don't know but even if it works I think you would have to scale the DAC output down (or use a small reference voltage if they have one) to get the full resolution.

Certainly either technique should work if you keep the existing transistor circuit as that's all the R2R network does anyway.

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

pgmartin


Quote
Personally I would go for the DAC.


I'll go with a DAC (your argument was very clear Graynomad, thanks). Found some cheap TDA1543 (16-bit), that if I get them to work using i2S I will achieve a very good resolution. I have enough time to do research until the DAC arrives.  :smiley-mr-green:

This way I'll have a better resolution in the DAC as in the Arduino ADC, and can achieve a good feedback control.

I'm planning to use a 24V 5A transformer, a diode bridge (for 10A) and some big capacitors for smoothing (the traditional linear way).Whether I should go with the 317 or with the transistor amplifier of the first circuit I referred is something I have to do some research. Help with pros and cons of this solutions would be appreciated.

Techone

I will go with the transistors design. Because that design can use the DC signal from the DAC. The LM317  will not.  Here the link of the datasheet of the LM317. http://www.datasheetcatalog.com/datasheets_pdf/L/M/3/1/LM317.shtml

Take you pick. There are a few of them.   
   
       Transistor Design                             LM317       
Pro - Control of Higher current        Pro - Simple adjustable PSU.
        Flexible Design.                             
Con - More parts                           Con - Less flexible.

My opinion

pgmartin

I agree with you Techone.

The transistor design is not complicated to build (and easy to understand for a rookie like me  :smiley-roll-sweat: ), and is more flexible because you don't have the minimum 1,25V that the LM317 has.
Trouble might appear in the filtering part, to avoid ripple. This is something to do some research in the analog world.

Ps: I found this other design that is microcontroller compatible, it supplies low current (less than 1A), but it surely can be improved.
http://powersupplycircuit.blogspot.com/2009/07/mini-bench-power-supply-circuit.html?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+PowCircuit+%28POWER+SUPPLY+CIRCUIT%29

Techone

Quote
The transistor design is not complicated to build (and easy to understand for a rookie like me   ), and is more flexible because you don't have the minimum 1,25V that the LM317 has


It look like you read the datasheet.  ;)

Quote
Trouble might appear in the filtering part, to avoid ripple. This is something to do some research in the analog world.


Ripple appear the input and output. The input side, you can use a PI config. Like : cap in //- inductor in serie - cap in //

Do you have beefy transistor in TO-220 or TO-3 package ? They will be your by-pass transistor like.

What type of display you will use to display the voltage & current ? Ardiuno can use a LCD. If not, you stuck with 7 Segments.

And you will need to sample voltage and current. I will need op-amps and set the output of these op-amp from 0-5 for the Ardiuno ADC's.

Like I said...I big fun project. 

pgmartin

#22
Jul 29, 2011, 04:25 pm Last Edit: Jul 29, 2011, 04:40 pm by pgmartin Reason: 1
Quote
Do you have beefy transistor in TO-220 or TO-3 package ?


I have a 2N3055 in stock already (it has been sleeping for ten years in my electronics box awaiting to be used), that will handle this power comfortably.
As OpAmps I have some LM358N for experimenting. Still not sure if they wil work for this job.

Now I'm researching how to make an analog overcurrent protection (looks like using a MOSFET is the best solution), because I'm not convinced that the Arduino would be fast enough.

Quote
Ripple appear the input and output. The input side, you can use a PI config. Like : cap in //- inductor in serie - cap in //

Never been good with inductors, I'll ask for help with that later  :smiley-mr-green:

The fun part is the display. I like the idea of using traditional 7-segments, because they are bigger and easyer to see. I have some Common Anode green ones for that purpose (but I might end buying some CC to run with a MAX7221). And I have also a 16x2 lcd.

I've seen some projects using monochromatic graphical LCDs, but they look blunt in my opinion.
Here is an example: http://www.microsyl.com/index.php/2010/03/31/bench-power-supply-0-25v-0-5amp/

So my plan is using the 7-Segment leds to show the actual current and voltage supplied, and the lcd for the menu part. It must show the following:

  • Working mode: constant voltage, constant current, current limited, and maybe upper or lower limits of these constraints

  • Memory select: choose 3.3, 5, 9, 12V or anything you store afterwards

  • Alarms: was there a short circuit or overcurrent


Besides some pushbuttons, I'll use a small encoder as interface.
I want all controls to be digital (exept power on-off), because one of the features is having a "LOCK" button, because I hate to burn thinks by accidentally touching the wrong button at the wrong time with my elbow  ;)
Also an output enable, disable button.
So the Arduino would end up doing the following:

  • Run the displays

  • Work as a Voltmeter

  • Works as an Ammeter

  • Read the encoder(s) and buttons

  • Block the input

  • Block the output

  • Control the voltage via a DAC

  • Monitor current limit throug the ADC

  • Monitor internal temperature an controlling a fan



Looking at this, I might be running out of pins quickly!  :smiley-roll-sweat:


graynomad

Quote
I might be running out of pins quickly! 

Not to mention time, how old are you :)

As soon as I read

Quote
Memory select: choose 3.3, 5, 9, 12V or anything you store afterwards


I though "Ooo that sounds dangerous", but I see you covered that later.

I way prefer LEDs but you may be displaying a lot of info there. Maybe a few large LEDs for the Volts/Amps and a 16x2 character LCD for everything else.

It should be a killer PSU.
______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

pgmartin

Quote
I way prefer LEDs but you may be displaying a lot of info there. Maybe a few large LEDs for the Volts/Amps and a 16x2 character LCD for everything else


I agree. It might be a southern hemisphere thing.

Quote
No to mention time

Well, patience is a virtue. My 2N3055 waited 10 years to be used, and i will have to wait a couple of months for the mail delivery of the DACs. Hope I don't forget to buy anything now  XD


Techone

Quote
I have a 2N3055 in stock already


A TO-3 <==NOW you talking !!! :D
I have a few.

Quote
As OpAmps I have some LM358N for experimenting. Still not sure if they wil work for this job.


They are just fine. Here a link to use op-amp to control the PSU. http://www.play-hookey.com/analog/experiments/ps_op_amp_control.html

Quote
Now I'm researching how to make an analog overcurrent protection


I agree, do it analog. May be look into a "crowbar" circuit. It design to shut off when a overload occur.

I hope you have a few. Op-amp is usefull in PSU design, specially linear type.   For voltage sensing, you may use op-amp for voltage convertion. Bear in mind, the analog pin of the Ardino is 0-5V. You can change the Aref to have a better resolution of the ADC. Link is : http://arduino.cc/en/Reference/AnalogReference And I read the Important section. I was a bit confuse by it and scare. :smiley-eek:     ( the Ardiuno part by being damage. ) 

By constructing this project step-by-step, you will be fine.


pgmartin

#26
Jul 31, 2011, 02:21 am Last Edit: Jul 31, 2011, 02:36 am by pgmartin Reason: 1
Quote
May be look into a "crowbar" circuit


The crowbar looks like a bit too violent for this problem, IMHO. The solutions using a Zener (wiring cathode to Analog input, and anode to ground) or an ultra fast diode, like the UN4001 or a Schottky (wiring them cathode to +5V, anode to analog input), looks much easier. Although I have some 5.1V zeners in stock, I might end up using the Ultra Fast Diodes, just because they sound fancy  :smiley-mr-green:
Well, actually, the Zeners will reduce my analog read scope to aprox. 4V, so, I´ll be loosing a lot of resolution.  :%

Meanwhile, I´ve found this circuit that uses an ATMega and PWM. I don´t lilke the PWM solution very much, but the rest of the circuit shows a good solution to solve the voltage regulation an current monitorin with OpAmps. See that for voltage sensing, only a voltage divider with two resistors is used. Schematics here . "Carga" is Load in spanish, so there goes the output. Corriente means current, an Tensión is Voltage.

Quote
You can change the Aref to have a better resolution of the ADC

As far as I know, this is only usefull when you get voltages below 5V, and all the designs I´ve found use the whole 0 to 5V scope to get better info.  And I found something called oversampling that can  improve the ADC accuracy, that I will use for sure. More about it here http://www.atmel.com/dyn/resources/prod_documents/doc8003.pdf

I´ll start building the meters for current and voltage.

Techone

Quote
See that for voltage sensing, only a voltage divider with two resistors is used.


Agree. But for the current, I recomment to use an another voltage divider.  Using a shunt resistor. Simply mesure the voltage drop of the shunt resistor.

Example :       + V   ------/\/\/\/\----  Vout
                             R1               R3
                              Vp1             Vp2
                             R2               R4
                             GND             GND

Take the voltage out from Vp2  <-- Voltage point 2.  Shunt resistor will be a high watt low value resistor.


Deeptronic

We have built such circuit, presented in our website deeptronic.com. The arduino power supply control software for is presented here http://www.deeptronic.com/digital-control-for-laboratory-power-supply-using-arduino/ , and the controlled switching voltage regulator  is presented here http://www.deeptronic.com/programmable-1-30v-lab-power-suppl/ . The power supply has main features:  3.3 - 30V adjustable output voltage, and 0.5 to 3A adjustable current limiter. Its current limiter and it switching nature make this power supply suitable for laboratory since it can sustain continuous shorted condition, no damage or over heating.

shooter

use this lm117 or 317 or L200 they all have safety build in
the control can be done with control transistor and a pwm output, this will give only 255 positions when not enough have 2 control transistors one for coarse and one for fine.
the voltage is one feedback to analog input with resolution of 1024
the current is easiest with special print
paul deelen
shooter@home.nl
making controls with codesys PLC and arduino

Go Up