Originally posted by: spanner
" RC network to get the "average" dc level. This is a crude way to do it. It works, but you will be trading off accuracy for slow response times."
could you send me details about how to do this? Precision is more important to me then accuracy because all this will be input to a DAQ card on a computer and I will have software to callibrate the signal.
It's basically a resistor in series with the signal and a capacitor to ground after the resistor. You'll have to play around with the values of R and C to give you the best response. time constant = R*C.
With that said, with a large time constant, you are looking at a more precise and stable DC level, but at the expense of response time when the PWM width changes.
With a small time constant, you will see a DC level that fluctuates (and it will look like a triangle waveform), but the response will be quick.
Since your feeding it into a DAQ, you can filter out the fluctuations with software algorithms.
Better yet, if your DAQ has digital inputs (it can even be done with analog inputs), you can feed the PWM signal directly to the DAQ (of course, buffer the signal with a unity gain opamp configuration) and implement a timer in your program to "count" the elapsed time of the pulse width. You will have to account for the delay time it takes the DAQ to read and send the data through the bus.
By the way, what is this for? I did something similar to what you are doing while in school.