Why 8 bit gray code, Rpm / response considerations – Electro Cam PS-4456 Absolute Gray Code Encoder User Manual

Page 2

Advertising
background image

When wiring an encoder to the PLC, the most important thing to
remember is which output is the MSB (Most Significant Bit) and
which is the LSB (Least Significant Bit). If the order is reversed,
or the output wiring is out of order (transposed wires), the value
that you create in the PLC register will not sequence properly.

MSB and LSB are digits of the binary number. An understand-
ing of the different number systems used by logic controllers
(binary, hex, decimal, etc.) is essential to know what these codes
signify.

Gray Code

is a cyclic or reflected binary code, specifi-

cally designed for positioning information. In a Gray Code
number only one-digit changes at a time. In a binary num-
ber, going from one number to the next may have many
of its digits
change.

The cyclic change is created by the relationship of the 8
pulse disks that turn the encoder OFF and ON. (See
Figure 6, page 6.)

Most Significant Bit refers to the binary code (Gray
Code) digit that is on the far left when written out. This
digit changes the least as the binary number goes from
0 to 255.

Least Significant Bit refers to the binary code (Gray
Code) digit that is on the far right when written out. This
digit changes the most as the binary number goes from
0 to 255.

Why 8 Bit Gray Code?

2

Absolute Position Decoding

The 8 Bit Gray Code

signal always represents the current position of the en-
coder shaft. The PLC cannot get out of sync with the
present encoder position — not even when the encoder
shaft is turned while power is off to the controller.

8 Bit Resolution (256 increments)

The revolution of

the encoder shaft is divided into 256 uniform increments.
Each increment is 1.4 degrees wide, which allows any
machine position to be known within

±

0.7 degrees. This

is appropriate resolution for many applications, especially
when PLC scan times are taken into account (@ 60 RPM,
a 10 mSec scan time equates to 3.6 degrees of motion
between scans).

Error Free Decoding

Only one of the bits changes

state when the encoder shaft rotates, eliminating the need
for sophisticated latching and/or handshaking circuitry be-
tween the encoder and the PLC. Standard DC input cards
are used to interface with the encoder. The only special
programming needed is 8 exclusive-ORed (XOR) ladder
rungs.

The operating speed and resolution required of the application
must be considered when interfacing the Gray Code encoder
directly to a PLC or other control device. The scan speed and/or
hardware response will cause delays that can reduce the overall
system response and resolution. Where full 8 bit resolution is
required at higher speeds, the use of an Electro Cam PL

µ

S

(Programmable Limit Switch) is recommended.

Values might not be true for certain fast response PLC inputs.
Faster response times are dependent on hardware.

RPM / Response Considerations

When machine speed rises above a certain level, several fac-
tors need to be considered:

What is the scan time of the PLC program?

What is the response time of the input module?

What is the integer value that is being used, and is it de-
pendent on several of the least significant bits?

Refer to the above chart to compare machine RPM to the values
listed on the chart. If speed exceeds the value, the PLC will not
"see" certain Gray Code values. Miscalculation of the output value
will occur.

If a bit is on for 30

µ

Sec, and the scan time is 10 mSec, the

processor will not see that bit (or combination of bits). If the input
module's response time is longer than the bit, or bits on time, the
module will not react to the input. All of these factors show up as
non-sequencing position values, or outputs that are not perform-
ing properly.

Figure 1

Scan Time / Maximum RPM / Degrees Per Scan

Deg / Scan

Deg / Scan

Deg / Scan

Deg / Scan

Scan Time

Max RPM

@ 30 RPM

@ 100 RPM

Scan Time

Max RPM

@ 30 RPM

@ 100 RPM

1 mSec

234

0.18

0.60

20 mSec

11

3 6

12.0

5 mSec

46

0.9

3.0

25 mSec

9

4.5

15.0

10 mSec

23

1.8

6.0

30 mSec

7

5.4

18.0

15 mSec

15

2.7

9.0

40 mSec

5

7.2

24.0

The table above indicates the maximum RPM that the encoder can be turning for all 256 positions to be decoded each revolution for the corresponding scan time.
Exceeding the indicated RPM will result in encoder shaft positions being skipped by the control. It is acceptable to skip encoder positions when 8 bit resolution is not
required. Worst case output response = 2 Scans + Hardware response.

Advertising
This manual is related to the following products: