Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 305 of 909
The Bi(1) bit is reset by any of the following:
l
Power reset
l
Z command (total reset of software)
l
Z(1,6) command
l
ZS command
EXAMPLE: (simple homing)
MV 'Set buffered velocity mode
ADT=10 'Set buffered accel/decel
VT=-4000 'Set low buffered maximum velocity
i=0 'A flag to know if any index was found
ZS G 'Start slow motion profile
Ai(0) 'Clear and arm index capture
WHILE Bm==0 'Travel until negative limit reached
IF Bi(0)==1
PT=I(0) 'Save this target
Ai(0) 'Clear and arm index capture
i=1 'Set flag to indicate index was found
ENDIF
LOOP
X 'Decelerate to a stop
IF i==0
'Index not seen, must have started close to limit
VT=4000 'Set low buffered maximum velocity
Ai(0) 'Clear and arm index capture
ZS G
WHILE Bi(0)==0 'Travel positive until index reached
LOOP
PT=I(0) 'Go back to index
ENDIF
MP ZS G 'Start motion
TWAIT 'Wait till end of trajectory
O=0 'Set origin at index
Part 2: Commands: Bi(enc)