Re: quadrature to voltage converter



Jamie Morken wrote:
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

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.

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.de

The 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
.



Relevant Pages

  • Re: quadrature to voltage converter
    ... I have a rotary encoder outputting a quadrature signal that I would like ... to convert to a voltage that indicates the encoders rotation direction ... other side of the cap to Vcc through a 1k resistor. ...
    (sci.electronics.design)
  • Re: Rotational Encoders
    ... looking signals, and you watch the phase relation between ... the two and count the number of pulses to figure out ... For the encoder, ... LEDs you can see the change in pulses really clearly. ...
    (sci.electronics.basics)
  • Re: DNA carries information
    ... signals that require some 'interpretation', ... communicating with its members. ... where the encoder was in this model. ...
    (talk.origins)
  • Re: Diffing LPCM vs. BRR Formats
    ... cancellation/nulling using two identical audio signals, ... A Google search on "lossy audio coding" turned up the following: ... The encoder attempts to ... common example of this is that higher audio frequencies can usually ...
    (rec.audio.tech)
  • Re: Diffing LPCM vs. BRR Formats
    ... when going from linear PCM to bit-rate reduced formats like AAC, ... cancellation/nulling using two identical audio signals, ... The encoder attempts to ... common example of this is that higher audio frequencies can usually ...
    (rec.audio.tech)