EEVblog Electronics Community Forum

General => General Technical Chat => Topic started by: angelo on April 27, 2010, 02:47:27 am

Title: DIY power supply/function generator
Post by: angelo on April 27, 2010, 02:47:27 am
Hey guys,

I was hoping to build a unit ( or two seperate possibly) that has two main functions.

Function Generator, and Adjustable Power Supply.

I have an XR2206 function generator IC that can output triangle/sine/square waves at adjustable amplitude and frequency, and I also have an adjustable power regulator and a separate 5v regulator.Combining these all together I hope to make: a set of terminals that output a given function of your choice at whatever frequency/amplitude you like, a second set of terminals that output your selected voltage, and a third set that always outputs 5v for logic.On top of this ebay sells voltage/amp display lcds that just clip in basically with no parts needed so I figure i can wire them into the adjustable supply to show voltage/amperage drawn. I'll take an old wall wart power supply and have it drive whatever features you turn on.

Sound good ? any advice, warnings, tips, previous experience is very much appreciated.

thanks for your time!

Title: Re: DIY power supply/function generator
Post by: alm on April 27, 2010, 09:23:12 am
A function generator from the XR2206 is fine, I'm sure you'll easily find a sample schematic on the internet.

I'm assuming your adjustable power regulator is something like an LM317? I see two issues with using this for a lab PSU:
- Can't go lower than 1.2V or so
- No adjustable current limit

The latter is also an issue with the 7805. Both have a limit to prevent their own destruction (2A or so), but this won't prevent blowing up your project or the supply. Something like an LM723 or L200 will have a real current limit, although you do have to provide a negative voltage for the LM723 to go all the way to 0V. You'll also need transformers and heat sinks (depending on the max. current and input voltage), plus some smaller stuff like rectifiers and capacitors. If you use a wall wart, make sure it delivers enough voltage and current, and is properly isolated from mains (see here (http://www.aplomb.nl/SMPS_leakage/Doc_ie.html) for some background). You'll probably not be able to regulate the voltage all the way to 0V with just a single input voltage. You also want to make sure that the current limit of everything together is less than the max. current of the wall wart, I wouldn't count on it being short-circuit proof.
Title: Re: DIY power supply/function generator
Post by: saturation on April 27, 2010, 01:25:00 pm
I would just build it as a learning experience, you can make quite a sophisticated FG at under 100kHz and then push your luck to radio frequencies.  You also learn about shielding and stability.  Now, trying to make it lab grade is another issue.  Lab grade parts are often high quality, or it could be the newer DDS variety.  But once you know how to make your own, you'll have the right mind tools to buy a good one that is cheap and repairable, say off eBay.

Similarly with PS, build it with 1A or less current [more power, more cost, higher safety risk] and highly variable voltage so you know how its done, make it capable of constant current or constant voltage and fully adjustable.  If you can, over drive it and try to destroy it.  This way you know what the real limits are and what symptoms it shows.  I'd make sure I get to learn about DC-DC conversion, switching, old style full wave bridges, half wave, etc., then like the FG, use this knowledge to buy a lab grade one cheap from eBay and repair it or insure its working up to snuff.


Title: Re: DIY power supply/function generator
Post by: angelo on April 27, 2010, 06:18:23 pm
yes, it is the LM317, and 7805 regulators.

I'm not too worried about over-current because it will almost always be small application, up to 1A max I presume. LM723 has a max current output of 150 mA as opposed to 1.5 A on the LM317, and I could always build in the current limit on top of the 317 if necessary in the future because I'm planning a very modular design where every function will haves its own small pcb that can always be added to, as opposed to one large PCB that will have to be scrapped to make any changes.

and as saturation stated, its moreso to get into design and a learning process.

whats with this full wave /half bridge stuff now ?

and is there a convenient way to implement a current limit on top of a regulated voltage ?

note**

by connecting a fixed resistor between the adjustment pin and output, the LM117 can be used as a precision current regulator.  from the datasheet
Title: Re: DIY power supply/function generator
Post by: angelo on April 27, 2010, 06:58:47 pm
If i were to use something like this:

http://cgi.ebay.com/DC-24V-3A-Regulated-Switching-Power-Supply-AC-110V-240V-/200462929452?cmd=ViewItem&pt=LH_DefaultDomain_0&hash=item2eac858e2c

and use it to power the regulators, and function generators, and the two volt/amp displays (9-12V each)
(given that I dont exceed about 20V leaving 4V tolerance. and dont draw more than 4 amps)

would this suffice ? or should I power the two LCD meters seperately?

this is the Amp panel, the volt one is identical

http://cgi.ebay.com/NEW-3-Digital-Blue-LCD-AC-0-1-999A-AMP-Panel-Meter-/280344256001?cmd=ViewItem&pt=LH_DefaultDomain_0&hash=item4145d1de01

or would this be better

http://cgi.ebay.com/AC-Power-Supply-Toshiba-20-LCD-TV-20HL85-DC-24V-3A-/250621929847?cmd=ViewItem&pt=LH_DefaultDomain_0&hash=item3a5a3b2977
Title: Re: DIY power supply/function generator
Post by: DJPhil on April 27, 2010, 08:41:24 pm
The volt/amp meters are unlikely to draw much current, especially an lcd display type. Most of the power consumption is probably in the backlighting, and even then I'd consider them negligible. It's worth testing them when you get them to be sure.

The function generator is likely to be negligible as well, depending on design. It's sort of a power supply in it's own right, how you design it will determine how much current it can sink or source, though we're probably talking tens of mA at very most. Again, if you build it and test it you'll be sure, but in this case you can simulate it in software first.

While I'm not aware of any real problem with using linear regulation after a switchmode power supply at substantial current, it might not be the best idea in this case. Poorly designed switchmode supplies will send noise along the lines in both directions, both the output and the building wiring. This is usually unimportant and minimal in professional equipment, but I doubt an $8 supply is designed with attention to low output noise and EMI. This is one of those times you probably want to be careful about these nit-picky details, because few things raise blood pressure like unreliable instrumentation. You might consider splitting up the two projects, at least until you get them working and stable. Housing them together might be a challenging exercise in noise management.

The power supply design depends a lot on what you're intended uses are. If you're just starting out you might not be worried to much about the details and just want to get something built, in which case I'd say give the switchmode/linear  a shot. Your first go won't be your last, most likely, and you can always adjust and refine later. It also has the benefit of not requiring you to work with line voltage right away, so it would be a safer way to start.

Either way, if you're going to buy a switchmode supply I'd get the first one you linked. The tv supply would be safer to work with, as it's designed to sit on a rug behind a tv. However it would be much easier to open up, modify, and mount the first one you listed, and you may get adventurous someday. Just remember to be careful around line voltages.

Hope that helps :)
Title: Re: DIY power supply/function generator
Post by: saturation on April 27, 2010, 08:54:23 pm
I agree with DJPhil.  For power supplies, I was looking more at buying these types.  They are also switch mode, but very crude and easy to tear into.   They only deliver about 500mA or less, just again, be careful about the AC side.  The a small PCB inside you can easily mount in another box, minimal ICs, leads large enough to probe with your DMM or scope, easy to take apart and dirt cheap, to the USA free shipping, at $1 each.

The parts alone inside you won't find anywhere in the USA for $1.

http://cgi.ebay.com/USB-AC-Power-Supply-Wall-Adapter-MP3-Charger-US-2P-Plug-/220580493832?cmd=ViewItem&pt=Laptop_Adapters_Chargers&hash=item335b9f3a08

As DJ mentions, by understanding how this simple supply works, you can also improve on its output.  I find many of these ripple like potato chips and pour noise on the power line like new years, yet it works for most devices plugged into it.  It goes to show that flat flat DC isn't really necessary as many devices have added smoothing at their power supply inputs too.

(http://imgs.inkfrog.com/pix/bestworld2009/USB-AC-Power.jpg)
Title: Re: DIY power supply/function generator
Post by: angelo on April 27, 2010, 09:01:26 pm
I've seen the USB type supplies before but i need at least 20V to power the project.

I figure that if i go with the TV one, its very stable and well designed, and i can just cut the connector at the end and run the power into my project leaving the transformer outside under my bench.

I do like the smaller one however and its easier to modify.

would you say that the TV unit is less noisy and provides a more stable output ? if i go with the first one and just put some filter caps on it would that suffice ?

thanks alot for all the help!
Title: Re: DIY power supply/function generator
Post by: saturation on April 27, 2010, 09:07:53 pm
If you buy an old lab grade power supply, it may come with a full wave rectifier circuit.  Its easy to make a high current supply this way; you'll be clued in that it may be this if find a large transformer inside with many low volt AC taps on the secondary side.  All you need to make full wave DC is 4 power diodes and a good sized capacitor, no ICs until you need strict regulation.

(http://upload.wikimedia.org/wikipedia/en/thumb/a/a3/RC_Filter.png/400px-RC_Filter.png)

yes, it is the LM317, and 7805 regulators.


whats with this full wave /half bridge stuff now ?


Title: Re: DIY power supply/function generator
Post by: angelo on April 28, 2010, 03:49:21 am
Is it possible to have two LM317's , such that one regulates the voltage, and a second regulates the current thereby forcing a given amperage and voltage ?

this means that you would have two pots, one for voltage one for current and then be able to set one or the other, or both ?
Title: Re: DIY power supply/function generator
Post by: EEVblog on April 28, 2010, 06:09:26 am
Is it possible to have two LM317's , such that one regulates the voltage, and a second regulates the current thereby forcing a given amperage and voltage ?

Yes, that's not uncommon. LM317 in constant current mode first, followed by a voltage mode LM317.

Quote
this means that you would have two pots, one for voltage one for current and then be able to set one or the other, or both ?

Correct. But for the current mode one all the current flows through the pot, so it has to be suitably rated.

Dave.
Title: Re: DIY power supply/function generator
Post by: Kiriakos-GR on April 28, 2010, 09:57:40 am
From my experience, regulating the current , its  an characteristic of powerful power supply units.

Any sort of regulating circuity s , cause less clean DC output.

The first task that I found that the regulated current , its a must have ,
are when you repair car stereos,  by limiting the amperes , you know just by the Amps , if it is damaged ,
and  in what degree.

Limiting the Amperes, its called as protection,  Low output power supplies it best to be protected by  common fuses, and keep the design of those power supplies, as simple as possible.

About the use of LM317 as current limiter , I am not aware of that,  but even so , just by the specs,
I do not see how one so small transistor ,  even with an wired pot , could be as useful to any one.
The only factor that most professionals seek in a well designed power supply,  are Clean and Stableoutput.
The above simple idea could be easily effected by the temperature, so its not like an "set it and forget it"  solution. 

 
Title: Re: DIY power supply/function generator
Post by: logictom on April 28, 2010, 10:43:40 am
When ever I have been taught about power supplies or borrowed books from the library the power supplies are always in the form of a transformer, bridge then a voltage regulator in one or another configuration but always either voltage or current regulated never both.
The designs I've come across on the world wide interwebs use opamp configurations but I haven't come across any books or tutorials that touch on the design process or how you go about minimising things like overshoot, rise times etc
Also if you want to create a digital front end what's the best way to make use of a microprocessor to control the limits? I was looking at SPI pots but they can only handle couple of hundred mA's.

Sorry for hijacking but maybe someone can point me in the right direction ;D
Title: Re: DIY power supply/function generator
Post by: alm on April 28, 2010, 11:16:33 am
When ever I have been taught about power supplies or borrowed books from the library the power supplies are always in the form of a transformer, bridge then a voltage regulator in one or another configuration but always either voltage or current regulated never both.
A transformer is not strictly necessary, plenty of low-power switchers without transformer, but it's usually mandated in mains-powered designs for safety reasons. In a linear supply (eg. 78xx/LM317), it's also useful for bringing down the voltage.

You are correct that you can either regulate voltage or current, the way a lab supply works is two regulators that are 'anded' in some way (eg. with diodes). The voltage should be below 12V and the current should be below 100mA, if any of these conditions is false, the current through the base of the pass transistor is decreased until both are true again.

The designs I've come across on the world wide interwebs use opamp configurations but I haven't come across any books or tutorials that touch on the design process or how you go about minimising things like overshoot, rise times etc
Also if you want to create a digital front end what's the best way to make use of a microprocessor to control the limits? I was looking at SPI pots but they can only handle couple of hundred mA's.
Yeah, the best lab supply designs use op-amps for voltage and current regulation with a single pass transistor (possibly multiple in parallel for more current/dissipation handling ability). This ELV design (text in German, but includes full schematic) (http://www.elv-downloads.de/Assets/Produkte/2/225/22532/Downloads/22532_Universelle_Netzteilplatine_um.pdf) is a good example. A constant current source is connected to the base of the pass transistors, and the op-amps can sink this current if their limit is exceeded.

Optimizing transient response is just like any other op-amp circuit, so any general electronics text like the art of electronics should suffice. A lab supply (usually) isn't a high speed circuit, however. There's often an relatively large electrolytic capacitor on the output, and I wouldn't expect much speed from those darlington power transistors either.

If you want micro-processor control, you should replace the potentiometers with DAC's as voltage/current source. I would recommend against using the tuxgraphics.org design (http://tuxgraphics.org/electronics/200707/bench-power-supply-unit.shtml). The ADC in the AVR is slow, and the simple regulation algorithm (increase/decrease output with one DAC unit every ADC reading until it's within limits) makes it have a horrible transient response. Just use analog regulation, and only set the limits or monitor the voltage/current for display purposes in the uC.
Title: Re: DIY power supply/function generator
Post by: Anders on April 28, 2010, 01:21:58 pm
If you like to keep it simple; here’s one way to do it with two regulators if you can live with a current limit adjusted in steps. This way you can omit an expensive high power rheostat. If you don’t have a centre-tapped transformer you can still make one of these but the output will not go all the way to zero. Of curse there are other ways to obtain this if you need it.
http://www3.telus.net/chemelec/Projects/Power-Supply/Power-Supply-1.png (http://www3.telus.net/chemelec/Projects/Power-Supply/Power-Supply-1.png)
Title: Re: DIY power supply/function generator
Post by: angelo on April 28, 2010, 01:37:30 pm
what sort of wattage should I be looking at on the current knob ? given that I will have between 0A and 3A and between 1.25V and 20V ?

W=IV = 60 Ws ? that doesn't seem right, even though i will likely never draw anywhere near 3A with the small stuff I'll use it  for.


thanks for all the help guys
Title: Re: DIY power supply/function generator
Post by: angelo on April 28, 2010, 04:00:24 pm
The highest wattage I can find are 2 or 3 watts will this suffice ?
Title: Re: DIY power supply/function generator
Post by: Kiriakos-GR on April 28, 2010, 04:17:39 pm
If you like to keep it simple; here’s one way to do it with two regulators if you can live with a current limit adjusted in steps. This way you can omit an expensive high power rheostat. If you don’t have a centre-tapped transformer you can still make one of these but the output will not go all the way to zero. Of curse there are other ways to obtain this if you need it.
http://www3.telus.net/chemelec/Projects/Power-Supply/Power-Supply-1.png (http://www3.telus.net/chemelec/Projects/Power-Supply/Power-Supply-1.png)


My congrats @Anders , nice - simple - practical ..   8)
( I even printed it )  ;D
Title: Re: DIY power supply/function generator
Post by: alm on April 28, 2010, 04:34:13 pm
One thing to keep in mind when using potentiometers for high-current applications in that the maximum power is usually with the pot on its highest resistance setting. If you set it halfway, only half of the surface is used, so the maximum power is approximately halved. Since the current will increase linearly with the inverse of the resistance in this circuit, and the power is increased with the square of the current, it's really easy to burn a pot at high current settings.

I'd change the circuit so the pot is not in the high-current path and use a separate shunt resistor in series with the current. I believe there's an example in the LM317 datasheet (either the National or the Onsemi one).
Title: Re: DIY power supply/function generator
Post by: joe912 on April 28, 2010, 07:27:31 pm
take a look at the L200
http://www.st.com/stonline/books/pdf/docs/1318.pdf
and look at figure 23.  using a shunt resistor to regulate the current.

also i found a design on the internet to make the current control linear.  much like the voltage control would be.

http://www.flyelectric.ukgateway.net/l200varcirc.htm

with this design you could use digital potentiometers since the current through them should be very low
Title: Re: DIY power supply/function generator
Post by: alm on April 28, 2010, 08:41:07 pm
I'm not too worried about over-current because it will almost always be small application, up to 1A max I presume. LM723 has a max current output of 150 mA as opposed to 1.5 A on the LM317
Which you can solve with an external pass transistor, and since it actually allows for current limiting, you don't have the same problems with lack of protection as with the LM317 with external pass transistor. I'm not claiming that the LM723 is a great chip for a lab supply, it's not that great as a current source, but it's pretty good as a voltage source with an adjustable current limit. The L200 is fine too, but it's hard to make that current limit adjustable (since all the current has to flow through the pot). Of course, you can solve everything by adding extra op-amps, but at that point, you might as well drop the dedicated IC's and build something better.
Title: Re: DIY power supply/function generator
Post by: clonecrp on April 29, 2010, 02:32:31 am
This thing is generating momentum ... can't wait for the outcome..
DT
Title: Re: DIY power supply/function generator
Post by: angelo on April 29, 2010, 03:34:05 am
If you guys like I can take a few pics as i start to build and update you.
Title: Re: DIY power supply/function generator
Post by: saturation on April 29, 2010, 10:15:56 am
If you guys like I can take a few pics as i start to build and update you.

Please do, I like seeing the pics, give more info than what is written.  Enjoy your build.
Title: Re: DIY power supply/function generator
Post by: Anders on April 29, 2010, 11:26:46 am
I think a by-pass transistor messes things up a bit unnecessarily. As mentioned on the drawing I linked to before you can use LM350 instead of the LM317 if you need higher current. It’s also possible to use the LM338 part with can put out 5A and handle 40V at its input.
Obviously if using LM350 (3A) or LM338 (5A) you must change both IC1 and IC2!
If you need more current (over 5A) then you can go for a by-pass transistor.

There’s also the LT1083 adj for 7,5A but it’s more expensive and cannot handle more than 25V on the input.

Just my two cents.  ;)
Title: Re: DIY power supply/function generator
Post by: angelo on April 29, 2010, 02:06:23 pm
Cool, thanks guys. I'll be sure to document the build and post some pics to pay you guys back for all the great helpI'm considering putting an instructable up.

I'd like to stick to the LM317's or 350's because I have them on hand unless another part saves me alot of work or is substantially better suited. My problem is still how to adjust the current with the potentiometer if it can't handle the high power. is it possible to put a 1W low value resistor in parallel with the potentiometer and just get a higher value pot to deal with the new parallel setup, or is the pot still going to see too much wattage.

given that I'm most likely going to go with an external power-supply such as for a laptop because its safer, very durable, very well regulated, and has overload protected. Plus I only need it for the 4A, 24V input and nothing else. I will maximum draw 20V at 3A if I use the LM350's and 1A with the 317's.

I'm not sure what level of power the pot should be able to handle
Title: Re: DIY power supply/function generator
Post by: alm on April 29, 2010, 02:10:06 pm
I think a by-pass transistor messes things up a bit unnecessarily. As mentioned on the drawing I linked to before you can use LM350 instead of the LM317 if you need higher current. It’s also possible to use the LM338 part with can put out 5A and handle 40V at its input.
Obviously if using LM350 (3A) or LM338 (5A) you must change both IC1 and IC2!
If you need more current (over 5A) then you can go for a by-pass transistor.
Sure, there's more than one way to skin a cat. It doesn't make much sense to use external pass transistors with an LM317 unless you need lots of current. I was suggesting the external pass transistor with an LM723, which is a fairly popular solution (although I prefer the two op-amp solution). One thing to keep in mind in the maximum dissipation vs. case temperature graph (you can calculate this from the max junction temperature and junction-case thermal resistance, Tj = Tc +  P * Rth junction-case). Power semiconductors often can only handle the maximum dissipation when the case temperature is below 40 degC or so, which would require almost ideal cooling. I wouldn't count on a TO-220 LM350 to dissipate 90W (3A * 30V) without extreme cooling. The advantage of external pass transistors is that you can easily parallel them to decrease dissipation and lower the temperature.

There’s also the LT1083 adj for 7,5A but it’s more expensive and cannot handle more than 25V on the input.
One thing to keep in mind is that you have to connect the adjust terminal to a potential below ground, so the actual voltage that the LT1083 sees is slightly higher than the voltage between the LT1083 input and ground. Plus the LT1083 is definitely more expensive than other solutions with power transistors like the 2N3055.
Title: Re: DIY power supply/function generator
Post by: Anders on April 30, 2010, 06:17:36 am
Yes I noticed the suggestion regarding the LM723 and I like this IC a lot even though many do not. The LM723 has to be treated with some care to work well; it has a tendency to self oscillate if not properly set up.

The power dissipation is well explained in the datasheets which everybody reads  ;) (I hope) when constructing things. To spread the “heat” you can very nicely parallel some LM317 or any of the other named regulators for higher power if you like.

I’m also for the OP-Amp solution you mentioned but in this case to make a simple power supply the regulator solution makes a lower part count and easier wiring.

For a more advanced psu there are many ways to keep the temperature within limits such as primary triac regulating of the transformer, secondary switching between winding on the transformer or a switch mode pre-regulation.

About your comment on the LT1083, I’m not sure exactly what you mean “below ground”.
However, I agree it’s too expensive!  :o
Title: Re: DIY power supply/function generator
Post by: alm on April 30, 2010, 12:13:10 pm
The power dissipation is well explained in the datasheets which everybody reads  ;) (I hope) when constructing things. To spread the “heat” you can very nicely parallel some LM317 or any of the other named regulators for higher power if you like.
In my experience, it depends a lot on the manufacturer. Datasheets from National, LT and AD are usually very good, but those from ST and TI often contain the bare minimum of both specs and application info. They omit unimportant details like that the regulator will not be stable without a certain minimum ESR on the output. They will state the thermal resistance and max Tj, but it might not be apparent for a beginner how to calculate the Tj from the dissipation and thermal resistance of the system (heat sink + insulation washers + thermal compound). It may not be obvious that even though an LM317 will do 35V between input and output, and will deliver 1.5A, it won't do both at the same time.

About your comment on the LT1083, I’m not sure exactly what you mean “below ground”.
I meant that you can't set (most) three terminal regulators all the way to 0V, since they have an internal reference (often 1.25V). To work around this, you can connect the resistive divider on adjust terminal to a potential below ground, but this will decrease your max. input voltage. The same is true for the LM317, but since its max input voltage is much higher, this is rarely a problem.
Title: Re: DIY power supply/function generator
Post by: Anders on April 30, 2010, 05:28:46 pm
Yes, that’s unfortunately the truth.
Some manufactures does not reveal the complete picture and this makes it a good idea always to look for a full app-note if possible no matter which manufacturer your part has.
These app-notes sometimes also explain how to parallel the regulators the way I suggested.

