Code to Read Absolute Encoder Gray Code Output

Hello All,

I have recently acquired 2x A19,15 bit,Gray Code Output, SSI, Absolute Rotary Encoder http://www.gurley.com/Encoders/08_Rotary.htm#Rotary_Absolute_Encoders
and I want to be able to read the gray codes using an Arduino UNO and interpret into positional data.

Now I've looked at forums Absolute Encoder and Arduino - Sensors - Arduino Forum for reading speed, Absolute rotary Encoder SSI SPI how ? - Networking, Protocols, and Devices - Arduino Forum for reading general binary which they say that the code at the bottom can switch to gray code, and Gray code - Wikipedia for converting from gray to binary, but I don't really understand how the data is transfered or if I need to have a gray code to general binary conversion. I actually would also like to understand how general binary can be interpreted by the controller :confused:

I'm a little inexperienced in programming and using the arduino UNO :confused:

Would it be possible for someone to help explain how the converter works and maybe help adjust one of the scripts in the forms to help read gray code and work with my encoders.

Let me know and thank you so much for your time.

Can you read the output ?
Converting is done by xor-ing the next bit with the result from previous stage.

also shown here

It will be tricky for a beginner in programming to read that encoder, which looks to be very nice.

It is serial output and there are signal timing requirements that must be obeyed. The encoder datasheet is not very clear.

Something similar to the code in the last post (#8) here will probably work, but you will have to carefully check the signal polarity and the bit timing.

Unfortunately it will be difficult for anyone on the forum to help, as it is unlikely that anyone has that encoder. You should contact the manufacturer for example code, or do an extensive web search.

knut_ny: Do you mean the serial output? I don't really know how to set everything up to read the output in general :confused: I'm very new to anything dealing with encoders.

jremington: Unfortunately my searches have not been very helpful and Gurley Precision does not provide any example codes :frowning: Would i be ale to adjust the code on post #8 to account for bit timing? Also I'm actually a little be confused on how to connect the SN75176BP to the encoder. Is he using 2 SN75179B, http://www.ti.com.cn/cn/lit/ds/symlink/sn75176b.pdf, with one encoder? or is he using one where R and RE are Clock + and -, D and DE is Data + and -, and A is receiver input and B is driver output?

Would i be ale to adjust the code on post #8 to account for bit timing?

Possibly.

Post the EXACT designation of the encoders you have. That will determine the nature of the input/output signals.

I have A19-S-15-S-G-RS-05-S-B-S-18-Y-02E-N on http://www.gurley.com/Encoders/Info/A19.pdf. I think that's what your asking for.

You will need the SN75179B line drivers or similar. A & B are the RS485 line output, which are connected to the encoder (+/-) clock and data lines. You may need resistive termination, so read up on RS485, e.g. http://www.ti.com/lit/an/slla272b/slla272b.pdf