Re: quadrature to voltage converter
- From: Tim Wescott <tim@xxxxxxxxxxxxxxxx>
- Date: Thu, 04 Aug 2005 15:57:21 -0700
Jamie Morken wrote:
Blech. You want to take a nice clean encoder signal and crap it up in the analog world just so you can crap it up more with an A to D conversion? Blech. I'd just get a bigger microprocessor.Hi,
I have a rotary encoder outputting a quadrature signal that I would like to convert to a voltage that indicates the encoders rotation direction and rotation rate. ie. when the rotary encoder is rotating one direction the voltage will be less than 2.5Volts and when rotating the other direction the voltage will be greater than 2.5Volts, and at rest the voltage should be close to 2.5Volts. Any ideas for a circuit that can do this? I am running out of microcontroller inputs, so I would like to use a single ADC channel instead of two digital inputs to decode the quadrature signal.
cheers, Jamie Morken
Do this as an exercise in digital design:
.----------.
A .----. .----. | | ___ To ADC
------|D Q|---o--|D Q|-----| up|---|___|---o---------
| | | | | | | |
.--|>ck | .----|>ck | | | |
| '----' | | '----' | | ___ |
| | '-------------| ~down|---|___|---o
B | .----. | .----. | | |
---|--|D Q|-|-o--|D Q|-----| some | |
| | | | | | | | logic | ---
o--|>ck | o----|>ck | | | ---
| '----' | | '----' | | |
| | '-------------| | |
| | | | ===
---o---------' '----------' GND
clock
created by Andy´s ASCII-Circuit v1.24.140803 Beta www.tech-chat.deThe first pair of D flip-flops cleans up the signal (if you're clocking this fast then use a chain of two or three here). The second just delays it by one clock. Run the four signals into some combinatorial logic -- the idea here is to have the "up" line go high whenever the encoder advances, and the "~down" line go low whenever the encoder retreats. I am _not_ going to detail the combinatorial logic here -- just get out a pencil and paper, make some Karnaugh maps, and be happy. You'll end up using lots of xor gates.
Size the resistors and cap for your desired level of anti-aliasing, or put a real filter there, and have fun.
--
Tim Wescott Wescott Design Services http://www.wescottdesign.com .
- Follow-Ups:
- Re: quadrature to voltage converter
- From: Joerg
- Re: quadrature to voltage converter
- References:
- quadrature to voltage converter
- From: Jamie Morken
- quadrature to voltage converter
- Prev by Date: Re: quadrature to voltage converter
- Next by Date: Re: audio line out voltage
- Previous by thread: Re: quadrature to voltage converter
- Next by thread: Re: quadrature to voltage converter
- Index(es):
Relevant Pages
|