About the LT1083; well this (internal reference voltage) is valid for most regulators, I misinterpreted your statement and thought you meant that the LT1083 was different from the rest.  :)

Title: Re: DIY power supply/function generator
Post by: angelo on May 03, 2010, 01:33:13 am
hey guys, I've got all the parts set out and I will start taking pictures, but the only thing I'm missing is what wattage pots I need. if I want to have 3A and 20V max what wattage should they be,  is there a way to determine wattage from voltage and current besides multiplying (60W) as I believe I'm missing something.
thanks
Title: Re: DIY power supply/function generator
Post by: Anders on May 04, 2010, 05:29:47 am
It depends on which solution you go for, which circuit you’re planning to build.
In any case for voltage adjustment a standard 0.25W LIN will do fine, for current it’s another story. You can use two potentiometers for the voltage if you like, one low value for fine adjustment. Do you need continuous variable current limit or switched ranges?
Title: Re: DIY power supply/function generator
Post by: alm on May 04, 2010, 04:08:03 pm
What's wrong with using a standard pot and a few external components instead of a high-power pot? It's probably easier to get and less expensive.
One thing to keep in mind when using potentiometers for high-current applications in that the maximum power is usually with the pot on its highest resistance setting. If you set it halfway, only half of the surface is used, so the maximum power is approximately halved. Since the current will increase linearly with the inverse of the resistance in this circuit, and the power is increased with the square of the current, it's really easy to burn a pot at high current settings.

