To add to what others have said - it seems like the original poster tried to calculate a precise particular RC time constant based on the PWM period. The whole point of the RC filter is that it should have a time constant which is much longer than the PWM period so that it does not allow the shape of the PWM waveform to pass but instead smoothes it out. If you are truly only generating a slowly-varying DC signal, then you should make the RC time constant very long - certainly at least 100 times the PWM period. Sean On Fri, Nov 2, 2012 at 11:13 AM, Harold Hallikainen wrote: > >> Isn't your time constant (1.5 mS ?) too short? >> >> Joe W >> > > I'd say it is! In these cases, I like to look at things in the frequency > domain instead of time domain. The PWM has a DC component, a fundamental > frequency component, and a bunch of harmonic components. You are followin= g > this with a low pass filter to attenuate everything but the DC. You will > never get rid of all the AC, but you can attenuate it substantially. When > you change the duty cycle, the LPF output will ramp to the new level due > to the LPF. There will always be ripple in the output, it's just a matter > of how much. I like using LTSPICE ( > http://www.linear.com/designtools/software/#LTspice ) to get a good idea > of what's going to happen. > > Harold > > > > -- > FCC Rules Updated Daily at http://www.hallikainen.com - Advertising > opportunities available! > Not sent from an iPhone. > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .