| Electronics > Beginners |
| PWM for LM317 - how to increase resolution? |
| (1/9) > >> |
| joeyjoejoe:
I'm using PWM to get variable voltage from an LM317. I take an RC filter, buffer that with an op-amp, and feed that voltage into the adjust pin of the LM317. It works very well! However, for my application (battery charger), I need a narrow range - 3-4.4 volts. Can I offset the LM317 somehow so my PWM resolution affects only that range? ie. 0% would give around 3v, 100% would give 4.4v. |
| ogden:
--- Quote from: joeyjoejoe on August 25, 2018, 09:17:59 pm ---Can I offset the LM317 somehow so my PWM resolution affects only that range? ie. 0% would give around 3v, 100% would give 4.4v. --- End quote --- Imagine two series resistors, let's say 1KOhm. One is connected to 5V, another to variable voltage source, let's say 0...5V. Voltage range of midpoint will be 2.5V to 5V. Got idea? |
| Cerebus:
That's just a classic summing Op Amp circuit. Derive your minimum voltage from somewhere (voltage divider, voltage reference, whatever) and use an op amp to add it to your smoothed PWM voltage, scaling the smoothed PWM signal to get the range you want. You'll find the basic circuit in any of the many compendiums of op amp circuits out there. If you're deriving the PWM from a processor you have the option of pick a inverting variant that subtracts your variable voltage from a fixed maximum and deal with the whole offset and scaling thing in software. |
| Zero999:
Just add a series resistor between the output of the op-amp and the adjust pin of the LM317. The voltage drop across the resistor is constant and proportional to the current flowing through the resistor connected between the output and adjust pins. If you post a schematic it will be easier to show you how. |
| joeyjoejoe:
--- Quote from: Cerebus on August 25, 2018, 09:35:06 pm ---That's just a classic summing Op Amp circuit. Derive your minimum voltage from somewhere (voltage divider, voltage reference, whatever) and use an op amp to add it to your smoothed PWM voltage, scaling the smoothed PWM signal to get the range you want. You'll find the basic circuit in any of the many compendiums of op amp circuits out there. If you're deriving the PWM from a processor you have the option of pick a inverting variant that subtracts your variable voltage from a fixed maximum and deal with the whole offset and scaling thing in software. --- End quote --- So if I set my minimum voltage to 3V, I would then have my PWM scale between 0 and 1.5V, giving me an effective range of 3-4.5v, but giving me a resolution of around 5mV (1500mV/255 steps) in that range I care about. I'll take a look :) |
| Navigation |
| Message Index |
| Next page |