| Electronics > Beginners |
| PWM for LM317 - how to increase resolution? |
| << < (9/9) |
| Zero999:
Good, I'm glad you got the two stage RC filtering working. An alternative is to put the additional RC circuit after the potential divider and adjust the other resistor in the LM317 circuit to compensate. It does make the calculations more difficult and isn't any better, but I thought I'd show it for completeness. |
| StillTrying:
You could switch CH2 and CH3 to AC coupling and increase the sensitivity to get a better look at the ripple. I get the p-p ripple to be under 5mVpp with just the one 100uF filter. :-// |
| iMo:
May be a bit off topic, but I could not resist to try with an LM358 + LM317: With 500us PWM period: --- Code: --- Duty Vout --------------------------- 50us 1.5023V 100us 3.0001V 150us 4.5002V 250us 7.497V 400us 11.996V 499us 14.964V --- End code --- |
| Zero999:
--- Quote from: imo on September 08, 2018, 04:52:57 pm ---May be a bit off topic, but I could not resist to try with an LM358 + LM317: With 500us PWM period: --- Code: --- Duty Vout --------------------------- 50us 1.5023V 100us 3.0001V 150us 4.5002V 250us 7.497V 400us 11.996V 499us 14.964V --- End code --- --- End quote --- That's a perfectly good circuit, but yes it is a little off topic. It has gain, whilst the original poster wanted some loss, i.e. a narrower range of output, than input voltages. A transfer function of VOUT = VIN/4.166+3.5. It is doable with an op-amp and even a transistor, rather than the LM317, if the short circuit and thermal protection aren't needed. Here's an alternative solution. I used the formulae on this site to help to design the circuit. http://earmark.net/gesr/opamp/gain_offset.htm Here's the section applicable: http://earmark.net/gesr/opamp/case7.htm Unfortunately the calculator isn't very good at picking out the optimum values or just giving the ratio, as the value for R1 has to be selected manually, so I copied the formula into a spreadsheet and used the solve function to generate the exact ratio of R1, R2 and R3, yes I could have spent ages revising how to do this the old way, but I'm lazy. I then put the ratio into the potential divider calculator, linked to earlier, which gave the optimum E24 values. The plain old LM358 can be used for the op-amp. If more than a couple of hundred mA is required, then both channels of the op-amp can be connected in parallel to give more base drive to Q1. For even higher currents, Q1 will need to be a Darlington or Sziklai pair. |
| Navigation |
| Message Index |
| Previous page |