User Manual

Table Of Contents
PD-1160 TMCL
Firmware Manual Firmware Version V1.42 | Document Revision V1.06 2018-JAN-09
94 / 113
To read out or to change the position value of the encoder use axis parameter #216. To read out the
position of the internal encoder use GAP 216, 0. The encoder position register can also be changed
using command SAP 216, 0, <n>, with n = -2147483648 . . . 2147483647.
Axis parameter #217 is used to change the encoder settings. This also includes the prescaler of the
encoder. The prescaler is used to match motor resolution and encoder resolution.
The motor can be stopped automatically if motor position and encoder position dier too much
(deviation error). This can be set using axis parameter #218 (maximum deviation). Setting this
parameter to 0 turns o this feature.
Using the prescaler the encoder counter increments / decrements can be aligned to the position (microstep)
counter. This is essential when using the deviation error supervision (axis parameter #218) and simplies
encoder counter versus position/microstep counter comparisons (1:1).
number_of_microsteps_per_motor_rotation = prescaler · encoder_ticks_per_rotation
Table 21 shows a subset of encoder prescaler values that can be selected. Other values can also be used,
but the bits 2. . . 4 must not be used for the prescaler because they are needed to select special encoder
functions.
If you are not sure about the resolution of the encoder, use a prescaler of 1 (SAP 217, 0, 512) and then let
the motor run exactly one round to see how far the encoder is counting then.
Encoder Prescaler Values
Value (<p>) Resulting prescaler SAP command
64 0.125 SAP 217, 0, 64
128 0.25 SAP 217, 0, 128
256 0.5 SAP 217, 0, 256
512 1 SAP 217, 0, 512
1024 2 SAP 217, 0, 1024
2048 4 SAP 217, 0, 2048
4096 8 SAP 217, 0, 4096
8192 16 SAP 217, 0, 8192
16384 32 SAP 217, 0, 16384
32768 64 SAP 217, 0, 32768
Table 21: Encoder Prescaler Values
Encoder resolutions are often (but not always) given in lines per rotation (lpr) by the manufaturer of the
encoder. Convert this value to counts per rotation (cpr) by multiplying it by four (because of the quadrature
interface).
Other values than those given in table 21 are also possible. The resulting prescaler is
p
512
. But please bear
in mind not to use bits 2, 3, and 4 of the value, as they are reserved for other functions.
Not all encoder resolutions can be matched with the motor microstep resolution. We recommend to
choose an encoder with a binary resolution (like 512, 2048, 4096, 32768) when selecting an encoder. There
is always a suitable prescaler for such encoders.
©2018 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com