Help building/understanding a switched power supply

Thread Starter

scorch

Joined Jun 20, 2009
9
I would really like to build the power supply described in the Linear Technology Application Note 84, page 146 (see http://cds.linear.com/docs/Application Note/an84f.pdf).
It's a 0-100V 2-8A supply.
The application note has a full schematic, but considering this thing is supposed to be able to do 100V and 8A (though not at the same time), I'm a little wary of just trying to slap it together on a breadboard.
So I built the circuit in LT Spice, thinking I could test it there, and get a better idea of what the actual limits of the circuit are. I've done a quick pc board design for it as well, but considering the voltages and currents involved, some of the traces will clearly need to be larger and widely spaced. Again, this is what I was hoping the simulation could help me figure out.
The problem is that my simulation doesn't seem to quite work, and I can't figure out why. I've never really done anything with switch mode power supplies before, so I feel kind of lost at this point. I've attached the .asc file from LT Spice.

Any ideas on what's wrong with the spice model? Thoughts on design/testing of the pcb? Pointers on where I could look to find out more information?

Thanks!
 

Attachments

R!f@@

Joined Apr 2, 2009
9,918
U have to wait till some one who uses spice to check it.
As for me I will follow this thread, I do have something like this in mind.

But I like to add tht PCB design consideration effects adversely on SMPS design and it's flawless operation

This is where I am having trouble
 

SgtWookie

Joined Jul 17, 2007
22,230
I've tidied it up a bit, and filled in some missing items.

The first attachment needs to be unzipped into your
C:\Program Files\LTC\SwCADIII\lib\cmp
directory, AFTER you have renamed your current Standard.dio to standard_dio.bak

The 2nd attachment contains pot.asy and pot.sub
Place pot.asy into C:\Program Files\LTC\SwCADIII\lib\sym
Place pot.sub into C:\Program Files\LTC\SwCADIII\lib\sub

I assume you've already downloaded 2N6387.LIB and placed it in the ..\sub directory.

I looked up the data for the Magnetics Inc MPP 55076 core; 57 turns would result in ~182uH for the primary and secondary of T1. LTSpice requires a SPICE directive like: K1 <inductor1> <inductor2> [...more inductors..] <coupling> to indicate a transformer.
I use 1 for the coupling. You could use numbers like .997 to indicate losses in the core, copper losses, etc. but it slows the simulation terribly.

I neglected to add the resistance of the winding in the model. 114 turns of AWG22 on that toroid would take ~172 inches (14.33 feet) of wire, which would measure ~232m Ohms (milliOhms). They say AWG-20 in the note, but that may not fit on the toroid according to the dimension specs in Magnetics' datasheet. Anyway, use 100m Ohms for the primary and 132m for the secondary. If you want to try it with AWG-20, the total resistance would be ~146m Ohms; use 59m for the primary and 87m for the secondary.

I used pots instead of individual resistors. Try the pot; you'll like it.

You need to understand the difference in LTSpice between milli and meg.
30m = 30 milliOhms, as in 30m Ohms. 30m = 0.03
In order to specify 2.7 MegOhms, use 2.7MEG
This will bite you if you don't remember it. Trust me on this.

You can specify 3900 Ohms as 3.9k or as 3k9 - LTSpice will accept both formats. You're better off to use the short form; it's too easy to make mistakes if you have lots of 0's in a number.

You'd used some Zeners that you must've added to your standard.dio that I didn't have. I substituted Zeners that I had added to my modified standard.dio.

You had an opamp (U2a) flipped around and mis-connected. I re-numbered the opamps to agree with the App Note.

I added a current source to Vout as a 1A load. If you operate it with a very small load, it will overshoot quite a bit with both pots set to 0.5 (midway)

I had to change some of the defaults in the Control Panel to get it to run; otherwise I was getting the "Timestep too small" error.
Compression tab...
Reltol: 0.0025
Absolute Voltage tolerance: 1e-4
Absolute Current tolerance: 1e-6
SPICE tab..
Gmin: 1e-10
Abstol: 1e-10
Reltol: 0.001
Chgtol: 1e-10
Voltol: 1e-5
Sstol: 0.001
MinDeltaGmin: 0.001

It still could use some work, as the overshoot on startup is considerable. Takes a while for it to settle out.

The IRF450 used in the original simulation was overkill for the voltage specification. Vdss will get to about double whatever you're using for the input voltage; so for a 50v supply, a Vdss rating of 100 to 150 would probably be fine. Even an old IRF540 might do the trick, but there are much better and more modern MOSFETs available than that now.
 

Attachments

Last edited:

Thread Starter

scorch

Joined Jun 20, 2009
9
Wow, I thought I had been fairly careful about inputting the circuit, but apparently I screwed up quite a few things. Thank you very much for helping me with this!
This is actually my first time using LT Spice, so I completely missed the m vs MEG. Yes I had kinda hacked in some extra zeners for ones that weren't in the default libraries, but I didn't really know what I was doing.
I figured there must be some way to have a pot, but I never really took the time to really look into it. That's a very nice addition to have.

With a working simulation, I feel much more confident in this project.
You mentioned that the IRF450 wasn't the best choice, and when I was looking for parts, I noticed that it's pretty much impossible to get these days. What sort of characteristics should I be looking for in a replacement? I must admit, I only have a very vague idea of what the purpose of it is in this circuit (which is why I wanted to put it into a simulator so I could safely experiment with it). Are there any recommendations for where I could learn more about this design, and how to improve things such as the startup overshoot?

Thanks again!
 

SgtWookie

Joined Jul 17, 2007
22,230
Wow, I thought I had been fairly careful about inputting the circuit, but apparently I screwed up quite a few things. Thank you very much for helping me with this!

This is actually my first time using LT Spice...
This was your first attempt? Gee, you did a lot better than I did on my 1st attempt - and this is a moderately complex circuit. Most 1st-timers make LOTS of errors and leave lots of stuff out. You had just about everything in there. If you go back and look at your original, you'll see how you left out a 3.9k resistor next to U2A and a few other things. A lot of what I did was simply reducing the amount of "white space" by pushing things together more, and removing some zig-zags in the wiring.

... so I completely missed the m vs MEG. Yes I had kinda hacked in some extra zeners for ones that weren't in the default libraries, but I didn't really know what I was doing.
In the standard.dio that I attached, there are a number of 1/2W and 1W Zeners that have been around for quite awhile. I really need to add some Zeners that have lower Izt's, as the old ones suck up a good bit of power. The BZX79 series would be a welcome addition.

I figured there must be some way to have a pot, but I never really took the time to really look into it. That's a very nice addition to have.
I can't take credit for the pot. I downloaded it from the Yahoo! LTSpice User's Group. I did rename it from "potentiometer" to "pot" and change the alignment in the symbol file, because I like fiddling with things. ;) I also added a line in the symbol file to automatically include the pot.sub in the Spice listing without having to enter that info into a Spice .inc directive.