I'd change the circuit so the pot is not in the high-current path and use a separate shunt resistor in series with the current. I believe there's an example in the LM317 datasheet (either the National or the Onsemi one).
Title: Re: DIY power supply/function generator
Post by: kc1980 on May 04, 2010, 11:47:34 pm
Does anybody have a schematic for a DIY switching power supply with voltage and current limiting?  Ideally, I'd like to get about 7A out of it.  Too ambitious maybe?  :-\
Title: Re: DIY power supply/function generator
Post by: alm on May 05, 2010, 05:26:45 am
Does anybody have a schematic for a DIY switching power supply with voltage and current limiting?  Ideally, I'd like to get about 7A out of it.  Too ambitious maybe?  :-\
Quite ambitious, I believe. A switching power supply with a variable voltage output is quite complex, since a regulator usually only has a limited voltage range without changing the inductor. Agilent probably has full schematics in some service manual. Commercial designs are likely to be primary side switchers (so they don't need a heavy, expensive 50/60 Hz transformer), I'd probably give up some efficiency and go for a secondary side switcher, I believe there are some schematics floating around on the internet, for example this one from ELV (german, PDF, with full schematics) (http://www.elv-downloads.de/Assets/Produkte/8/833/83399/Downloads/83399_SPS5630_km_web_um.pdf), and Elektor recently published one (will cost you money, up to 3A, not sure how scalable the design is) (http://www.elektor.com/magazines/2010/april/unilab.1285365.lynkx). Something like this probably wouldn't be suitable as a first SMPS project, I'd start with something simpler.

The specs are also attainable with a linear power supply, just use ten or so power transistors in parallel, and a large heatsink with active cooling to cool them all. Larger and less efficient that a switching design, but much simpler. Basically just a regular linear variable power supply, just with more pass transistors.
Title: Re: DIY power supply/function generator
Post by: Anders on May 05, 2010, 11:02:27 am
The ELV supply is nice but you have to buy the thing (very expensive!) since they probably won’t hand out the source code and a few other things. And it’s not really a full SMPS it’s a secondary switched (as mentioned) which means you still need a large and heavy transformer.
Why not make yourself a primary switch mode 0 – 30V 0 – 12A almost for free? Find an old ATX computer supply and make a few modifications almost without spending anything. Sounds good? well this guy knows all about it: http://www.chirio.com/switching_power_supply_atx.htm (http://www.chirio.com/switching_power_supply_atx.htm)
Title: Re: DIY power supply/function generator
Post by: alm on May 05, 2010, 03:07:35 pm
The ELV supply is nice but you have to buy the thing (very expensive!) since they probably won’t hand out the source code and a few other things.
I didn't look at it in depth, but I assumed that the micro controller firmware would be easy to replace since the regulation seemed all analog, so the only thing it would do is control a few DAC/PWM signals, and measure some voltages.

And it’s not really a full SMPS it’s a secondary switched (as mentioned) which means you still need a large and heavy transformer.
True. The fact that none of the electronics magazines or websites (that I'm aware of) have published a variable-voltage/current primary switched power supply says something about the complexity.

Why not make yourself a primary switch mode 0 – 30V 0 – 12A almost for free? Find an old ATX computer supply and make a few modifications almost without spending anything. Sounds good? well this guy knows all about it: http://www.chirio.com/switching_power_supply_atx.htm (http://www.chirio.com/switching_power_supply_atx.htm)
Not sure how much easier a good modification is compared to building from scratch. You need to confirm that the loop will remain stable under all conditions, since the duty cycle will be outside of the normal specifications, and I wouldn't trust them to have enough margin for a 200%+ increase in output voltage either. He also disabled the over voltage protection. Many ATX power supplies need a minimum output current at several voltages to remain stable, a load resistor would screw up your current regulation (you'd need a constant current sink). I'm not a big fan of reusing ATX power supplies, except when you need a high-current 12V output without much protection, and don't demand a clean signal. If you want to try it, I'd use a high-quality name-brand one, since they tend to be the most stable and are better protection.

I've found the service manual for an Agilent primary switched power supply (3MB PDF) (http://www.home.agilent.com/agilent/redirector.jspx?action=ref&cname=AGILENT_EDITORIAL&ckey=1000000384-1%3Aepsg%3Aman&lc=eng&cc=US&nfr=-536902293.0.00). Reading the theory of operation section may give you a rough idea, although the implementation of a high-power switcher is quite hard. Note that circuit layout and magnetics are likely to be very critical.

I'd say that the extra complexity does not outweigh the lower costs for a DIY project. 30V, 7A is well within the range of linear supplies, you just need good cooling. Of course there's nothing wrong with doing it for fun, but I would suggest you to become very familiar with simple buck/boost converters and fixed-voltage primary switchers before you try to make something like this.
Title: Re: DIY power supply/function generator
Post by: kc1980 on May 06, 2010, 07:40:48 am
Thanks for all the suggestions!  It sounds way more complicated than I had previously thought.  I've been meaning to get into switching power supply design but it sounds like I'm still too much of a novice.  In the meantime, I'll crack open my copy of Switching Power Supply Design by Pressman to get my feet wet.  I will definitely build a linear power supply very soon.

