Example - position follower (point-to-point), Example - position follower (continuous move) – Yaskawa SMC–4000 User Manual
Page 356

346
SMC–4000 User Manual
Example - Position Follower (Point-to-Point)
Objective - The motor must follow an analog signal. When the analog signal varies by 10V, motor must
move 10000 counts.
Method: Read the analog input and command X to move to that point.
Example - Position Follower (Continuous Move)
Method: Read the analog input, compute the commanded position and the position error. Command the
motor to run at a speed in proportions to the position error.
Instruction
Interpretation
#POINTS
Label
SP 7000
Speed
AC 80000;DC 80000
Acceleration
#LOOP
Label
COMPP=@AN[1]*1000
Read analog input, and compute position
PA COMPP
Command position
BGX
Start motion
AMX
After completion
JP #LOOP
Repeat
EN
End
Instruction
Interpretation
#CONT
Label
AC 80000;DC 80000
Acceleration rate
JG 0
Start job mode
BGX
Start motion
#LOOP
COMPP=@AN[1]*1000
Compute desired position
VE=COMPP-_TPX
Find position error
PVEL=VE*20
Compute velocity
JG PVEL
Change velocity
JP #LOOP
Repeat
EN
End