User Manual

TMCM-102 Manual (V1.01 / 7 November 2007) 12
Copyright © 2006, TRINAMIC Motion Control GmbH & Co. KG
5.5 Encoder interface
The TMCM-102 provides an interface for single ended incremental encoders with TTL (5V) outputs. Use
the encoder entrances A+ for A, B+ for B and (optional) N+ for N. Leave the others unconnected. The
encoder counter can be read by software and can be used to control the exact positioning of the
motor. This also makes closed loop operation possible. The +5V DC supply voltage can be used for the
encoder. For greater orders differential encoders are supported on request, also.
The Encoder channel N is for nulling of the encoder counter. It can be selected as high or as low
active, and it is automatically checked in parallel to the Encoder channel A and B inputs, to give an
exact reference. It has to be determined by the user, which potential of the encoder A and B inputs
correspond to the zero position. This depends on the actual encoder type used.
To read out or to change the position value of the encoder, axis parameter #209 is used. So, to read
out the position of encoder 0 (the only one) use GAP 209, 0. The position values can also be changed
using command SAP 209, 0, <n> , with n = ± 0,1,2,…
To change the encoder settings of an encoder, axis parameter #210 is used:
Please note that the pre-scaler values can only be set and not read back or stored to EEPROM (it has
to be initialized after every power down). To change the pre-scaler of encoder 0 use SAP 210, 0, <p>.
To select a pre-scaler, the following values can be used for <p>:
Value for
<p>
Resulting pre-
scaler
SAP command for motor 0
SAP 210, M0, <p>
Resulting steps per rotation
for a 400 line (1600 quadrate
count) encoder
64 0.125 SAP 210, M0, 64 200
128 0.25 SAP 210, M0, 128 400
256 0.5 SAP 210, M0, 256 800
512 1 SAP 210, M0, 512 1600
1024 2 SAP 210, M0, 1024 3200
2048 4 SAP 210, M0, 2048 6400
4096 8 SAP 210, M0, 4096 12800
8192 16 SAP 210, M0, 8192 25600
16384 32 SAP 210, M0, 16384 51200
32768 64 SAP 210, M0, 32768 102400
Table 5.1: TMCL – Pre-scaler values
Formula for resulting steps per rotation:
StepsPerRotation = LinesOfEncoder * 4 * PreScaler
There are some special functions that can also be configured using these values. To select these
functions just add the following values to <p>:
Adder for
<p>
SAP command for motor 0
SAP 210, M0, <p>
1 Encoder Channel A polarity for Null channel event (0=negative, 1=positive)
2 Encoder Channel B polarity for Null channel event (0=negative, 1=positive)
4 Clear encoder with next null channel event
16 Encoder Channel N polarity for encoder clearing (0=negative, 1=positive)
Table 5.2: Special encoder functions
Add up both values <p> from this tables to get the required value for the SAP210 command. The
resulting pre-scaler is Value/512. Other pre-scaler values are possible, also.