BTW, I have a old HP 6255A linear power supply that I purchased used on Ebay.  I've owned it for about 7 years, but i have no clue how old it really is.  Do you think I can still trust this power supply or is it likely that the electrolytic capacitors have degraded over time?

thanks again guys!
Title: Re: DIY power supply/function generator
Post by: Anders on May 06, 2010, 02:22:47 pm
Kc1980:>
A visual check of the capacitors can sometimes reveal if things are going bad. You might as well have real good look at everything while in there. Look for discoloring, suspect soldering and anything else that doesn’t look right. Another thing you can do is to test the supply with different loads and measure the ripple voltage which should be within specs.
If you have access to cap/ESR meter you can carefully disconnect and measure the caps.

 :)
Title: Re: DIY power supply/function generator
Post by: Anders on May 06, 2010, 02:30:08 pm
The ELV supply is nice but you have to buy the thing (very expensive!) since they probably won’t hand out the source code and a few other things.
I didn't look at it in depth, but I assumed that the micro controller firmware would be easy to replace since the regulation seemed all analog, so the only thing it would do is control a few DAC/PWM signals, and measure some voltages.

This might seem simple enough for a professional programmer but there sure are many traps and pitfalls that will jeopardize the reliability regarding stability and voltage control unless you know exactly what you are doing. This also applies to the electronics of a supply of curse.
I’m not saying it cant be done just that it’s not for everyone to manage, the interaction between electronics and software are crucial.

And it’s not really a full SMPS it’s a secondary switched (as mentioned) which means you still need a large and heavy transformer.
True. The fact that none of the electronics magazines or websites (that I'm aware of) have published a variable-voltage/current primary switched power supply says something about the complexity.

I agree the complexity is high compared to linear supply’s however the principle is not that far from the secondary switchers except maybe for the very dangerous high voltages involved.

Why not make yourself a primary switch mode 0 – 30V 0 – 12A almost for free? Find an old ATX computer supply and make a few modifications almost without spending anything. Sounds good? well this guy knows all about it: http://www.chirio.com/switching_power_supply_atx.htm (http://www.chirio.com/switching_power_supply_atx.htm)
Not sure how much easier a good modification is compared to building from scratch. You need to confirm that the loop will remain stable under all conditions, since the duty cycle will be outside of the normal specifications, and I wouldn't trust them to have enough margin for a 200%+ increase in output voltage either. He also disabled the over voltage protection. Many ATX power supplies need a minimum output current at several voltages to remain stable, a load resistor would screw up your current regulation (you'd need a constant current sink). I'm not a big fan of reusing ATX power supplies, except when you need a high-current 12V output without much protection, and don't demand a clean signal. If you want to try it, I'd use a high-quality name-brand one, since they tend to be the most stable and are better protection.

The less it’s modified the better, you will benefit form the original well tested supply and the proposed mod is not very complex at all. As the author points out there are only a few controllers which are suitable for this kind of mod and this tells me that he has been there, tried other controllers and more. I’m sure you can appreciate the way he extended the voltage range with minimum effort and still kept the original parts in the high current section. And of curse it was necessary to disable the over voltage, haven’t seen many of these implemented in variable PSU’s.
I don’t believe you need a minimum load for this to work but if so it could be done without interfering if it’s put before the current shunt.  

I've found the service manual for an Agilent primary switched power supply (3MB PDF) (http://www.home.agilent.com/agilent/redirector.jspx?action=ref&cname=AGILENT_EDITORIAL&ckey=1000000384-1%3Aepsg%3Aman&lc=eng&cc=US&nfr=-536902293.0.00). Reading the theory of operation section may give you a rough idea, although the implementation of a high-power switcher is quite hard. Note that circuit layout and magnetics are likely to be very critical.

That’s why I think it’s a great idea to use an already made and well tested base like the ATX supply to start on.
The Agilent supply is very advanced and that’s just not a project for homebrew. If you need a supply like this I believe you have to buy it.

I'd say that the extra complexity does not outweigh the lower costs for a DIY project. 30V, 7A is well within the range of linear supplies, you just need good cooling. Of course there's nothing wrong with doing it for fun, but I would suggest you to become very familiar with simple buck/boost converters and fixed-voltage primary switchers before you try to make something like this.

Yes, it’s possible to build analog supply in any range but even here you can make mistakes. One issue in analog technique is self-oscillation which suddenly under some condition can blow things up for you. Also depending of what you are using it for there are hazards involved like ham radio equipment for instance.  
Title: Re: DIY power supply/function generator
Post by: alm on May 06, 2010, 03:49:59 pm
BTW, I have a old HP 6255A linear power supply that I purchased used on Ebay.  I've owned it for about 7 years, but i have no clue how old it really is.  Do you think I can still trust this power supply or is it likely that the electrolytic capacitors have degraded over time?
I'd test the ESR (if you have an ESR meter or can improvise one), or just measure the ripple. It's quite likely that it still works fine, or will work fine after replacing a few capacitors.

The less it’s modified the better, you will benefit form the original well tested supply and the proposed mod is not very complex at all. As the author points out there are only a few controllers which are suitable for this kind of mod and this tells me that he has been there, tried other controllers and more. I’m sure you can appreciate the way he extended the voltage range with minimum effort and still kept the original parts in the high current section. And of curse it was necessary to disable the over voltage, haven’t seen many of these implemented in variable PSU’s.
I don’t believe you need a minimum load for this to work but if so it could be done without interfering if it’s put before the current shunt.
The issue that I have is that certain choices like magnetics are quite critical for the stability of a switcher, and they where chosen for 12V 1-20A and 5V 0.5-10A operation (or whatever the specs are), plus they should be as cheap as possible. If you're going to change it to work under significantly different conditions, it's possible that it won't be stable. Some ATX supplies are barely stable in their original configuration. Without knowing the margins of the original design, this is hard to confirm. It may be stable with well-behaved loads, but will it stable under all conditions (as a lab supply should)? The energy levels involved are high enough to be dangerous or fry something. Is the author an experienced SMPS designer, or just someone who studied the datasheet, hooked up his multimeter, and found out that the voltage increased? It's clear that he did spend a fair amount of time on this, but does he know what he's doing? Even if he does, you'll have to confirm that your supply has the same amount of headroom as his supplies, what if they skimped on the magnetics or capacitors?

That’s why I think it’s a great idea to use an already made and well tested base like the ATX supply to start on.
The Agilent supply is very advanced and that’s just not a project for homebrew. If you need a supply like this I believe you have to buy it.
That's what it takes to do it right (except GPIB control, you can obviously skip that), and why I consider it hard. This supply is sure to be very stable, and will be protected against everything you can throw at it (as a lab supply should). And yes, it does have over voltage protection ;).

Yes, it’s possible to build analog supply in any range but even here you can make mistakes. One issue in analog technique is self-oscillation which suddenly under some condition can blow things up for you. Also depending of what you are using it for there are hazards involved like ham radio equipment for instance.
Sure, plenty that can go wrong with analog circuits (do you consider a SMPS digital?). But the components involved with a linear power supply are usually very slow (eg. LM358, often bandwidth limited, 2N3055), so that makes them less likely to oscillate. The frequencies and current changes (dI/dT) of a SMPS are much higher, which makes things more critical and harder to get stable.
Title: Re: DIY power supply/function generator
Post by: kc1980 on May 06, 2010, 09:13:08 pm
Great info!  Thanks guys.  So, I've decided just to build a linear power supply.  There are times when my 1.8A bench supply just doesn't cut it.  Can you suggest any good schematics for voltage and current regulated linear power supplies?  I found this one -- any thoughts on it?

http://www3.telus.net/chemelec/Projects/MC1466/MC1466.htm (http://www3.telus.net/chemelec/Projects/MC1466/MC1466.htm)

Also, I may incorporate an old variac that I have laying around to improve efficiency.

Thanks again guys.
Title: Re: DIY power supply/function generator
Post by: kc1980 on May 09, 2010, 07:47:35 am
Who here is capable of analyzing circuits like this?  I'm reluctant to build something that I don't understand so I've been staring at this schematic off and on for a few hours.  I'm not necessarily asking for someone to explain this to me -- I'm just wondering if this type of circuit analysis should be trivial for a seasoned professional EE.  ???

http://www3.telus.net/chemelec/Projects/MC1466/MC1466-1.png (http://www3.telus.net/chemelec/Projects/MC1466/MC1466-1.png)
Title: Re: DIY power supply/function generator
Post by: Anders on May 10, 2010, 06:05:24 am
The circuit you refer to is partially (almost all of it) a replacement for the obsolete MC1466 IC as the author explains. It might look complex but it’s not too bad to assembly if you make a PCB for it.
Perhaps if you study the datasheets for the original circuit (MC1466) you can grasp its internals better. There are even some example circuits which might shed some light on how the IC operates.

http://www.datasheetarchive.com/pdf-datasheets/Datasheets-21/DSA-409990.pdf (http://www.datasheetarchive.com/pdf-datasheets/Datasheets-21/DSA-409990.pdf)

http://www.datasheetarchive.com/pdf-datasheets/Databooks-5/Document249256.pdf (http://www.datasheetarchive.com/pdf-datasheets/Databooks-5/Document249256.pdf)

http://www.datasheetarchive.com/pdf-datasheets/Databooks-2/Book278-1125.pdf (http://www.datasheetarchive.com/pdf-datasheets/Databooks-2/Book278-1125.pdf)
Title: Re: DIY power supply/function generator
Post by: kc1980 on May 10, 2010, 06:41:30 am
Thanks Anders!  I just wanted to understand it better.  My original approach was to slap it all into LTSpice and see what each functional section does.
Title: Re: DIY power supply/function generator
Post by: saturation on May 10, 2010, 06:11:35 pm
This was how things used to be in the absence of good ICs.  Darlington, Sziklai transistor pairs powered by a full and half wave bridge rectified circuit are good for lessons in schools.  There are psuedo totem pole transistor setups to source current, but most transistors are wired in parallel.   There are a lot of diodes used for fixed voltage drops to bias transistors.

Its obsolete today, you could still build it, but the parts count would cost more than using any established DC regulating IC. 

Even simple circuits like an oscillator using a LM555 with a low parts count instead of a PIC12F675 isn't cost effective, the PIC albeit more involved to get started with and tools to program, costs about the same per chip as the LM555.  However, once you learn how to use PICs the overall versatility gives more flexibility in total design than working with discrete chips.

Should you still build it to own and use? you can if you have the parts free lying about so no expense there.






Who here is capable of analyzing circuits like this?  I'm reluctant to build something that I don't understand so I've been staring at this schematic off and on for a few hours.  I'm not necessarily asking for someone to explain this to me -- I'm just wondering if this type of circuit analysis should be trivial for a seasoned professional EE.  ???

http://www3.telus.net/chemelec/Projects/MC1466/MC1466-1.png (http://www3.telus.net/chemelec/Projects/MC1466/MC1466-1.png)
Title: Re: DIY power supply/function generator
Post by: kc1980 on May 11, 2010, 11:34:35 pm
I would love to get my hands on something like the MC1466L.  It's described as a precision wide-range voltage and current regulator.  With external components, the current and voltage limits can be set and the whole thing functions like a lab power supply.

http://pdf1.alldatasheet.com/datasheet-pdf/view/87107/MOTOROLA/MC1466L.html (http://pdf1.alldatasheet.com/datasheet-pdf/view/87107/MOTOROLA/MC1466L.html)

Are there any modern ICs that do the same thing?  I'm aware of linear regulators (e.g. LM317) that can be configured to for constant voltage or constant current, but can it be configured to do both (i.e. limit the voltage and current as a lab power supply would do)?

