P
ar
t
1: P
rog
ra
m
ming
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 170 of 909
Position Counters
The SmartMotor's processor contains various position counters. These are used to keep track
of shaft position and the position of trajectories, or commanded counts within those trajectory
generators. Some of the counters are virtual, while others directly track hardware. All
counters may be set to zero or changed to a specific value as shown in the following table.
Counter
Description
Cleared
to 0
Set to any
value
Begins
counting
Notes
CTR(0),
RCTR(0)
Internal encoder
O=0
(When ENC0:
O=value,
OSH=relative)
1
Always (from
internal encoder)
Internal Encoder Hardware
level counter that can be set
or changed by user
CTR(1),
RCTR(1)
External encoder
input
MF0,
MS0
(When ENC1:
O=value,
OSH=relative)
2
Always (from
encoder ext
inputs)
External Encoder Hardware
level counter that can be set
or changed by user
PA, RPA
Points to CTR(0)
when ENC0
(default), CTR(1)
when ENC1
O=0
O=value,
OSH=relative
value
Always
Position Actual — Where the
shaft is at any given time
with regard to the encoder
being used for PID
PMA,
RPMA
Modulo actual per
PML limit
O=0
(O=value,
OSH=relative
value) mod PML
Always
Position Modulo Actual is a
modulo wrapped counter
based off of PA but limited by
PML (Position Modulo Limit)
PC, RPC
Trajectory into PID
(EA=RPC–RPA)
O=0
Always (updates
to RPA when drive
is off)
Position Commanded by the
PID trajectory
PC(0),
RPC(0)
Identical to PC,
RPC
O=0
Same as above, (PC)
PC(1),
RPC(1)
Relative position of
trajectory 1
O(1)=0
O(1)=value,
OSH(1)=relative
value
Accumulates delta
position from RPA
(but may have a
constant offset
from RPA)
PC(1)=PC(0) when in Single
Trajectory mode
PC(2),
RPC(2)
Relative position of
trajectory 2
O(2)=0
O(2)=value,
OSH(2)=relative
value
Accumulates rel-
ative targets (but
don’t assume PT =
PA if relative
moves were inter-
rupted)
PC(2) can be used to track
gearing or camming offsets
from point where G(2) was
issued
PT, RPT
Target position
PT=0
PT=value
Position Target is user spe-
cified desired absolute target
position; when G or G(1) is
issued, this will be the Tar-
get
PRT,
RPRT
Relative Target
Position
PRT=0
PRT=value
PRT is always a relative dis-
tance offset to where PC is;
similar to PT, G or G(1) is
required
PRA,
RPRA
Relative Move
Actual Position
Start
new
move
Start of MV or MP
move (absolute or
relative)
This tracks the distance that
a trajectory 1 move MV or MP
has traveled since the G com-
mand, offset by the position
error of the PID
PRC,
RPRC
Relative Move Com-
manded Position
Start
new
move
Start of MV or MP
move (absolute or
relative)
This tracks the distance that
a trajectory 1 move MV or MP
has traveled since the G com-
mand
1. When ENC0 is commanded, CTR(0) tracks PA.
2. When ENC1 is commanded, CTR(1) tracks PA.
Part 1: Programming: Position Counters