User's Manual

PMAC User Manual
132 Basic Motor Moves
Note:
If the following error is received when giving the HOMEZ command, the reported
actual position after the HOMEZ command will not be exactly zero; it will be equal
to the negative of the following error.
Homing into a Limit Switch
It is possible to use a limit switch as a home switch. However, first disable the limit function of the limit
switch to have the move finish normally; if this is not done, the limit function will abort the homing
search move. Even so, the home position has been set; a J=0 command can then be used to move the
motor to the home position.
To disable the limit function of the switch, you must set bit 17 of variable Ix25 for the motor to 1. For
example if I125 is normally $C000 (the default), specifying the use of +/-LIM1 for motor 1, setting I125
to $2C000 disables the limit function.
Note:
The polarity of the limit switches is the opposite of what many people would
expect. The -LIMn input should be connected to the limit switch at the positive
end of travel; the +LIMn input should be connected to the limit switch at the
negative end of travel.
It is a good idea to use the home offset parameter Ix26 to bring the home position out of the limit switch,
so the limits can be re-enabled immediately after the homing search move, without being in the limit.
The following examples show two quick routines to do this type of homing. One uses a motion program
and the other a PLC program. The same function could also be done with on-line commands.
;********* Motion Program Set-up Variables (to be saved) ***********
CLOSE
I123=-10 ; Home speed 10 cts/msec negative
I125=$C000 ; Use Flags1 for Motor 1 (limits enabled)
I126=32000 ; Home offset of +2000 counts
; (enough to take you out of the limit)
I902=3 ; Capture on rising flag and rising index
I903=2 ; Use +LIM1 as flag (negative end switch)
;************** Motion program to execute routine ******************
OPEN PROG 101 CLEAR
I125=$2C000 ; Disable +/-LIM as limits
HOME1 ; Home #1 into limit and offset out of it
I125=$C000 ; Re-enable +/-LIM as limits
CLOSE ; End of program
;************** PLC Set-up Variables (to be saved) *****************
CLOSE
I123=-10 ; Home speed 10 cts/msec negative
I125=$C000 ; Use Flags1 for Motor 1 (limits enabled)
I126=32000 ; Home offset of +2000 counts
; (enough to take you out of the limit)
I902=3 ; Capture on rising flag and rising index
I903=2 ; Use +LIM1 as flag (negative end switch)
M133->X:$003D,13,1 ; Desired Velocity Zero bit
M145->Y:$0814,10,1 ; Home complete bit