Speed control by joystick – Yaskawa LEGEND-MC User Manual

Page 349

Advertising
background image

339

LEGEND-MC User’s Manual

Speed Control by Joystick

The speed of a motor is controlled by a joystick. The joystick produces a signal in the range between -
10V and +10V. The objective is to drive the motor at a speed proportional to the input voltage.

Assume that a full voltage of 10 Volts must produce a motor speed of 3000 rpm with an encoder
resolution of 1000 lines or 4000 count/rev. This speed equals:

3000 rpm = 50 rev/sec = 200000 count/sec

The program reads the input voltage periodically and assigns its value to the variable VIN. To get a speed
of 200,000 ct/sec for 10 volts, we select the speed as

Speed = 20000 x VIN

The corresponding velocity for the motor is assigned to the VEL variable.

Instruction

Function

#A

Label

AI1

Wait for input 1

PR 6370

Distance

SP 3185

Speed

BGX

Start Motion

AMX

After motion is complete

SB1

Set output bit 1

WT 20

Wait 20 ms

CB1

Clear output bit 1

WT 80

Wait 80 ms

JP #A

Repeat the process

START PULSE I1

MOTOR VELOCITY

OUTPUT PULSE

TIME INTERVALS

move

output

wait

ready

move

Motor Velocity and the Associated Input/Output signals

Advertising