Modular l ynx system – Intelligent Motion Systems Modular LYNX System User Manual

Page 35

Advertising
background image

1 - 35

Modular L

YNX 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

12

3

4

5

6

123

45

6

12

3

4
5
6

22

21

23
24
25
26

31

32

33
34
35
36

GND

V+

A1

A0

A2
PT

HI

UG

TM

Motor Driver

Z

N

42
9D

G

P

5962

7A

Z

N

42
9D

G

P

59
62

7

A

+5VDC Opto Supply

GND

+5VDC

Step Clock Input

Direction Input

SCLK+

DIR+

+5VDC

OUTPUT

Di
f

f

e

r

e

n

t

ia

l

/

O

M
O

D

U

L

E

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.

T r a n s l a t i n g t h e E U N I T V a r i a b l e t o a D i m e n s i o n o f D i s t a n c e

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

Advertising