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i
f
i
d
o
m
g
n
i
r
i
w
t
u
o
h
t
i
w
)
n
o
i
s
r
e
V
Table 9.5: Expansion Slot 2 Encoder Connections
T e s t i n g Y o u r E n c o d e r S e t u p
Now that your encoder is connected, let’s test the setup and verify
its operation by typing the following into your terminal:
‘set munits to correspond with MSEL=256
MUNIT=51200
‘set the encoder units variable EUNIT to the number = 4 x
‘encoder resolution, ie 500 line encoder x 4 = 2000,
‘200 line encoder x 4 = 800 etc.
EUNIT=2000
‘Set the stall factor variable to 10% of EUNIT (10% of a
‘revolution
STLF=200
‘Enable encoder functions
EE=1
POS=0
‘set position counter to 0
CTR2=0
‘set counter 2 to 0
SAVE
‘save the aforementioned settings.
Test the encoder setup by entering the following into your terminal:
MOVR 10
‘the motor moves 10 revolutions (we hope)
PRINT POS ‘we read the POS variable, it should say “10.000”
PRINT CTR2
‘we read CTR2, it should read 10 X EUNIT, or 20000
I n t r o d u c i n g T h e E U N I T ( E n c o d e r U N I T S ) V a r i a b l e
During open loop operation, the MicroLYNX takes the number of clock pulses
registered on CTR1, scales that number using the MUNIT variable and then writes
the result to the position variable POS.
For closed loop operation, where the encoder functions are enabled (EE=1), the
MicroLYNX takes the number of clock pulses registered on CTR2, scales them by
The +5VDC output of
the High-Speed I/O is
not designed to power
external devices other
than an encoder!
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from
Downloaded from