omron — Homing Into a Limit Switch

PMAC Product Guide 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 if to finish the move normally. Otherwise, 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. Note: The polarity of the limit switches is the opposite of what is expected. 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.

To disable the limit function of the switch, 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. 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 quick routines to do this type of homing. One uses a motion program and the other a PLC program. The same function can 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 it 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 it 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 62 Programming PMAC