Você está na página 1de 5

Computerized Study of the Linear Optical Incremental Encoder

DORINA-MIOARA PURCARU
Faculty of Automation, Computers and Electronics
University of Craiova
13 Al. I. Cuza Street, Craiova RO-1100
ROMANIA

Abstract: - The paper presents an algorithm that ensures the computerized measurement of some motion
parameters (position, displacement, average velocity) using the signals from a linear optical incremental
encoder. The working mode of the sensor is with zero initial position or with pre-established target position.
This algorithm is adequate for studying the working modes of the sensor with an intelligent system composed
by an IBM-PC compatible computer, an interface with a microcontroller from the 80C51 family and a signal
conditioning subsystem. Such measurement system is very useful in higher education and research activities.

Key-Words: - computerized measurement, linear optical incremental encoder, working mode, displacement,
position, velocity.

1 Introduction characteristics. The intelligent interface [7] achieves


It is well known that the measurement of the motion the sensor data acquisition and processing. Hardware
parameters (displacement, position, velocity, resources of the interface enable the generation of
acceleration etc.) is very important for many control some digital and analog commands and the
systems (e.g., robotic systems); the motion sensors acquisition of many digital or analog signals,
are based on various physical effects [2,3,4,5,11]. A necessary for computing some motion parameters or
one-to-one relationship may not always exist sensors characteristics. This interface is endowed
between a measuring device and a measured with adequate software resources for connecting and
variable. Furthermore, many motion parameters can studying different displacement sensors. Between
be obtained using the same measuring device and an interface and computer there is a soft interaction.
appropriate data processing technique. By way of
example, it is well known that a linear or rotary
optical incremental encoder can serve for measuring 2 Measurement Principle for Motion
the displacement and average velocity of its mobile Parameters
element and for the discrimination of the motion The optical incremental encoders are used for the
sense. precise measurement of the displacement. The linear
This paper proposes an algorithm for encoder contains an incremental scale (the fixed
computerized measurement of some motion element) and a slider that moves relative to the scale.
parameters using a linear optical incremental There are three possibilities for sensor construction
encoder. This algorithm is adequate for studying the [11]. One among these supposes a glass scale with
sensor with an intelligent system composed by an two parallel paths ( PA and PB in Fig.1a) that
IBM-PC compatible computer, an interface with a
contain opaque and clear equispaced zones with ∆L
microcontroller from the 80C51 family [1,8,10] and
their width. Between the two paths there is a spatial
a signal conditioning subsystem. Such intelligent
system (fundamental in facts presented in [6]) is very ∆L
shift of . The slider contains two pairs light
useful in higher education and research activities. 2
This measurement system is extremely versatile; it emitting diode – phototransistor, for reading the two
can be easily adapted for studying other motion paths of the scale. The signals from the
sensors [6,9]. The IBM-PC compatible computer phototransistors FTA and FTB are amplified and
assures a simple dialog with the user and the data conditioned to give the pulses A and B, TTL
processing and interpretation; it also displays the compatible [2,4,11]. The phase shift between A and
measured variables and computes some sensor B denotes the sense of the slider motion.
left right

FTA S
∆L ∆L

°°
PA
PB

FTB
x=0
A a)

0
A1 x
0
A2 x

0
B x

0
B1 x

0
B2 x

0
R=uo x

0
x
b)

Fig.1a,b: The linear optical incremental encoder and the signal diagram

p(t1) p(0) pT p(t2)



-55,05 -28,15 0 +30,11
p[mm]

p<0,|p| p<0,|p| p>0,|p| p>0,|p|


a)
p(t2) pT p(0) p(t1)

-41,16 0 +34,10 +60,08
p[mm]

p<0,|p| p<0,|p| p>0,|p| p>0,|p|

b)

Fig.2a,b: Working mode with pre-established target position


p(t2) p(0) p(t1)

-40,12 0 +32,17
p[mm]

p<0,|p| p<0,|p| p>0,|p| p>0,|p|


Fig.3: Working mode with zero initial position

