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 372

Advertising
background image

350

System Programs • System Program 25 - Home

Publication 1398-PM601A-EN-P — October 2000

APPENDIXES

DISLIM = ON ;if here, start by moving backward

MOVV HomeVel

;will be looking for (-) edge if Home switch already on

IF HSWSTAT=ON JMP C2

;This is the backward move section

bkwrd: S3 ON ;turn on (+) edge detector

WAIT state>1

c1: IF state>3 JMP c2

MOVV 0

IF state=2 JMP err ;hit forward limit while moving backward

S3 OFF

WAIT VEL1 > -0.1 ;wait until decel about done

MOVV -HomeVel ;move off limit switch

;wait until limit turns on (if decel took axis past

; switch)

WAIT i2=off

state=0 ;wait for both limit switches to be the same

S5 ON

WAIT state=1

state=0

HomeVel = -HomeVel

limcnt = limcnt+1

IF limcnt < 2 JMP fwrd

MOVV 0 ;saw both limit switches, no home switch

JMP err

c2: state=0

S4 ON ;now look for edge OFF of switch

WAIT state>1

S4 OFF

IF HSWSTAT=OFF JMP ae2

MOVV 0

WAIT VEL1 > -.10 ;wait for decel to about finish

; we are on the switch. If we see a limit before edge

; of switch, fault

limcnt=1

JMP c1

;This is the forward move section

fwrd: S3 ON ;enable edge ON detector

DISLIM = ON

MOVV HomeVel

WAIT state>1 ;wait for (-) edge or limit switch

IF state>3 JMP mf3 ;jump if saw (-) edge, not limit switch

MOVV 0 ;saw limit switch, stop

IF state=3 JMP err ;error: saw reverse limit while moving forward

S3 off

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

MOVV -HomeVel ;move backward off (+) limit switch

WAIT i1=off

state=0

S5 ON

WAIT state=1

;S5 off

;delay .01

;make sure S5 is off before clearing state

Advertising