P
ar
t
2: C
omman
d
s
Moog Animatics SmartMotor™ Developer's Guide, Rev. L
Page 374 of 909
CTR(enc)
Counter, Encoder, Step and Direction
APPLICATION:
Motion control
DESCRIPTION:
Encoder counter reading: CTR(0)=internal encoder counter;
CTR(1)=external encoder counter
EXECUTION:
Updated once each PID sample
CONDITIONAL TO:
N/A
LIMITATIONS:
None
READ/REPORT:
RCTR(enc)
WRITE:
Read only
LANGUAGE ACCESS:
Formulas and conditional testing
UNITS:
Encoder counts
RANGE OF VALUES:
-2147483648 to 2147483647
TYPICAL VALUES:
0
DEFAULT VALUE:
0
FIRMWARE VERSION:
5.x and later
COMBITRONIC:
RCTR(0):3, x=CTR(0):3
where ":3" is the motor address — use the actual address or a
variable
DETAILED DESCRIPTION:
The CTR command can be used as follows:
l
The CTR(enc) command allows access to the internal or external encoders
l
The CTR(0) command will always access the internal encoder
l
The CTR(1) command will always access the external encoder
If the ENC0 or ENC1 commands are used, the CTR commands will still access the encoders as
described above.
Note that the O= or OSH= commands will affect the encoder selected by the ENC0 (internal
encoder) or ENC1 (external encoder) command. Therefore, if ENC0 is commanded, then O=
and OSH= commands will affect CTR(0). However, if ENC1 is commanded, then O= or OSH=
will affect CTR(1) because the external encoder is being used to measure the motor's position
and to close the PID loop.
MF0 and MS0 will both set CTR(1) to zero in addition to selecting the type of input (quadrature
or step/direction, respectively). However, those commands will only have an effect in ENC0
mode (the default mode at power-up).
Part 2: Commands: CTR(enc)