The signal diagram from the Fig.1b corresponds The signals L* and R * memorize the motion
to the slider motion to right (Fig.1a).
The displacement of the slider relative to the sense between two successive pulses u o ; L* = 1
scale can be measured with different resolution. The memorizes the sense to left, and R * = 1 memorizes
simplest method is the countering of the pulses A or the sense to right.
B during the displacement. The resulted number is This method for the discrimination of the motion
multiplied with 2 ⋅ ∆L for obtain the displacement. sense is used in the algorithm presented below.
The resolution of the measurement is 2 ⋅ ∆L and it is The linear optical incremental encoder can work
often too much. in two modes: with pre-established target position
The usual method for the displacement and with zero initial position.
measurement improves electronically the resolution. The first working mode enables the reaching of
The positive and negative fronts of the pulses A and an imposed target (or stop) position, p T = 0 ; this
B are detected and the signals A1 , A 2 and B1 , B 2 , origin of the position axis imposes the sign of other
respectively are obtained (Fig.1b). The spatial period positions, including p(0 ) (Fig.2a,b). At the moment
of the signal t = 0 , the content of the CP counter represents the
u o = A1 + A 2 + B1 + B 2 (1) absolute value of the target position and p(0 ) = − p T .
∆L In the second working mode, the initial position
is . So, the number of the pulses u o is
2 p(0 ) = 0 is the origin of the position axis and Z = 0
∆L at the moment t = 0 . All the positions p(t ) situated
multiplied with for obtain the displacement of
2 on the positive semi-axis have the sign plus, and
the slider. In this way, the resolution of the those situated on the negative semi-axis have the
measurement is four time improved. This second sign minus (Fig.3).
method is used for the displacement measurement in Both working modes ensure the measurement of
this paper. the position and average velocity of the slider
Both methods presented above ensure only the relative to the scale.
displacement measurement, during the motion, The pulses obtained at the output R or L must
without identifying the motion sense. But there are be counted up or down by the counter CP for
many situations when the motion sense must be position. The countering sense depends on the sign
known. If in relation (1) the addition of each signal of the last measured position and the state of the
A1 or A 2 is conditioned by the level of B and the counter CP. Z = 1 at the counter reset. The sign of
addition of each signal B1 or B 2 is conditioned by the displayed position is plus when P = 1 and
the level of A, the motion sense can also be detected. M = 0 , or minus when P = 0 and M = 1 .
If there are two outputs, After an analyze of all possible motion
R = A1 ⋅ B + B1 ⋅ A + A 2 ⋅ B + B 2 ⋅ A (2) situations, the pulses that must be counted up form
the signal
and
U = R ⋅ (P + Z ) + L ⋅ (M + Z ) (4)
L = A1 ⋅ B + B1 ⋅ A + A 2 ⋅ B + B 2 ⋅ A , (3)
and those that must be counted down form the signal
all the pulses A1 , A 2 , B1 , B 2 appear
D = Z ⋅ (R ⋅ M + L ⋅ P ) . (5)
• at the output R and L = 0 , when the slider The content of the CP counter is multiplied with
moves to right (figure 1b), ∆L
• at the output L and R = 0 if the slider for obtain the absolute value of the measured
2
motion is to left.
position relative to the origin.
When the slider does not move, R = L = 0 .
The sign of the computed position depends on Read A and B
the sign of the previous (the last displayed) position,
the motion sense and the state of the counter CP. The
signals associated with the position signs are M
( M = 1 for the sign minus) and P ( P = 1 for the sign Tv=0
plus):
( )
M = M P ⋅ R * ⋅ Z + L* + Z ⋅ L* , (6)
( )
P = PP ⋅ L ⋅ Z + R + Z ⋅ R * .
* *
(7) Compute L and R

If the last displayed position is positive, PP = 1 , and


if it is negative, M P = 1 .

No
L=1 or R=1

Select
Working mode (WM) Yes
Compute U and D

