P
ar
t
1: P
rog
ra
m
ming
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 136 of 909
O
=0
' set current position to zero
MP
' set to position mode (required if currently in another mode)
VT
=100000
' set velocity to 100000
ADT
=1000
' set accel/decel to 1000
PT
=1000000
' set commanded absolute position to 1000000
G
' Go (Start moving)
WAIT
=8000
' wait about 8 seconds
VT
=800000
' set new velocity of 800000
ADT
=500
' set new accel/decel of 500
G
' initiate change in speed and acceleration
Shift Point of Origin Example
The following example demonstrates how to change (shift) the point of origin between moves.
This is accomplished through the OSH command. The Origin command O={value} may also
be used and can be set to any absolute number.
O
=0
' set current position to zero
MP
' set to position mode (required if currently in another mode)
VT
=100000
' set velocity to 100000
ADT
=1000
' set accel/decel to 1000
PT
=2000
' set commanded absolute position to 2000
G
' Go (Start moving)
TWAIT
' wait until move is complete
OSH
=-2000
' shift current position back 2000 counts
WAIT
=8000
' wait 8 seconds
PT
=2000
' set commanded absolute position to 2000
G
' Go (Start moving)
TWAIT
' wait until move is complete
NOTE:
The motor moved a total of 4000 counts, but its current position is only 2000
because it was reset to zero between moves.
Relative Position Mode
In Relative Position mode the SmartMotor moves relative to its current position by the use of
the PRT (Position Relative Target) command.
The following list details the minimum requirements for a move to occur in Relative mode:
• Initiate Position mode
MP command
if not already in Position mode
• Nonzero value of Velocity
VT=###
set velocity equal to ###
• Nonzero value of Acceleration
ADT=###
set accel/decel equal to ###
•
Relative commanded position
PRT=###
set relative position to ###
•
Go command to initiate move
G
start move immediately
Relative Mode Example
The following example illustrates the use of Relative mode. The example moves the motor
through three 2000-count moves or a total of 6000 counts.
Part 1: Programming: Shift Point of Origin Example
Содержание SmartMotor
Страница 1: ...Developer s Guide Class 5 Later SmartMotor Technology with TM ...
Страница 909: ...PN SC80100003 002 Rev L ...