Author Topic: Another kit: All-discrete power supply  (Read 51796 times)

0 Members and 1 Guest are viewing this topic.

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Another kit: All-discrete power supply
« on: January 02, 2014, 09:10:39 pm »
While I am still working on my function generator kit (well, after my week-long break), I had originally planned to put together multiple kits, all in the same "How Analog Works" style. The damn FG is taking too long; I'm going to simultaneously put together a much simpler one, so that I will actually have something completed before I grow old ::)

This is a power supply (0-30V 500mA) made entirely from discrete components, but designed to have the line and load regulation of a "proper", opamp-controlled PSU. The regulation loop is fully differential with optional, external sense terminals (obviously not too necessary at 500mA, but they are used to cancel out any internal resistance including through an ammeter). Mostly SMD again, but unlike the FG there aren't as many parts, so it's all 0805. (Unfortunately SOT-363 is a bit tricky to solder and I needed three of them. Inexpensive matched pairs are a bit hard to find.)

I have tested the circuit, but using hand-matched transistor pairs without good thermal coupling, as I do not have the specified parts. Line regulation was 1mV on 30V over an input voltage range from 35 to 45V (0.03%), load regulation was about the same from 0 to 500mA. Once I order PCBs, I will fully characterize the circuit for line and load regulation, temperature coefficient and transient response with the correct parts installed, and will make a probably futile attempt at measuring the output noise with the equipment I have on hand...

The total BOM cost for the control PCB is $10 sourcing all parts from Mouser in decent-quality versions; I will be able to cut probably 20% from this by sourcing general-purpose transistors and resistors elsewhere. This does not include an enclosure, a transformer, a heat sink, the contents of the front panel (pots, meter, meter switch, banana jacks, power switch, power indicator), and the contents of the rear panel (mains connector, fuse holder and fuse).

Modification for power greater than 500mA is fairly simple and will be addressed in the assembly instructions, but will require significant heat sinking (40W for 1A, 80W for 2A).

I will order PCBs tonight; more info to follow after testing them.

P.S. It looks like KiCad's PDF export is fixed now. Previously, I had to export all greyscale PostScript and convert to PDF. If anybody has problems opening the schematic, please let me know.

P.P.S. I'm going to work on the documentation tonight, so if anybody has any "how does this part work?" questions, please wait until I post that. If you have any "you're an idiot and this will never work" comments, feel free to post them now before I spend too much time documenting a brainfart :-+

P.P.P.S. If anybody has any good info on temperature-compensating a Zener, I'm all ears. I used a 6.2V diode + 1N4148, which seemed like a good combination according to the datasheets. There appears to have been a series of compensated Zeners at one point, but I can't find any now. I'm not going to use a bandgap reference because that violates the "all-discrete" design pattern here. I'm not too worried about temperature compensation, as that's more of a long-term drift property, at least once the unit warms up, but I am making an effort to keep it from being dreadful. It's not a precision instrument, but I do like a power supply that starts up to the same voltage I set it to yesterday.

P.P.P.P.S. This is the most P.S.'s I've ever used.
« Last Edit: January 02, 2014, 09:25:04 pm by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline cellularmitosis

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Another kit: All-discrete power supply
« Reply #1 on: January 02, 2014, 09:32:52 pm »
Excellent!  I've been following / reading the archived threads about the LM317 approaches as well as op-amp / pass-transistor approaches, and this makes a perfect third companion.

Been hacking on an LM317-based supply myself as of late.  Fun!

LTZs: KX FX MX CX PX Frank A9 QX
 

Offline calexanian

  • Super Contributor
  • ***
  • Posts: 1886
  • Country: us
    • Alex-Tronix
Re: Another kit: All-discrete power supply
« Reply #2 on: January 02, 2014, 10:32:27 pm »
Looks like fun. Some good learning to be had there. There are many people i encounter that claim to be engineers who do not even know how a conventional AB discrete amplifier works. I like to see discreet kits as it really teaches how a circuit works. Sure you could use a couple of LM317's but you will not learn anything.
Charles Alexanian
Alex-Tronix Control Systems
 

Offline peter.mitchell

  • Super Contributor
  • ***
  • Posts: 1567
  • Country: au
Re: Another kit: All-discrete power supply
« Reply #3 on: January 02, 2014, 10:58:22 pm »
c4757p, throw in a discrete triac pre-regulator :P
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Another kit: All-discrete power supply
« Reply #4 on: January 02, 2014, 11:18:27 pm »
An intriguing idea, but definitely more complicated than I want for this. The function generator is my ALL THE FEATURES!!! project ;)
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline Kappes Buur

  • Regular Contributor
  • *
  • Posts: 137
  • Country: ca
