LM317 power supply diagnostics - Page 1
Forum section: electronics / beginners

author: microbug
author_rank: Frequent Contributor
timestamp: November 21, 2013, 09:09:45 pm
content: Hi,I have been working on a simple LM317 power supply with current limit for some time now (Paul Price's design). The schematic I used to make the pcb (home-etched) is attached.I only have a crappy UT120C pocket DMM which won't do current >400ma and a Hitachi V-223 scope (picked up for £15 on eBay) which I recently 'calibrated' with a cheap AD9850 module.My problem at the moment is that the current limiting isn't working properly. It seems to be very intermittent and always pulls the output to .2v or so (not 0). The voltage adjust pot is a very nice Vishay spectrol wirewound, but the current one is a cheap ebay thing from china (a fake Bourns one) - I need to replace it, but I don't see why it should cause too much of a problem at the moment because there isn't much current going through it. I don't know, but I suspect it's a 10-turn trimmer in a wirewound housing.I need to know how I can work out what the current limit is based on the non-inverting input of op-amp A - it doesn't seem to directly relate to the limit which is applied.Is there something I'm missing here? My PCB layout was pretty sketchy, but it seems to be OK (all components tested linked to correct places). The components should be decent quality (apart from the current set pot). The trace widths on the pcb are plenty wide. Input is just over 40v pk-pk, rectified to 20v. I have noticed that if I set the voltage adj pot to its minimum, the output is -0.4v.Would I be better off just starting again with the pcb? I can attach pics of it if needed.Adding to the confusion is the fact that I don't really trust the readings on my multimeter. It's not shielded at all, often reads 5-50mv background noise and my oscilloscope shows a large amount of background noise as well - I am working fairly close to our switchboard. I'm getting a BM257 for Xmas.

author: Simon
author_rank: Unknown
timestamp: November 21, 2013, 09:48:00 pm
content: what is the current limit op-amp supposed to be doing ? most limiting designs rely on a BJT and a voltage drop resistor that shuts the transitor off (or rather turns it on so that it turns something else off)

author: microbug
author_rank: Frequent Contributor
timestamp: November 21, 2013, 10:04:48 pm
content: As far as I can tell (this isn't my design) the first opamp amplifies the drop across a 0.01ohm shunt and feeds it into the second. The second acts as a comparator, pulling the adj pin low if the set current is lower than the output. The diode between the output of the second opamp and the adj pin prevents the opamp from pulling adj high.There is a nice dual tracking lm317 in silicon chip. I have the digital copy of that issue and the pcb image for etching - I might just start again - scrap this - and use that as it is much better documented and also dual tracking. I believe that one uses a transistor to pull the adj pin as low as it needs to before the output current reaches the set current.

author: codeboy2k
author_rank: Super Contributor
timestamp: November 21, 2013, 10:06:14 pm
content: According to your schematic, the points labelled IOUT and ISET are direct reading, at 1V = 1A , so if you put a digital multimeter there you can read amps directly at either the ISET point or the IOUT point.Quote from: Simon on November 21, 2013, 09:48:00 pmIt looks like the 358 current limit opamp is drawn to do that, to shunt current away from the ADJ pin of the LM317, thus lowering the voltage output until the IOUT pin matches the ISET pin.As the ADJ pin of the 317 only requires a few micro-amps of current, the opamp directly on the ADJ pin should be able to do it.to the OP : note that the LM358 op amp has 3mV of input offset, so this will be amplified at the current sense by 100, so, a 500mA limit will be set at 0.500V at the ISET node, but the input offset of the current sense opamp will likely cause the current sense to trip at 0.500V - (3mVx100) = 0.200VIn other words, as soon as 200ma is drawn from the circuit through the 10mOhm sense resistor, then that opamp will multiply that by 100-> 200mV, add that to the input offset x 100 = 200mV+300mV = 500mV and that matches your setpoint.So you will seem to set it for 500mA but it trips at way less than that because of the sense opamp's input offset.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 23, 2013, 03:49:16 pm
content: Quote from: microbug on November 21, 2013, 09:09:45 pmFirst, I wouldn't worry too much about not getting precisely 0V when the voltage is at min; this depends on the forward voltage of LED2. It needs to match the 1.25V reference inside the LM317. You could replace LED2 with a VBE-multiplier (one small-signal transistor and a resistor, and a pre-set resistor) if this matters to you.Regarding the current control circuitry, I see how it is supposed to work, but I'm slightly worried about the fact the op-amp is powered from 0V, and it expects to work with the inputs at 0V. Yes, I know the LM358 is supposed to work with the inputs at 0V, but even so, I personally would have preferred to power the op-amp from the -2V rail. Of course, the 555-generated -2V rail might not be able to supply the current; it would need testing. Indeed, when I built something like this many years back, I derived the negative rail from the AC input directly. Much simpler...As the op-amp's output can't get to 0V, that's why the current on this PSU can't be adjusted right down to 0mA.To debug, break it down. Does the voltage at "IOUT" seem sensible? As mentioned, it should be 1V per amp. This will be there all the time, so I'd lift one end of D3 so that the current limit can't affect the output, then try varying the load (use some chunky resistors). If you can borrow a second DVM, you can measure the actual current while monitoring the voltage at IOUT.Once you're happy that's working, check that the voltage at "ISET" varies smoothly as you adjust the control. It should vary between 0 and ~1.6V (depends on the LED, of course). If that looks good, reinstall D3, and see what happens. Use your 'scope to see if the op-amp is oscillating when it enters current limit mode...Oh, and the current limit circuit won't be able to pull the output right down to zero - you have whatever the op-amp can do when the output is saturated against its negative rail, plus the drop of D3, plus the 1.25V of the LM317. Don't expect lab-grade performance from such a simple supply; but that said, this ought to be pretty good when working, so it'll be worth the effort. Taking the time to figure out how it should be working will give you invaluable experience for the futureAnd watch the temperature of the LM317. I wouldn't expect 1.5A at low voltages from a single one of these. In the future, you might consider strapping a beefy transistor around it to share the load...Good luck,Mark

author: Kevin.D
author_rank: Frequent Contributor
timestamp: November 23, 2013, 05:09:30 pm
content: Just some problems with this circuit microbug some already pointed out by other responders .How stable do you think that output voltage derived from the 555 is .? If it drifts then so does the output of the V reg .On your current limiting circuitry :-The input offset Voltage of the 358 is (2-7 mV ?) times the gain of IC3b (you have ~100) will appear as an offset on it's output .In order for the output of the lm317 to be ~ 0 V requires the adj pin being pulling down to -1.25V ,but your opamp IC3A output can only go down to ~0 V (and then you have a diode drop of D3 to add to that) ,so during current limiting you would still have ~ 1.8 V at the output off the lm317 .Lastly that current control loop will oscillate ,look at the enourmous gain you got around that loop there ,you would need to roll off the high frequency gain of IC3A by quite alot to make that stable .Heres an ideawhy dont you drop the lm317 (which was never designed to go to 0v) and go for a nice darlington transistor based design instead ,it will cost you not much more and you will gain much more knowledge doing that and end up with a nice power supply at the end .

author: microbug
author_rank: Frequent Contributor
timestamp: November 23, 2013, 06:16:30 pm
content: Ok, there's something weird going on. With a 50 ohm load at 10v, there was about 200ma of current (using my scope as a dvm?). Iout read 120mv. Then the current started to drop spontaneously and Iout began to oscillate at 2.5 kHz. Is this thermal shutdown on the LM317? It should have only been dropping about a watt, it was not but not burning.Edit:@Kevin.D, do you have any specific designs in mind?I'm looking at Iset. With the same 50ohm load, current limiting triggers at just below 150mv. Between 150mv and 45mv, Iout oscillates before settling a bit above 0 (I can't remember exactly, my bench is downstairs and computer is upstairs).

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 23, 2013, 06:44:44 pm
content: Is the LM317 on a decent heat sink?

author: microbug
author_rank: Frequent Contributor
timestamp: November 23, 2013, 06:46:27 pm
content: No - I can mount it to the fairly large metal back plate of the enclosure the supply will eventually be in. I do have heatsink compound.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 23, 2013, 06:55:10 pm
content: It must be on a heat sink. With 10 volts out, you've got approximately 10 voltsacrossthe LM317. At a current of 200mA, that's a power dissipation of 2 watts.The thermal resistance of an LM317Twith no heat sink is 80C/W, so the temperature rise will be 160C.Be careful - that could hurt! In general, if a component is too hot to hold, it's more than 60C, and for a semiconductor, that's usually too hot for long-term reliability. In my experience, despite the claimed built-in thermal protection, they will fail when allowed to overheat.When you attach it to the heat sink, remember you'll need to insulate the metal tab.Remember, you can't debug the current controller until you're happy the thing works reliably in "constant voltage" mode. As I said above, break it down

author: microbug
author_rank: Frequent Contributor
timestamp: November 23, 2013, 06:56:46 pm
content: OK- I have an insulating kit for to-220 packages so I'll drill a hole in the back panel and mount it. I'll post back afterwards!

author: microbug
author_rank: Frequent Contributor
timestamp: November 24, 2013, 11:21:39 am
content: OK, the LM317 is properly mounted with a TO-220 mounting kit and some thermal grease. The tab of the LM317 is not shorted to the back plate. The aluminium back plate seems to be working well - it is getting very slightly warm on a 50ohm load @ 10v.Iout and Iset both seem to have a ~20mv offset. With the same load as before (2x100ohm 5w resistors in parallel @10v) Iout is 120mv, which is about right. When Iset is at or below the same value, Iout oscillates. The pk-pk voltage of Iout gets lower and lower until when Iset is near 20mv, Iout stays at 30-40mv.I'm a little concerned about the oscillation - is there anything I can do to fix it?

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 24, 2013, 01:15:18 pm
content: Sounds like progressTry a 100pF capacitor between pins 1 and 2 of IC3...All the best,Mark

author: microbug
author_rank: Frequent Contributor
timestamp: November 24, 2013, 04:32:34 pm
content: I put a 100pf ceramic cap between pins 1 and 2 of the LM358 and the oscillations reduced but didn't completely go, so I swapped it for a 1nf cap. However, that was with a 50ohm load. With a 33.3ohm (3x100ohm parallel) load, the oscillations re-appear. They are at ~8khz.Also, with no load Iout is 10mv. With a 100ohm load, it reads 20mv. 50ohm reads 120mv and 33.3 reads 220mv. This doesn't seem right - it is both non-linear and has a -80ma offset :/

author: Kevin.D
author_rank: Frequent Contributor
timestamp: November 24, 2013, 08:34:51 pm
content: Why are you so commited to using this design ?,when theres plenty of other less problematic designs for you to choose from ,just do the usual search with the right key words .ok lets see :-quote :- "The pk-pk voltage of Iout gets lower and lower until when Iset is near 20mv, Iout stays at 30-40mv" .well that will be because of what I posted earlier about there being a minimum of ~1.8V output that your current limit can reduce the output to ,so the minum current you can set would then depend on what the resistance of the load is,so 1.8/RLoad .( so with a direct short your current limit would be infinite and so have no effect whatever).A possible fix for above would be to remove D3 and use somthing like a small N chan mosfet (2n7000) to drive the lm317 adj pin (source to -2V, ) ,so the opamp now drives gate of fet instead of adj pin directly ,this would also allow the use of a lower voltage opamp ( it would also invert opamp output control (going higher now pulls down adj pin)so you would swap the inputs of ic3a.) .Quote :-"Also, with no load Iout is 10mv. With a 100ohm load, it reads 20mv. 50ohm reads 120mv and 33.3 reads 220mv. This doesn't seem right - it is both non-linear and has a -80ma offset :/"Well the first three seem like what I would expect from that opamp but i'm not sure where the last (33R3) is coming from ,you have at least two other offsets , there is the input offset votage and also the input bias current (which is typically 50-100nA for 358, so 50nA through 100k ~5mV offset).If you really dont need to have a 1V=1A output of ic3b then reducing the gain would solve your offset probs(or use a better opamp).quote :-" I put a 100pf ceramic cap between pins 1 and 2 of the LM358 "Yes putting a feedback cap to - input would help you with stabilty by lowering bandwidth of ic3a ,but for that cap to be really effective the - input needs to be high impedance (but here it's directly connected to the output of ic3b ,so it's low impedance),so put a resistor (say 10k) between the inv input and output ic3b. Without looking at a bode plot of that loop I could not guess at how big a cap it needs to be but just experiment till it's stable under various loads then add some.(with a little bit of reading you could do a simple transient step load test on the real circuit and watch the response on your scope to determine the stabilty and approx optimum size,).anyway good luck and happy expermenting

author: microbug
author_rank: Frequent Contributor
timestamp: November 24, 2013, 09:51:34 pm
content: OK. I'm beginning to think that trying to make a current-limited power supply that works is more trouble than it's worth. Especially as this is my first power supply, I want to have something that is known to work. As I said before, there is a nice dual tracking supply in silicon chip which I could use.In the meantime I'd like to try and carry on the design I have currently; I will create a second version of the schematic (and in turn the pcb). I'll use a 2n7000 on the adj pin of the LM317 for the current limit and a better op-amp instead of LM358 (any suggestions?). I'll also experiment with the cap size. Again, any suggestions for reading material on transient step load tests would be welcome. I foundthisapp note by the late Jim Williams.I am using a 2x0-15v transformer which in reality reads 40v pk-pk - I am only using one winding, so I could use the other as a negative rail. If I did this, would I need to regulate it down to 2v or whatever (using 79xx reg)? I'm guessing so. This would also have the added benefit of higher stability, as I do not completely trust the 555 inverter - it reads -1.6v not -2.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 25, 2013, 12:30:11 am
content: Quote from: microbug on November 24, 2013, 09:51:34 pmIn the first post, you cite the designer. Was this offered as a complete, debugged design, or as a starting point?QuoteI'm not sure that an op-amp upgrade is needed at this stage. Nor would I add anything else between the op-amp and the LM317. Instead, try and arrange a negative supply for it - even temporarily as part of the debug process. Even a PP3 might help you prove the pointQuoteKevin made an excellent point about the lack of resistor between the output of IC3B and the input to IC3A. I should have spotted that myself. Try to arrange for something like 1k to 10k there, as that will help a lot with the oscillation.QuotePersonally, I'd suggest that you don't need to worry about this just yet. Get the thing basically stable first. I test using a MOSFET and power resistor, with a pulse generator driving the MOSFET, while observing the waveform on an AC-coupled 'scope.QuoteIt would be a waste to use the whole winding just to create a low-current negative rail. Personally, I'd simply build another PCB (once debugged) and have a dual PSU - far more usefulAs I mentioned, you could derive a negative rail from the incoming AC to the bridge - it would need two diodes and two capacitors. I'll try to attach a suggested schematic...QuoteAnd I explained this in the first paragraph of my first post; the voltage is entirely dependent on the forward voltage of the chosen LED. They vary alot. Typically 1.6V for red, 2V for green, yellow, orange, and ~3.5V for blue, white, "pure green" - you get the idea.I also suggested you could try a VBE multiplier, which would be adjustable to match the 1.25V of the LM317 - see the attached schematic.All the best,Mark

author: microbug
author_rank: Frequent Contributor
timestamp: November 26, 2013, 04:40:35 pm
content: OK. Thanks for your help, I am creating a new schematic (based on yours).How would you calculate (formula / rule of thumb) what size decoupling caps to use in certain places? I know that for most logic-level ics and op-amps a .1uf ceramic as close to the device as possible is good, but what about other places (e.g., across the 5v6 zener on your schematic). The datasheet for the LM317 recommends a 10uf electrolytic for the output and this is what I used before for that purpose - would 10uf also be a good option for the cap after the zener?Edit:A couple more questions (directed at Mark Hennessy, but I'll take answers from anyone):- Why have you put a resistor marked as ~100r on the positive supply of the current limit op-amp (on the schematic you posted previously)?- Why do you need the extra voltage drop on the output of the current limit op-amp (an led plus a normal diode)?-What is the purpose of the diode in parallel with the 240r resistor next to the lm317 (protection?) ?OK, looking at the lm317 datasheet I found that it is for protection so if the input is shorted to ground current is not forced into the output of the regulator.

author: microbug
author_rank: Frequent Contributor
timestamp: November 28, 2013, 04:16:29 pm
content: Bump.Also, should it make any difference, I am using a 330ohm resistor in place of 240 next to the lm317 because +unreg (with my transformer) is about 19v, so a 330ohm will give my 5k pot more resolution (my calculator tells me the max voltage with 330ohm is 20.18 and with 240 is 27.29).Edit:Another question! I'm doing the current control stuff now. How do you work out the gain of ICB (differential amplifier)?Wikipediaonly confused me further. A=Rf/R1 works in this case, but how do I know it will work in other applications?

author: mariush
author_rank: Super Contributor
timestamp: November 28, 2013, 05:21:58 pm
content: You shouldn't use more than 120 ohm ... in some circumstances the regulator won't work properly if you exceed that value. 100-120 ohm is the recommended range of values.The datasheet shows 240 ohm but that's for the LM117 regulator (the datasheet is for lm117/lm317).If you want to increase the maximum voltage, just put a resistor in series with the pot but then you'll have higher minimum voltage.

author: microbug
author_rank: Frequent Contributor
timestamp: November 28, 2013, 05:26:58 pm
content: OK. Is that because of the minimum load (10ma)? If that's the case, would the resistor marked 'should pass around 10ma' (going from -1.25v to ground) on Mark's schematic help to solve this problem?Edit:I'm debating whether to add a 7805 regulator for logic level stuff (breadboards etc). This would also be useful for a voltage divider for the current control pot. Opinions?Thanks!

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 28, 2013, 05:38:32 pm
content: Quote from: microbug on November 26, 2013, 04:40:35 pmOften, it's just experience. Sometimes, manufacturers give recommendations. Sometimes, you determine what's needed during debugging. I'd encourage that, as you'll learn most from doing that...QuoteA cap after a zener is actually less useful than you might think, as the zener has a low slope resistance, which forms a filter with the capacitor. A "generic" 100uF might be OK there - you have to experiment.The output cap is decided when evaluating the dynamic behaviour, but 10uF is probably a good start.QuoteIt's good practice. It forms a filter, which cuts down the noise on the +UNREG supply. It offers some protection against surges. Should the IC (or bypass cap) go short, the resistor will smoke, but the fallout from that would be relatively small.QuoteI don't. However, you do need a diode so that the current limit works (as in CV mode, the op-amp output is hard up against the supply rail). Adding the LED gives you a convenient front-panel indication that you are in CC mode. Question for you: why not omit the diode, given that the LED is a diode?All the best,Mark

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 28, 2013, 05:44:54 pm
content: Quote from: mariush on November 28, 2013, 05:21:58 pmAre you sure about that? I've never come across that before. I've always used 240 ohms as it gives a convenient ~5mA.I've just checked a few datasheets from different manufacturers, and no sign of that... What manufacturer was you using?

author: microbug
author_rank: Frequent Contributor
timestamp: November 28, 2013, 05:47:02 pm
content: Actually, I have theTi datasheetopen and it lists 'minimum load current to maintain regulation' as typically 3.5ma and max 10ma.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 28, 2013, 05:49:54 pm
content: Quote from: microbug on November 28, 2013, 04:16:29 pmSeriously, I would leave that until the voltage regulation is working. The golden rule of engineering is to break it down, thoroughly testing each part of the circuit before moving on.As part of this journey, you might be interested in prototyping this (from the National Semiconductor datasheet):

author: microbug
author_rank: Frequent Contributor
timestamp: November 28, 2013, 06:13:40 pm
content: Quote from: Mark Hennessy on November 28, 2013, 05:49:54 pmOK - I am currently re-doing the schematic: should I continue with this and do multiple pcb revisions (copper clad board is cheap) or go back to breadboard (with the lm317 hanging off the board on a heatsink)? The schematic is quite different from the 'original' (first post) so modding the current pcb isn't really an option.Answer to your LED question: Is it something to do with switching speed? The 1n4148 is a high-speed diode... It can't be that the 1n4148 is needed in series to make speedfasterthough...Alternatively, maybe it's capacitance: 1n4148 diodes have about 4pf of capacitance at 1MHz and are fairly stable; LEDs' capacitances vary with frequency and at 1MHz can be 60pf.TBH, I don't know.That circuit looks interesting, but it's a little squashed. I can't make sense of the schematic like that: I'll try to find a copy / redraw it.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 28, 2013, 06:31:02 pm
content: Ah - the thing about LEDs is that they have a lousy reverse-voltage breakdown - typically about 6 volts or thereabouts... So the additional 1N4148 takes care of that...When I build a project, I don't commit to a PCB until the thing is 100% debugged and designed. I start with plug-in bread-board, and move to Veroboard or copper-clad "dead bug" construction style if required. Often, for a one-of, Veroboard done neatly is perfectly adequate for final construction - I've got projects that are over 20 years old and still working well on Veroboard.That NS schematic is reasonably subtle. but does most of what you want, and is worth the effort in understanding. Basically, the current is turned into a voltage by R3, and the op-amp is comparing that with the voltage set up by R2 and R5. The reference for the current setting is the LM317 itself. The I-sense resistor is inside the feedback loop, unlike your circuit. This one won't go down to 0V or 0mA, of course, but you now know how to fix the 0V issue

author: microbug
author_rank: Frequent Contributor
timestamp: November 28, 2013, 06:42:43 pm
content: OK - I was thinking too much!The reason I used a pcb was because my breadboard was too small - I should have known better but this is my first 'real' analog project so I have an excuse. At least I won't make that mistake again. I will get a bigger breadboard (thisone seems to look good) and go back to that. I will (eventually) want to use a pcb, because as you (or was it Kevin.D) suggested, I have 2 isolated outputs from my transformer and it'd be a waste not to use both. I'll finish the new schematic first though (while I'm waiting for the breadboard to arrive!). Obviously the new schematic won't be final, but I will need something to work from on the breadboard and I can't be bothered trying to do it all from memory.Quote from: Mark Hennessy on November 28, 2013, 06:31:02 pmWhich issue?

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: November 28, 2013, 07:23:03 pm
content: Quote from: microbug on November 28, 2013, 06:42:43 pmThe not getting down to 0V issue. Which the -1.25V rail fixesI must dash now, but good luck with it. Breadboard looks good at a glance - much bigger that the one I had when I started out.Cheers,Mark

author: microbug
author_rank: Frequent Contributor
timestamp: November 28, 2013, 09:52:16 pm
content: Thanks for your help Mark!I have finished the revised schematic now (attached). I'm still not sure about the current limit, but it should be adjustable from 0-2A (I know the LM317 can't do 2A continuously) and the amplifiers work with 0.1V=1A to cut down on oscillation. This will also make the 3mv input offset of the lm358 more manageable as it gets amplified to 30mv not 300mv. I put a 10k resistor between the output of the current amplifier and input of current limit comparator to make the input higher impedance so the 100pf cap can do its business.I don't think it will make any difference, but I replaced the BC548 in Mark's schematic with a BC547 because I have those.This is very much a work in progress and I'll revise it as I debug. I've ordered 2x830-point breadboards and some jumpers (solid core and flexible) for experimentation on eBay (a grand total of £10.28). It might be a few days before they arrive (shipping from uk so not too long) and I can get started.

author: microbug
author_rank: Frequent Contributor
timestamp: November 29, 2013, 07:13:46 am
content: Quote from: Alicelewis on November 29, 2013, 07:10:30 amThat now shouldn't be the case though as it is only multiplied by 10, making for a 30mv offset.

author: codeboy2k
author_rank: Super Contributor
timestamp: November 29, 2013, 10:40:32 am
content: This person Alicelewis is actually spamming the board, copying other persons text from the start of threads on the board and posting with links to their website.That text above you quoted from Alicelewis is actually the text of my own first post in the thread here.

author: microbug
author_rank: Frequent Contributor
timestamp: November 29, 2013, 03:35:39 pm
content: I thought that looked familiar! I'll send a PM to Simon (although I imagine Alicelewis has already been reported).

author: microbug
author_rank: Frequent Contributor
timestamp: December 06, 2013, 07:37:15 pm
content: I received my breadboard (2x830 point) and jumpers, and I'm putting in an order for some components for the power supply. I intend to get at least 2 of each so I can make another one when I'm done debugging the first.I'm a bit confused about Mark's circuit which taps off a low current negative rail from the AC input. Here's my understanding:- When the tap (bottom AC input) is positive compared to 0v, current flows through the capacitor connected directly to the tap, through a diode and then to 0v. This first cap is charged. From the previous cycle, the second cap is charged and the load runs off the charge.- When the tap is negative compared to 0v, current flows through the second cap (charging it) and the load, then through another diode (which prevents positive voltage from the tap getting into the negative rail) and to the first capacitor.By doing this is the first capacitor not reverse biased when current is flowing from 0v to -20v (the tap)?

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 07, 2013, 05:20:57 pm
content: Yes, that's nearly it. The key thing is that, with respect to ground, the AC signal moves between the rails (well, the rails plus a diode drop). So yes, when the AC input is at its most positive, the first capacitor is indeed charged via the first diode. When the AC input is at its most negative, the negative end of the first capacitor is taken negative, and the second/bottom diode is able to conduct, and this charges the smoothing capacitor (the second one).This circuit is a classic arrangement - I didn't invent it, sadly. It's fine for the small currents we're using here...As an aside, one point that isn't always appreciated at first is that the smoothing capacitors supply energy to the load formostof the time. The current from the transformer (via the rectifier diodes) only flows for a brief time. Therefore, the peak current that flows during this time is actually much greater than the average DC current that is supplied to the load - perhaps 4 or 5 times! That's why the wiring between transformer, rectifier and smoothing capacitor must be short and heavy. It's also why you should take the output from the smoothing capacitor, not the rectifier...All the best,Mark

author: microbug
author_rank: Frequent Contributor
timestamp: December 07, 2013, 05:24:33 pm
content: OK, thanks. I will use caps rated at 35v+ for this circuit to be on the safe side (rectified dc is about 19v).

author: microbug
author_rank: Frequent Contributor
timestamp: December 10, 2013, 09:05:16 pm
content: I've got my parts + breadboard etc. and am at the prototyping stage. The bridge rectifier works as expected with the smoothing cap, but the tap for a low current negative rail starts at 0v (capacitor discharged?) and very slowly creeps down. I got bored watching it when it got to about -7v. With a 10k load it barely goes negative at all. I'm using 2 100uf 35v caps here - it seems that 100uf may be too much (?).Suggestions?

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 10, 2013, 10:44:18 pm
content: Quote from: microbug on December 10, 2013, 09:05:16 pmCheck everything very carefully - there is a mistake or faulty component somewhere.In case you're thinking that's not a very helpful response, I have just taken the time to prototype it, and it works completely as expected.By "it", I'm talking about the rectifiers. I haven't built anything downstream of them. I loaded them up with 1k resistors.Good luck,Mark

author: microbug
author_rank: Frequent Contributor
timestamp: December 11, 2013, 08:18:26 pm
content: OK, I looked over the layout again and there was a link missing in the rectifier. I rebuilt the negative rail and now both rails work fine. However, when I added the -1.25 vbe multiplier, the main 2200uf smoothing cap started smoking and getting hot. I turned off the power, but not before causing irreversible damage (swelling - see pictures). I have two 4700uf power supply caps - could I use those instead or would the filtering capability be reduced? I'm not too keen on buying a new 2200uf cap because I just got a component order delivered and there are P&P costs of £4 on farnell (which I use) for orders under £20 - hardly worth it for a £1 cap.EDIT: I investigated further: there does not seem to be a short between the +unreg rail and 0v; the resistance between the two rails is about 12k. I did short tests with the damaged cap measuring the ripple on the +unreg rail and it was about 7v with just the vbe multiplier as a load. The cap heated up fairly fast and I turned off the power again. I don't know whether the ripple is due to the damaged cap having decreased capacitance or something else (I'm guessing the first). If the ripple is causing the problem then maybe the capacitor has too high ESR - the link to the cap ishere.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 12, 2013, 01:18:20 am
content: There is no reason why the VBE multiplier should cause this. Again, there is a construction error somewhere.The VBE multiplier is not connected to the +UNREG rail, and shouldn't load it in any way.With no load connected to the +UNREG rail (I assume, as you've not mentioned the presence of the LM317 yet), there should be minimal ripple - well less than a volt, if at all.Capacitor ESR is not the issue.Your question about larger smoothing capacitors somehow reducing the "filtering capacity" suggests to me that a little further reading might be beneficial. Rectifiers might seem simple, but they are quite subtle in operation. And as you've discovered, they are not without their dangers. At the risk of saying something that you might already know, capacitors can and do explode when abused!To minimise any further risk, I'd suggest that you temporarily connect a light bulb between the transformer and the rectifier. Something like 24V at 2 watts. Or a couple of identical 12V bulbs in series if they are easier to source locally. These act like fuses, only instead of blowing, they light up to indicate that your circuit is drawing too much current. When working correctly, the complete PSU should only take 10-20mA with no load connected, and such a small current won't cause much voltage drop across the bulb(s).Google "lamp limiter". This idea is used a lot in service and restoration work. I recommend it

author: microbug
author_rank: Frequent Contributor
timestamp: December 12, 2013, 09:49:13 pm
content: Ok, I rebuilt the rectifier (using a 4700uf smoothing cap) and it, the negative supply and the -1.25v vbe multiplier work fine. What I meant with 'filtering capacity' was that by increasing the value of the capacitor I was decreasing the frequency response, but I since realised that's not the case!I have some 500ma glass fuses which I'll use in the immediate future and will get some incandescent bulbs when next possible. I also now have a used Fluke 83 so I can measure current.I'll continue building up the project and post if (when) I have problems. I will also try to be more careful with construction, I noticed several things which could have caused the cap to swell. I think the source of the heat was actually in the diodes and the heat transferred through the metal breadboard contacts and into the cap - the diodes were even hotter than the cap (by crude finger measurement) and it was them that I first noticed smoking, not the cap swelling.Thanks for all your help!Microbug

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 12, 2013, 10:18:36 pm
content: Excellent news - good, solid progress. And it's great that you're finding the answers yourself with almost no help from me - it really is the best way to learnIt's very easy to make mistakes with this sort of thing - I confess that I made a couple when initially prototyping the rectifiers a few days back because I was in a hurry. But that's where the lamp limiter (or some other equivalent) is a superb plan - you get instant visual feedback long before anything bad happens.Just a minor caution with your Fluke - those current range fuses areveryexpensiveWhile waiting for light bulbs, you might consider a 50 to 100 ohm series resistor instead of fuses. Of course, it will affect the circuit if you try to draw current from it, but it'll save blowing all your fuses. Just a thought

author: microbug
author_rank: Frequent Contributor
timestamp: December 14, 2013, 04:43:00 pm
content: In adding the LM317 I realised there was a problem with the vbe multiplier. When the LM317 is attached, the -1.25v rail is pulled up to 2-3v, meaning the minimum output voltage of the LM317 is far above 0v. When I connect the adj pin of the LM317 directly to ground or to ground through the voltage adjust pot, the minimum output is about 1v which is about right. Furthermore, I also realised that the -unreg rail is being pulled high by the vbe multiplier, even when the LM317 is not attached. When there is no load, it steadily falls to -20v, but with the vbe multiplier hooked up (the resistor marked as 'should pass about 10ma' is 2k2), it is pulled up to -3.3v (varies). I measured the current going from that resistor and it doesn't exceed 10ma.I'm using the BC547 instead of the suggested BC548, but I can't see that it will make much difference - the nominal base-emitter voltage only differs by 1v and they are even both in the same datasheet (here). The issue happens with and without the 47uf cap (not that the cap should make much difference).I'm stumped. I have rebuilt and checked the vbe multiplier and negative rail, so while it's possible that there is a construction error, it seems unlikely (I'll check again just to be sure). Suggestions?

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 14, 2013, 05:55:10 pm
content: If the -1.25V rail is being pulled up, then that means the LM317 "adjust" current is higher than the current being supplied from the -UNREG rail. The adjust current should be close to 5mA with a 240 ohm resistor installed between ADJ and OUT, and that's why I suggested that the VBE multiplier should be supplied with around 10mA.From what you say, the -UNREG rail is unable to supply enough current, so increasing the value of the two capacitors from 100uF to 470uF or thereabouts might fix it.I've still got my prototype built, so if I get a chance later, I'll add the LM317 and the VBE multiplier...Oh, and when I drew the schematic, I did think about adding a diode across the VBE multiplier - arranged to go forward-biased should the -1.25 rail ever get pulled positive. I was thinking about a different scenario than this, but this is another good reason to add it. It will protect the VBE multiplier transistor and the 47u capacitor in parallel with it.The transistor type is unimportant.

author: microbug
author_rank: Frequent Contributor
timestamp: December 14, 2013, 06:06:54 pm
content: OK, I thought that -UNREG might not be able to supply enough current. The only 470uf capacitors I have are 16v which is not high enough if I don't want bits of cap in my eye, but I ordered 10 100uf 35v caps for this project last week (that was the minimum on Farnell) so I'll put a few in parallel until the problem is solved. I imagine that slightly more current will also be needed to drive the opamps (what is the correct term: op amps; op-amps; opamps?) as well if they're pulling the LM317 low during current limiting so there would be no harm in adding a bit of extra capacitance on top of that.I'll put a diode across the Vbe (correct term according to datasheet) multiplier - as it's on a low current rail I think a 1n4148 would be enough.

author: microbug
author_rank: Frequent Contributor
timestamp: December 14, 2013, 09:02:06 pm
content: I tested with larger capacitances (4x100uf in parallel and 5x100uf in parallel). With 400uf (for each capacitor), -UNREG stabilised at about -2v. With 500uf, it stabilised at about -2.2v. I'll check with 100uf later, but to my memory -UNREG reached close to 0. Is this correlation (-UNREG compared to capacitance) likely to be linear - if so, I'll need pretty big capacitors!I forgot to add that when I was testing with the LM317, I put first a 330 ohm resistor between ADJ and OUT and then a 220 ohm (I don't have any 240 ohm resistors).It would be very nice to have two outputs on my power supply, but not absolutely necessary - I could just use the second secondary transformer winding.EDIT:After a Google search I foundthispage which should help give me some pointers.QuoteI'll try making Cseries alone larger (maybe around 1000uf - I'll need to see what caps I've got).

author: microbug
author_rank: Frequent Contributor
timestamp: December 15, 2013, 11:31:21 am
content: I found an old board that had several 35v 470uf capacitors, so I used them. I tried a variety of combinations of sizes, but -UNREG always seems to fall down to -3 or -4 volts under less than 10ma load. I even tried using a 4700uf cap for CSeries but it didn't help much.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 15, 2013, 02:07:35 pm
content: You'll learn nothing if I tell you outright, but if you want a clue, observe what happens to +UNREG when -UNREG falls, and ask yourself why...

author: microbug
author_rank: Frequent Contributor
timestamp: December 15, 2013, 03:37:19 pm
content: When the Vbeamplifier is connected, -UNREG rises (from -20 to -4) and so does +UNREG - up to around 40v from 20v. Is this because 0v is being pulled negative by -UNREG? That would mean that with respect to '0v', +UNREG would seem further from '0v' (higher) and -UNREG would seem closer to '0v' (also higher). When a low current is going back to the rectifier from 0v, the Vbeamplifier with parallel smoothing capacitor, diode and series capacitor function like the last diode of the rectifier and take some of the current. The parallel smoothing capacitor takes most of the current as opposed to the Vbeamplifier, and as the current is low it is not completely charged.However, when there is a load between +UNREG and 0v, more current needs to flow back through the rectifier to the AC input. Some goes through the parallel smoothing cap until it is fully charged, some trickles through the Vbeamplifier but most goes to the rectifier, so -UNREG remains comparatively low.Am I correct?

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 15, 2013, 09:02:29 pm
content: Suffice to say, when the +UNREG rail is unloaded, a load on the -UNREG rail will do strange things. That's because (a) the bridge rectifier for the +UNREG rail is no longer a simple rectifier, thanks to the presence of the bits that are producing the -UNREG rail, and (b) the -UNREG circuit relies on the +UNREG rectifier being just that.A simple 1k resistor across the +UNREG supply will fix it. Of course, it'll waste a little energy, so put it to good use - add an LED to indicate the presence of powerMy prototype is working well. I've got the VBE multiplier working, along with the current controller. I won't claim that it's fully debugged by any means, but I'll upload a schematic in the next few days. It's happily using 100uF for -UNREG.

author: microbug
author_rank: Frequent Contributor
timestamp: December 15, 2013, 10:04:06 pm
content: Good - I was right.I've been using a 100 ohm 5W resistor which is fine, but power dissipation is above 4W so it gets hot and can only be used for so long (a couple of minutes) before I feel I need to take it out because it'll melt my breadboard. I could use 1k resistors, but my 1k resistors are only 0.25W and the heat dissipation again would be 0.4W; too high. I'm considering using a couple of the same 100 ohm resistors in series.I was going to say that my Vbemultiplier wasn't working with the LM317, but I thought to check the LM317 pinout just to be sure and I had got IN and OUT mixed up. I'm glad I didn't damage the transistor; I haven't yet put in a diode across the Vbemultiplier. Having switched them around, it now works as expected, although I have not tested with any load yet. I'll try putting 100uf caps back in for -UNREG as well as doing some on the current controller tomorrow, but right now it's getting late.I like the Vbemultiplier because I can precisely trim the output to 0v, although the accuracy is only as good as my pot - it can vary from 5 to 40 ohms when you turn it to its minimum, but that only equates to a few tens of millivolts of change so I'm not too fussed. I'll have a load switch in the final design so I don't need to be able to get the output toexactly0v, just as close as possibleThanks for helping!

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 16, 2013, 10:11:34 am
content: In my prototype, a 2k2 resistor feeding a green LED is enough to make the rectifiers behave themselves.Of course, there is a useful trick (forgive me if you already know) - you could take 4 of your 1k resistors and put them in a series-parallel combination, which will give you a 1k, 1W resistor. But as I say, 2k2 seems to do the trick for me.The VBE multiplier can be improved as things progress - ultimately we can put a resistor in series with the preset to reduce the range of adjustment, while still providing enough range to cover the expected deviation. Of course, the VBE multiplier is temperature-sensitive, so some drift is to be expected, though it'll only really noticeable if you fit digital metering...

author: microbug
author_rank: Frequent Contributor
timestamp: December 16, 2013, 08:12:41 pm
content: In the final design I was thinking about having a fixed 5v output from a 7805 regulator. This would mainly be for powering 5v logic, but would also be useful internally for providing a reference for setting the current limit using a resistor divider and driving a power LED. Although I know there is no need to use a separate regulator for this a 5v fixed output would be useful anyway so why not put one in. The power LED and small amount of current for the current limit would probably be more than enough for rectifier stability based on your setup.I was planning to put a panel meter into the final design, so perhaps a potential solution would be to set the Vbemultiplier to slightly under so the output can always be hand adjusted. I will probably have a front panel board with binding posts and a switch to choose display options for the panel meter so the Vbetrimpot could go on there - the board would probably be linked by an IDC connector + ribbon cable so an extra two connections is fine. I'll have to check my enclosure to see whether there would be space for two panel meters (current and voltage), but I'll get on with the rest of the prototyping first.

author: microbug
author_rank: Frequent Contributor
timestamp: December 22, 2013, 08:32:33 am
content: I checked how well the -UNREG rail works with both caps at 100uF of capacitance: it's fine, but there are a few volts of ripple; it works better with Cseriesat 470uF (the other cap is fine at 100uF). I don't want too much ripple on -UNREG because the -1.25V rail will inherit that ripple and I'll get it on the output as the ADJ pin is driven from the -1.25V rail. On a related matter, I tested the output of the LM317 and it works fine up to 500mA, but at 500mA +UNREG is pulled down to about 17V with several volts of ripple. Should I be concerned about this?The 2k2 resistor and LED keep the rectifier in check for me as well.I'm also going over the design, in particular the current amplifier and limiting. What are the advantages and disadvantages of doing current measurement high side or low side? I have seen in several places that low side current measurement is better, but why? Also, I was thinking about using either:- some sort of zero-drift op amp to cut down on input offsets (OPA335)- a purpose-built current sense amplifier.What would be the pros and cons of each?

author: microbug
author_rank: Frequent Contributor
timestamp: December 22, 2013, 09:24:19 am
content: Just to let you know, I've switched from Eagle to Upverter (online) for my EDA tool, so you can now find the schematic athttps://upverter.com/microbug/d177dc3e638e9332/LM317-linear-power-supply/.I forgot to say in my last post that I have switched to the LM833 for my op amp; it has a much lower input offset voltage (max 2mV, typical 0.15mV). Current set / sense now works using 1A=100mV to help with offset problems; the feedback resistor is now 10k so even with the LM833's large input bias current of 300nA, the offset is lower (300na * 10k = 3mv offset compared to 5mv previously).EDIT:The schematic is saved every time I edit it, so if you're viewing it while I'm editing it might be incomplete.EDIT 2 (11:36AM 22/12):OK, finished editing.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 22, 2013, 05:30:30 pm
content: Of course you're going to get ripple on unregulated rails - but beware that while increasing smoothing capacitance will reduce the ripple, it will shorten the conduction angle and increase the amplitude of the charging pulses, and hence I-squared-R losses in the diodes and transformer windings.A few volts of ripple going into the regulator is fine. Of course, the lowest voltage combined with the drop-put voltage of the regulator determines the highest regulated voltage you can get from the regulator.You're correct to say that any ripple on the -1.25V rail will be transferred directly to the output, so it's good to reduce the ripple there if possible. In my prototype, I took the more elegant approach of splitting the resistor feeding it (R4 in your schematic) in half, and decoupling the mid-point to ground. That has much more effect on the ripple than simply increasing C1 or C2. Of course, an even more elegant approach would be to replace R4 with a current source, but that's increasing the component count somewhat, and as any LM317-based supply is never going to be lab-grade while the LM317 is doing the voltage regulation, I'd draw the line at that point.The basic problem is that the VBE-multiplier has a reasonably high internal impedance, so the ripple current is turned into a ripple voltage. Better references are available, but they cost more and aren't adjustable either side of 1.25V (as that's the band-gap voltage). You can improve on the simple circuit by adding another transistor - one of the best texts I can think of regarding VBE-multipliers is Douglas Self's audio power amplifier book.Of course, it is possible to use a better reference with a higher voltage, and add a trim in series with the voltage adjust pot (e.g. TL431 - cheap as chips!). But my experience of the LM317 suggests that it's not really worth it; the VBE-multiplier is obviously temperature-sensitive, but so is the LM317. Sadly, the drift of the LM317 isn't a simple straight line, else it might be possible to compensate for it with the -1.25V reference.Another way to reduce noise: place a capacitor between ADJUST and ground. And C3 becomes redundant then...Looking at your schematic, I wouldn't bother using 1N5401s in all those positions. Perhaps D1-4 only, if you're planning to take more than 1A (which I definitely wouldn't for thermal reasons). 1N4002 or something is fine.Regarding the current control, I used a single 741. You don't need a differential amplifier if you're doing low-side sensing. I used 0.1 ohms as a current shunt. Yes, it affects the output impedance, but this isn't a lab-grade PSU. As to whether you do high-side or low-side, it depends on the topology of the rest of the regulator, but in general, high-side requires a differential amplifier that can swing the whole range of the output of the supply, and its CMRR becomes an issue. Why bother? And as to the other possibilities you mentioned, the answer is the same - why bother? A simple "jellybean" op-amp does the job perfectly. If you don't mind me saying, you're doing the classic thing of throwing a lot of complications at a really simple problem because you don't yet fully realise how simple all this really is.C7 is wrong (I think I mentioned this before) - it needs to go around the current-control op-amp.I moved the red LED because the op-amp couldn't go negative enough to pull the output all the way to ground (I decided not to increase the negative rail). As the CC indication is useful (essential IMHO), I used a simple transistor to do it. Note how I shared parts with the power LED... A dual-colour LED would work well there, changing from green to red when in CC mode.My prototype is by no means fully ready for production, but it's getting there...More in a bit...

author: microbug
author_rank: Frequent Contributor
timestamp: December 22, 2013, 06:41:45 pm
content: I'll have a look at 'Audio Power Amplifier Design Handbook' by Douglas Self.I'll integrate the changes you made in your schematic to mine (I will likely make a PCB from this eventually so I'll need my own schematic. Re-drawing your (or others') schematics also helps to clarify the purpose of each component to me as I have to think before I place a part). I noticed that you used a 240 ohm resistor between OUT and ADJ and put another trimpot in parallel with the voltage adjust pot; I'll work out the values for that. The output voltage was stable for me with a 330 ohm resistor in the limited testing I did but it won't hurt to lower that.I was using 1N5401s on my schematic (1N4001s in prototype) because I might want to draw at least an amp out of the power supply and I thought that perhaps the diodes wouldn't be able to handle this. If they can function at larger currents for a short amount of time (feeding the smoothing cap), I'm happy to use 1N4001s.Thanks for clarifying the current control section. I have got a 0.1 ohm shunt, so I'll use that. I realise that there is no need for a fancy op amp for the current control; I was more concerned with the current sense amplifier but I imagine that's not needed any more. I might just try a standard non-inverting amplifier with the 0.01 ohm shunt (I just copied the differential amplifier from the original schematic which was not drawn by me), but it's probably more trouble than it's worth for my purposes. There is also the issue of contact resistance in the breadboard for me when prototyping, which is not insignificant. I'm sure I was throwing too many complications at the problem and I'm grateful for your letting me know.Question: why have you put 10k resistors on the inputs of the current control op amp? Is it because you needed high input impedance for the inverting input (attached via a 100pF cap to the output) and put another resistor on the other input to balance it out?For the current limit LED, I think I'll either put it on a separate resistor (when both LEDs are on, the current going to each will drop - the difference in brightness is the sort of thing that would get on my nerves) or perhaps use a dual colour LED like you suggested. I believe Dave did a video that applies to the latter about the LED on his Hakko 888 soldering station.Typing 'conduction angle' into Google Images brings up a labelled waveform from your website as the first entry!

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 22, 2013, 08:42:28 pm
content: Quote from: microbug on December 22, 2013, 06:41:45 pmTo be honest, I really think that you're pushing your luck to expect more than an amp from this. Here's why:Worst-case power dissipation is when the output is shorted with the current limit turned to max. Perhaps there is ~20 volts across the regulator with 1 amp flowing, giving 20 watts.To determine the junction temperature rise, we calculate the total thermal resistance from junction to free air. Perhaps we'll have a good heat sink that has a thermal resistance of 1 watt per degree C. So, in theory, the rise is only 20 degrees, right?But, we have to also consider the thermal resistance of the case to the heat sink, which could be 1C/W again. OK, so the rise could be 40C. Fine so far...But the killer here is the thermal resistance between the junction and the case. Which is 5 degrees per watt. So now we have 7C/W in total, so the total rise is 140 degrees C. Ambient might be 25C, so the junction temperature is 165C. Well over the maximum allowed temperature of 125C!Even if the heat sink was "perfect", the thermal resistanceinside the IC, which we can't do anything about, will be responsible for a 100C rise.OK, so you probably wouldn't run it continuously into a short, but you never know what might happen accidentally. So, there are a few approaches:1. Re-specify your goals. Make it 500mA instead, and that brings things back into the allowable limit. That'll be my starting point when I write all this up as an article on my website... Don't forget that you'll be able to connect your two units in parallel (or even offer a "parallel" mode, like the Thurlby units do).2. Add a big power transistor or two around the unit, as the datasheet suggests. These will have a lower thermal resistance, solving the problem. Been there, done that. It works.3. Use a thermal cut-out to protect the LM317. This is pragmatic, as it saves over-specifying the heat sinking which probably won't be needed 75% of the time, but protects everything against "accidents". I do this a lot, and recommend it, even if you do think everything will be OK (vents get blocked!). The simple bi-metallic units are pretty good for the money.There are other ideas, but all a bit complex at this stage. Oh, and if you rely on the in-built thermal protection, don't expect it to be reliable. Well, that's my experience, at leastQuoteAh well - that's another trick. I was going to explain it previously, but instead left you a clue with the word "changing"...A red LED has a Vf of 1.6V typically. Whereas it's ~2V for green. So when the red LED comes on, the green LED goes off. NeatAlthough if you like the sound of that, do check with the LEDs you have. The ones on my prototype do appear to have a similar Vf, meaning that the green one does indeed dim, and I agree that is a bit naff. If it was a dual red/green LED, it would go yellow, which isn't so bad.QuoteSo it does! Lol!QuoteAs you mentioned it first, I'll plug another article on my site - the one about op-amps.In summary, op-amps draw a tiny DC current into each of their inputs, and each input takes very nearly the same current. This current is turned into a voltage by the net resistance "seen" by this current, and if this total resistance is different for each input, then a voltage difference exists at the op-amp inputs, which of course becomes an offset at the output.While we're looking at this part of the circuit, I'll point out another "trick". Note the 10k current pot - which was the first one I found - is working into a low impedance (1k1). This will "distort" the law of the pot, so that it's no longer linear. Which in turn gives you more control over the current at lower settings. Yes, you could buy a linear pot, but they have certain drawbacks. And my prototype uses 10k for voltage (with 3k9 in parallel), and it's always best to use identical components where possible.Oh, and the resistor values shown won't get you to 1 amp - perhaps only a third of that. I haven't optimised them yet - it was just what was conveniently to hand.

author: Mark Hennessy
author_rank: Frequent Contributor
timestamp: December 22, 2013, 10:20:52 pm
content: A bit of development...or, why it's important to prototype, and give it plenty of time for ideas for ideas to form and developI was planning to let this unfold gradually, but knowing how busy I'm going to be this week, I'll write it all down down now.Earlier I mentioned that the VBE-multiplier wasn't perfect, but had the virtue of being adjustable. We also mentioned ripple across the VBE-multiplier, saying that we needed to clean up the supply feeding it...Initially, I split the 2k2 resistor into two, and decoupled the mid-point. This is fine - it works well, and has a certain elegance. I could have left it there, but no-one should add electrolytic capacitors to a design unless they really have to. So, what else?Instead of the capacitor, a zener diode would be good. Perhaps use 10 volts or thereabouts. But hang about - don't we already have a zener diode nearby, feeding the op-amp? Well yes - let's use that.If so, we need to maintain the current into the VBE-multiplier (~10mA), and that requires a resistor of around 430 ohms. And to ensure that there is enough current for the op-amp and the zener, maybe the resistor feeding that from -UNREG should come down a little as well - perhaps make this something between 470 and 680 ohms. OK, that'll work...A better reference?I mentioned better references earlier. The VBE-multiplier has a temperature coefficient - a normal PN junction such as we find in the base-emitter junction of a bipolar transistor is around -2mV per degree C, and we're doubling that to get ~1.25V. So a not-untypical 10 degree rise will shift the output voltage by around 40mV. Quite noticeable if we fit digital metering with 10mV resolution. Even just placing a finger on the transistor shifts the output voltage by ~30mV!We could fit a 1.25V bandgap reference, and hope that we don't need to trim it. An LM4040 is nice, not too expensive, but it possibly a little OTT here, given that it has a 100ppm/C tempco. Save that one for the next project!As it's hard to find an adjustable 1.25V reference, what else can we do? Does the reference itself have to be adjustable, or cansomething elsebe adjusted? Well, yes.Imagine we had a 2.5V reference - these are readily available (the humble TL431 can be salvaged from most junk SMPSs). But now, when we turn our voltage control to minimum, the output voltage would go below zero volts: to -1.25 volts in theory. Not ideal. If only we could put back the 1.25 volts somehow...But remember, the "adjust" current from the LM317 is a fixed 5.2mA (1.25/240). So if we installed a 240 ohm resistor between the voltage potentiometer and the -2.5V reference, then this resistor would always have 1.25 volts across it. And, importantly, it could be tweaked with a preset if required.Developing this idea further, remember that we installed a 79L05 earlier when we cleaned up the -1.25V rail. Can we use that?Looking at the datasheet, we see that the 79L05 has a similar tempco than the LM317. It'll be better in practice as it won't see such a large range of temperatures. And the tempco of the LM317 is multiplied by the output voltage setting, of course. So, my initial thought is that the -5V rail is indeed good enough to use as a reference.Now, we need to drop 3.75 volts across the padding resistor, which should be 720 ohm. A 680 plus 100 ohm preset will do nicely. On my prototype, I needed 560 plus 100 ohms.The prototype behaves pretty well. Output noise is nice and low, and the drift isn't too bad. Holding the 79L05 causes the output to drift by about 2-3 mV, which is 10 times better than the VBE-multiplier. The LM317 output falls by about 50mV as it heats up. And that's in addition to the load regulation losses caused by the current shunt and the IC itself. As I've said, LM317 designs aren't lab-gradeThe attached schematic shows a welcome reduction in complexity around the negative side of things, and all with readily available cheap components. Can't be bad

author: microbug
author_rank: Frequent Contributor
timestamp: December 23, 2013, 03:57:31 pm
content: I pretty much did all of the three approaches you suggested:- I have added a power transistor to my design to help with thermal issues. You can see it on theUpverter pagewhere the schematic is hosted. I'll also add a thermal cut-out to the heatsink as a safeguard.- I decided to redefine the supply as being 0V-15V at a max of 1.5A (my transformer can only do 2A so I don't want to have a max current higher than that).- I'll add a thermal cut-out to the heatsink as an additional safeguard in the final design. I hadn't heard of these before, but they seem to be a good idea! If I were to have two supplies in the same enclosure, where would I put a thermal cut-out (or would it be better to have two, or some other combination)? I think I could put it on the mains input, the ones on Farnell say they're rated to mains voltages.I also worked out resistor values for the min / max voltage adjustment trimmers, the max voltage is trimmable from 13V to 18V.I'm a little concerned about the transient response on the LM317 with a power transistor, but I haven't tested any of this yet so I'll have to see. At the time of writing the schematic is incomplete but the things I talked about here (except the thermal cut-out) are already implemented. I will need to get a few more parts (namely the power transistor) so I won't be able to test the whole thing for some time (Christmas postage times).Yesterday I sawthison eBay - while I don't wish my finished product to have a tracking option (for complexity reasons) it would be nice to have a series / parallel / independent switch like you suggested. It would need to be rated to a decent current, or there would need to be a control board with a couple of relays.EDIT: I'm going to stick with a 7805 as the reference by which the current limit is set (as opposed to your design which uses +UNREG); +UNREG can vary from 15V up to 30V and will change the value of the current limit when it does so. I'll keep the LM741 on +UNREG though; it might need to go higher than 5V.Have a merry Christmas!

author: megajocke
author_rank: Regular Contributor
timestamp: December 24, 2013, 05:30:39 pm
content: Quote from: Mark Hennessy on December 22, 2013, 05:30:30 pmIt might seem so - but only if the transformer has negligible resistance and leakage inductance, which is typically not the case.Your example waveformis quite representative of what happens in the input filter of low-power SMPS where the source impedance is comparatively low, but power supplies with transformers usually have waveforms looking more like the attached waveform with considerable flattening due to the transformer impedance. For very low capacitance values you can see changes in the conduction angle with changed capacitor value, but for reasonable capacitor values you typically don't see much change as the capacitor value is varied.The attached waveform shows a simulation using measured transformer parameters from a 2x20 V 6 A toroidal transformer. Source resistance is 0.14 ohms (inductance was negligible) and no-load peak voltage 25.9 V (this is at low line voltage of -10%) . The simulation is for a single secondary (assuming equal loading of the other secondary), 7 mF (left) and 70 mF (right) of smoothing and 3 A DC load current. This makes the AC RMS current 5.99 A for 7 mF or 6.08 A for 70 mF, right on the transformer thermal limit. Peak-to-peak ripple is roughly 15 % (left) or 1.5 % (right). There isn't really much of a difference there.Measuring the current when putting the components together in reality showed results very close to the simulated values.

author: microbug
author_rank: Frequent Contributor
timestamp: February 03, 2014, 10:12:44 pm
content: I've ordered the parts I need for the latest version of the design. They'll be here tomorrow so the problems will probably start again at that time! I've been quite busy over Christmas and was saving up for a parts order, so it's been a while, but I assure you I am still alive.Sent from my iPod touch using Tapatalk

author: microbug
author_rank: Frequent Contributor
timestamp: February 10, 2014, 07:47:12 pm
content: Up until now all has been fine. The constant voltage section, current limit LED and -5V rail were fine. I connected the LM741, but didn't realise I had the pinout wrong: I had confused the power pins. I managed to blow both my 79L05s (and an electrolytic cap; that was exciting!) so I'll get replacements from Maplin at the weekend. I (probably) can't do it before then so the next post could be a while.

author: microbug
author_rank: Frequent Contributor
timestamp: February 18, 2014, 11:12:48 am
content: Almost everything is now working. The current limiting is semi-functional, but it seems that the resistor values I chose (seehere) only get the current limit up to 88mV which equates to a max limit of 880mA. Despite this, the current limit seems to kick in at around 30mA which is obviously useless.I'll do some more testing to try to work out why this is. I am using an LM833 instead of the 741 because the 741 was dead after the previous incident.- microbug

author: microbug
author_rank: Frequent Contributor
timestamp: March 04, 2014, 09:44:52 pm
content: All appears to be working as expected (the current limit goes to about 1.2A with my current (no pun intended) setup). I think the current limit is functioning ok, but the contact resistance of my breadboard (~5r from the rectifier to the shunt) means that I can't test it. As my breadboard is generally rubbish (cheapie from eBay), I will buy a nice Wisher one from Farnell. Thanks for your patience!

author: microbug
author_rank: Frequent Contributor
timestamp: March 21, 2014, 07:02:10 pm
content: It works! The current limiting is correct and I have tested the current capacity up to 200mA (so far).What is the next step? I would like to test the transient load capability with and without the power transistor - I will make an order from Farnell with some N-Channel MOSFETs, I have 100ohm power resistors which I can put in parallel (should I buy some smaller values as well?). I don't have a pulse generator but maybe I could do something with a 555 timer? Alternatively I can look out on eBay for a used one.Let me know what you think,microbug

author: bance
author_rank: Contributor
timestamp: March 22, 2014, 08:46:16 am
content: Sounds like you could use Jay_Diddy_B's dynamic load.....https://www.eevblog.com/forum/projects/dynamic-electronic-load-project/msg288313/#msg288313HTH Steve.

author: microbug
author_rank: Frequent Contributor
timestamp: March 22, 2014, 10:05:00 pm
content: That looks ideal! I'll make one as soon as possible (probably a while).