Combining linear encoder signals

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

 

I'm returning to the pool after a long absence and once again diving in over my head.  I have a machine tool with  two linear encoders on what amounts to the same axis.  I would like to combine the quadrature outputs from the two encoders and generate a new quadrature output that is either the sum or difference of the two input signals.  The outputs from the linear encoders are differential RS422 signals and I don't need to worry about the index pulses from either encoder.

 

Here's what I'm thinking.  First each of the A and B channels from each encoder would go through a Differential to TTL converter like the MAX14890E.  The output from the converters would then be fed to a pair of quadrature decoders like the LS7184N.  An AVR would watch for interrupts from either of the CLK outputs of the decoders and then read the UP/DN output of the decoder.  Based on the direction output, an index into a 4-state gray code table would be incremented or decremented.  The output states of the A and B phases would be read from the table and then sent to a differential line driver like the AM26C31.

 

Is the logic there correct and does this seem doable?  Break it to me gently if you don't think I have any chance of making it back to shore.

 

 

Cheers,

Tom

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When in the dark remember-the future looks brighter than ever.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The US Digital product hasn't been available for purchase for the last couple of years, and the M-DRO unit won't work with differential output encoders, nor 1micron encoders - both of which I need.

Cheers,

Tom

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is a nice project for a Tiny micro. I would skip  LS7184N and implement that functionality in the microcontroller.

 

The challenge here is when an encoder switches phase in the same time (or almost) with the other one. Your physical connection to the reader has a speed limit and the reader itself as well. Here is how I would do it.

 

Decide on the output max counting speed, due to the RS422 and the reader input specs. Lets say 1Mbps (it may be too fast, I just take it as an example). This means that the output from your microcontroller will never change state faster than every microsecond. Your encoders (added) should never go in the same direction faster than this for too long, but they can bounce back and fourth faster than this.

Read each encoder from its MAX14890E  outputs by polling the signals (two pins needed for each encoder). Some people prefer interrupts, I prefer polling. Some implementations need two steps in the same direction in order to count up or down, so the output is always behind 90degrees. It outputs a cleaner signal. You no need that one because this whole thing takes care of it. Have a one 8bit counter assigned to each encoder so these counters goes up and down as needed, and they can go as fast as needed, even by following the signal bouncing.

Every microsecond:

- add these 8 bit counter and keep only the least significant byte. Call it AddCounter

-  have an 8 bit counter called OutputCounter and if AddCounter > OutputCounter increment OutputCounter. Likewise if less, decrement OutputCounter. It could be that after this increment / decrement these two counters are still not equal, but don't worry about it, it will catch up later. Now take the least two bits of OutputCounter and go to a lookup table and find your output pattern.