BEI.APR–BEI Motion Systems–pm
Choosing the right optical encoder for your control system
Answers to questions designers frequently ask about function, interface,
and installation of shaft-angle optical encoders
BY ROBERT H. KEMP BEI Motion Systems Co. Chatsworth Encoder Div.
Chatsworth, CA
Encoders are an important part of rate and positioning system feedback
loops. Therefore signal outputs, available options, and how the devices
are adapted in the control system are critical elements of every system
design. Here are some of the typical questions designers ask about putting
shaft-angle optical encoders in their applications.
General encoder application questions
Q: What are the basic types of digital shaft encoders? A: There are two
basic types of optical shaft-angle encoders–incremental and absolute.
Incremental encoders are the most common, and the easiest to understand. A
code disk is attached to the shaft where measurements are required. The
incremental code disk (see Fig. 1) has a simple pattern of equally spaced
opaque and clear segmented tracks located around the disk. Light from an
LED passes through the rotating code disk and strikes photodetectors,
converting the light pattern to electrical signals (see Fig. 2). Typical
outputs from this type of shaft angle encoder are square waves equal to
the number of lines on the code disk. By counting the square-wave pulses,
one can derive shaft speed and position with respect to a previous
reference angle. Absolute encoders provide added benefits to the designer
in many applications. The absolute encoder provides a digital word output
of the shaft angle position. This is accomplished in two steps. First, the
encoder precisely positions a unique code pattern of clear and opaque
areas on multiple tracks around the code disk. Second, it reads this code
in a radial line. Individual sensor elements read each track and provide a
unique digital word output for each shaft position.
Q: What is the difference between accuracy, resolution, and
repeatability? A: Accuracy. This term should not be confused with
resolution. Accuracy defines how precisely the shaft position or linear
displacement can be measured. Accuracy can be measured with respect to an
external standard at adjacent transition points. Alternatively, absolute
accuracy from any transition to any other transition can be measured.
Resolution. This term indicates only the number of transitions available
on the scale or code disk. For incremental encoders, resolution is usually
stated as cycles per turn. For absolute encoders, resolution is referred
to as bits per turn. And for multiturn encoders, bits per turn plus the
number of turns equals the total bit-word output. Resolution can be
increased electronically through interpolation or multiplication.
Repeatability. This term is very important in many system applications.
It is the ability of the encoder to repeat the exact bit placement or the
amount of deviation from the encoder position between multiple passes.
Repeatability is normally several times better than the accuracy of the
encoder. This is possible because the output coding is generated by
reading very accurately placed lines on the code disk.
Q: What are tri-state outputs? When should they be used? A: Tri-state
outputs (on, off, or transparent to the controller) apply to any type of
encoder. These outputs permit multiplexing two or more encoders onto the
same ports of a single input/output card of a controller. The data outputs
from several encoders can be fed over the same cable. Alternatively,
multiple cables can be connected in parallel, as long as only one encoder
is sending data at any given time. Each encoder must have its own
tri-state control line. The controller (which must also be a tri-state
controller) selects which one of the encoders will be active by grounding
the control line of the selected encoder. All the other encoders keep
their output lines in a high impedance state, which makes them
electrically invisible to the controller and to each other, even though
they are connected to the same cable.
Q: If the glass disk in my optical encoder keeps breaking, what should
I look at to correct the problem? A: First, you should understand the
reason for the disk breakage. Disk breakage generally occurs from
mishandling of the encoder or careless installation of gears, flats,
key-ways, and other modifications without proper instruction and
precaution. Disk breakage can also occur by selecting an encoder not
suited for the application environment. Select the encoder that has the
correct specification for your application. Important considerations are
* Radial and axial loading of the bearing and shaft assembly. * Suitable
housing for the application. * Shock. * Vibration. *Temperature. If
you require key-ways, flat on the shaft, or other modifications, contact
the encoder manufacturer to see if these features are available as
options.
Q: Why do I need a flexible coupling on the shaft encoder, and will
this affect the system accuracy and repeatability? A: It is important
that the encoder shaft align and move identically with the shaft to be
monitored. In most applications, the encoder is intended to provide a rate
or position feedback.Misalignment of the two shafts can affect the
accuracy of these measurements along with the encoder life. There are two
popular methods of encoder mounting. One is to hard-couple the encoder to
the moving shaft and tether the encoder body to a stationary base. This is
typically done with hollow shaft encoders and, depending on the encoder
bearings, is the easiest mounting method (see Fig. 3). The second method
is more popular with conventional shaft encoders. First, hard-mount the
encoder body to the stationary base. Then, use a flex coupler between the
encoder shaft and the rotating shaft. The function of the coupling is to
correct for small misalignments between the two shafts. The two shafts
should be aligned as precisely as possible to eliminate premature coupling
failure. To maintain accuracy and repeatability, as well as to ensure the
rated life of your encoder, select the coupling that meets the system's
performance. A few suggested coupling parameters to examine are *
Windup * Radial load. * Angular misalignment. * Parallel misalignment.
* Maximum torque.
Incremental encoders
Q: How can I determine direction of rotation from the incremental
encoder? A: Incremental encoders that provide a quadrature output allow
the user to determine direction of rotation by looking at the two output
channels and determining if channel A leads or lags channel B. As the
encoder input shaft changes direction, the phase relationship of the two
channels also changes (see Fig. 4). In most applications, quadrature
outputs should be used even if the system is unidirectional. Most systems
have certain amounts of inherent vibration. Therefore, stopping the
encoder at the edge of a transition causes an error in the count. As the
encoder shaft is forced back and forth across this edge by the vibration,
it provides output signals.The counter counts these signals even though
the system is stopped. When the two-channel quadrature encoder is used,
the system looks at both outputs. As vibration forces the shaft back and
forth, the system views the quadrature in its proper direction and
maintains the correct position information.
Q: What is the purpose of the zero-reference signal? A: The
zero-reference signal is a pulse output that occurs once per revolution on
a separate output channel. This zero-reference channel can be gated to the A
and B quadrature channels and used to trigger the accuracy of certain
events within the system. In some applications, the zero-reference signal
is used for alignment of the shaft to a mechanical reference point.
Q: When should I use complemented signal outputs? A: For differential
data transmission, two complementary signals, rather than a single signal,
are used to communicate a bit of information. For example, a logical-high
state would be indicated by the presence of a logical-high voltage on the
“true” data wire and a logic-low voltage on the not-true or complementary
data wire. In contrast, the single-ended mode of communication would use
one wire at a logic high state when measured with respect to another wire
at ground potential. The differential mode is often preferred, even
though it requires more wires. This is because the differential mode is
more reliable in electrically noisy environments, such as those having
electric motors, switches, and actuators. If an electrical noise pulse
happens to be injected into a data cable at the same time that encoder
data is being transmitted, a logic low with a spike might be interpreted
as a logic high in a single-ended wiring arrangement. If complementary
signals are used, along with twisted shielded wire pairs, the stray
electrical pulse is less likely to cause a change in the received data.
Even if the pulse drives both data lines into a logic-high state, the
receiver's logic state can recognize that as illegal and decline to take
action on the bad data. The technique of using differential data
transmission can be applied to parallel or serial data from an absolute
encoder, as well as incremental encoder data. It is good practice to
always terminate the differential line driver into a compatible
differential line receiver.
Q: What precautions must be taken when using incremental encoders in an
industrial environment? A: Incremental encoders are often used in
electrically noisy environments. For the greatest reliability, the
differential data transmission mode should be used wherever possible. In
addition, the electrical cable should contain twisted pairs for each
signal, and the cable should be properly shielded. The cable shield should
be connected to the power supply ground at the controller end. The shield
should not be connected to the circuit ground at the encoder. The wire
gauge and the capacity of the power supply must be large enough to keep
the input power above the specified minimum.
Absolute encoders
Q: What is cyclic binary (gray) code and how does it differ from natural
binary? A: Cyclic binary, or gray code, as it is often called, is an
arrangement of code patterns that has only one bit changing state between
adjacent words. Arranging a code disk pattern using the gray code scale
eliminates the risk of ambiguities caused by simultaneous changes of
multiple bits. Other benefits of gray code are as follows: * The finest
code elements are twice the width of equivalent natural binary code
elements, permitting easier processing and better quality control. * It
is easily converted to natural binary * The mirror-image appearance makes
it easy to identify (see Table 1). Natural binary code assigns the powers
of 2 to the code disk tracks. This arrangement allows several bits to
change state between adjacent words. When the natural binary code changes
from word 31 to word 0, in a 5-bit encoder, all bits change states from
logic 1 to 0. As stated earlier, the encoder provides a
shaft-angle-position word output by optically reading a radial line of the
code disk with individual sensors for each track. Mechanical tolerances,
not to mention electrical delays, make the reading of instantaneous and
simultaneous changes very difficult, and one or more bits could be read
incorrectly. As the number of bits used increases (see Table 2), the
likelihood of an error also increases.
Q: When should I select an absolute encoder? A: Absolute encoders are
often selected because they allow each shaft position to be identified by
a unique code and so no two position code words are identical. Therefore
should the system have a power interruption, the system will know the
exact location of the shaft when power is reapplied–even if the shaft
moved when the power was off. Therefore the absolute encoder is preferred
in applications where a true indication of shaft position is required for
operator or machine safety. Absolute encoders are also selected when the
system cannot easily be returned to a home or zero position after a power
failure.
Q: Transmission of parallel data requires such a high number of
leads. What are my options? A: High-resolution absolute encoders and
multiturn encoders require the transmission of a large number of bits. If
a parallel interface is used, a separate wire is needed for each bit. For
best noise immunity, differential data transmission is preferred, with two
wires needed for each bit. It is not unusual to have 30 to 50 wires in
the cable. To avoid such bulky and expensive cables, many users choose a
serial data interface requiring only two wires for data communication,
regardless of the resolution of the encoder.
Q: What is serial data transmission, and how does it work? A: There are
several serial data formats used by absolute encoders, but all involve
sending one bit at a time and reconstructing the full data word at the
receiving point. A serial data interface is either synchronous or
asynchronous. Both interfaces require a clock signal to help define the
intervals between bits. If the clock signal is generated by the host (or
controller), the encoder will receive the clock signal and lock onto it,
sending position data in sync with the host. Thus, the term “synchronous
data communication.” If the timing of the data bits is set by the encoder
without reference to a shared clock signal, the mode of communication is
termed “asynchronous.” For the host to understand what the encoder is
sending, both devices must have internal clock signals set to be nominally
the same within a reasonable tolerance. The asynchronous data rate, usually
expressed as a baud rate, is generally much slower than the maximum data
rates for synchronous communication. This is to ensure that the two
independent clock signals (one in the encoder and one in the controller)
stay well matched.
Q: Can the absolute encoder be multiplexed? If so, how? A: Yes,
several absolute encoders can be multiplexed to the same controller. This
is possible because they maintain their position words even if power is
removed from the encoder. The correct position word will always be
available when the system requests data from the addressed encoder. The
use of tri-state outputs will assist a designer in accomplishing
multiplexing tasks. Selecting the proper optical encoder can be critical
to achieving optimum design performance in motion control and positioning
systems.
CAPTIONS:
Fig. 1. The incremental disk gives position and speed relative to a
reference point, while the absolute disk indicates the exact position of
the shaft at any moment, even if power is switched off and reapplied.
Fig. 2. Light from an LED passes through the rotating code disk and
strikes photodetectors, converting the light pattern to electrical
signals.
Fig. 3. One method of mounting the encoder is to hard couple the encoder
to the moving shaft and tether the encoder body to a stationary base.
Fig. 4. Most incremental encoders use two or three outputs. Channels A
and B provide reliable bidirectional position sensing while channel Z
supplies a zero reference used to locate a unique position of the encoder.
Table 1 Sample of the natural binary and gray code patterns for words 0
to 9, and for word 31 in a 5-bit binary word.
Table 2 A reference chart enables designers to convert binary words to
decimal numbers and their equivalent angles per bit.
Advertisement