0% found this document useful (0 votes)
20 views

Interpolation Paper

Interpolation Paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Interpolation Paper

Interpolation Paper
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 51, NO.

5, OCTOBER 2002 1073

New Interpolation Method for Quadrature


Encoder Signals
K. K. Tan, Member, IEEE, Huixing X. Zhou, and Tong Heng Lee, Member, IEEE

Abstract—This paper presents a new interpolation method first introduced by Heydemann [1]. He used least squares fitting
suitable for increasing the measurement resolution obtainable to compute these error components efficiently and made correc-
from quadrature encoder signals. Based on the existing sinu- tion for the two nonideal sinusoidal signals. Using this method,
soidal signals, high-order sinusoids can be derived, from which
binary pulses can be generated, which can be decoded using only K. P. Birch [2] was able to calculate optical fringe fractions to
standard servo controllers for position information. A look-up nanometric accuracy. By making use of the amplitude variation
table, constructed off-line, serves as the inferencing engine for with angle, Birch divided one period of the sinusoidal signal
the proposed method. Imperfections in the encoder signals can into equiangular segments to increase the effective electrical
be directly compensated for in the look-up table, including mean angle resolution. The micro step controller [3] and encoder code
and phase offsets, amplitude difference, and waveform distortion.
Simulation and experimental results are provided in this paper. compensation technology [4] have been developed based on this
method. Relevant applications can also be found in [5], [6].
Index Terms—Encoder resolution, interpolation errors, look-up These interpolation approaches generally require explicit
tables, measurement interpolation, quadrature encoder signals.
high-precision analog-to-digital converters in the control
system, and a high-speed DSP to compute the electrical angle
I. INTRODUCTION to the required resolution. Therefore, they are inapplicable
to the typical servo controller with only digital incremental
H IGH-PRECISION and resolution motion control relies
critically on the precision and resolution achievable from
the encoders. These factors are in turn limited by the technology
encoder interface. Furthermore, it is cumbersome to integrate
sinusoidal correction with interpolation since the correction
behind the manufacturing of encoders. To date, the scale grating parameters must be calibrated off-line. As a result, most servo
on linear optical encoders can be manufactured to less than controllers that are able to offer interpolation have assumed
four micrometers in pitch, but, clearly, further reduction in perfect quadrature sinusoids. As a result, specifications re-
pitch is greatly constrained by physical considerations. This lating to resolution may be achievable, but the accompanying
implies an optical resolution of one micrometer is currently accuracy cannot be guaranteed. The current effort for sinusoid
achievable. Interpolation using soft techniques will provide correction also does not consider error in the form of waveform
an interesting possibility to further improve on the encoder distortion, i.e., the actual signal may be periodic but is not
resolution, by processing the analog encoder signals online perfectly sinusoidal. These errors are certainly significant when
to yield the small intermediate positions. sub-micron resolution and accuracy are required.
The error sources associated with position information ob- This paper presents a new method to carry out both correc-
tained this way can be classified under pitch and interpolation tion and interpolation, independent of the servo controller. As
errors. Pitch errors are due to scale manufacturing tolerances a result, the method is applicable to most servo controllers, in-
and mounting distortion. They can be compensated via the same cluding those with only digital incremental encoder interfaces.
procedures that will be carried out for general geometrical error The basic idea is to derive high-order sinusoids based on ex-
compensation. Interpolation errors are associated with the accu- isting quadrature sinusoids from the encoder. These high-order
racy of subdivision within a pitch, affecting any calibration per- signals may in turn be converted to a series of high-frequency
formed. Ideal signals from encoders are a pair of sinusoids with binary pulses that are readily decoded by standard servo con-
a quadrature phase difference between them. Interpolation op- trollers. A look-up table is used to implement the idea with little
erates on the relative difference in amplitude and phase of these computational requirements, compared to the online computa-
paired sinusoids. Therefore, interpolation errors will occur if the tion of electrical angle necessary in current interpolators. Sinu-
pair-periodic signals deviate from the ideal waveforms on which soidal corrections, including mean and phase offsets, amplitude
the interpolation computations are based. These deviations must difference and waveform distortion, can be directly reflected in
be corrected before interpolation, using digital signal processing the look-up table. This process is usually done offline, although
techniques, to reduce the interpolation errors. the table can also be updated adaptively online to reflect any
The technology to compensate the mean value errors, phase subsequent changes or drift in the encoder signals. Simulation
and amplitude errors for two quadrature sinusoidal signals was and experimental results are provided to highlight the principles
and applicability of the proposed method.