With a working simulation, I feel much more confident in this project.
You mentioned that the IRF450 wasn't the best choice, and when I was looking for parts, I noticed that it's pretty much impossible to get these days. What sort of characteristics should I be looking for in a replacement?
I did a parametric search on Digikey, looking for a MOSFET that had a Vdss of 100v to 180v, Id rating of 15A to 50A, and TO220 package. After more selective weeding, this one seems to meet all the requirements:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=IRFB5615PBF-ND
Datasheet: http://www.irf.com/product-info/datasheets/data/irfb5615pbf.pdf

Although there are several others that could also work. This one just seems to be the best trade-off for a reasonable price that Digikey had in stock. Note that Digikey will ship SMALL orders via USPS 1st Class, which can save $$$. Order several extra for spares and perhaps other projects.

I've attached a zipped model and symbol for it. Same routine as last time.

Adding MOSFETs to LTSpice is somewhat of a pain. In order to convert a standard Spice model to the format LTSpice uses, you have to do a lot of interpreting. I said the heck with that and just download the models I need as I need them.
From the \sym directory, I created a \MOSFETs directory, and then separate \N-ch and \P-ch directories for the symbols.
The .sub or .spi files just go in the \lib\sub directory.

If I really wanted to do it right, I'd copy/paste all of the models into a single library, and then the model desired could be selected from a list.

I must admit, I only have a very vague idea of what the purpose of it is in this circuit (which is why I wanted to put it into a simulator so I could safely experiment with it). Are there any recommendations for where I could learn more about this design, and how to improve things such as the startup overshoot?
I'll echo Kermit2's recommendation as a starting place. LOTS of good reading on that site. Stay away from the "hobby" circuits though.

Oh, BTW - you used the wrong kind of caps for C1, C9, C10. Those are supposed to be 10uF, 200v film caps (like metalized poly film), not aluminum electrolytic. Aluminum electrolytic caps would explode due to the high power dissipation. In the simulation, C9 was dissipating nearly 5 Watts of power! Were it a test with actual components, you'd have aluminum confetti everywhere. :eek:

Replace those caps with the non-polarized cap symbol, and just indicate the capacitance and voltage rating for the moment. Even 100v caps should be OK. Caps with high voltage ratings get large and expensive quickly, particularly if they are not electrolytic caps.

OK, after a quick search on Digikey, this seems to be the cheapest cap that'll do the job:
http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=EF2106-ND
$3.44/ea isn't terrible for a poly film cap that large. 250v rating, too.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Just a thought...
might've been too early to reduce the Vdss of M1. I'd just gotten the simulation working, and still stomping out some bugs here and there. Even with relaxed tolerances for the SPICE settings, it still takes a heck of a long time to run the simulation on this computer, as it doesn't have a coprocessor (old Celeron 2.5GHz). I really ought to be doing this kind of stuff on my dual core beastie.

