User guide
206
6000 Series Programmer's Guide
Trackball Program
(Continued)
DEL FINE
DEF FINE ; Subroutine to assign fine positioning
FOLRN.5,.5 ; Fine positioning ratio is 0.5:1
GO11 ; Move to begin travel at new ratio
VAR1=0 ; Flag to indicate we are in fine mode
END ; Return to main loop
DEL TRACK
DEF TRACK ; Main track ball program
IF(IN.1=b1 AND VAR1=0) ; If input 1 is set to 1 and we are
; currently in fine mode, then enter coarse mode
GOSUB COARSE ; Set high ratio
NIF
IF(IN.1=b0 AND VAR1=1) ; If input 1 is set to 0 and we are
; currently in coarse mode, then enter fine mode
GOSUB FINE ; Set low ratio
NIF
IF(LIM.1=b0 OR LIM.2=b0) ; If a limit is hit, allow track ball to move off
D~ ; Back off of the limit, axis 1
GO1
NIF
IF(LIM.4=b0 OR LIM.5=b0)
D,~ ; Back off of the limit, axis 2
GOX1
NIF
END
DEL MAIN
DEF MAIN ; Begin definition of main program
V1,1 ; Set non-Following move parameters
A99,99
LH3,3,0,0
FOLMAS+31,+41 ; Encoder #3 is master axis for slave axes #1 and
; Encoder #4 is master axis for slave axes #2.
; The slave axes will move in the same direction as
; the master.
FOLRN.5,.5
INDEB25,250 ; Noisy switch debounce of 250 milliseconds
INDEB26,250
FOLRD1,1 ; Initial slave-to-master ratio is set to fine
; positioning (0.5:1)
VAR1=0 ; Flag set to fine positioning
MC11 ; Set both axes 1 and 2 to continuous positioning mode
FOLEN00 ; Following is initially disabled
COMEXC1 ; Continue command execution during motion.
COMEXS1 ; Continue command execution after stop
COMEXL11 ; Continue command execution after a limit is hit
INFEN1 ; Enable input functions
SGP20,20 ; Set servo gains
SGV5,5
DRIVE1100 ; Enable drives
DRFLVL11XX ; Set drive fault level for Compumotor 670-T drives
ONP LOCK ; Select LOCK as an ON program
ONIN.26-1 ; Trigger B locks trackball to stage
ONCOND1000 ; Inputs enabled for interrupts
$WAITLP ; Main program loop
IF(IN.26=b1) ; If trigger input B is set to 1 (stage locked),
; enter trackball mode
GOSUB TRACK
NIF ; End of IF statement
; *************************************************************
; * Other user programs can be added here for performing *
; * motion when the stage is not locked to the trackball. *
; *************************************************************
JUMP WAITLP ; Return to main loop
END ; End program definition










