Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 124 of 909
direction. The value set by the VT command only governs the calculated trajectory of MP and
MV modes (position and velocity). In either of these modes, the PID compensator may need
to "catch up" if the actual position falls behind the trajectory position. In this case, the actual
speed exceeds the target speed. The value defaults to zero, so it must be set before any
motion can take place. The new value does not take effect until the next G command is issued.
To convert velocity in revolutions per second to units of VT, follow this formula:
VT = Velocity * ((enc. counts per rev.)/(sample rate)) * 65536
If the motor has a 4000 count encoder (sizes 17 and 23), multiply the desired velocity in
rev/sec by 32768 to arrive at the setting for VT. With an 8000 count encoder (size 34), the
multiplier is 65536. These factors assume a PID rate of 8.0 kHz, which is the default.
Motion Mode Commands
The following are motion-mode commands. For more details on these commands, see Part 2:
SmartMotor Command Reference on page 238.
MP
Position Mode
Issuing the Mode Position(MP) command puts the SmartMotor in Position mode. Position
mode is the default mode of operation for the SmartMotor on power-up. In Position mode, the
PT, PRT, VT, ADT, AT and DT commands can be used to govern motion. At a minimum, ADT,
VT and (PT or PRT) must be issued.
MV
Velocity Mode
The Mode Velocity (MV) command allows continuous rotation of the motor shaft. In Velocity
mode, the programmed position using the PT or the PRT commands is ignored. Acceleration
and velocity need to be specified using the ADT and the VT commands. After a G command is
issued, the motor accelerates up to the programmed velocity and continues at that velocity
indefinitely. Similar to Position mode, in Velocity mode, velocity and acceleration are
changeable on the fly, at any time — simply specify new values and enter another G command
to trigger the change. In Velocity mode, the velocity can be entered as a negative number,
unlike in Position mode where the location of the target position determines velocity direction
or sign. If the 32-bit register that holds position rolls over in Velocity mode, it will have no
effect on the motion.
Velocity mode calculates its trajectory as an ideal position over time and corrects the
resulting measured position error instead of measuring velocity error. This is significant in
that this mode will "catch up" lost position, just as Position mode will if a disturbance causes a
lagging position error.
MT
Torque Mode
The Mode Torque (MT) command puts the SmartMotor in Torque mode. In Torque mode, the
motor applies a PWM commutation effort to the motor proportional to the T command and
independent of position. If the motor model has a current-control commutation mode, then
torque is controlled in proportion to the T command. Otherwise, torque depends on the actual
motor speed and bus voltage, eventually reaching an equilibrium speed. Nevertheless, for a
locked rotor, the torque will be largely proportional to the T value and bus voltage.
Part 1: Programming: Motion Mode Commands