7 velocity – Rockwell Automation 57C422B 2 Axis Servo Module User Manual

Page 95

Advertising
background image

APPLYING THE MODULE

5-9

5.7

Velocity

The following example illustrates the software necessary to
use the axis in the velocity mode. Three examples are
provided, one each for turning velocity on, changing the
velocity while the drive is active, and turning velocity off.

7991

!

7992

Turn on velocity mode

7993

!

7994

! FDBK_SCALING

= encoder counts/engineering unit

7995

! SPD

= velocity (in engineering units)

7996

! ACCEL

= acceleration (in engineering units)

7997

! DECEL

= deceleration (in engineering units)

7998

FAULT@

= fault status

7999

!

8000

MODES%=MODES% AND 0AFH

8005

IF SPD < 0. THEN MODES%=MODES% OR 01 OH \SPD=-SPD

8047

REM

8048

REM Issue VELOCITY command to axis

8049

REM

8050

CMD_VEL!=SPD*FDBK_SCALING*65.536

8055

CMD_ ACC!=ACCEL*FDBK_SCALING*.065536

8060

CMD_DEC! =DECEL*FDBK_SCALING*.065536

8065

MODES%=MODES% OR 4

8070

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

8075

RETURN

8100

!

8294

!

8295

! Change velocity while drive is running

8296

!

8297

! FDBK_SCALING = encoder counts/engineering unit

8298

! SPD = velocity (in engineering units)

8299

!

8300

IF SPD < 0. THEN SPD=-SPD

8305

CMD_VEL!=SPD*FDBK_SCALING*65.536

8310

CMD66%=0100H \GOSUB 25000

8315

RETURN

8400

!

8497

!

8498

! Turn off velocity mode

8499

!

8500

MODES%=MODES% AND 0BBH

8505

RETURN

Advertising