Re: Another kit: All-discrete power supply
« Reply #5 on: January 02, 2014, 11:45:25 pm »
If anybody has problems opening the schematic, please let me know.

I cannot open the pdf file. All I get is this:

 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8070
  • Country: gb
Re: Another kit: All-discrete power supply
« Reply #6 on: January 02, 2014, 11:48:02 pm »
Excellent!  I've been following / reading the archived threads about the LM317 approaches as well as op-amp / pass-transistor approaches, and this makes a perfect third companion.

Been hacking on an LM317-based supply myself as of late.  Fun!

Watch out for those cheap 10-turn pots. They're seriously fragile.
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Another kit: All-discrete power supply
« Reply #7 on: January 03, 2014, 12:11:39 am »
If anybody has problems opening the schematic, please let me know.

I cannot open the pdf file. All I get is this:

That looks like a problem on your end, or with the forum software. The .pdf extension has been stripped. Try saving it and then adding the extension manually.
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline liquibyte

  • Frequent Contributor
  • **
  • Posts: 475
  • Country: us
Re: Another kit: All-discrete power supply
« Reply #8 on: January 03, 2014, 12:27:31 am »
Here you go, have a png.
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Another kit: All-discrete power supply
« Reply #9 on: January 03, 2014, 12:34:32 am »
 :-+

Glad I decided to put together a SPICE sim from the schematic, to include with the docs. Just noticed I swapped the wires to the voltage reference at some point while rearranging the schematic... D'oh! :palm:
No longer active here - try the IRC channel if you just can't be without me :)
 

Lurch

  • Guest
Re: Another kit: All-discrete power supply
« Reply #10 on: January 03, 2014, 12:42:01 am »
I cannot open the pdf file. All I get is this:

Problem with your browser. Something isn't configured for opening PDF's, or incorrectly configured.
 

Offline Galaxyrise

  • Frequent Contributor
  • **
  • Posts: 531
  • Country: us
Re: Another kit: All-discrete power supply
« Reply #11 on: January 03, 2014, 12:47:08 am »
Dave found a temperature compensated zener in his EDC MV106 calibrator teardown (#210)... Microsemi 1N821-1 seems to be the current version.  Mouser doesn't seem to source from Microsemi at all, and digikey doesn't stock it; I guess everyone uses the reference ICs now?  avnet lists it as in stock for qty 1, but looks like it'd be a pretty big increase to your $10 discrete BOM! (judging from digikey's price.)
I am but an egg
 

Offline johnwa

  • Frequent Contributor
  • **
  • Posts: 255
  • Country: au
    • loopgain.net - a few of my projects
Re: Another kit: All-discrete power supply
« Reply #12 on: January 03, 2014, 01:20:14 am »
If anybody has problems opening the schematic, please let me know.

I cannot open the pdf file. All I get is this:


It looks like the server is giving a Content-Type: of application/octet-stream for all types of attachments. I am not sure to what extent this is a problem - it sort of acts as a suggestion that the browser saves the file instead of opening it immediately, though in the end it depends on how your browser is configured. Perhaps I will mention it to Dave.
 

Offline cellularmitosis

  • Supporter
  • ****
  • Posts: 1111
  • Country: us
Re: Another kit: All-discrete power supply
« Reply #13 on: January 03, 2014, 01:24:27 am »
Watch out for those cheap 10-turn pots. They're seriously fragile.

Thanks for the heads-up, I was wondering why they were priced "too good to be true"...

Do you know what the common failure mode is?  e.g. should I expect the wiper to eventually go open-circuit?
LTZs: KX FX MX CX PX Frank A9 QX
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Another kit: All-discrete power supply
« Reply #14 on: January 03, 2014, 01:25:00 am »
Oh freaking great. The KiCad "I'm not going to open your PCB file, and I'm not going to give a meaningful error message. Segfault! Fuck you!! >:D" bug strikes again. Well, the PCB will have to wait until I can get this sorted out. Hopefully tonight.  |O |O |O |O |O

I'll attach a SPICE sim and new schematic soon; I made a couple changes to fix things I didn't notice on the bench.
No longer active here - try the IRC channel if you just can't be without me :)
 

Online Monkeh

  • Super Contributor
  • ***
  • Posts: 8070
  • Country: gb
Re: Another kit: All-discrete power supply
« Reply #15 on: January 03, 2014, 01:30:35 am »
Watch out for those cheap 10-turn pots. They're seriously fragile.

Thanks for the heads-up, I was wondering why they were priced "too good to be true"...

Do you know what the common failure mode is?  e.g. should I expect the wiper to eventually go open-circuit?

The glue on the terminal bar fails and the hilariously thin wire within proceeds to break.
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2124
Re: Another kit: All-discrete power supply
« Reply #16 on: January 03, 2014, 01:43:59 am »
Oh freaking great. The KiCad "I'm not going to open your PCB file, and I'm not going to give a meaningful error message. Segfault! Fuck you!! >:D" bug strikes again. Well, the PCB will have to wait until I can get this sorted out. Hopefully tonight.  |O |O |O |O |O
Mawha ha ha ha, ... oops, sorry, shouldn't laugh. As far as I know, the Kicad files are all ASCII based, so you can go in there with your favourite text editor and remove, change, comment-out the offending bit. Caveat: I'm not responsible for any bits of PCB you delete, destroy or otherwise disconnect. ;)

