P
ar
t
1: P
rog
ra
m
ming
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 134 of 909
MV
' set motor to Velocity mode
VT
=100000
' set velocity to 100000
ADT
=1000
' set accel/decel to 1000
G
' Go (Start moving)
WAIT
=2000
' wait about 2 seconds
T
=TRQ
' set torque to the value the PID filter was commanding in MV
MT G
' set motor to Torque mode
WAIT
=2000
' wait about 2 seconds
OFF
' turn the motor off
Velocity Mode
Velocity mode allows the SmartMotor to run at a constant commanded speed. SmartMotors
close the speed loop on position, not encoder counts per unit time. As a result, moving to and
from Position mode to Velocity mode is simple.
The following list details the minimum requirements for a move to occur in Velocity mode:
• Initiate Velocity mode
MV command
if not already in Velocity mode
• Nonzero value of Velocity
VT=###
set velocity equal to ###
• Nonzero value of Acceleration
ADT=###
set accel/decel equal to ###
•
Go command to initiate move
G
start move immediately
Constant Velocity Example
The following example shows a basic constant-velocity move. In the example, the motor
starts moving when the G command is issued. It accelerates up to a velocity of 100000 at a
rate or 1000 samples/sec/sec. It then remains at that speed until told to do otherwise.
MV
' set motor to Velocity mode
VT
=100000
' set velocity to 100000
ADT
=1000
' set accel/decel to 1000
G
' Go (Start moving)
Change Commanded Speed and Acceleration
In this example, the command speed and acceleration are changed while the program is in
progress. The motor‘s move parameters are changed about two seconds after the initial
commanded move begins.
O
=0
' set current position to zero
MV
' set motor to Velocity mode
VT
=100000
' set velocity to 100000
ADT
=1000
' set accel/decel to 1000
G
' Go (Start moving)
WAIT
=2000
' wait 2 seconds
VT
=800000
' set new velocity of 800000
ADT
=500
' set new accel/decel of 500
G
' initiate change in speed and acceleration
Part 1: Programming: Velocity Mode