You are on page 1of 5

769

Optimization of Incremental Optical Encoder Pulse Processing

Naveena Johnson1 Jiss Mohan K2 and Elias Janson K3 Jemti Jose4


Department of ECE Department of AEI Department of ECE
Saintgits College of Engineering. MBC College of Engg. and Tech. St.Joseph’s College of Engg. and Tech.
Kottayam, Kerala Idukki, Kerala Kottayam, Kerala
navenajohnson@gmail.com jissmohank@gmail.com jemtijose@gmail.com
eliasjansonk@gmail.com

Abstract—Incremental optical encoder is one of the commonly Encoder Disc Encoder axis
used transducer, used for angular velocity and position
estimation. Unfortunately both period and frequency counting
methods that are frequently employed for angular velocity
estimation, using incremental optical encoder signals are
affected by the quantization errors. This paper proposes a
Simulink based method, to estimate the angular velocity of a
LED A
Transparent
moving system with minimized quantization error inherent in LED B
the conventional period counting technique. This is done band
through frequency division of encoder pulses. The algorithm
model is integrated with the Simulink model of incremental θp
encoder for performance evaluation. Accuracy and Percentage
error for different ranges of angular velocity is studied, for
both conventional period counting and proposed method.
θp+θq
A
Keywords- Incremental optical encoder, transducer,
quantization error, period counting, frequency counting, angular B Opaque band θ
velocity. Rotating axis
Photosensors
I. INTRODUCTION Figure1. Construction principle of the incremental optical encoder
[http://www.acta.sapientia.ro/acta-emeng/C2/emeng2-3.pdf]
Robust motion control, servomotor or robotic
applications require precise estimation of position, velocity
and acceleration. With the evolution of servo and stepper
motor technologies, pulse train command motion controllers Pulse A
are now available for precise position control. Advanced
pulse train motion controllers also provide real time position,
velocity and acceleration comparison and triggering options. Pulse B
Incremental encoders are the simpler and by far the most TON (a)
popular pulse train transducer, having as an output a series of
square pulses generated as the code disk, when its evenly
spaced non transparent and transparent radial line moves past
a light source. One or more such encoders can be employed
to provide the parameters like distance, direction, speed etc. Pulse A
as feedback to the controller in a motion control system,
particularly suited to the most challenging applications in Pulse B
process and machine control, motor feedback, factory
TON
automation, robotics, web tensioning etc. (b)
Encoders may measure other motions than rotary motion
(e.g. linear), a rotary encoder is considered as an example as Figure 2. (a) Encoder output pulses for counter clock wise rotation
it is probably be most likely to use to measure wheel rotation (b) Encoder output pulses for clock wise rotation
for motor applications. Incremental encoder, as a position
transducer converts the shaft rotation into electrical pulses. The modulated light beam can then be processed by an
Connected to the shaft there is a rotating code disk consisting electronic circuitry consisting of several optoelectronic
of transparent and opaque zones and this code wheel can sensors.
modulate the light beam emitted by a light source.
The encoder generated signals can be characterized by
the two pulse parameters: the pulse width and the number of
pulses. The generated number of pulses is given by (1),

978-1-4673-5090-7/13/$31.00 ©2013 IEEE


770

where ‘θp’ and ‘θq’ are width of the transparent and non- where period counting is employed at low speeds i.e. less
transparent band and they are considered to be equal. than a predefined velocity and above which frequency
counting is used through appropriate switching. But in all
θ θ these methods, the sampling interval used for measurement
N= = (1)
θp +θq 2. θP was almost constant. Hence an angular velocity or encoder
pulse frequency adaptive sampling interval can be employed
The pulse width or the ON-time of the optoelectronic where the quantization error can be compensated in order to
sensor output depends on the angular width of the improve system accuracy at all speed ranges.
transparent band ‘θp’ and the angular velocity ‘ω’. Hence Adaptive windowing [3], [4] is a modern technique to
the time period and frequency of the output pulse can be measure the angular velocity. It uses period counting to
concluded to be a function of ‘θp’ and ‘ω’, the angular adapt the sampling interval in frequency counting that
width of the transparent band being equal to that of the non- produces accurate estimates of velocity both at low and high
transparent band. Conceptually, the ON-time of the sensor speeds. In this method, the encoder pulse and observation
output will be reduced if the shaft’s angular velocity is high window is synchronized and so the quantization error is
and the mathematical equation used to deduce the pulse minimized.
width is given by (2), where ‘K’ is a constant that can be The practical solution for the quantization error in
chosen appropriately to obtain a desired fit between TON period counting is to increase the frequency of the clock
and ‘ω’. signal along with maximum enhancement of the encoder
pulse width. In order to produce accurate estimates of
θP θp velocities both at low and high speed ranges, the adaptation
TON ∝ =K (2)
ω ω of sampling window size in frequency counting based on the
encoder pulse period measured with the period counting is
employed.
II. ANGULAR VELOCITY ESTIMATION : A REVIEW
The processing of incremental encoder generated output III. PROPOSED METHODOLOGY
pulses can be done through different methods that are The performance evaluation of the proposed method is
proposed in the literature. They can be mainly classified into accomplished using an incremental optical encoder model
two classes: Period counting and Frequency counting. In developed in MATLAB-Simulink which produces encoder
period counting method [1], the elapsed times between pulses similar to the physical incremental encoder. Here
successive pulses are measured by counting the high quantization error is minimized by reducing the clock period
frequency clock signals. The position and angular velocity to its maximum and extension of encoder ON time so that
evaluation of rotating body can be calculated based on the the space elapsed between the clock pulses and the encoder
pulse width and the number of pulses of the encoder output reduces so that the clock pulses well occupy the
generated pulses as (1). entire space of encoder ON time, the quantization error is
minimized.
dθ θp
ω= = (3)
dt n. Tf
Period
where n and Tf are the number of pulses and pulse period of measurement
the high frequency clock signal respectively. Frequency Pulse counter
Frequency counting method explained in [2], the divider selector
number of encoder pulses is measured during a predefined
fixed time window. The angular velocity can be evaluated
as (2). 100ms
Clock
dθ dθ θp .N
ω= ≅ = (4) Encoder Main Time
dt Ts Ts 20ms
Pulse Counter Counter Clock
The period and frequency counting methods suffer
from quantization errors that are caused due to lack of
synchronization between rising edges of the clock edges and Velocity Evaluation
the encoder signals. The period measurement remains
reasonably accurate method at low speed ranges and
frequency counting at medium and high speed ranges. Figure 3. General block diagram of proposed technique
The mixed mode period and frequency counting [1]
employs both period and frequency counting strategies
771

Encoder Pulses

To pulse selector
Figure 4. Simulink structure of frequency divider

The adaptation of the measurement time (sampling time) (encoder pulse frequency) adapted pulse obtained at the
based on the angular velocity (or frequency of encoder output of the multiplexer is connected to angular velocity
pulse) is realized using a frequency divider (or pulse width evaluation unit.
enhancer), a period measurement counter, a decoder and a
pulse selector (multiplexer). Each block is realized in X1
MATLAB Simulink. A MATLAB Simulink model of
incremental optical encoder is also developed towards the X2
performance assessment. The Simulink models of each of
the blocks are depicted in the following section. A single
stage of pulse width enhancement/frequency divider and the
combined five stages of frequency division are clearly
shown in figure 1. The clock signals used for period Selected pulse
measurement counter and main time counter are 100 ms and
20 ms respectively.
The frequency division is achieved by using several
stages of D-Flip flop and OR gate combinations. In each
stage, the frequency of the encoder pulse is halved and the X2
output of each stage is connected to the input of the next
stage. Here five stages of frequency division is realized. The X4
outputs of frequency divider are connected to a pulse X8
selector. The pulse selector selects one among the different
pulses based on the counter value of the period X16
measurement counter. The pulse period of the adapted pulse
obtained at the output port of pulse selector is interpreted as Figure 5. Simulink structure of pulse selector
the sampling time. The sampling time ( ) is measured by
counting the high frequency clock pulses during a single
pulse period of the adapted pulse. The angular velocity
772

TABLE I. STANDARD AND MEASURED ANGULAR VELOCITY


Selected Pulse
Actual Angular Velocity Measured Angular Velocity
(rad/sec) (rad/sec)
900 898.3
1000 998.8
1100 1096
1200 1199
1300 1296
1400 1397
Selected Pulse 1500 1495
1600 1592
1700 1693
1800 1798
Encoder Pulses
1900 1893
2000 1988

Figure 6. Simulink structure angular velocity evaluation unit

The counter values of main time counter (MTC) and Angular velocity Vs % Error
encoder pulse counter (EPC) are used for angular velocity
estimation. The MTC counts the number of high frequency 1.8
clock pulses, which are contained in the single pulse period 1.6
of the adapted pulse. The angular position difference is 1.4
obtained by counting the encoder pulses during a single 1.2
% Error

pulse period of the adapted/selected pulse, done by EPC. 1


Now angular velocity can be easily calculated as: 0.8
θ p Np 0.6
ω = K (5) 0.4
Nc T
0.2
where Np and Nc are the counter values of encoder pulse 0
counter and main time counter respectively. T0 is the period 500 1000 1500 2000
of the high frequency clock signal used, θ is the angular
Angular velocity 'ω'
resolution of the incremental encoder and K is the constant.

IV. RESULTS
Figure 6. Percentage error in period counting method
Percentage errors in normal period counting and adaptive
windowing methods are presented here. Adaptive
windowing method offers comparatively good accuracy Angular velocity Vs % Error
compared to the conventional period counting method. The 2
angular velocity estimates of the proposed algorithm comes 1.8
very close to the numerical value at the input of incremental 1.6
encoder model. Unlike in conventional period counting 1.4
method where fixed values were obtained for a varying
% Error

1.2
range of angular velocity, the proposed scenario fully 1
overcomes the issue. 0.8
Since the input output transformation is almost of linear 0.6
curve fit, linear regression approach is a good choice to 0.4
minimize even the minimum inherent error. The estimated 0.2
correlation coefficient, from the observations in Table I, is 0
numerically close to unity (0.999). The repeatability of the
500 1000 1500 2000
measurement algorithm is ensured, with repeated
simulations producing same values of angular velocity. Angular velocity 'ω'

Figure 7. Percentage error of proposed method


773

V. CONCLUSION
Accuracy estimate corresponding to different angular An adaptive windowing method was devised in
velocity ranges for normal period counting and proposed Simulink, to reduce the quantization error inherent in the
method is shown in Table II and Table III respectively. conventional methods of velocity evaluation. This was
Over the range from low angular velocity towards high, the accomplished through frequency division of encoder pulses.
conventional period counting method offered accuracy of The algorithm model is integrated with the Simulink model
0.014 at low- mid frequency range and of 0.016 at high of incremental encoder for performance evaluation of the
angular velocity, whereas the adaptive windowing method measurement system. Accurate velocity estimates are
offered accuracy of 0.006 at all the range of angular obtained irrespective of the encoder pulse durations.
velocity.
VI. FUTURE SCOPE
TABLE II. OBSERVATIONS WITH PERIOD COUNTING METHOD As the input output transformation function is observed
to be comparatively linear, exhibiting adequate value of
Actual Measured correlation coefficient, ie 0.999, with a close proximity to
Range Angular Angular
Accuracy
unity, a linear regression approach would be a good choice
(rad/sec) Velocity Velocity of error minimization.
(rad/sec) (rad/sec) REFERENCES
500 505.1 0.0102
600-900 600 606.1 0.010167 [1]. Ndubuisi Ekekwe, Ralph Etienne-Cummings and Peter Kazanzides,
700 709.2 0.013143 “Incremental Encoder Based Position and Velocity Measurements
800 VLSI Chip with Serial Peripheral Interface”, Proc. IEEE Symp.
803.2 0.004
Circuits and Systems (ISCAS 2007), May.2007, pp.3558-3561,
900 913.2 0.014667 doi:10.1109/ISCAS.2007.378451.
1000 1010 0.01
1100 1111 0.01 [2]. F. Briz, J. A. Cancelas, and A. Diez, “Speed measurement using
1200 1212 0.01 rotary encoders for high performance AC drives,” in Proc. IEEE
1100-1500 1300 Con. Industrial Electronics, Control and Instrumentation
1307 0.005385
(IECON’94), Sep. 1994, pp. 538–542, doi: 10.1109/ IECON.
1400 1418 0.012857 1994.397844
1500 1515 0.01
1600 1626 0.01625 [3]. Farrokh Janabi-Sharifi, Vincent Hayward, and Chung-Shin J. Chen,
1700 “Discrete-Time Adaptive Windowing for Velocity Estimation”, IEEE
1600-2000 1709 0.005294
Trans.Control Sys. Tech., vol.8, no.6, Nov. 2000, pp.1003-1009.
1800 1808 0.004444
1900 1905 0.002632 [4]. John N. Lygouras, Theodore P. Pachidis, Kostas N. Tarchanidis and
Vassilis S. Kodogiannis “Adaptive High-Performance Velocity
Evaluation Based on a High-Resolution Time-to-Digital Converter,”
TABLE III. OBSERVATIONS WITH PROPOSED METHOD IEEE Trans. Instrum. Meas., vol. 57, no. 9, Sept. 2008, pp. 2035-
2043.
Actual Measured
Range Angular Angular
Accuracy
(rad/sec) Velocity Velocity
(rad/sec) (rad/sec)
500 497 0.006
600 598.2 0.003
500-1000 700 696.3 0.005286
800 797.5 0.003125
900 898.3 0.001889
1000 998.8 0.0012
1100 1096 0.003636
1200 1199 0.000833
1100-1500 1300 1296 0.003077
1400 1397 0.002143
1500 1495 0.003333
1600 1592 0.005
1700 1693 0.004118
1600-2000 1800 1798 0.001111
1900 1893 0.003684
2000 1988 0.006

You might also like