Electronics > Beginners
PWM for LM317 - how to increase resolution?
iMo:
I think you will get large ripple as the resistors and capacitors are rather small values. You would need high PWM freq to get ripple small.
I would go with an opamp ie the LM358 as the buffer (or put the LM317 inside the opamp loop). The PWM filter could be then with large R and C --> small ripple even with low freq PWM..
joeyjoejoe:
--- Quote from: imo on September 05, 2018, 09:35:05 pm ---I think you will get large ripple as the resistors and capacitors are rather small values. You would need high PWM freq to get ripple small.
I would go with an opamp ie the LM358 as the buffer (or put the LM317 inside the opamp loop). The PWM filter could be then with large R and C --> small ripple even with low freq PWM..
--- End quote ---
So I briefly looked at higher PWM freq. I'm using a 32u4, so it has a 16 bit timer which might help. In doing so temporarily bricked it, so I'm working on getting it back now :)
EDIT : Back in business. I got PWM going as well. 10-bit gives me great resolution at 2kHz. 9-bit a bit less at 4kHz.
If I'm doing this right, at 2kHz, I can get a decent filter with 2k and 47u.
I think the time constant would be good enough for a battery charger.
In any case, I think I have some work to do with filter both the output as well as potentially my bench supply. Time for more reading!
Zero999:
--- Quote from: joeyjoejoe on September 05, 2018, 09:38:17 pm ---
--- Quote from: imo on September 05, 2018, 09:35:05 pm ---I think you will get large ripple as the resistors and capacitors are rather small values. You would need high PWM freq to get ripple small.
I would go with an opamp ie the LM358 as the buffer (or put the LM317 inside the opamp loop). The PWM filter could be then with large R and C --> small ripple even with low freq PWM..
--- End quote ---
So I briefly looked at higher PWM freq. I'm using a 32u4, so it has a 16 bit timer which might help. In doing so temporarily bricked it, so I'm working on getting it back now :)
EDIT : Back in business. I got PWM going as well. 10-bit gives me great resolution at 2kHz. 9-bit a bit less at 4kHz.
If I'm doing this right, at 2kHz, I can get a decent filter with 2k and 47u.
I think the time constant would be good enough for a battery charger.
In any case, I think I have some work to do with filter both the output as well as potentially my bench supply. Time for more reading!
--- End quote ---
Where are you thinking of putting the 2k resistor?
Any resistance in series with the PWM input will change the potential divider scaling factor.
Don't forget that the output impedance of a potential divider is equal to the value of the two resistors in parallel, so R in your RC circuit should be the values of R1 and R2 in parallel. For example, if R1 = 5k6 and R2 = 2k4, then R for the purpose of your RC circuit is:
R = (R1*R2)/(R1+R2) = (5.6k*2.4k)/(5.6k+2.4k) = 1.68k.
If the capacitor value is 100μF, then the RC constant is:
τ = RC = 1680*100×10-6 = 168×10-3 = 168ms
joeyjoejoe:
I was thinking of doing an RC filter on the final output stage of the regulator. I'm now second guessing this...
Zero999:
--- Quote from: joeyjoejoe on September 06, 2018, 08:26:23 pm ---I was thinking of doing an RC filter on the final output stage of the regulator. I'm now second guessing this...
--- End quote ---
On the output? No that's a bad idea. It will increase the output impedance of the regulator, which will severely restrict the output current.
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version