4 homing – Rockwell Automation 57C422B 2 Axis Servo Module User Manual

Page 92

Advertising
background image

5-6

2-Axis Servo Module M/N 57C422B

5.4

Homing

The following is a sample routine that will home the axis. If
the setup parameters defined in section 5.3 are used, the
axis will first move in the direction of decreasing encoder
counts (negative) towards the home limit switch. After the
home limit switch has been tripped, the axis will then move at
slow speed in the opposite direction until it reaches the
marker pulse. This same routine will correctly perform all of
the other home sequences based on the configuration data
in register 2.

4991 !
4992 ! Homing Sequence
4993 !
4994 ! FDBK-SCALING

= encoder counts/engineering unit

4995 ! FDBK-POS

= position (in engineering units)

4996 ! SPD

= velocity (in engineering units)

4997 ! ACCEL

= acceleration (in engineering units)

4998 ! FAULT@

= fault status

4999 !
5000 HOME_SPD!=(SPD/100.)*FDBK_SCALING*65.536

\!Slow home velocity

5010 CMD_POS!=FDBK_POS*FDBK_SCALING

\!Home position

5020 CMD_VEL! =(SPD/10.)*FDBK_SCALING*65.536

\!Fast home velocity

5030 CMD_ACC!=(ACCEL/4.)*FDBK_SCALING*.065536

\!Maximum accel

5040 CMD_DEC!=CMD_ACC!

\!Maximum decel

5050 MODES%=MODES% AND 0FEH

\!Disable fdbk

5060 DELAY 10 TICKS
5070 MODES%=MODES% OR 1

\!Enable fdbk loop

5080 CMD66%=4 \GOSUB 25000

\!HOME COMMAND

5090 IF FAULT@ THEN RETURN
5100 DELAY 20 TICKS VF NOT HOME_COMPLETE@ THEN GOTO 5100
5110

DELAY 20 TICKS

5120 FAULT@= (FAULTS% AND 037FH) < > 0
5130 RETURN

Advertising