Вы находитесь на странице: 1из 10

Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont...

Page 1 of 10

l Explore
l Community

Search Books, Presentations, Business, Academics...

l Login
l Sign Up
l |
l Log In

Ads by Google
Optical Components
Optics, Targets, Reticles,
Encoder Discs and Scales
www.drc.com/solutions/es/poc.htm

Encoder
Sick Optic Electronic
Save 40-60% on New, Surplus, Repair
www.PlcCenter.com

Multi-turn Rotary Sensors


Contactless, Non-mechanical
Absolute Digital, Analog Outputs
www.everightsensors.com

/ 4

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont... Page 2 of 10

Proceedings of IETE 37th MTS:ICTIRD-2006, Kolkata, India P31-1

Incremental Encoder Reader Circuit with Error


Detection and Correction using Microcontroller
1
Arindam Sanyal, 2Snehasish Das, 3Sonai Ray, 4P.Venkateswaran, 5S.K.Sanyal and 6R.Nandi

Abstract Design of incremental encoder interface involves


--

designing a circuit to decode the positional and directional


data embedded in the output signals of the encoder , as well as
designing a counter circuit to count the number of pulses.
This can be done either by using a custom IC or 5-10 discrete
ICs. Four monostable circuits would be needed to implement
the direction sensing unit. However, with the increase in
number of components, system reliability is reduced. Also, channel A
systems are easily susceptible for interference by noise. This
paper presents a way of implementing the above functions
using software only. In addition, the paper provides a
mechanism for efficient error correction, thus making it
suitable for servomotor control designs, even under noisy conditions.
channel B

Fig. 1. Typical encoder waveform showing channel B being 900 offset


Index Terms--biphase , control system , encoder from channel A
reader circuit , error correction , forward pulse train ,
microcontroller . An incremental biphase encoder is the most commonly
used device in computer-controlled feedback system. The
microcomputer actuates several final control elements
based on the information obtained from the encoder. In
I. INTRODUCTION addition to providing positional and directional
information[1], the encoder interface circuit must also
Whenever mechanical rotary motions have to be perform some special functions to maintain proper
monitored, an encoder is the most important interface operations, such as missing pulse correction, error
between the mechanics and the control unit. Encoders correction, resetting the position counter based on control
transform rotary movement into a sequence of electrical signal from the microcomputer, etc. It requires 5-10
pulses. As a single channel can detect only incremental discrete ICs to implement all the above functions. Also,
rotation, a second signal, phase shifted by 90 degrees is also certain types of combinational logic are error prone due to
generated. This second signal, along with the first signal, gate delays or threshold offsets and multivibrator
enables the direction of rotation to be determined. The two imprecisions. This paper tries to do away with these errors
signals from channel A and B are shown in Fig. 1 as well as reducing drastically the amount of hardware
___________________________ needed. The scheme is explained in section II and the
implementation details are given in section III.
1
Arindam Sanyal is a B. E. Tel. E student of the Department of
Electronics & Tele-Communication , Jadavpur University , Kol-32.
( email : arindam_3110@yahoo.co.in ) (Corressponding author).

2
Snehasish Das is a B. E. Tel. E student of the Department of Electronics
& Tele-Communication , Jadavpur University, Kol-32.
( email : snehasishetce@yahoo.co.in ).

3
Sonai Ray is a M. S student of Computer Science and Engineering in
IIT Kharagpur ( email : sonai@cse.iitkgp.ernet.in).

4
P.Venkateswaran is with the the Department of Electronics & Tele-
Communication , Jadavpur University , Kol-32 ( email : pvwn@ieee.org).
II. PROPOSED SCHEME

5
S.K.Sanyal is with the Department of Electronics & Tele- A. Edge Detection algorithm
Communication , Jadavpur University, Kol-32.
( email : s_sanyal@ieee.org)
The change of states of signals A and B (Fig. 1) can
E
R.Nandi is with the Department of Electronics & Tele-Communication ,
be represented in the form of the following state diagram
Jadavpur University , Kol-32. ( email : robnon@ieee.org). (Fig. 2).

/ 4

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont... Page 3 of 10

Proceedings of IETE 37th MTS:ICTIRD-2006, Kolkata, India P31-2

determining whether the state transition is in the forward or


reverse direction, and then generating the proper signal.

00

