Maker Pro
Maker Pro

Stable DC from a pwm

hi,
I want to use the pwm output of the microcontroller as digital
potentiometer because this is a cheaper solution (respect to buy
digital pot) ...I think about an integrator and a sample and hold
circuit,so i should have a stable dc output varying with the
characteristics of pwm,but do you know a more cheaper solution?
thaks
 
F

Frank Buss

Jan 1, 1970
0
I want to use the pwm output of the microcontroller as digital
potentiometer because this is a cheaper solution (respect to buy
digital pot) ...I think about an integrator and a sample and hold
circuit,so i should have a stable dc output varying with the
characteristics of pwm,but do you know a more cheaper solution?

If you use high values for the RC element, the integrated signal is very
clean, so you don't need a sample and hold circuit. But you need an Op Amp,
if you want to drive a low resistance input with it. The integrator and
amplifier could be something like R3, C1 and U3 in this schematic:
http://www.frank-buss.de/tmp/4-20.png
 
hi,
I want to use the pwm output of the microcontroller as digital
potentiometer because this is a cheaper solution (respect to buy
digital pot) ...I think about an integrator and a sample and hold
circuit,so i should have a stable dc output varying with the
characteristics of pwm,but do you know a more cheaper solution?

When I've done this - from the first time, back in 1974 - I've always
used a Sallen and Keys low-pass filter, mostly second order, optimised
for fastest settling time. Now that op amps have gotten really cheap,
the one-op-amp-per-pole variant lets you adjust the various RC
products by varying only the resistors, which saves you from the
problem of getting precise capacitor ratios.

If you wanted to change the potentiometer output very frequently you
might run into trouble getting enough attentuation out of your low
pass filter while still maintaining a fast-enough settling time.

Up to a point, raising the order of the low pass filter can help, as
can playing with the way you do the pulse-width modulation - sigma-
delta D/A converter theory could be worth looking into - but digital
potentiometers aren't usually twidled all that fast.
 
J

John Larkin

Jan 1, 1970
0
hi,
I want to use the pwm output of the microcontroller as digital
potentiometer because this is a cheaper solution (respect to buy
digital pot) ...I think about an integrator and a sample and hold
circuit,so i should have a stable dc output varying with the
characteristics of pwm,but do you know a more cheaper solution?
thaks

I assume you want a DC output that tracks duty cycle.



pwm--------R--------+----------out
|
|
|
C
|
|
|
gnd


That's it. Make the RC time constant a lot longer than the pwm period,
and be aware that loads on "out" will drag the output down, how much
depending on the size of R.

If those constraints aren't OK, fancier stuff can be done.

Lately, we've been doing delta-sigma, rather than pwm, using one pin
from an fpga. That works better at the 16-bit level, where a pwm may
need a very slow r-c to get the ripple down.

John
 
F

Fred Bartoli

Jan 1, 1970
0
Le Fri, 26 Oct 2007 08:51:30 -0700, John Larkin a écrit:
I assume you want a DC output that tracks duty cycle.



pwm--------R--------+----------out
|
|
|
C
|
|
|
gnd


That's it. Make the RC time constant a lot longer than the pwm period,
and be aware that loads on "out" will drag the output down, how much
depending on the size of R.

If those constraints aren't OK, fancier stuff can be done.

Lately, we've been doing delta-sigma, rather than pwm, using one pin
from an fpga. That works better at the 16-bit level, where a pwm may
need a very slow r-c to get the ripple down.

John

In case of stable DC level needed, that one can buy you better response
time. Of course it's of no use when generating AC signals, unless you can
tolerate a good deal of distorsion...

VCC
|
|/
.------|
| |>
___ | ___ |
PWM >-|___|--+--|___|-+-----+-----
10K | 100K | |
| |< |
+------| |
| |\ |
--- | ---
C --- | --- C
| | |
GND GND GND
 
Top