Gray code encoder question

Rushome

Member
Join Date
Apr 2016
Location
Edinburgh
Posts
21
Hi I have a question about a gray code absolute 8 bit encoder. The encoder is connected to 8 inputs on an Allen Bradley PLC. if you turn the encoder 1 full turn it will count from 0 up to 255 but then instead of returning to zero it starts counting backwards on the next turn until it gets to zero and then on the next turn starts counting up again. I have 2 machines which both seem to work like this. Will this be a special encoder or is this done in software?
 
This is probably not answering your question but typically, one would get a special encoder PLC module.

Since you said it "works". i"m curious. The PLC logic must be tracking the phase, right?
 
I'm not that familiar with allen bradley but the physical inputs seem to be programmed into a special gray code block (which i cant open) and then in other blocks and on the HMI i can see a decimal position for the encoder. The input card is just a standard input card.
 
You're probably seeing the negative numbers because you're looking at a SINT datatype tag (which is an 8-bit Signed integer) and the actual underlying bits do not represent an integer at all, but rather a Gray Code bit pattern.

The protected instruction is just a decoder for the Gray Code. You should be able to just leave it alone and use the integer position output value.
 
Google 'Gray Code' to better understand what you are seeing. The raw value from the encoder can be confusing. Any images of the code disks from online articles should give you a better feel for the situation.
 
And kudos for spelling it correctly; Dr. Frank Gray is one of the great heroes of the Bell Labs era.
 
look in the software as the position should be the variable, and when an overflow it should be checked if it is a psoitive one or a negative turn.
and listin to bernie and ken
 

Similar Topics

Hey guys, Although I've poured through this forum for help in the past this is my first post. I am looking at replacing obsolete Baumer IVO...
Replies
6
Views
1,940
First time I have used an absolute encoder and it is definitely:banghead:. I have a Siemens 6FX2001-5FN25...
Replies
21
Views
6,040
I am migrating a PLC-5 to CLX. I do not have the option of changing out the existing encoders (845D-SJHZ25AGCW4). 8-24v DC, 256...
Replies
0
Views
1,590
Any recommendation on using a gray code encoder as input to a compactlogix PLC to trigger a digital input every 15 degree position on a rotary...
Replies
3
Views
2,769
Hi, Currently i have a Nemicon 10 bits Gray code absolute encoder, and the conversion between Gray code to binary code works fine. Now, we buy a...
Replies
9
Views
3,561
Back
Top Bottom