Parker
Hannifin
WHILE (NOT BIT 16134 OR NOT BIT16166)
REM Jump to User error routine if home fails
IF (BIT 16135 OR BIT 16167) THEN GOTO HomeFailed
WEND
REM now find the Z markers for each axis encoder for
REM more accurate positioning
REM MSEEK uses master move profile settings
ACC 250
VEL 50
DEC 250
STP 250
JRK 1250
REM X axis ballscrew is 10mm per motor rev, so command a move
REM of 10.5 to ensure 1 rev
MSEEK X(10.5,0)
REM Rising First Marker : Z Mark, ENC0
REM Hardware Capture Parameter : P12292
REM Capture Complete Flag : BIT777
REM Y axis ballscrew is 10mm per motor rev, so command a move
REM of 10.5 to ensure 1 rev
MSEEK Y(10.5,0)
REM Rising First Marker : Z Mark, ENC1
REM Hardware Capture Parameter : P12548
REM Capture Complete Flag : BIT809
REM Z axis ballscrew is 5mm per motor rev, so command a move
REM of 5.5 to ensure 1 rev
MSEEK Z(5.5,0)
REM Rising First Marker : Z Mark, ENC2
REM Hardware Capture Parameter : P12804
REM Capture Complete Flag : BIT841
REM all position counters are now set to 0 by successful MSEEKs.
REM If home sensors/Z marks are not at the desired
REM machine zero location, move to “true zero”
REM or preload current location settings “RES X97 Y57.5 Z4.4”
X-97 Y-57.5 Z –4.4
INH –516 : REM wait until moves are complete
RES X Y Z : REM reset all counters to 0
REM change master move profile back to normal operation settings
ACC 750 VEL 250 DEC 750 STP 750 JRK 2250
REM change jog profiles back to normal operation settings
JOG ACC X1000 Y1000 Z200
JOG DEC X1000 Y1000 Z200
JOG VEL X300 Y300 Z100
RETURN : REM go back to main program execution
_ HomeFailed
IF (BIT 16199) THEN PRINT “ Z Homing Failed”
IF (BIT 16135) THEN PRINT “ X Homing Failed”
IF (BIT 16167) THEN PRINT “ Y Homing Failed”
END
ENDP
Application Examples 95