Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 306 of 909
EXAMPLE: (fast index find)
MP 'Set buffered velocity mode
ADT=1000 'Set fast accel/decel
VT=4000000 'Set fast velocity
PRT=RES+100 'Set relative distance just beyond
'One shaft turn
Ai(0) 'Clear and arm index capture
O=0 'Force change to position register
G 'Start fast move
TWAIT 'Wait till end of trajectory
PT=I(0)+100 'Go back to index
G 'Start motion
TWAIT 'Wait until end of trajectory
O=0 'Set origin at index
Index used as High Speed Position Capture:
When enabled through EIRI, the Bi(0) flag is set to 1 when a rising edge is seen at I/O pin 6.
As a result, I/Opin 6 can be used to capture position for high-speed registration applications.
EXAMPLE: (fast position capture)
EIGN(6) 'Set port 6 as input port
EIRI 'Set port 6 to register internal encoder
'Set F command flags
VT=100000 'Set Velocity
ADT=100 'Set accel/decel
MV 'Set to Velocity Mode
Ai(0) 'Arm registration
G 'Start moving
WHILE Bi(0)==0 'Travel until index reached
LOOP
X 'Decelerate to a stop
RI(0) 'Report registered position
END
RELATED COMMANDS:
Ai(arg) Arm Index Rising Edge (see page 264)
Aij(arg) Arm Index Rising Edge Then Falling Edge (see page 266)
Aji(arg) Arm Index Falling Edge Then Rising Edge (see page 270)
R
B(word,bit) Status Byte (see page 291)
R
Bx(enc) Bit, Index Input, Real-Time (see page 346)
EIRE Enable Index Register, External-Input Capture (see page 412)
EIRI Enable Index Register, Internal-Input Capture (see page 414)
R
I(enc) Index, Rising-Edge Position (see page 471)
R
W(word) Report Specified Status Word (see page 793)
Z Total CPU Reset (see page 806)
Z(word,bit) Reset Specified Status Bit (see page 808)
ZS Global Reset System State Flag (see page 818)
Part 2: Commands: Bi(enc)