Yes
WM=1
Compute M and P
No Reset CP
No (Z=0)
WM=2
Display p(t)
Yes M=P=0

Insert pT
The No
same motion
sense
Load CP with | pT |

Yes
Yes
Tv=Tv+1
pT>0

No P=0
M=1 No
No Tv=1s Tv=0
pT<0

Yes Yes

P=1, M=0 Compute and


display va

Tv=0
Display p(0)

Fig.4: Flow chart of the Initialization Procedure


Fig.5: Flow chart of the Signal Processing
Procedure
The average velocity v a is computed only if the References:
slider moves in the same sense during Tv = 1s . This [1] Ayala, K.J., The 8051 Microcontroller:
Architecture, Programming and Applications, West
motion parameter is computed with
Publishing Company, 1994.
p(t 2 ) − p(t 1 ) [2] De Silva, C., Control Sensors and Actuators,
va = , (8)
t 2 − t1 Prentice-Hall, 1990.
where t 2 − t 1 = Tv . [3] Doebelin, E.O., Measurement Systems
Application and Design, 4th ed., New York:
McGraw-Hill, 1990.
[4] Helfrick, A., Cooper, W., Modern Electronic
3 Algorithm for Studying the Instrumentation and Measurement Techniques,
Working Modes of a Linear Optical Prentice-Hall International Editions, 1990.
Incremental Encoder [5] Ohba, R., Intelligent Sensor Technology, John
The algorithm for this computerized measurement Wiley & Sons, 1992.
contains two procedures: Initialization and Signal [6] Purcaru, D.M., Purcaru, I., Experimental System
Processing. for Studying Some Displacement Sensors, The
The Initialization Procedure is presented in International Symposium on Systems Theory,
Fig.4. The selected working mode ( WM ) of the Automation, Robotics, Computers, Informatics,
sensor can be with zero initial position ( WM = 1 ) or Electronics and Instrumentation (SINTES 10),
with pre-established target position ( WM = 2 ). The Craiova (Romania), 2000, Proceedings, pp. E106-
E109.
user must insert the target position p T if WM = 2 .
[7] Purcaru, I., Purcaru, D.M., Intelligent Interface
This procedure also establishes the absolute value for Studying Different Sensors, The International
and sign of the initial position p(0 ) . Symposium on Systems Theory, Automation,
The flow chart of the Signal Processing Robotics, Computers, Informatics, Electronics and
Procedure (when the slider moves) is presented in Instrumentation (SINTES 10), Craiova (Romania),
Fig.5. The slider position and average velocity are 2000, Proceedings, pp. E75-E78.
computed and displayed for each working mode. [8] Stewart, J., The 8051 Microcontroller:
The slider motion can be continuous or not. Hardware, Software and Interfacing, Prentice-Hall,
When the slider stops, the last measured position 1993.
rests displayed, the sign and absolute value of [9] Tompkins, W.J., Webster, J.G. (eds), Interfacing
position are memorized and the average velocity is Sensors to the IBM-PC, Englewood Cliffs, NJ:
zero. Prentice Hall, 1988.
The algorithm for computerized measurement [10] Tran Tien Lang, Computerized Instrumentation,
presented in this paper has the following advantages: John Wiley & Sons, 1991.
• improves electronically the resolution; [11] Usher, M.J., Sensors and Transducers, New
• ensures the discrimination of the motion York: Macmillan, 1985.
sense; [12] Wobschall, D., Circuit Design for Electronic
• enables the studying of two working modes Instrumentation, 2d ed., New York: McGraw-Hill,
of the linear optical incremental encoder; 1987.
• computes the position and average velocity.

4 Conclusion
This paper proposes an algorithm for computerized
measurement of displacement, position and velocity
and for the discrimination of the motion sense using
a linear optical incremental encoder. This algorithm
is adequate for studying the sensor with an
intelligent system composed by an IBM-PC
computer, an interface with a microcontroller from
the 80C51 family and a signal conditioning
subsystem. Such measurement system is very useful
in higher education and research activities.

Você também pode gostar