Manuscript received February 1, 2000; revised July 19, 2002. II. PRINCIPLE OF THE PROPOSED INTERPOLATION METHOD
The authors are with the Department of Electrical and Computer Engineering,
National University of Singapore, Singapore. The basic idea of the proposed interpolation method is to de-
Digital Object Identifier 10.1109/TIM.2002.806028 rive high-order sinusoids based on the fundamental one. From
0018-9456/02$17.00 © 2002 IEEE
1074 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 51, NO. 5, OCTOBER 2002

Fig. 1. Sinusoidal signals correction.

these, binary pulses can be generated which can be readily de- how some of these error components can be calibrated and
coded by standard servo controllers for position information. As corrected.
an example, given the values of and , and Ideally, the quadrature encoder signals (denoted by and
can be obtained from the trigonometry relations: respectively) are identical sinusoidal signals displaced by a
phase of with respect to each other

(1)
(3)

In general, assuming and are known with suf- denotes the instantaneous phase and denotes the amplitude
ficient precision, and can be of the signals.
derived from the following general equations According to the Heydermann method [1], the more general
equations relating the ideal and practical encoder signals are

(4)

where and are the mean values of the signals and is the
(2) phase shift. The and are values obtained from the encoder.
Using an electronic comparator to detect zero crossings, and , are the actual amplitudes of the encoder
quadrature binary pulses may in turn be obtained from signals.
and . These pulses are more readily decoded using Direct simplification of (3) and (4) yields
most standard servo controllers or CNC systems for position
information. A further four times interpolation can be obtained (5)
from these signals. The method eliminates the need for preci-
sion analog-to-digital signal acquisition and processing units where , are the constants, and they can be iden-
within the control system for interpolation purposes, since tified online or offline by a least squares fitting routine [1].
interpolation has been done independently of the controller. From , the offset parameters of the encoder signal may be
A look-up table will serve as the inferencing engine to provide derived as follows
the signal interpolation (Section IV). Errors in the originating
encoder signals can then be directly reflected in the entries of
the look-up table without any separate correction mechanisms.
These errors will include waveform distortion error, which has
not been duly addressed in the literature reported, to the best of
our knowledge.
(6)
III. PRE-INTERPOLATION SIGNAL CONDITIONING
Before interpolation, it is important to correct the errors in
the originating encoder signals. Commonly encountered errors
in the encoder signals are the mean and phase offsets, amplitude
difference and waveform distortion. This section will describe
TAN et al.: NEW INTERPOLATION METHOD FOR QUADRATURE ENCODER SIGNALS 1075

TABLE I
LOOK-UP TABLE BASED ON u
~ ONLY

Consequently, the corrected and united signals can be obtained TABLE II


as INDEX TABLE

(7)

It should be noted that this processing is usually done offline on


logged encoder information over the entire travel of the actuator.
If , , , and vary significantly with time, a recursive
least square fitting can be applied to recursively compute these
parameters online as they change.
This method has assumed a sinusoidal structure in the en-
coder signal in the formulation of the least squares estimation
algorithm. As a result, it is not able to handle any error due to
waveform distortion.
An illustration of the sinusoidal signals with no waveform
distortion, before and after correction, using the above method
is given in Fig. 1. The correction parameters are

Fig. 2. Variation of amplitude against angle.

IV. CONSTRUCTION OF A LOOK-UP TABLE


