Escolar Documentos
Profissional Documentos
Cultura Documentos
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.
°°
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
b)
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
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
Tv=0
Display p(0)
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.