Electronic – Combine signals from two rotary incremental encoders to one output

encoderrotary

There is some device controlled by (optical) rotary incremental encoder (which gives quadrature output – two channels with square shaped pulses and shifted between each other). I want to add another encoder, which will work in "parallel" with first one – thus will be possible to control device with any of them. So I need to combine two rotary encoders to one quadrature output. How I am gonna do that?

Best Answer

What you're going to have to do is decode both of them into step and direction bits, combine those, and then regenerate the quadrature outputs.

The first part can be done with a couple of flip flops and a couple of xor gates. See http://www.fpga4fun.com/QuadratureDecoder.html . Then you OR the step bits together and use a mux to select which direction bit to use. Finally, use a simple state machine to generate a quadrature output from the step and direction signals.