1 - 35
Modular LYNX System
Modular LYNX System 12.05.2003
Figure 6.8: Connecting and Using an Encoder
DIR+
DIR-
SCK-
SCK+
GND
+5V
RX-
RX+
TX-
TX+
CGND
RX
TX
22
21
23
24
25
26
31
32
33
34
35
36
IG
123456
123456 123456
22
21
23
24
25
26
31
32
33
34
35
36
GND
V+
A1
A0
A2
PT
HI
UG
TM
Motor Driver
ZN429D
GP5962 7A
ZN429D
GP59627A
+5VDC Opto Supply
GND
+5VDC
Step Clock Input
Direction Input
SCLK+
DIR+
+5VDC
OUTPUT
Differential/O MODULE
TM
13+
13-
14-
14+
15-
15+
16-
16+
17-
17+
18-
18+
GD
HSIO ENCODER
13- Channel A-
13+ Channel A+
14- Channel B-
14+ Channel B+
Stepping Motor
&
Encoder
Power Connections
Not Shown For
Simplification
PRINT CTR2
‘Print the position of the motor. Your terminal should echo “2.000”
PRINT POS
By printing the variable CTR2 (CTR2 = EUNIT X POS) we can view the distance the motor has traveled in
raw encoder counts, or by printing POS you can see the distance of travel represented by number of units
relative to 0.
Translating the EUNIT Variable to a Dimension of Distance
The EUNIT, or Encoder Unit variable, is the scaling factor used to translate Encoder steps to a dimension of
distance, or user units. At this point you should already be familiar with the MUNIT variable. The main
difference between the two is as follows: By using MUNIT scaling factor you monitor the position of an axis
based upon the value of CTR1, the register that contains the actual count of clock pulses sent to the drive.
The number of pulses is then scaled to user units by setting the MUNIT Variable to the appropriate scaling
factor for the type of units being used, be they inches, millimeters, degrees, etc. Then the POS variable
tracks position in the user units specified. Example:
User Unit (POS) = CTR1 ÷ MUNIT where EE (Encoder Enable) Flag = FALSE (0)
By setting the state of EE, the master encoder function enable flag, to a true state you will monitor the
position of an axis based upon the actual position of the motor shaft as it is fed back to the Control Module