2023 - Chapter 2.4-Final
2023 - Chapter 2.4-Final
H T Tran - IUH
ENCODERS
1) Encoder Definitions
What is an encoder?
An encoder is a device which converts a
mechanical information of a shaft or position into
an electrical signal
x(mm)
Encoder
α(rad/độ)
Encoder Principle
Incremental Encoders
Typical Applications in Industrial System
Input Output
Controller Operation
(Application)
Feedback
Sensor
6
2) Structure
Code disc
Lens
Shaft
2) Structure
Transmitter(s)-Light source(s)
LEDs or IR LEDs provide light source.
Light is collimated using a lens to make the
beams parallel.
Receiver(s)-Photosensor(s)
Either Photodiode or Phototransistor.
Code Disk
One or more “tracks” with slots to allow light to
pass through.
3) Advantages
High accuracy
High reliability
Relatively low cost
4) Classification of Encoders
Encoder
Incremental Absolute
4) Classification of Encoders
Light Source.
Graduated Disk.
Photovoltaic Cells
Condenser Lens
Scanning Reticle
Incremental (Quadrature)
EXAMPLE 1
An incremental encoder has 240 empty slots. Starting
from the reference point, the photo sensor counts 100
pulses clockwise (CW), 30 pulses counterclockwise
(CCW), then 45 pulses CW. What is the current
position?
EXAMPLE
EXAMPLE 1
An incremental encoder has 240 empty slots. Starting
from the reference point, the photo sensor counts 100
pulses clockwise (CW), 30 pulses counterclockwise
(CCW), then 45 pulses CW. The current position?
SOLUTION
If the disk has 240 slots, then each slot/pulse
represents 1.5° of rotation. Starting at the reference
point, we first rotated 100 pulses, then reversed 30
pulses to 130°, and finally reversed again for 45°,
bringing us finally to 175 pulses from the reference
point, thus corresponding to 262,5 °
Incremental (Quadrature)
• Type:
Double track/Double photocell
Two photo-sensors/two track
arrangement to determine direction
A B
A
CCW—Photocell waveforms
B for counterclockwise
A
CW—Photocell waveforms for
clockwise
B
Incremental (Quadrature)
EXAMPLE
EXAMPLE 2
For control of a mobile robot as seen in the figure
below, an incremental encoder (double track) has 600
empty slots. Starting from the reference point, the
robot runs forward 30 cm then runs back 12.5 cm.
How many pulses will we get from the encoder, given
that R=12cm?
EXAMPLE
EXAMPLE 2
2 2 R
2 R
R
(rad ) L R
2
If ( A B ) then
0, 6
360
1 Pulse
1 2,5(rad ) 143,3
L1 30 600
R 12 n 143,3
239 Pulse 143,3
0, 6
EXAMPLE
EXAMPLE 2
If ( B A ) then
1 Pulse 0, 6
360
2 1, 04(rad ) 59, 7
L1 12, 5 600
R 12 n 59, 7
100 Pulse 59, 7
0, 6
Incremental (Quadrature)
Decoding direction
from V1 and V2
A decoder for an
incremental optical
encoder.
EXAMPLE
EXAMPLE 3
A position-sensor system (figure below) uses a 250-slot
disk. The current value of the counter is 00100110.
What is the angle of the shaft being measured?
SOLUTION
For a 250-slot disk, each slot represents 360°/250 = 1.44°,
and a count of 00100110 = 38 decimal, so the position is 38
×1.44° = 54.72°
Incremental (Quadrature)
A circuit diagram of
optical-encoder-
tomicrocontroller
interface
EXCERCISE
Incremental
Electronic Interface
Absolute optical
encoders
Absolute optical encoders
Absolute optical encoders
An absolute optical
encoder using a grey code
PCB for absolute rotary encoders
absolute encoders
Magnetic Rotary Encoder
• A high-speed rotary magnetic
encoder designed for use in
harsh environments.
• The traditional design enables
easy integration on existing
machines.
• A magnet is mounted to the
shaft within the encoder’s body.
• Rotation of this magnet is
sensed by a custom encoder
chip within the body, and
processed to give the required
output format.
Absolute optical encoders
BCD Disk
Gray disk
Gray Code Disc vs. Binary Code Disc
Absolute Disk Codes
001
135-180 011 3
(start at 1)
000
180-225 100 4
(turn off bit 0)
010
225-270 101 5
(turn on bit 1)
270-315 110 6
315-360 111 7
Problem with Binary Code
Angle Binary Decimal
001
135-180 011 3
(start at 1)
000
180-225 100 4
(turn off bit 0)
010
225-270 101 5
(turn on bit 1)
It looks like we 270-315 110 6
=> 2
Gray Code
135-180 010 3
Bit 0
180-225 110 4
270-315 101 6
Bit 2
315-360 100 7
Converting from Gray Code to Binary Code
1. Copy MSB.
2. If MSB is 1, write 1s until next 1 is met. If
MSB is 0, write 0s until next 1 is met.
3. When 1 is met, logically switch what you
are writing (1=>0 or 0=>1).
4. Continue writing the same logical until
next 1 is met.
5. Loop back to step 3.
Example:Convert 0010 to Binary Code
Copy MSB: 0_ _ _
Write 0s until next 1 is met: 00_ _
Switch to writing 1s: 001_
Write 1s: 0011
Example: Convert 1110 to Binary Code
Copy MSB: 1_ _ _
Write 1s until next 1 is met: 1_ _ _
Switch to writing 0s until next 1 is
met: 10_ _
Switch to writing 1s until next 1 is
met: 1011
Encoder Reliability and Errors
Resolution
Incremental
360
where N=# of windows.
N
• Resolution can be increased by reading both rising
and falling edges ( 360 ) and by using quadrature
( 4 N ).
360 2N
Absolute
360
where n=# of tracks.
2n
90
360
4
Encoder Selection Process
Electrical Interface
Mechanical Considerations
Types of Encoders
Rotary Linear
Absolute
LED
Lens
Scanning mask Signals typically use SSI, parallel, or field
Code disc Photo- Bus interfaces (Ethernet/IP, EtherCAT,
Elements Profinet, Devicenet, CANopen, Profibus, etc)
Encoder errors
1. Quantization Error – Dependent on digital
word size.
2. Assembly Error – Dependent on eccentricity
of rotation (is track center of rotation=center
of rotation of disk)
3. Manufacturing tolerances – Code printing
accuracy, sensor position, and irregularities
in signal generation.
Encoder Reliability and Errors
Measuring Length
with Wheels and Rolls
Ballscrew Position
Table Example
Applications
Copper cable
Fiber optics
Copper cable
Fiber optics
• Handheld, battery • USA sized encoders with • Absolute single- and • Compact wiredraw
operated programming SICK’s “F”-Technology: multi-turn encoders with encoder for applications in
tool EtherNet/IP, EtherCAT, tight spaces
• Wide set bearings for and Profinet interfaces
• Easy menu structure for even shaft loading • Up to 10m of measuring
fast setup and flexibility • Device Level Ring (DLR) length
• Metal code disc for high functionality with the
vibration and temperature EtherNet/IP version
• Can be used for • Analog output scalable
diagnostics with the directly on the encoder for
display or as a cloning • Programmable using the • Superior diagnostics for fast commissioning
module PC-based tool temperature, speed,
runtime, and many more
Fields of applications
Packaging Print & Paper Wood industry
LIFT APPLICATIONS – Height and Width positioning using BGC Wiredraw Encoders
Additional Resources
Tech Tuesdays
Check www.sickusa.com for
schedule
Company
LOGO