10 01
The direction of the current state transition is determined
on the basis of two previous transitions. If the transition is
an FPT and an error has occurred, then the present state is
given by An = Bn − 1 and Bn − 1 = An − 1 ⊕ 1 and , if the
11 transition is an RPT, then the present state is given by
An = Bn − 1 ⊕ 1 and B n = An − 1 . Thus, any error in the
signals A and B can be readily corrected. However, the
noise interference may be such that it gives rise to a valid
transition. The algorithm can be used to give the correct
Fig. 2 State transition diagram of a biphase incremental encoder.
Dashed lines indicate erroneous transition. number of transitions even in such a case. An error will
occur if due to the noise, a ‘1’ appears as a ‘0’ and vice
The above state diagram has been formed taking the value versa. If a spike occurs in any channel, it can be
of channel A as the msb ( most significant bit ) and the considered as an FPT and an RPT in succession. The
value of channel B as the lsb ( least significant bit ). The program uses a counter to store the number of transitions.
state transition from 00→01→11 →10 is denoted by FPT( The counter is incremented by 1 for every forward
forward pulse train )[2] and the state transition from transition and decremented by 1 for every reverse
00→10→11→01 is denoted by RPT ( reverse pulse train ). transition. Thus, there will be no change in the value of
The erroneous state transitions are shown by dotted lines. the counter due to the spike. If the spike triggers an
From the state diagram it can be seen that for no state erroneous transition, then the program will automatically
change, An ⊕ An − 1 = 0 and B n ⊕ Bn − 1 = 0 where An correct the error and generate the correct state. This has
been explained with simulation diagrams in the next section.
and Bdenote
n the nth states of A and B. For an FPT,
A ⊕ B − = 0 and, B n ⊕ An − 1 = 1 and , for an RPT ,
n n 1
An ⊕ Bn − 1 = 1 and Bn ⊕ An − 1 = 0 , provided a valid
transition has occurred. The program detects all the four
edges (Fig. 1) in a single cycle. So any missing edge must
be due to an erroneous transition. From the state
diagram(Fig. 2), it is seen that if any erroneous transition
occurs, then An ⊕ An − 1 = 1 and Bn ⊕ Bn − 1 = 1 . This
algorithm forms the basis of decoding the positional and
directional information from the output signals of the III. IMPLEMENTATION
biphase encoder. However, there may be errors due to
excessive noise. There are two ways to handle this error: We have used Intel 8031 Microcontroller[3,4] to
(i) the program increments an error counter at every implement the reader circuit. We have also used UMPS
instance of an error and if the error counter exceeds a given demo version 1.75C to simulate the encoder reader circuit.
limit, it sends a proper signal to the main system , (ii) We have used DS80C320 microcontroller to simulate the
otherwise, the program automatically corrects the error. reader circuit. In both the hardware implementation as well
The error handling mechanism is explained in the next as the simulator implementation, channel A was connected
section. to port pin P1.1 and channel B was connected to port pin
P1.0. The interface output was seen at port pin P1.2. The
output shows a transition for every edge detected. The
number of valid transitions are stored in the register R0. Its
value is shown in the snapshots of the two simulation
diagrams(Fig. 3 and Fig. 4) given below. In Fig. 3
B. Error Handling algorithm
below, we had taken two error free inputs as signals A and
B. We had simulated 8 cycles of signals A and B and the
The error handling algorithm follows readily from the
value of position counter stored in register R0 correctly
previous algorithm. The error correction is done by first
gives the number of transitions as 32. In Fig. 4 , we had

/ 4

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont... Page 4 of 10

Proceedings of IETE 37th MTS:ICTIRD-2006, Kolkata, India P31-3

simulated in the presence of noise, thus leading to distorted


signals A and B. In this case also, the value of program
counter is 32 as it should have been if the signals were
error free.

Fig. 3 Snapshot of the simulated waveform in the absence of noise

Fig. 4 Snapshot of the simulated waveform in the presence of noise

/ 4

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont... Page 5 of 10

Incremental Encoder Reader Circuit with Error


Detection and Correction using Microcontroller
/ 4
Design of incremental encoder interface involves

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont... Page 6 of 10

designing a circuit to decode the positional and directional


data embedded in the output signals... (More)

Reads:
3,323
Uploaded:
11/25/2008
Category:
School Work
Rated:

(1 Rating)

