LM317 PWM control - Page 1
Forum section: electronics / projects

author: Griffin
author_rank: Unknown
timestamp: December 01, 2013, 02:32:23 pm
content: Hi EveryoneAfter some limited "success" with my first attempt at designing a digital PSU :https://www.eevblog.com/forum/beginners/lm317-pwm-using-bc547/I have finally had the opportunity to change to an OP-AMP based design. Using a LM324N I have had success but I am looking at a more precise OP-AMP like Dave suggested in his PSU design videos (TLC2272) but that can handle 1.25-20V with the same precision.Also any suggestions on changes to the schematic will be welcome.Notes: I left out the input capacitors as they are not relevant to the current discussion.

author: penfold
author_rank: Frequent Contributor
timestamp: December 01, 2013, 07:34:40 pm
content: The presence of C1 won't be doing you any favors, ideally you want to reduce any capacitance on the output of your op amp unless you properly compensate for it.

author: Zero999
author_rank: Super Contributor
timestamp: December 02, 2013, 12:48:25 pm
content: It's a good idea to have C1 to maximise the ripple rejection.The LM324 seems to be quite stable and could be the best op-amp for this application. Some of the more modern faster op-amps can become unstable when a large capacitance is connected to the output.

author: Kjelt
author_rank: Super Contributor
timestamp: December 02, 2013, 01:04:36 pm
content: Just a question when I see the circuit I notice the LM324 gets his voltage from Vout which it also controls, is that right? Why not the Vin which is stable?

author: Griffin
author_rank: Unknown
timestamp: December 02, 2013, 02:48:34 pm
content: Yes there is an error or 2 in the schematic that a few people have pointed out. I will upload a corrected version as soon as I get home. The op amp shoud be connect to 24+ and the gain formula is also wrong.Thanks for the feedback guys. It's very much appreciated.

author: Six_Shooter
author_rank: Regular Contributor
timestamp: December 02, 2013, 03:16:22 pm
content: Interesting concept, and something I am going to have to play with.

author: Griffin
author_rank: Unknown
timestamp: December 02, 2013, 06:04:28 pm
content: So here is the revised schematic as suggested. I will be bread boarding this and testing in the week to come. Any other suggestions will be appreciated as always. I have settled on using the LM324 as the OP amp or the LM358N.

author: Bored@Work
author_rank: Super Contributor
timestamp: December 02, 2013, 06:28:07 pm
content: Two issues:The LM324's current sink capability rapidly degrades for low output voltages. Roughly below 1V it can't anymore sink the 5 mA you need (for R5 = 240 Ohm). This means you'll hardly be able to drive the output near the minimum 1.25V. More like 2.25 V.Second, R5 is to large. You need 120 Ohm to satisfy the LM317's minimum load current. Using 240 Ohm is a common error, and many LM317 seem to still work with it, but there is no guarantee.Interestingly, lowering R5 increases the problem with the LM324's current sink capability. With 120 Ohm it has to sink 10 mA, and 10 mA is already near the maximum it can sink at higher output voltages. You won't be able to use it much below 2V.

author: Griffin
author_rank: Unknown
timestamp: December 02, 2013, 06:34:44 pm
content: @ Bored@WorkThe idea is to drive the LM317 using the schematic above and connect the output to a 2N3055 to handle all the heavy lifting. Will this then still affect the LM324 as mentioned?

author: Kjelt
author_rank: Super Contributor
timestamp: December 02, 2013, 07:04:33 pm
content: Quote from: Griffin on December 02, 2013, 06:04:28 pmI see exactly the same picture with the same mistakes as before?

author: Griffin
author_rank: Unknown
timestamp: December 02, 2013, 07:16:12 pm
content: Sorry the correct image is now uploaded.

author: Bored@Work
author_rank: Super Contributor
timestamp: December 02, 2013, 07:53:29 pm
content: No, this is about the LM324 current sink capability.

author: Kjelt
author_rank: Super Contributor
timestamp: December 02, 2013, 08:14:16 pm
content: What is the purpose of the double input low pass filter? I mean they are exactly the same 10k/100nF why is a single one not sufficient?

author: dannyf
author_rank: Super Contributor
timestamp: December 02, 2013, 10:13:28 pm
content: My 2 cents:1) Take a look at the datasheet. Pay particular attention to the spec on minimum current and adj pin bias current. Ask yourself why there needs to be a fairly low-resistance dc path to ground from the adj pin;2) Take a class on opamp / control theory. Anytime you put a large inductor or capacitor on the output of a high gain blook with negative feedback, you are asking for trouble. Unless of course you know what you are doing.Otherwise, the design looks promising.Hope it helps.

author: dannyf
author_rank: Super Contributor
timestamp: December 02, 2013, 10:19:12 pm
content: "t's a good idea to have C1 to maximise the ripple rejection."It does exactly the opposite of what you think it does.

author: IanB
author_rank: Super Contributor
timestamp: December 02, 2013, 10:56:02 pm
content: Quote from: Griffin on December 02, 2013, 06:04:28 pmEchoing what others have said:There will be 5 mA flowing through R5. The only places it can go are though R6 or through R2+R1.If 5 mA flows through R6 it will cause a voltage difference of 5 V across that resistor. I don't think that will help the circuit operate the way you wish.If 5 mA flows through R2 alone it will cause a voltage difference of 165 V, let alone including R1 in the equation.Your circuit is doomed by this problem alone.But secondly, the inclusion of C1 may be good for the LM317, but it is bad for the LM324. Consider that the op amp is trying to move the output voltage as fast as possible in order to regulate the input error by feedback. Putting a capacitor on the output is like tying it down with a great big anchor. It would be like fixing a heavy weight to the racket arm of a tennis player to compensate for the vibrations of the racket hitting the ball. How many games do you think the tennis player would win if handicapped like that?

author: dannyf
author_rank: Super Contributor
timestamp: December 02, 2013, 11:00:59 pm
content: -Your circuit is doomed by this problem alone.-technically the opamp can sink current- problem solved.

author: Bored@Work
author_rank: Super Contributor
timestamp: December 02, 2013, 11:05:54 pm
content: Quote from: dannyf on December 02, 2013, 11:00:59 pmAnd practically the opamp gets in trouble sinking so much current at low voltages

author: dannyf
author_rank: Super Contributor
timestamp: December 02, 2013, 11:11:04 pm
content: "But secondly, the inclusion of C1 may be good for the LM317"Never a good idea to hang a capacitor so naked on the output.

author: IanB
author_rank: Super Contributor
timestamp: December 02, 2013, 11:28:28 pm
content: Quote from: dannyf on December 02, 2013, 11:00:59 pmNot with R6 in the way, it can't.Quote from: dannyf on December 02, 2013, 11:11:04 pmC1 is not on the output, it's on the ADJ input. The LM317 data sheet says that is OK, and even good (when bypassing the adjust resistor).C4 is on the output, and the LM317 data sheet says that is fine also.

author: Griffin
author_rank: Unknown
timestamp: December 05, 2013, 12:26:48 pm
content: If anyone is interested here are the final designs for the first prototype. I made this a 2 board construction (PSU Board and Controller). This is the PSU board with a slot designed to insert different types of op amps like the one attached.I will release the control board once testing on this one is done and if there is enough interest for this hobby level digital power supply.