While and can be computed from (2), it is
too inefficient to be viable when the encoder signals are to be
processed at high speed, especially when is large. A look-up
table can be designed instead for this purpose. The table can
output directly the values of and , given the
inputs and .
Fig. 3. Interpolation based on u
~ .
A. Look-Up Table Based on Only
To simplify the inferencing procedure, the values of fixed and known. Table II serves as the search table to locate the
and can be pre-computed and recorded corresponding relevant entries efficiently. We first define indices , ,
to pre-determined samples of either or , and the sign of the as
other (for illustration, we will use and the sign of for this round
purpose). To simplify the addressing of the table, these samples
are obtained at equal intervals over the entire amplitude
range from 1 to 1 (instead of over the entire range of electrical
angle over one period). The samples are obtained at interval One potential problem with this tabulation method arises due
over this range, and thus there will be a total number of sam- to the large nonlinear variation of the amplitude of with the
ples obtained over each quadrant of the sinusoid. There are thus electrical angle . Using pre-recorded samples of equally
samples per period. A large will result in finer interpolation spaced in amplitude, will mean a varying interval of the corre-
resolution; however, the trade-off is a larger look-up table and sponding angle as shown in Fig. 2.
increased sensitivity to noise. This angle resolution is poor near the vicinity of
As an example, consider and . The look-up . Thus, to have sufficient information
table is accordingly set up as in Table I for one period. pre-recorded from this part of the signal, must be very large
Given the real-time value of and sign of , the associated which will correspondingly imply a large look-up table. Fig. 3
table entry can be directly located since the sample interval is shows the interpolation result, when and .
1076 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 51, NO. 5, OCTOBER 2002

TABLE III
LOOK-UP TABLE FOR n = 16

TABLE IV
INDEX TABLE

Fig. 4. Interpolation based on both u


~ and u
~ .

The waveforms of and are distorted around


.

B. Look-Up Table Based on Both and


To overcome this difficulty, amplitudes of both
and may be pre-recorded, since for the region around
, has a much more even relationship
between the amplitude and phase angle. Therefore, can be
used more effectively for the inferencing procedure instead in
these areas. To this end, we propose that for , we
will use as the basis to search for the table entry. Otherwise, Fig. 5. Waveform error mapping.
the amplitude of is used. Essentially, this means the look-up
table now consists of more portions (eight instead of four) C. Maximum Interpolation
corresponding to various parts of and .
The maximum interpolation achievable is limited by the
The look-up table for is given in Table III.
minimum number of samples to be recorded in one period of
There are samples over the amplitude range of 0 to 0.707 the raw encoder sinusoid signal, and the minimum number of
and, therefore, the division is now . There are also samples required to appear over one period of the high-order
samples over the range 0.707 to 1, thus having a finer division sinusoid to be generated according to the following equation:
in this poor angle resolution region. To facilitate the efficient
and quick access to the appropriate part of the look-up table, an (9)
index table (similar to Table II) is useful. To this end, we also
define indices , , as: Here, is the maximum number of samples recorded in one
period of , and is the minimum number of samples to
appear over one period of [since one cycle of
round will contain cycles of ]. The factor of four arises due
to the additional fourfold interpolation for digital encoders. For
(8) example, if and an interpolation of 1024 is required (i.e.,
round
), then , i.e., we need to acquire at least
round 1536 samples over one period of the raw signal. It should be
noted that the limit on interpolation due to sampling is consid-
Based on these indices, the following index table (Table IV) ered in (9). Noise sensitivity is another issue that is considered
yields the actual points where the appropriate and separately in Section IV-G.
can be directly located ( ), corresponding to the
various parts of and respectively. D. Waveform Distortion
Fig. 4 shows the interpolation results when and In Section III, we have assumed that the signals from the en-
. There is no waveform distortion even though , coder are ideal and periodic sinusoidal signals, with no wave-
which is smaller than that used in Fig. 2 ( ). form distortion. In practice, the waveform of the actual encoder
TAN et al.: NEW INTERPOLATION METHOD FOR QUADRATURE ENCODER SIGNALS 1077

Fig. 6. Quadrature sinusoidal signal decoding.

Fig. 8. Interpolation (n = 16).

Fig. 9. Interpolation and conversion to quadrature pulses (n = 16).


Fig. 7. Interpolation (n = 4).

signals deviate from the ideal sinusoidal waveform. Therefore,


corrections based on the ideal sinusoidal waveform assumption
may yield inaccurate position information that may not be ac-
ceptable for applications with high-precision requirements. It
is more reasonable to assume that the encoder signal is peri-
odic and reproducible in the waveform that is not necessarily
sinusoidal. In this case, since the nonsinusoidal waveforms are
available, we can use an error mapping method to map them into
sinusoidal ones. The idea is depicted in Fig. 5. The look-up ta-
bles of Section IV continue to be applicable.
It should be cautioned that this is possible if the distorted Fig. 10. Interpolation and conversion to quadrature pulses (n = 32).
waveforms are periodic and there exists a one-to-one mapping
of each point to the ideal sinusoid. It is also necessary for the in the table can be directly converted into binary values ( and
A/D converter to have a wordlength sufficient to resolve two respectively) according to the following equations:
different points on the waveform.