Title: Re: DIY power supply/function generator
Post by: alm on May 12, 2010, 08:41:38 am
The first two pages of this thread were about that topic ;).

In short:
Title: Re: DIY power supply/function generator
Post by: Anders on May 12, 2010, 10:45:40 pm
The LM723 has some limitations compared to the more accurate MC1466L, both the current and the voltage (max/min) ranges are limited. The almost equivalent L146 was (now unfortunately also obsolete) better in terms of the maximum input voltage (80 V instead of only 40 V for the 723 part). The MC1466L goes all the way down to zero volts with no hassle, where the 723 requires extra effort. The current regulation is also better and simpler to use with the MC1466L.
Still; the winner is the 723 but only because it’s still easily available and very cheap, just don’t forget to take measures to prevent it from self-oscillating!   

The L200 is very rugged and close to indestructible, adding a single op-amp it will also perform continuous variable current limit. The L200 also takes some effort if down to zero volts are required.

A discrete solution opens for more possibilities and higher accuracy but also adds to the parts count and complexity.
Title: Re: DIY power supply/function generator
Post by: kc1980 on May 13, 2010, 01:01:59 am
alm,anders -
Thanks for your replies!  Just to clarify, my original question was regarding a MC1466L replacement that requires very little external components.  It would be fun to spend time learning about designing with discrete BJTs, but I think that I need to focus more on subject matter that is not so obsolete in today's world.  After reading all the input and researching online, I really think an op-amp-based design will work the best for me. 

Regarding the first two pages of this thread, I don't like the idea of passing too much current through pots -- especially because I'm looking to output up to 7A.  I like the idea of using some level of switching to improve efficiency at the main transformer, but that could get way over my head very quickly.  Instead, I'll probably use a variac transformer and manually adjust the secondary voltage to a reasonable level.

I will post my schematic as soon as I finish.  It is basically a tweaked version of the German ELV design. 
Title: Re: DIY power supply/function generator
Post by: alm on May 13, 2010, 08:13:03 am
All of the mentioned solutions (including the L200 with the solution Anders mentioned) can use a shunt separate from the pot.

Most solutions will need some kind of negative voltage below the output ground to regulate all the way to 0V (gotta get that base at 0V-Vbe). I wonder how the MC1466L got around this, internal voltage inverter like the MAX232? I'm not familiar with the MC1466L, apparently it's better in some aspects, but I'm not a big fan of using obsolete parts in new designs unless there's really no (good) alternative. It's bad enough to have to chase down obsolete parts to repair existing stuff, no need to create these problems in advance.

One solution to limit dissipation used before the introduction of switching power supplies was a triac pre-regulator before the power transformer. This is simpler than a real switcher, but probably not worth the effort these days. You do need to filter out the noise if low noise output is an issue.

A more basic solution to limit dissipation, especially if you want a large voltage range (eg. 0-30V), is to use a switchable voltage doubler (used in some ELV designs) or a transformer with two secondary windings and switch the second winding. A (solid-state) relay is used to switch the extra leg. The former requires double the capacitance (and some diodes), the latter a transformer with two secondaries and two extra diodes (but if you buy new, you don't usually pay much extra for that). This lets you halve the input voltage once you get below half the max. output voltage or so, and saves you 50% on dissipation with worst case scenario (dead short, the pass transistors have to dissipate 99.9% of the voltage at max. current).
Title: Re: DIY power supply/function generator
Post by: angelo on May 14, 2010, 04:53:38 pm
UPDATE:

The last part I needed has finally shipped from China so in approx 7 days I will photo-document my progress. I will be building the function generator and power supply separately for noise control.

the function generator will use: XR2206 IC, with pots for amplitude and frequency adjustment (0-12v, 2-2Mhz) and a switch for triangle, square, sine waveforms. it will have banana jack connectors and a BNC output.

the power supply will use: 2x LM150 and 7805, it will have voltage regulation from 1.25v to 20v and amperage regulation to 2.5A. it will have banana jacks for the adjustable output as well as a second set for the 5v output. the amperage/voltage regulation will have a switch to control what is being regulated and I have two LCD's displaying the supplied voltage and amperage.

Both will be powered over a 2.1' barrel jack supplied by a 24v 3A laptop power brick with built in safeguards and circuit protection.

I will keep you posted.

If anyone knows any good books I could check out that they used from experience, not just suggestions from the net, I would be very grateful

thanks again
--

Angelo
Title: Re: DIY power supply/function generator
Post by: saturation on May 15, 2010, 03:06:58 pm
You have the LM150?  I read they are discontinued for some years, the LM350 is an upgrade, with similar specs.  Keep us posted, and enjoy.

Good Books: as always, Horowitz and Hill, if you had to own but one.

UPDATE:

The last part I needed has finally shipped from China so in approx 7 days I will photo-document my progress. I will be building the function generator and power supply separately for noise control.

the function generator will use: XR2206 IC, with pots for amplitude and frequency adjustment (0-12v, 2-2Mhz) and a switch for triangle, square, sine waveforms. it will have banana jack connectors and a BNC output.

the power supply will use: 2x LM150 and 7805, it will have voltage regulation from 1.25v to 20v and amperage regulation to 2.5A. it will have banana jacks for the adjustable output as well as a second set for the 5v output. the amperage/voltage regulation will have a switch to control what is being regulated and I have two LCD's displaying the supplied voltage and amperage.

Both will be powered over a 2.1' barrel jack supplied by a 24v 3A laptop power brick with built in safeguards and circuit protection.

I will keep you posted.

If anyone knows any good books I could check out that they used from experience, not just suggestions from the net, I would be very grateful

thanks again
--

Angelo
Title: Re: DIY power supply/function generator
Post by: kc1980 on May 16, 2010, 09:09:48 am
I've been working on my design (as time permits), but I realized that I shouldn't hijack Angelo's thread.  I will create a separate post when I finish tracking down the sources of oscillations.  Grrrr.... :'(

BTW, Angelo - I look forward to seeing what you have going on.  It's always nice to see other people's projects in development.

Peace,
Ken