Quote
I'll attach a SPICE sim and new schematic soon; I made a couple changes to fix things I didn't notice on the bench.
Something that has been tweeking my pots (as t'were), and I can't quite make my mind up, but: You have the load connect to the collector of the "output amplifier", so the loop gain of the voltage control is defined by the load - which is unpredictable - wouldn't it be better to use a voltage-follower output stage?.
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Another kit: All-discrete power supply
« Reply #17 on: January 03, 2014, 01:50:42 am »
It would be more stability-friendly in theory, that is certain. To be honest, I don't remember why I chose that topology... I haven't had any problems with it at all, though, and I've tested it with large capacitive and inductive loads as well as resistive. It is a fairly common arrangement.

I will consider changing it, though, especially considering that the kit is supposed to be instructional. "Eh, it works for me!" isn't exactly good engineering!

Edit: Theory != practice. A quick swap plus reconfiguration of the error amplifier has made a very unhappy control loop that seems to chew up and spit out most compensation topologies I can think of.. I spent enough time farting with the loop today - I don't really feel like changing it in the name of "good practice" when I've got a working circuit.

Oh freaking great. The KiCad "I'm not going to open your PCB file, and I'm not going to give a meaningful error message. Segfault! Fuck you!! >:D" bug strikes again. Well, the PCB will have to wait until I can get this sorted out. Hopefully tonight.  |O |O |O |O |O
Mawha ha ha ha, ... oops, sorry, shouldn't laugh. As far as I know, the Kicad files are all ASCII based, so you can go in there with your favourite text editor and remove, change, comment-out the offending bit. Caveat: I'm not responsible for any bits of PCB you delete, destroy or otherwise disconnect. ;)

Seems to be an error in loading the file, not saving. I think the file is fine. Though, I will try the old "binary search" method to figure out which part it doesn't like (for the uninitiated, load only half the file, then the other half, then descend into the bad half, narrowing down which section works and which does not).
« Last Edit: January 03, 2014, 01:57:40 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2124
Re: Another kit: All-discrete power supply
« Reply #18 on: January 03, 2014, 02:29:28 am »
"Eh, it works for me!" isn't exactly good engineering!
Edit: Theory != practice.
I agree, that's why I said I couldn't make my mind up. An "n" of 1 working devices outstrips an "n" of 0 theoretical devices! Although, I am still weary of putting some of the specification into the "user" space; you never know what the user is going to hang on to the output!

Quote
Seems to be an error in loading the file, not saving. I think the file is fine. Though, I will try the old "binary search" method to figure out which part it doesn't like (for the uninitiated, load only half the file, then the other half, then descend into the bad half, narrowing down which section works and which does not).
If i remember correctly (and I could be remembering a totally different program), the parser doesn't have much error detection. If something does not conform to the "format", it just runs off the end of the file looking for the appropriate terminator string, hence seg fault on a missing comma, or too many commas etc..
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2124
Re: Another kit: All-discrete power supply
« Reply #19 on: January 03, 2014, 02:58:17 am »
Oh and, ... at the risk of returning the original topic, full marks for presenting a ground-up power supply design from first principles. I'm getting a bit P'd-off with seeing yet another method of forcing a LM317 to do what it was never intended to do. I'm not anti LM317, but, right place, right time?
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Another kit: All-discrete power supply
« Reply #20 on: January 03, 2014, 02:59:11 am »
If i remember correctly (and I could be remembering a totally different program), the parser doesn't have much error detection. If something does not conform to the "format", it just runs off the end of the file looking for the appropriate terminator string, hence seg fault on a missing comma, or too many commas etc..

I spent a few days writing a library generator for KiCad - most of my libs are auto-generated - and I will have to correct you here. It doesn't have any goddamn error correction.....

OK, maybe a little.....



SPICE simulation here. It's a little bit messy; I'm not done with it. But it works.