arindam31101324
Ads by Google
Digital Readouts - India
Manufacturer of DROs, Linear Glass
/ Magnetic Encoders
www.innovativedro.com
Programming
Get Set To Unleash Your Creativity
With Visual Studio 2010. Learn
More
Microsoft.com/VisualStudio2010
Microcontroller / MCU
Avnet offer advanced
Microcontroller / MCU components
www.em.avnetasia.com
Rotary Encoder
Magnetic Rotary Encoders, 8-bit,
10-bit, 12-bit. Order free
samples!
www.austriamicrosystems.com
Sensorline Encoder
Encoder with solid or semi-hollow
shaft flange and torque support
www.Lenord.com

Reading just got better!


Welcome to Scribd's new HTML5 reading experience.

l Learn more
l Change your reading preferences

Share & Embed

Link / URL: http://www.scribd.com/doc/8406382/Incremental


Embed Size & Settings:

l Width: (auto) Auto 







/ 4
l Height: 300

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont... Page 7 of 10

l Start on page: 1
l Preview View: Scroll

<a title="View Incremental Encoder Reader Circuit with Error Detection and Correction using Microcontroller on Scribd" href="htt

Related
1. 64 p.

Error Performance of Turbo Codes

Reads: 249

45 p.

Embedded Systems training report

Reads: 6147

414 p.

ABB ACSM1 Drive Manual

Reads: 528

2. 3 p.

La Aventura Semiologica

Reads: 381

12 p.

The Junction Field-effect Transist...

Reads: 658

5 p.

Dharma and Cosmic Dynamics Dr. Shr...

Reads: 0

3. 4 p.

filmen-eidgenossische

Reads: 0

1 p.
/ 4
Reflection 1

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont... Page 8 of 10

Reads: 0

5 p.

Google Adwords Alternatives

Reads: 0

4. 19 p.

STEPHEN WHITE, IAN McALLISTER - Pu...

Reads: 0

55 p.

80C51 Guide

Reads: 0

4 p.

Description Fulvicin

Reads: 0

5. 4 p.

dedham-bike

Reads: 0

136 p.

Manila Bay: Initial Risk Assessmen...

Reads: 0

4 p.

surround-sound-theater

Reads: 0

More from this user


1. 3 p.

ArindamSanyal Resume

From: arindam31101324
/ 4
Reads: 687

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microcont... Page 9 of 10

4 p.

Incremental Encoder Reader Circ...

From: arindam31101324

Reads: 3,386

8 p.

FPGA Based Efficient Interface ...

From: arindam31101324

Reads: 401

2. 4 p.

Incremental Encoder Reader Circ...

From: arindam31101324

Reads: 1,543

Commenting has been disabled.

Hengstler Products
UK Leading Suppliers of Hengstler
Encoders & Counters
jdhengstler.co.uk
Magstripe Encoders
MSR206, MSE630A, MSR505C,
MSE750...
Low Prices - Same Day Shipping
www.e-
scan.com/plastic.htm#encoder
DC Motor Controller
Several models up to 2x120A
Encoder/Analog feedback
www.roboteq.com
Digital Readouts - India
Manufacturer of DROs, Linear Glass
/ Magnetic Encoders
www.innovativedro.com
Programming
Get Set To Unleash Your Creativity
With Visual Studio 2010. Learn
More
Microsoft.com/VisualStudio2010
Microcontroller / MCU
Avnet offer advanced
Microcontroller / MCU components
www.em.avnetasia.com
/ 4
Rotary Encoder
Magnetic Rotary Encoders, 8-bit,

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com
Incremental Encoder Reader Circuit with Error Detection and Correction using Microc... Page 10 of 10

10-bit, 12-bit. Order free


samples!
www.austriamicrosystems.com
Thermocouple Interfaces
MAX6675 TC Interface Breakout
Measure temps with Arduino and
µC's
ryanjmclaughlin.com/
Ads by Google

Search Books, Presentations, Business, Academics...

Scribd

l About
l Press
l Jobs
l Contact
l Blog
l Scribd Store

Legal

l Terms - General
l Terms - API
l Terms - Privacy
l Copyright

Help & Tools

l Getting Started
l Community Guidelines
l Support & FAQ
l Web Stuff

Partners

l Partners / Publishers
l Branded Reader
l Developers / API

Subscribe to Us

l On Scribd
l On Twitter
l On Facebook

What's New

l We have updated our Terms of Service


l Branded Reader
l Multi-file Uploader
/ 4

http://www.scribd.com/doc/8406382/Incremental-Encoder-Reader-Circuit-with-Error-Dete... 6/18/2010
PDF created with pdfFactory Pro trial version www.pdffactory.com

Вам также может понравиться