User manual
PDx-113-57/60-SE / TMCM-113-57/60-SE Firmware Manual (V1.10 / 2009-OCT-28) 88
Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG
9.2 Changing the prescaler value of an encoder
The PD-113-57/60-SE PANdrive™ is a full mechatronic solution including a NEMA 23 (flange size 57mm) or
NEMA 24 (flange size 60mm) stepper motor, a motion controller/driver and a sensOstep
TM
magnetic encoder
(max. 256 increments per rotation), e.g. for step-loss detection under all operating conditions.
For the operation with encoder please consider the following hints:
The encoder counter can be read by software and can be used to control the exact position of the
motor. This also makes closed loop operation possible.
To read out or to change the position value of the encoder, axis parameter #209 is used.
So, to read out the position of your encoder 0 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, axis parameter #210 is used. For changing the prescaler of the
encoder 0 use SAP 210, 0, <p>.
Automatic motor stop on deviation error is also usable. This can be set using axis parameter 212
(maximum deviation). This function is turned off when the maximum deviation is set to 0.
To select a prescaler, the following values can be used for <p>:
Value for
<p>
Resulting
prescaler
SAP command for motor 0
SAP 210, 0, <p>
Suggestion for micro step solution
(setting of parameter 140)
6400
12.5 (default)
SAP 210, 0, 6400
6 (64 micro steps)
3200
6.25
SAP 210, 0, 3200
5 (32 micro steps)
1600
3.125
SAP 210, 0, 1600
4 (16 micro steps)
800
1.5625
SAP 210, 0, 800
3 (8 micro steps)
400
0.78125
SAP 210, 0, 400
2 (4 micro steps)
200
0.390625
SAP 210, 0, 200
1 (2 micro steps)
The table above just shows a subset of those prescalers that can be selected. Also other values between
those given in the table can be used. Only the values 1, 2, 4, and 16 must not be used for <p> (because they
are needed to select the special encoder function below or rather are reserved for intern usage).
Consider the following formula for your calculation:
Example: <p> = 6400
6400/512 = 12.5 (prescaler)
There is one special function that can also be configured using <p>. To select it just add the following value
to <p>:
Adder for
<p>
SAP command for motor 0
SAP 210, M0, <p>
4
Clear encoder with next null channel event
Add up both <p> values from these tables to get the required value for the SAP 210 command. The
resulting prescaler is Value/512.
Prescaler = _p_
512