I don't know what the ESR is of those 10uF poly caps I suggested; haven't found that in the specs yet. But, just to have something in there, I added 10m for their resistance. They'll certainly have a lower ESR than aluminum electrolytics, but I really don't know what it'll be right now.
 

Thread Starter

scorch

Joined Jun 20, 2009
9
Yeah, I realized that there was no way I should use an al electrolytic cap in those spots, that was just what I picked out of the parts list because I couldn't figure out how to type in a mu.
I've actually already picked up some caps for those http://www.mouser.com/Search/Produc...TPvirtualkey64700000virtualkey647-QXK2E106KTP

Hopefully tonight I'll have some time to plug the changes you've given me into my computer and check out the results.

And thanks for the pointer to the SMPS site. I've been reading pages as I get time.
 

SgtWookie

Joined Jul 17, 2007
22,230
Those caps should work just fine - good price, too. :)

OK, next iteration...
I was having some really strange artifacts (spikes) pop in after changing C1,C9,C10 to low-ESR versions (just typing in 10m, then 25m for series resistance); took me awhile to figure out that you'd used a REALLY bad cap for C4; it had an ESR of 3.5 Ohms! :eek:

That's the bypass cap for U1; it has to be a low ESR type.

Also, a very dim bulb finally lit in my thick skull that there were NO bypass caps for U2 and U3 shown in the original schematic! I added C15, C16 and C17; 100nF (0.1uF) caps; they can be metal poly film or ceramic caps. Those changes made a lot of difference.

I changed D8 to a diode that's in the library; it needs to have a higher voltage rating than is currently available. I just don't have time right now to fiddle around more with it today.

I've also added parameters so that the efficiency of the circuit can be displayed. This is a great tool to find out where you're dissipating power.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
A couple more notes;
The Zeners I used aren't quite right.
D1 has 10mA current through it.
D2 has 3mA current; so it should be a BZX79 series type.
D3 doesn't have any current through it right now; haven't analyzed why not as of yet.
D11 is a 2.4v Zener that's only getting 3mA as well. It really needs to be an accurate 2.5v reference. I suppose a TL431 could be used, but you want that point to be very stable over temperature, as any errors will be multiplied by a factor of 40.
 

SgtWookie

Joined Jul 17, 2007
22,230
Let's compare the specs between your MOSFET, the IRF450, and the one I selected.
Rich (BB code):
FQPF11N40CT - N-Ch Power MOSFET(Vdss=400,Rdson=430m,Id=11A,Qg=28nC)
IRF450      - N-Ch Power MOSFET(Vdss=500,Rdson=500m,Id=12A,Qg=120nC)
IRFB5615PBF - N-Ch Power MOSFET(Vdss=150,Rdson= 32m,Id=35A,Qg=26nC)
Your MOSFET has a far lower gate charge, just a bit lower current rating, and 14% lower Rdson than the IRF450. However, the IRF450 came in a TO-3 package, which helps a great deal in transferring heat to a sink; it's about 4x as effective as the TO-220 package. I don't have a model for your MOSFET, and Fairchild has made it tough to get at them.

If you want to request the model, click on the "Electrical/Thermal" link near the bottom right of this page: http://www.fairchildsemi.com/pf/FQ/FQPF11N40C.html
and provide the requested information.

The MOSFET I selected has a much lower Vdss rating, but that should be OK. The gate charge is just a bit less than your MOSFET, basically a tie. The big difference is in the Rds(on); the power dissipation in the MOSFET I selected will be about 6.5% of the IRF450, and about 7.44% of your MOSFET.

At low power out, I was getting around 350mW power dissipation in the MOSFET that I selected; yours would be around 4.7W. At high power out, I'm afraid it would be impossible to keep your MOSFET cool enough to prevent a melt-down - even if you had it immersed in ice water. The thermal coupling from the die to the case (tab) is simply not good enough in the TO220 package.
 

SgtWookie

Joined Jul 17, 2007
22,230
Actually, it might not be as bad as I suspect. I tried a Silconx(sp) Si7802DN, which has an Rdson of 435, Vds of 250 and gate charge of 19nC; the closest thing I could find in the standard library. Power dissipation was up to around 2W during the initial climb, and that's not too bad. Haven't tried adjusting the pots yet; this thing just takes a really long time to run.
 

Thread Starter

scorch

Joined Jun 20, 2009
9
You make an excellent point with regard to the Rds(on), which is not something I had thought of. Once heat sink requirements and lifespan is factored in, I think it's probably worth a few bucks to get the part you suggested.
You mentioned alternate part possibilities for D11, but I actually already picked up the part specified in the schematic (LT1034CZ-2.5), so I'd assume that would be a fairly stable. It seems impossible to find a spice model for it however, so I'm not sure how best to approximate it. I was thinking a fairly ideal 2.5v zener should do it.

