need help: DC pulse train has to be converted to a DC voltage

I will have a constant amplitude pulse, that will increase and decrease depending on my system. I need to take this pulse, take the average value (DC voltage) and put it into my PID controller. Any suggestions! Thank you in advance.

Reply to
Cosmo
Loading thread data ...

Do you mean that the amplitude will increase and decrease, or the duty cycle?

If it's the amplitude then you can rectify the pulse and filter it, as is done with AM detectors.

If it's the duty cycle then you can filter it and read the analog voltage. If you're implementing a PID controller on a microcontroller then you may be able to measure the duty cycle with a counter on the chip.

If it's the frequency of the pulses then you can use a frequency to voltage converter, or you can use your on-chip counter.

More detail would help us help you.

--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

On 30/09/2006 the venerable Cosmo etched in runes:

If it increases and decreases then it's not constant

I need to take this pulse, take the

My suggestion is that describe what you want in a clearer way.

--
John B
Reply to
John B

Sorry I wasn't very clear. What I have is a optical sensor sending DC square waves at some positive constant amplitude, unfortunately the pulse will be different widths depending on the system. I will combat this problem with a LM555 timer that will give me a positive constant amplitude and width every time it is triggered. Now I have these square wave pulses of all positive DC values, constant width whose frequency is proportional to the speed of the system and need to get an analog DC value. I'm very limited with in terms of components and experience; I would like to do this with diodes, resistors, capacitors, op-amps or other basic devices.

Basically yes! I need a frequency to voltage converter. I need to make one with very limited supplies, and I thought since it is only a positive square wave pulse there may be a way to get the dc value out of it. I can't buy a FVC.

Thanks again!

Reply to
Cosmo

You are producing (out of the 555) a series of fixed height, fixed width pulses??

If you simply low-pass the pulses from the output of the 555, you will have what you want.

...Jim Thompson

--
|  James E.Thompson, P.E.                           |    mens     |
|  Analog Innovations, Inc.                         |     et      |
|  Analog/Mixed-Signal ASIC\'s and Discrete Systems  |    manus    |
|  Phoenix, Arizona            Voice:(480)460-2350  |             |
|  E-mail Address at Website     Fax:(480)460-2142  |  Brass Rat  |
|       http://www.analog-innovations.com           |    1962     |
             
I love to cook with wine.      Sometimes I even put it in the food.
Reply to
Jim Thompson

Thanks Jim I will do that!

Reply to
Cosmo

All you may need is one resistor and a capacitor to ground. Probably something like 10k from the 555 output to the capacitor. Then make the capacitor large enough so you do not see much ripple from the pulses but small enough so the DC value can change fast enough when the speed changes.

Keep in mind that the pulse width out of a 555 is not very precise and has drift. This will directly affect you measured DC output.

--
Regards, Joerg

http://www.analogconsultants.com
Reply to
Joerg

If that's your only feedback your application is just crying out to be done with a microcontroller. Most decent microcontrollers have input capture units that you can use to time the arrival of your pulse, then you can just subtract the two arrival times to get a frequency, and feed that number straight into a PID controller.

Or you can use a few op-amps, each the same size as the microprocessor you don't want to use, along with caps, resistors, and all those nasty analog problems*.

  • Of course you'll be avoiding all those nasty digital problems going the other way...
--

Tim Wescott
Wescott Design Services
http://www.wescottdesign.com

Posting from Google?  See http://cfaj.freeshell.org/google/

"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
Reply to
Tim Wescott

Thanks again fella's.

Reply to
Cosmo

Use a charge pump; series limiting capacitor from the square-wave-generator into (1) diode clamp to ground and (2) pass diode to output. Connect an op amp to the output in current-to-voltage converter configuration. Add capacitors to the feedback resistor if you want some low-pass filtering in this stage.

The limiting capacitor discharges to GND (through clamp diode) on the negative slope of the square wave, puts Q = (V-2*Vf)*C charge through the second (pass) diode into the current-voltage converter on the positive slope of the square wave. The output voltage is then proportional to F*Q. Your Vf (forward voltage drop of a conducting diode) can be made small by use of various tricks, or compensated for.

And frequency-voltage converters of other sorts (like CD4046 phase-locked loop chip) are cheap and easy enough to use; specialized 'voltage-frequency converter' modules are pricey instrumentation gizmos (for sub-1-percent precision use); ignore 'em.

The third possibility is to 'clean up' the square wave by using a '555 as a monostable (fixed pulse width); then the average value of the output voltage is proportional to the frequency at which it's triggered.

Reply to
whit3rd

you already have half of one (given that your pulses are fixed width) add a low pass filter and the output voltage will be prop[ortional to the speed.

--

Bye.
   Jasen
Reply to
jasen

LM2907/17

Reply to
GPG

Correct me if I am wrong, but cant your problem be solved by using an opamp-based integrator. You will have to tweak the values depending on your application, but it should work.

Is your PID controller opamp based?

Steve

Reply to
Scubasteve

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.