User manual

TMCM-1180 and PD86-1180 TMCL Firmware V4.42 Manual (Rev. 1.08 / 2012-NOV-20) 104
www.trinamic.com
8.2 Changing the prescaler value of an encoder
The PD86-1180 PANdrive™ is a full mechatronic solution including a 86mm flange high torque motor, a
motion controller/driver and a integrated sensOstep™ encoder. The built-in encoder has 256 steps/rotation.
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>
Microstep solution of
axis parameter 140
25600
50
SAP 210, 0, 25600
8 (256 micro steps)
12800
25
SAP 210, 0, 12800
7 (128 micro steps)
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