Moog Animatics SmartMotor™ Developer's Guide,Rev. L
Page 178 of 909
following commands to the motor (the following example is for one motor, following that is
another example that shows a similar method for a three-axis system):
PT=PA 'Set position target to current position
MP 'Set to position mode
G 'Go "nowhere"
This will leave the motor with the target position equal to the current position and prevent any
unwanted motion. Any PTS or PTSS commands issued afterward will have the correct basis for
accurate velocity and acceleration calculations.
The following example expands on the previous one to show a three-axis system subroutine
for moving to absolute positions x, y, and z.
C11 '3 axis X, Y, Z
PT:1=PA:1 PT:2=PA:2 PT:3=PA:3
MP:0
G:0
WAIT=50
VTS=vvv
ADTS=aaa
PTS(x;1,y;2,z;3)
IF PTSD!=0 'this ensures no dead motion due to no change in position
GS
TSWAIT
ENDIF
RETURN
It is also important to avoid commanding a distance of 0 (in 2D or 3D space). In other words,
a PTS command should not be issued with a target positions identical to the current target
position. Refer to the "IF PTSD!=0" code in the previous example.
Finally, do not issue the PTS command unless the motors are stopped and have no motion
faults. Otherwise, if the motors are in motion or faulted, it could result in an unexpected
motion or no motion at all.
Other Synchronized-Motion Commands
The following commands are used to start a synchronized move and wait for a synchronized
move to complete. For more details on these commands, see Part 2: SmartMotor Command
Reference on page 238.
GS
Start Synchronized Move
To start a synchronized motion profile, use the GS command. It acts behind the scenes and
issues G commands to all axes involved in the previous PTS() or PRTS() command. It is
important to be sure all motors are at their previous targets before issuing the GS command.
Otherwise, the motion will not be synchronized.
Part 1: Programming: Other Synchronized-Motion Commands