Note on the SPICE sim: There is a software instability that does not appear to exist in real life. Some load conditions (including, 100% of the time, the SPICE active load/current sink) cause the circuit to oscillate at 5 MHz for about 2ms during startup. I see no startup instabilities in real life, and it quickly stabilizes. The solution is not to run ".tran startup" under these conditions.

Changes made:
1) Startup sequencing. The main rails come alive before the dedicated bias rail for the current limit amplifier, meaning that for a few ms, the output is unlimited. I added Q14, Q15, R25, R26, and R13, which override the control loop until the bias rail is up.

2) Active load on the differential amplifier. With 2N3904 there was enough DC gain for good load regulation with a resistive load, and the lower AC gain made the loop easier to stabilize. With the PMP4201Y (could just be the model -  I don't have one on hand) the line regulation goes out to 0.1%. WIth an active load I am getting 0.002% in simulation - real life, I'm sure, won't be quite that good. This also means no bias trimpot is necessary.

3) Changed the voltage loop compensation. It stabilizes differently with the active load, of course. Annoyingly, this also contributes to the line ripple rejection... It's pretty decent now, though I'm considering sitting down to a cup of coffee and calculator and designing a compensation network with a steeper edge around 120 Hz.

The reference designators should match the schematic, unless I missed something, though I haven't posted the updated KiCad schematic The SPICE one should do for now. I'll post the schematic along with the PCB after I finish fighting with KiCad.

Shh... don't tell anyone I packed the models in the zip file. IIRC you're not supposed to distribute them  >:D

Don't forget to probe across the load to measure the voltage. Those inductors output leads both have resistance!
« Last Edit: January 03, 2014, 03:04:08 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Another kit: All-discrete power supply
« Reply #21 on: January 03, 2014, 03:05:14 am »
Do you know what the common failure mode is?  e.g. should I expect the wiper to eventually go open-circuit?

You should always expect wipers to go open circuit, because they do all the time. Always design your circuit to do something safe if this happens.

Speaking of which, my voltage pot. Er.... thanks for bringing that up. :-[ :)
« Last Edit: January 03, 2014, 03:06:49 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Offline calexanian

  • Super Contributor
  • ***
  • Posts: 1886
  • Country: us
    • Alex-Tronix
Re: Another kit: All-discrete power supply
« Reply #22 on: January 03, 2014, 03:21:32 am »
Watch out for those cheap 10-turn pots. They're seriously fragile.

Thanks for the heads-up, I was wondering why they were priced "too good to be true"...

Do you know what the common failure mode is?  e.g. should I expect the wiper to eventually go open-circuit?

The glue on the terminal bar fails and the hilariously thin wire within proceeds to break.

Those Bourns knock off ones. Bonens i think they have written on them. Garbage.
Charles Alexanian
Alex-Tronix Control Systems
 

Offline c4757pTopic starter

  • Super Contributor
  • ***
  • Posts: 7799
  • Country: us
  • adieu
Re: Another kit: All-discrete power supply
« Reply #23 on: January 03, 2014, 04:13:21 am »
Found it! It saved the file wrong. Yet another case of "KiCad developers can't handle symbols in names". |O It saved an invalid net ID for every copper pour that was tied to V- or V+.

They are supposed to be integers >= zero. The fact that it segfaults if it encounters a -1 makes me suspect something very, very dirty in the net code. Like, parsing the numbers and then shoving them directly up the ass of an array subscript without a bound check.

Think I'll file a bug report. I can't get it to save the file wrong again :-// but it consistently segfaults on -1, which is very bad.

If anyone has that problem, look for any instances of (net -1) in the PCB file, and just remove the whole key-value pair including parentheses. That'll leave the pours unassigned, and you can just edit them and reassign them.

Edit.... nope.... it doesn't even always choke on (net -1)...
God, they put the shittiest coders they can possibly find on parser duty. I was going to be nice and put together a minimal test case, but I guess they can just dig through my whole 3000-line PCB file.
« Last Edit: January 03, 2014, 04:22:52 am by c4757p »
No longer active here - try the IRC channel if you just can't be without me :)
 

Online Andy Watson

  • Super Contributor
  • ***
  • Posts: 2124
Re: Another kit: All-discrete power supply
« Reply #24 on: January 03, 2014, 04:33:06 am »
Edit.... nope.... it doesn't even always choke on (net -1)...
God, they put the shittiest coders they can possibly find on parser duty. I was going to be nice and put together a minimal test case, but I guess they can just dig through my whole 3000-line PCB file.
I've only reverse engineered the bits that I needed to know about but what did stand out was the total inconsistency in string handling. Some strings are quoted; some are not. Some strings have special identifiers at the start, some...who knows? It doesn't seem to matter! If you've managed to embed a special token in the middle of an unquoted string - you're stuffed ;)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf