PL
µ
PS — 4256 / 4456
ABSOLUTE GRAY CODE ENCODER
S
Controls Div.
PS-4456/4457 (NEMA 4X)
Easily Interfaced to PLCs Using Standard Digital DC Inputs
Or Directly to Gray Code Modules*
Features
■ Absolute 8 Bit Output
■ Rugged Construction
■ 3/4" Shaft with Ball Bearings
■ NEMA 12 or NEMA 4X
Applications
■ Packaging Machines
■ Pick and Place Operations
■ Assembly Machines
■ Food Processing Equipment
■ Indexing Equipment
PS-4256/4257 (NEMA 12)
General Information
Sinking† or Sourcing† Output — The encoders are available with Sinking† or Sourcing† outputs. Be sure to order
the type that is compatible with the control's input circuits. The use of fast response DC inputs is recommended
to minimize missed fast pulsing encoder outputs.
NEMA 4X Option — The NEMA 4X version of the encoder includes a stainless steel enclosure and shaft,
double sealed ball bearings, and conformal coating on
both sides of the internal circuit board. This version should
be ordered for applications which involve washdowns,
high humidity or corrosive atmospheres.
*
A-B 1771-DL or Similar type modules
13647 Metric Rd • Roscoe, IL 61073 USA • 815-389-2620 • FAX 815-389-3304 • 800-228-5487 (USA & Canada)
†
See page 7 for sinking/sourcing definitions
Why 8 Bit Gray Code?
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 understanding 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 number, 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.
Absolute Position Decoding — The 8 Bit Gray Code
signal always represents the current position of the encoder 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 between 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.
RPM / Response Considerations
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.
Scan Time / Maximum RPM / Degrees Per 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.
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
Deg / Scan Deg / Scan Deg / Scan Deg / Scan
Figure 1
When machine speed rises above a certain level, several factors 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?
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 performing properly.
2
Decoding Gray Code?
The Ladder Programming examples shown below apply
for all Gray Code Encoder models. The examples show
how to convert the 8 Bit Gray Code output signal (G0-G7)
of the encoder to a binary number (B0-B7) during each
scan of the PLC. The value of the Binary result will always be in the range of 0 - 255 because the 8 bit encoder
divides each revolution into 256 uniform increments. Ladder rungs which follow the conversion can compare the
rotary position value to known positions for control of
machine devices that must operate at specific positions
within the overall machine cycle. The rotary position of
Models DDN & DDP
CLOCKWISE ROTATION
G7
B7 G6
G6B7
B6 G5
G5B6
B5 G4
G4B5
B4 G3
G3B4
B3 G2
G2B3
B2 G1
G1B2
B1 G0
G0B1
DRAWING L-1
B7
B6
B5
B4
B3
B2
B1
B0
COUNTER-CLOCKWISE ROTATION
G7
B7 G6
G6B7
B6 G5
G5B6
B5 G4
G4B5
B4 G3
G3B4
B3 G2
G2B3
B2 G1
G1B2
B1 G0
G0B1
DRAWING L-2
B7
B6
B5
B4
B3
B2
B1
B0
the machine cycle can also be used to gate input sensors
and shift register functions.
Converting Gray Code to Binary involves a sequence of
"Exclusive OR" operations. It is simple to program this
same conversion logic in other programming languages
besides ladder logic. In addition to decoding the rotary
position of the encoder, controls with arithmetic capability
can be programmed to perform direction reversal, position offset and re-zero functions, as well as convert the
position value to degrees for ease of monitoring and setup.
Model DDH
COUNTER-CLOCKWISE ROTATION
G7
B7 G6
G6B7
B6 G5
G5B6
B5 G4
G4B5
B4 G3
G3B4
B3 G2
G2B3
B2 G1
G1B2
B1 G0
G0B1
DRAWING L-3
B7
B6
B5
B4
B3
B2
B1
B0
CLOCKWISE ROTATION
G7
B7 G6
G6B7
B6 G5
G5B6
B5 G4
G4B5
B4 G3
G3B4
B3 G2
G2B3
B2 G1
G1B2
B1 G0
G0B1
DRAWING L-4
B7
B6
B5
B4
B3
B2
B1
B0
Use a limit test function to program a pulse in the PLC. The limit test uses a test reference (in this case the integer
register that the Gray Code is going into), and compares it to see if it is between a lower limit and an upper limit. If the
integer value is between the lower limit (ON setpoint), and the upper limit (OFF setpoint), the rung is true and an output
is turned on. If the integer value does not fall between the upper and lower limits, the rung is false, and nothing happens.
For every output pulse to occur, a different limit test must be programmed with the appropriate limits. Reminder: The
limit values are position values, not degrees.
PLC
Output
LIM
Limit Test
Low Lim 107
107<
Test N7:0
0<
High Lim 128
128<
3
O:2.0
( )
0