User's Manual

PMAC User Manual
134 Basic Motor Moves
I907=11 ; Capture on flag low and index channel high
I908=0 ; Use HMFL2 (home flag) as trigger flag
CMD"#2HM" ; Do actual homing move
WHILE (M245=1) ; Waits for Home Search to start
ENDWHILE
WHILE (M233=0) ; Waits for Home motion to complete
ENDWHILE
DIS PLC11 ; Disables PLC once Home is found
CLOSE ; End of PLC
Already Into Home?
A similar situation occurs when it is not known on power-up whether or not it is positioned already into
the home trigger. Here, the easiest solution is to write a program that evaluates this condition; if it is in
the trigger, it moves out before doing the real homing.
;*************** Motion Program Set-up variables (to be saved) *******
CLOSE
M320->X:$C008,20,1 ; Variable for HMFL3 input
I325=$C008 ; Use Flags3 for Motor 3
;************** Motion program to execute routine *********************
OPEN PROG 103 CLEAR
IF (M320=1) ; Already in trigger?
I323=10 ; Home speed 10 cts/msec positive direction
I326=1600 ; Home offset +100 counts (to make sure clear)
I912=11 ; Capture on falling flag and rising index
I913=0 ; Use HMFL3 as flag
HOME3 ; "Home" out of switch
ENDIF
I323=-10 ; Home speed 10 cts/msec negative direction
I326=0 ; No home offset
I912=3 ; Capture on rising flag and rising index
I913=0 ; Use HMFL3 as flag
HOME3 ; Do actual homing move
CLOSE ; End of program
;***************PLC Set-up variables (to be saved) ********************
CLOSE
M320->X:$C008,20,1 ; Variable for HMFL3 input
I325=$C008 ; Use Flags3 for Motor 3
M333->X:$00B5,13,1 ; Desired Velocity Zero bit
M345->Y:$0994,10,1 ; Home complete bit
M350->D:$009E ; Present Desired Velocity
;**************** PLC program to execute routine *********************
OPEN PLC 12 CLEAR
IF (M320=1) ; Already in trigger?
I323=10 ; Home speed 10 cts/msec positive direction
I326=1600 ; Home offset +100 counts (to make sure clear)
I912=11 ; Capture on falling flag and rising index
I913=0 ; Use HMFL3 as flag
CMD"#3HM" ; "Home" out of switch
WHILE (M345=1) ; Waits for Home Search to start
ENDWHILE
WHILE (M333=0) ;Waits for Home motion to complete
ENDWHILE
ENDIF
I323=-10 ; Home speed 10 cts/msec negative direction