E. Conversion to Binary Pulses

In order for the encoder signals to be received by a gen- (10)


eral-purpose incremental encoder interface, the quadrature si-
nusoidal signals must be converted to a series of binary pulses. Thus, we can generate and which are quadrature square
An analog comparator may be used to transform the high-order curves directly from Table III. can be 0 or a small value set
sinusoids into pulses. As shown in Fig. 6, the comparator will according to the threshold of measurement noise.
simply switch the pulse signals when the associated sinusoidal
signal crosses zero. The rest of the analog information will not F. Direct Conversion to Digital Position
be used. The pulse information in Table III can be easily converted into
Alternatively, this transformation can be more efficiently digital position values, which can be directly used for control
done within the look-up table. The and entries purposes without further computations. This is especially true
1078 IEEE TRANSACTIONS ON INSTRUMENTATION AND MEASUREMENT, VOL. 51, NO. 5, OCTOBER 2002

Fig. 11. Mapped interpolation (n = 8).

if the aforementioned interpolation method is integrated into a V. EXPERIMENTS


general digital controller. Alternatively, the encoder card can
be made PC-bus based and the general motion controller can A dSPACE controller with a high-speed A/D card (with a
acquire the digital position value directly from the register or wordlength of 12 b) is first used to acquire the raw quadrature
shared memory. In this case, the D/A converters are not required. sinusoidal signals from the Heidenhein linear encoder LIP481
for the pre-interpolation signal conditioning. The compensation
G. Practical Constraints parameters are: , ,
, . This process is carried out offline.
Similar to existing interpolation methods based on computa-
Interpolation is subsequently carried out based on the pro-
tion of the electrical angle, the proposed approach is also subject
posed method. Fig. 7 shows the interpolation result with .
to practical constraints such as noise sensitivity and digitization
This (as well as subsequent results to be presented) is done on-
errors.
line with the actuator controlled to run at a constant speed.
In order to resolve each sample (separated by ) of the
encoder’s signal, the A/D converter should have a wordlength Fig. 8 shows the results with .
sufficient to meet the following condition: Fig. 9 shows the results with and in addition, the
look-up table entries are converted to binary values, according
to Section IV-D, to yield binary pulses directly. To allow the
pulses (with similar amplitudes) to be shown more clearly in
Fig. 9, the amplitude of is deliberately set to 0.8.
Conversely, given a fixed wordlength , the resolution and Fig. 10 shows the results with .
therefore the final interpolation achievable will be limited To more clearly illustrate the situation with nonsinusoidal
accordingly. encoder signals and the correction using mapping, triangular
The bandwidth ( ) of the control electronics limits the waveforms are simulated and mapped to sinusoidal ones. The
number of pulses which can be acquired per unit time, which interpolation results for and their Lissajous figures are
in turn limits the maximum velocity achievable by the shown in Fig. 11. Current interpolators that rely on a computa-
actuator in order for interpolation at to still work well. An tion of electrical angle for interpolation will be inadequate when
estimate of the velocity can be obtained from the following applied to these periodic but nonsinusoidal signals.
equation, where is the encoder pitch:

VI. CONCLUSION

Noise arising in encoder signals should be minimized prior to A new interpolation method is developed in this paper,
interpolation by proper shielding and grounding of the transmis- suitable for increasing the measurement resolution obtainable
sion and reception circuits. However, it is unlikely that it can be from quadrature encoder signals. Based on the existing sinu-
totally eliminated. The higher order sinusoids generated from soidal signals, high-order sinusoids are derived, from which
the proposed interpolation approach can be contaminated by binary pulses are generated which can be decoded using only
measurement noise. However, the final measurement can be rel- standard servo controllers for position information. A look-up
atively unaffected if the conversion to binary pulses at the zero table, constructed off-line, serves as the inferencing engine
crossing is properly handled to avoid erroneous switching due for an effective way of generating the signals online with
to noise. This is usually handled in practice via the hysteresis minimal computational burden. Imperfections in the encoder
(or switching threshold) in the comparator so that switching can signals can be directly compensated offline in the look-up
only happen when the zero point is crossed sufficiently. The table, including mean and phase offsets, amplitude difference
hysteresis level is selected to correspond to an estimate of the and waveform distortion. Simulation and experimental results
amplitude of the measurement noise. provided illustrate the effectiveness of the proposed method.
TAN et al.: NEW INTERPOLATION METHOD FOR QUADRATURE ENCODER SIGNALS 1079

