Author Topic: LM317 PWM control  (Read 16113 times)

0 Members and 1 Guest are viewing this topic.

Offline GriffinTopic starter

  • Supporter
  • ****
  • Posts: 36
  • Country: za
    • Amara Solutions
LM317 PWM control
« on: December 01, 2013, 02:32:23 pm »
Hi Everyone

After 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.


If it cannot be done, the answer is simple: Do the impossible and hurry up!
 

Offline penfold

  • Frequent Contributor
  • **
  • Posts: 675
  • Country: gb
Re: LM317 PWM control
« Reply #1 on: December 01, 2013, 07:34:40 pm »
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. 
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 20831
  • Country: gb
  • 0999
Re: LM317 PWM control
« Reply #2 on: December 02, 2013, 12:48:25 pm »
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.
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6617
  • Country: nl
Re: LM317 PWM control
« Reply #3 on: December 02, 2013, 01:04:36 pm »
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?
 

Offline GriffinTopic starter

  • Supporter
  • ****
  • Posts: 36
  • Country: za
    • Amara Solutions
Re: LM317 PWM control
« Reply #4 on: December 02, 2013, 02:48:34 pm »
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.
If it cannot be done, the answer is simple: Do the impossible and hurry up!
 

Offline Six_Shooter

  • Regular Contributor
  • *
  • Posts: 117
  • Country: ca
Re: LM317 PWM control
« Reply #5 on: December 02, 2013, 03:16:22 pm »
Interesting concept, and something I am going to have to play with.   :-DMM
 

Offline GriffinTopic starter

  • Supporter
  • ****
  • Posts: 36
  • Country: za
    • Amara Solutions
Re: LM317 PWM control
« Reply #6 on: December 02, 2013, 06:04:28 pm »
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.

« Last Edit: December 02, 2013, 07:15:46 pm by Griffin »
If it cannot be done, the answer is simple: Do the impossible and hurry up!
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: LM317 PWM control
« Reply #7 on: December 02, 2013, 06:28:07 pm »
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.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline GriffinTopic starter

  • Supporter
  • ****
  • Posts: 36
  • Country: za
    • Amara Solutions
Re: LM317 PWM control
« Reply #8 on: December 02, 2013, 06:34:44 pm »
@ Bored@Work

The 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?
If it cannot be done, the answer is simple: Do the impossible and hurry up!
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6617
  • Country: nl
Re: LM317 PWM control
« Reply #9 on: December 02, 2013, 07:04:33 pm »
So here is the revised schematic as suggested.
I see exactly the same picture with the same mistakes as before?  ???
 

Offline GriffinTopic starter

  • Supporter
  • ****
  • Posts: 36
  • Country: za
    • Amara Solutions
Re: LM317 PWM control
« Reply #10 on: December 02, 2013, 07:16:12 pm »
Sorry the correct image is now uploaded.
If it cannot be done, the answer is simple: Do the impossible and hurry up!
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: LM317 PWM control
« Reply #11 on: December 02, 2013, 07:53:29 pm »
 No, this is about the LM324 current sink capability.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 6617
  • Country: nl
Re: LM317 PWM control
« Reply #12 on: December 02, 2013, 08:14:16 pm »
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?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: LM317 PWM control
« Reply #13 on: December 02, 2013, 10:13:28 pm »
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.
================================
https://dannyelectronics.wordpress.com/
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: LM317 PWM control
« Reply #14 on: December 02, 2013, 10:19:12 pm »
"t's a good idea to have C1 to maximise the ripple rejection."

It does exactly the opposite of what you think it does.
================================
https://dannyelectronics.wordpress.com/
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12607
  • Country: us
Re: LM317 PWM control
« Reply #15 on: December 02, 2013, 10:56:02 pm »
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.

Echoing 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?
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: LM317 PWM control
« Reply #16 on: December 02, 2013, 11:00:59 pm »
-Your circuit is doomed by this problem alone.-

technically the opamp can sink current- problem solved.
================================
https://dannyelectronics.wordpress.com/
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: LM317 PWM control
« Reply #17 on: December 02, 2013, 11:05:54 pm »
-Your circuit is doomed by this problem alone.-

technically the opamp can sink current- problem solved.

And practically the opamp gets in trouble sinking so much current at low voltages


« Last Edit: December 02, 2013, 11:07:32 pm by Bored@Work »
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline dannyf

  • Super Contributor
  • ***
  • Posts: 8221
  • Country: 00
Re: LM317 PWM control
« Reply #18 on: December 02, 2013, 11:11:04 pm »
"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.
================================
https://dannyelectronics.wordpress.com/
 

Offline IanB

  • Super Contributor
  • ***
  • Posts: 12607
  • Country: us
Re: LM317 PWM control
« Reply #19 on: December 02, 2013, 11:28:28 pm »
technically the opamp can sink current- problem solved.

Not with R6 in the way, it can't.

"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.


C1 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.
 

Offline GriffinTopic starter

  • Supporter
  • ****
  • Posts: 36
  • Country: za
    • Amara Solutions
Re: LM317 PWM control
« Reply #20 on: December 05, 2013, 12:26:48 pm »
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.



If it cannot be done, the answer is simple: Do the impossible and hurry up!
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf