Encoders Frequently Asked Questions
Q: What is a differential line provides the rated PPR for each encoder. Q: Is shielded cable needed?
output? For example: with a 100 PPR encoder, A: YES. The use of shielded cable is highly
there are 100 pulses per revolution from recommended. This is especially true for
A: Differential output refers to the fact that
channel A, and 100 pulses from channel areas in which large amounts of electrical
each channel has a complement channel,
B. This is a total of 200 pulses if your noise exist. If you are having any noise prob-
i.e. Channel A and Channel A not. A
controller can count both channels (X2 lems, or suspect that you might, then use a
differential line driver is used to help
logic). Some controllers can count the shielded cable.
increase noise immunity. It also allows
rising edge and the falling edge of each
you to sink or source more current than a
Totem-pole output. A differential line
pulse (on both channels) thereby Q: How do I set my calibration
increasing the effective resolution by a constant?
driver will work with either a sinking or
factor of four (X4 logic), and counting 400 A: The calibration constant can be simpli-
sourcing circuit. It can also help in
edges per revolution on a 100 PPR quad- fied by selecting the correct pulses per
increasing the distance that a signal is
rature encoder. This doesn't mean that revolution (PPR). When choosing your
transmitted.
there are 400 pulses coming from a 100 calibration constant, remember: the
Q: What is an open collector PPR quadrature encoder. closer to 1, the better. The value of the
output? calibration constant is your best resolution
Q: Why do I need a pull-up
A: An open collector output is an NPN per pulse of the encoder.
resistor?
transistor. An NPN transistor allows the
sinking of current to common. It can be
A: A pull-up resistor is used to pull the Q: How do I choose the pulses
logic high voltage level up to the level of per revolution (PPR)?
thought of as a switch that allows the
the operating voltage. This is useful when A: When choosing the PPR value of the
circuit to be connected to common after
the output of the open collector is not encoder, you should follow a few simple
the load. This means that a source is
reaching the voltage level needed to indi- rules. Make sure that you do not choose
required for the output to work. A supply
cate a logic high signal or when noise is a PPR that will exceed the maximum input
through a load must be connected to the
present on the signal line. When a logic frequency of the controller (or whatever
output, otherwise the NPN transistor is
high signal is present, its voltage level will device the encoder is driving). To calcu-
simply creating a path to common, (i.e., a
be approximately that of the operating late the max frequency of the encoder
dry contact). Therefore, if you were to
voltage for an open circuit. The difference signal (in Hz): simply multiply the speed
measure the voltage at the output of an
is due to the voltage drop across the pull- that the encoder will spin (in revs/sec) by
open collector that is not connected to
up resistor. This is not necessarily true if the PPR of the encoder (don't forget to
some supply, you would not see a change
the load is referenced to ground. Pull-up take X2 or X4 logic into account if it
in voltage. The voltage should be
resistors are also used to convert sinking applies for your application). Try to chose
measured across the output load to deter-
devices to sourcing devices, which inverts a PPR that is an even multiple of the value
mine if the open collector is working
the pulse train. you are trying to measure or display. For
properly.
example, if one revolution of the encoder
Q: What is the difference
Q: What is a Totem-pole output? equates to 12 inches of travel, you might
A: A Totem-pole output, sometimes
between X2 and X4 logic? chose a 1200 PPR encoder. This can
referred to as a push-pull output, is a A: Some devices that are commonly inter- eliminate or simplify the need for a cali-
bipolar output with active devices that are faced to encoders (controllers, counters, bration constant or scaling factor and
controlled such that, as the resistance of displays) can detect more events per revo- more importantly, it eliminates the possi-
one increases, the resistance of the other lution than the rated PPR output of a bility of accumulating a rounding error
decreases; so that according to the rela- quadrature encoder signal. Because a over many cycles of the encoder. In this
tive states of the two active devices, the quadrature encoder provides two chan- example you would be able to measure
output voltage can swing between levels nels of pulses, a controller that counts the the travel to a resolution of 1/100 of an
approaching the two supply voltages. The pulses on both channels can count twice inch. You should also consider any 2x or
term ‘totem-pole output,’ as commonly (X2) the PPR output of a given encoder. 4x counting logic in your controller. If
used, does not include three-state For example, a controller with X2 logic your controller can "see" pulses on both
outputs. can count 240 pulses per rev. from a 120 the A and B channels (2x logic), then it
PPR encoder. Some controllers can count will count 2400 pulses for every 12
Q: What is a quadrature output? the rising edge and the falling edge of inches of travel in our example. If the
A: Quadrature output refers to the use of each pulse (on both channels) thereby controller counts both the leading edge
two output channels (A and B) separated counting four times (X4) the PPR rating of and the trailing edge of each of the
by 90 degrees of phase shift. The fact that the encoder (or 480 edges per revolution pulses on both channels (4x logic), then it
the signals are 90 degrees out of phase in our example). It's important to will count 4800 edges per revolution and
allows a controller to determine the direc- remember that a quadrature encoder your effective resolution would increase to
tion of rotation, i.e. if channel A leads B produces two channels of pulses at a 1/400 of an inch per count.
then the encoder is spinning one direction, given PPR. X2 or X4 logic refers to how
if B leads A then the other. See the channel the controller (or other device) interprets ( FAQs continued on next page )
timing charts for a graphical view of this those pulse streams.
concept. Remember that each channel
Volume 14
e21-32 Sensors 1 - 80 0 - 633 - 0405
Encoders Frequently Asked Questions Company
Information
Systems
Overview
Q: How accurate will an encoder Q: Why use an absolute Q: What is a sinking or sourcing
be in my application? encoder? Input? Programmable
Controllers
A: Encoders can provide a very accurate A: An absolute encoder has each position A: Sinking and sourcing inputs simply
indication of rotational position, but it's of the revolution uniquely numbered. This refer to the current flow in a transistor.
Field I/O
impossible to say how accurate a given means that instead of an output of pulses, This means that they require a voltage
encoder will be in a real-world applica- you get an output that is a specific value and a load to operate. A sinking input Software
tion. Mechanical inaccuracies and elec- in a binary format. This is very useful requires the voltage and load to be
trical issues such as noise, or lost counts when exact positioning is a must. If the present before connecting it to the circuit. C-more &
other HMI
can affect the accuracy of any system. A power should be lost, the actual value of This means that it is “sinking” the current
good rule of thumb is to design the the position will be known when power is to ground for the circuit. A sourcing input Drives
system to measure from 2 to 5 times more restored, since each location in an must be before the load in the circuit. This
resolution than your desired accuracy. For absolute encoder’s revolution is a unique means that it is “sourcing” the current to Soft
Starters
example: if you wish to accurately binary value. The exact position will be the circuit. Voltage and a load must be
measure movement of 1/100th of an known even if the controller loses power present in either case to detect a voltage Motors &
Gearbox
inch, you should select an encoder that and the process is moved. change at the input. The same is true for
can deliver at least 200 counts per inch sinking or sourcing outputs. Steppers/
of resolution. In a rotary application - if Q: What is gray code? Servos
you need accuracy within 6 degrees, A: Gray code is a form of binary. The
Motor
select an encoder that can deliver at least difference between gray code and binary Controls
120 counts per revolution ( a resolution is the method of incrementing to the next
of 3 degrees) to your controller. number. In gray code, only one digit may Proximity
Sensors
change states for every increment. This
Q: How far away can I place my means the count sequence would look Photo
Sensors
encoder from my system? something like this: 0, 1, 3, 2, 6, and 7.
A: There is no set answer to this question. This is different than standard binary, Limit
Many factors play a role in determining where the sequence would be 0,1, 2, 3, Switches
the maximum length of cable that can be 4, and 5. Encoders
used to connect the units together. The Gray code is used to prevent errors as
largest problem with running long lengths transitions to the next state occur. An Current
Sensors
of cable is that the cable becomes more example of how an error could occur
susceptible to noise. This is due to the would be when both values in the Pressure
Sensors
capacitance of the cable, the cable acting sequence were true. This can occur due to
as an antenna, and the loss of power the timing sequence and the capacitance Temperature
through the cable. The maximum distance of the cable. The transition from 0011 to Sensors
of cable can be achieved by following 0100 could cause 0111 to be generated. Pushbuttons/
some basic wiring principles. Do not run With gray code this is not possible. Lights
the cable near objects that create a lot of
electrical noise. This includes AC motors, Q: How do I convert gray code to Process
arc welders, AC power lines, and trans- binary? Relays/
formers. Use twisted pair cabling when A: The conversion from gray code to Timers
using the signal and its compliment, and binary is simple. Comm.
shielded cabling when running any type of
signal. Use the highest voltage available Step 1: Write the number down and copy
Terminal
for the output voltage. For example, if the the left most digit under itself. Blocks &
Wiring
encoder will output 5 to 24 volts, then use Step 2: Add the highlighted binary digit to
24 volts. Use an open collector or differ- the gray code immediately up and to the Power
ential line driver output with a differential right of it. So, 1 plus 1 is 0 dropping the
Circuit
receiver so that the maximum amount of carried digit. Write the result next to the Protection
current can be sink/sourced. If you are binary digit just added. Drop all of the
using the encoder as an input to more carried digits. Enclosures
than one controller, use a signal amplifier. Step 3: Repeat Step 2 until the number is Tools
This is also a good way to help increase completed.
the distance a signal can travel. Typical Pneumatics
maximum distances for a differential line
Safety
driver are around 100ft., or more when
using a differential input, and for an open Appendix
collector the distance is around 35 ft.
Product
Index
Part #
Index
Volume 14
w w w. a u to m at i o n d i re c t . c o m / e n c o d e rs Sensors e21-33