Appendixes – Rockwell Automation 1398-PDM-xxx IQ Master Version 3.2.4 for IA-2000 and IQ-5000 Positioning Drive Modules, IQ-55 User Manual

Page 373

Advertising
background image

System Programs • System Program 25 - Home

351

Publication 1398-PM601A-EN-P — October 2000

APPENDIXES

state=0

HomeVel = -HomeVel

limcnt = limcnt+1

IF limcnt < 2 JMP bkwrd

MOVV 0

JMP err ;saw both limit switches, no home switch

mf3: MOVV 0 ;state=4 home switch was on

WAIT VEL1 < .10

DISLIM=OFF ;in case we hit a limit switch here

MOVV -creep ;make sure we didn’t go through the switch

WAIT HSWSTAT=ON

atedge: DISLIM=OFF

IF HSWSTAT=OFF JMP ae2 ;if already off switch, creep onto switch on the

; switch, move off then creep on looking for (-) edge

MOVV -creep

WAIT HSWSTAT=OFF

MOVV 0

;don’t look for rev limit, needed if using reverse

; limit as home switch

ae2: S2 OFF

state=0

;we are off the switch, creep onto the switch

S3 ON ;looking for (-) edge of switch

MOVV creep

WAIT state>1

DISLIM=OFF

IF INDEXEN=ON JMP jonsw1 ;if will be looking for index, do it

MOVV 0 ;else, move to offset

MOVD HOFFS,V=HVEL

JMP finish

jonsw0: MOVV creep ;looking for index, move forward w/ creep speed

jonsw1: FIDX1 OFF ;clear index flag

IDX1=on ;turn on index1 interrupt

WAIT FIDX1=ON ;wait for index

ifound: MOVV 0

WAIT VEL1 < .1 ;wait for decel to about finish

DWELL .1 ;dwell to let move end

temp=PCMD-IX1P1-HOFFS ;calculate current position

DP temp ;note: dp does not affect FE

MOVD -temp,V=HVEL ;move to the zero spot

JMP fsdh ;jump to finish, skip Define Home

err: DISLIM=OFF ;restore previous settings

JACCEL = origJacc

JDECEL = origJdec

SYSERROR = 72

DWELL 5 ;wait for syserror to abort program

finish: DWELL 1

DH

fsdh: FOUNDHOME = ON

DISLIM=OFF ;restore previous settings

JACCEL = origJacc

JDECEL = origJdec

END

Advertising