Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 167 of 909
C5 'Home routine (Home to hard stop)
PRINT("HOME MOTOR",#13)
VT=vv*rr 'Set home velocity
ADT=aa 'Set home accel/decel
MV 'Set to Velocity mode
ZS 'Clear any prior errors
T=tt*rr 'Preset torque values
G 'Begin move toward hard stop
MT
WHILE ABS(EA)<ee LOOP 'Loop, while position error within limit
PRINT("HIT HARD STOP",#13)
G WAIT=50 'Wait 50 milliseconds
O=hh*rr 'Set origin to home offset
PRINT("MOVING TO ZERO",#13)
MP PT=0 G TWAIT 'Set motor to zero
RETURN
'========================================================
CAUTION: When writing a cam table to EEPROM, structure the program so
that the cam table is not frequently rewritten or written from a loop. Repeated
erasing and rewriting can burn bits and corrupt data. For details and sample
code, refer to Electronic Camming Notes and Best Practices on page 159.
Part 1: Programming: Cam Example Program