REFERENCES Huixing X. Zhou was born in Jiangsu, China, in 1963. He received the B.Eng.
degree in production engineering from Dalian University of Technology, Dalian,
[1] P. L. M. Heydemann, “Determination and correction of quadrature fringe
China, and the Ph.D. degree in mechanical engineering from the Tsinghua Uni-
measurement errors in interferometers,” Appl. Opt., vol. 20, no. 19, Oct. versity, Beijing, China, in 1983 and 1998, respectively.
1981.
From 1998 to 2000, he was a Postdoctoral Research Fellow in the Depart-
[2] K. P. Birch, “Optical fringe subdivision with nanometric accuracy,” Pre- ment of Electrical and Computer Engineering, National University of Singa-
cision Eng., vol. 12, no. 4, Oct. 1990. pore, Singapore. Since 2001, he has been a Product Development Manager in
[3] K. Watanabe and H. Yokote, “A microstep controller of a DC servo-
the Keyworth Institute, University of Leeds, Leeds, U.K. His research interests
motor,” IEEE Trans. Instrum. Meas., vol. 39, pp. 60–62, Dec. 1990. include CNC machine and DSP embedded system, motion control, linear actu-
[4] N. Hagiwara and H. Murase, “A method of improving the resolution
ators (piezo and VCM), mechatronics, and manufacturing systems. He is also
and accuracy of rotary encoders using a code compensation technique,” interested in product development, technology transfer, and management.
IEEE Trans. Instrum. Meas., vol. 41, pp. 98–101, Feb. 1992.
[5] H. Yokote and K. Watanabe, “A hybrid digital and analog controller for
DC and brushless servomotors,” IEEE Trans. Instrum. Meas., vol. 39,
pp. 259–263, Apr. 1989.
[6] J. R. R Mayer, “High resolution of rotary encoder analog quadrature
signals,” IEEE Trans. Instrum. Meas., vol. 43, pp. 494–498, June 1994.
[7] J. S. Chen and C. C. Liang, “Improving the machine accuracy through Tong Heng Lee (M’88) received the B.A. degree (first class honors) in the en-
machine tool metrology and error correction,” Int. J. Adv. Manufact. gineering from Cambridge University, Cambridge, U.K., and the Ph.D. degree
Technol., vol. 11, 1996. from Yale University, New Haven, CT, in 1980 and 1987, respectively.
[8] J. Ni, “CNC machine accuracy enhancement through real time error He is a Professor in the Department of Electrical and Computer Engineering,
compensation,” J. Manufact. Sci. Eng., vol. 119, Nov. 1997. National University of Singapore, Singapore. He is also the Head of the Control
[9] G. C. Goodwin and R. L. Payne, Dynamic System Identification: Exper- Engineering Division in the same Department, and the Vice-Dean of Research
iment Design and Data Analysis. New York: Academic, 1977. in the Faculty of Engineering, National University of Singapore. His research
interests are in the area of adaptive systems, knowledge-based control, and intel-
ligent mechatronics. He has published extensively in these areas and is currently
an Associate Editor of Automatica, Control Engineering Practice, International
K. K. Tan (S’94–M’99) received the B.Eng. in electrical engineering (with Journal of Systems Science.
honors) and the Ph.D. degree from the National University of Singapore, Sin- Prof. Lee was a recipient of the Cambridge University Charles Baker
gapore, in 1992 and 1995, respectively. Prize in Engineering. He is Associate Editor of IEEE/ASME TRANSACTIONS
His research interests include precision motion, intelligent control, and ON MECHATRONICS and the IEEE TRANSACTIONS ON SYSTEMS, MAN, AND
mechatronics. CYBERNETICS

You might also like