I tried plugging in the model I got from here: http://www.centralsemi.com/engineering/spicemodels/spicezener.aspx (the CMDZ5222B). It seems to work.
 
Last edited:

Thread Starter

scorch

Joined Jun 20, 2009
9
So what would be the best way to add a 12v fan to the circuit? I'm planning on building this into an enclosure, and considering the power involved, I'd like to ensure it has adequate cooling.
Would there also be some way to add an amp-limit indicator? I'm thinking an LED that would turn on when the current limiting circuit takes over.
Finally, how can I determine what sort of values I should use for a fuse on the incoming AC voltage?

I've also been playing around with laying the pcb out in eagle. If anyone cares to take a look and give me any criticism/advice, I'd be thankful. The transformer and inductor that I stuck in there are not actually the footprints I expect for those components. The packages for the potentiometers are also kinda misrepresented, since those would actually be panel mounted.
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
You make an excellent point with regard to the Rds(on), which is not something I had thought of. Once heat sink requirements and lifespan is factored in, I think it's probably worth a few bucks to get the part you suggested.
You mentioned alternate part possibilities for D11, but I actually already picked up the part specified in the schematic (LT1034CZ-2.5), so I'd assume that would be a fairly stable. It seems impossible to find a spice model for it however, so I'm not sure how best to approximate it. I was thinking a fairly ideal 2.5v zener should do it.

I tried plugging in the model I got from here: http://www.centralsemi.com/engineering/spicemodels/spicezener.aspx (the CMDZ5222B). It seems to work.
From what the simulation shows, the part I chose seems to work pretty well. Yours might not be too bad, either. The simulation just takes a very long time to run on this computer, so I haven't performed much analysis on it; basically just made the thing run.

If you already have the LT1034CZ-2.5, you're in good shape for that. I suppose you could replace D11 with a 2.5v source; that way you'd know it was rock-steady in the simulation. However, you wouldn't be able to calculate efficiency after that; as the efficiency routine requires 1 voltage source and 1 current source exactly. Basically, anything that gives you about 2.5v at the top of D11 will be OK.
 

SgtWookie

Joined Jul 17, 2007
22,230
So what would be the best way to add a 12v fan to the circuit? I'm planning on building this into an enclosure, and considering the power involved, I'd like to ensure it has adequate cooling.
As Markd77 mentioned, a 120v fan would be the way to go; otherwise you'd place additional load on the supply.

Would there also be some way to add an amp-limit indicator? I'm thinking an LED that would turn on when the current limiting circuit takes over.
That would be in the vicinity of U2a and the Vc input. When Vc drops below ~0.8v, the regulator shuts down. If there is current flow through D9, it's in shutdown.

Finally, how can I determine what sort of values I should use for a fuse on the incoming AC voltage?
10A slow blow should do it, or a 10A circuit breaker.

I've also been playing around with laying the pcb out in eagle. If anyone cares to take a look and give me any criticism/advice, I'd be thankful.
Did you attach both the .sch and .brd files, and any custom .lbr files that you had to create?

The transformer and inductor that I stuck in there are not actually the footprints I expect for those components. The packages for the potentiometers are also kinda misrepresented, since those would actually be panel mounted.
So use pads from wirepad.lbr, or perhaps a 3-pin header from header.lbr.
 

Thread Starter

scorch

Joined Jun 20, 2009
9
That would be in the vicinity of U2a and the Vc input. When Vc drops below ~0.8v, the regulator shuts down. If there is current flow through D9, it's in shutdown.
Would something as simple as a resistor and LED work from the base of Q2 (which should be at 3.9v) to Vc work? Or should I use another op-amp comparator to isolate things more?

Did you attach both the .sch and .brd files, and any custom .lbr files that you had to create?
The .sch and .brd files are in the .zip. I don't think I used any custom .lbr files.

So use pads from wirepad.lbr, or perhaps a 3-pin header from header.lbr.
I'm not sure why I didn't think of that... I guess I was concentrating on reproducing the schematic.
 

Thread Starter

scorch

Joined Jun 20, 2009
9
I've swapped out the pots for wirepads, and switched in a more realistically sized inductor. This allowed me to rearrange things a bit and size the board down. The transformer is still just a stand in, though I think the actual one will be fairly close in general dimensions, and traces on that portion of the board aren't very crowded, so I'm not worried about that. I don't have the current limit indicator circuitry on there, since I'm not sure what that'll look like yet.
I am using a 2 sided board, with the top being primarily a ground plane. I'm planning on etching this myself, so I wanted to keep the second layer fairly simple so it'll be a little more forgiving of any alignment errors.
 

Attachments

Top