

- Changchun Rongde Optics
- Co.,Ltd.
- Add:No.1666 Yaan Road,
- North Lake Development District,
- Changchun 130102,China
- Tel:86-431-81881745
- Fax:86-0431-85256892
- E-mail:rongdecui@roundss.net
- Skype:adacui_roundss
Optical rotary encoder gray code!
Changchun Rongde Optics Co.,Ltd. Release time:2016/8/17 Browse:699There is one more consideration when selecting single-turn absolute encoders: many
don’t count in standard binary code. Here is an example of the way binary normally
counts up
Decimal # Binary Code
12 01100
13 01101
14 01110
15 01111
16 10000
17 10001
18 10010
Notice the transition from Decimal 15 to 16: all 5 digits change state at once. If the
PLC is reading inputs when this transition occurs, a bad value could temporarily be
decoded by the PLC (at least for one scan) since each output may not change state at
the same exact instant (there could be nanoseconds of difference).
When outputs on a machine are turned on and off based on encoder position, this
could create a big problem. This may not happen very often, but considering the PLC
updates its input image table with each scan (hundreds, if not thousands, of times per
second), any glitch in reading position can be problematic.
To combat this problem of reading multiple transitions simultaneously, Gray Code was
developed. Gray Code is a special kind of binary that only increments one bit at a time.
Since only one bit changes with each transition, a PLC is much less likely to decode
erroneous position data.
Decimal # Binary Code Gray Code
0 0000 0000
1 0001 0001
2 0010 0011
3 0011 0010
4 0100 0110
5 0101 0111
6 0110 0101
7 0111 0100
The only drawback to Gray Code is that it’s not very intuitive to recognize the value as
the bits change state. However, the logic to decode gray code is very straightforward
and can be done with minimal ladder programming.
absolute encoder, incremental encoder, bianry code,gray code,hybrid encoder, non-magnetic
Previous:Angular displacement sensor installation method
Next:5V DC 25 PPR Black Plastic 80mm Hand wheel CNC Encoder