Author Topic: DIY power supply/function generator  (Read 42702 times)

0 Members and 1 Guest are viewing this topic.

Offline angeloTopic starter

  • Contributor
  • Posts: 32
DIY power supply/function generator
« 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!

 

alm

  • Guest
Re: DIY power supply/function generator
« Reply #1 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 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.
 

Offline saturation

  • Super Contributor
  • ***
  • Posts: 4787
  • Country: us
  • Doveryai, no proveryai
    • NIST
Re: DIY power supply/function generator
« Reply #2 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.


« Last Edit: April 27, 2010, 01:31:38 pm by saturation »
Best Wishes,

 Saturation
 

Offline angeloTopic starter

  • Contributor
  • Posts: 32
Re: DIY power supply/function generator
« Reply #3 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
 

Offline angeloTopic starter

  • Contributor
  • Posts: 32
Re: DIY power supply/function generator
« Reply #4 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
 

Offline DJPhil

  • Frequent Contributor
  • **
  • Posts: 511
  • Country: 00
Re: DIY power supply/function generator
« Reply #5 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 :)
 

Offline saturation

  • Super Contributor
  • ***
  • Posts: 4787
  • Country: us
  • Doveryai, no proveryai
    • NIST
Re: DIY power supply/function generator
« Reply #6 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.


« Last Edit: April 27, 2010, 08:59:53 pm by saturation »
Best Wishes,

 Saturation
 

Offline angeloTopic starter

  • Contributor
  • Posts: 32
Re: DIY power supply/function generator
« Reply #7 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!
 

Offline saturation

  • Super Contributor
  • ***
  • Posts: 4787
  • Country: us
  • Doveryai, no proveryai
    • NIST
Re: DIY power supply/function generator
« Reply #8 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.



yes, it is the LM317, and 7805 regulators.


whats with this full wave /half bridge stuff now ?


Best Wishes,

 Saturation
 

Offline angeloTopic starter

  • Contributor
  • Posts: 32
Re: DIY power supply/function generator
« Reply #9 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 ?
 

Offline EEVblog

  • Administrator
  • *****
  • Posts: 37734
  • Country: au
    • EEVblog
Re: DIY power supply/function generator
« Reply #10 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.
 

Offline Kiriakos-GR

  • Super Contributor
  • ***
  • !
  • Posts: 3525
  • Country: gr
  • User is banned.
    • Honda AX-1 rebuild
Re: DIY power supply/function generator
« Reply #11 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. 

 
 

Offline logictom

  • Supporter
  • ****
  • Posts: 336
  • Country: au
Re: DIY power supply/function generator
« Reply #12 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
 

alm

  • Guest
Re: DIY power supply/function generator
« Reply #13 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) 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. 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.
 

Offline Anders

  • Contributor
  • Posts: 34
  • Country: se
Re: DIY power supply/function generator
« Reply #14 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
Proper Planning Prevents Piss Poor Performance
 

Offline angeloTopic starter

  • Contributor
  • Posts: 32
Re: DIY power supply/function generator
« Reply #15 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
 

Offline angeloTopic starter

  • Contributor
  • Posts: 32
Re: DIY power supply/function generator
« Reply #16 on: April 28, 2010, 04:00:24 pm »
The highest wattage I can find are 2 or 3 watts will this suffice ?
 

Offline Kiriakos-GR

  • Super Contributor
  • ***
  • !
  • Posts: 3525
  • Country: gr
  • User is banned.
    • Honda AX-1 rebuild
Re: DIY power supply/function generator
« Reply #17 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


My congrats @Anders , nice - simple - practical ..   8)
( I even printed it )  ;D
 

alm

  • Guest
Re: DIY power supply/function generator
« Reply #18 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).
 

Offline joe912

  • Newbie
  • Posts: 8
Re: DIY power supply/function generator
« Reply #19 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
 

alm

  • Guest
Re: DIY power supply/function generator
« Reply #20 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.
 

Offline clonecrp

  • Regular Contributor
  • *
  • Posts: 52
    • http://theclonestore.com
Re: DIY power supply/function generator
« Reply #21 on: April 29, 2010, 02:32:31 am »
This thing is generating momentum ... can't wait for the outcome..
DT
 

Offline angeloTopic starter

  • Contributor
  • Posts: 32
Re: DIY power supply/function generator
« Reply #22 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.
 

Offline saturation

  • Super Contributor
  • ***
  • Posts: 4787
  • Country: us
  • Doveryai, no proveryai
    • NIST
Re: DIY power supply/function generator
« Reply #23 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.
Best Wishes,

 Saturation
 

Offline Anders

  • Contributor
  • Posts: 34
  • Country: se
Re: DIY power supply/function generator
« Reply #24 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.  ;)
Proper Planning Prevents Piss Poor Performance
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf