Datasheet
TMC429 DATASHEET (v. 1.07 / 2012-AUG-01) 24
Copyright © 2010-2012, TRINAMIC Motion Control GmbH & Co. KG
9.11 Calculation of p_mul and p_div
The proportionality factor p = p_mul / p_div depends on the acceleration limit a_max and frequency
pre-divider parameters ramp_div and pulse_div. So, a pair of p_mul / p_div has to be calculated
once for each provided acceleration limit a_max. There may exist more than one valid pair of p_mul
and p_div for a given a_max. To accelerate, the ramp generator accumulates the acceleration value
to the actual velocity with each time step. Internally, the absolute value of the velocity is represented by
11+8 = 19 bits, while only the most significant 11 bits and the sign are used as input for the step pulse
generator. So, there are 2
11
= 2048 values possible to specify a velocity, ranging from 0 to 2047. The
ramp generator accumulates a_max divided by 2
8
= 256 at each time step to the velocity during
acceleration phases. So, the acceleration from velocity = 0 to maximum velocity = 2047 spans over
2048* 256 / a_max pulse generator clock pulses. Within that acceleration phase, the pulse generator
generates S = ½ * 2048* 256 / a_max * T steps for the (micro) step unit. The parameter T is the clock
divider ratio T = 2
ramp_div
/ 2
pulse_div
= 2
ramp_div pulse_div
= 2^(ramp_div-pulse_div). During acceleration, the
velocity has to be increased until the velocity limit v_max is reached or deceleration is required to
reach the target position exactly (see Figure 9-1). The TMC429 automatically decelerates, if required
using the difference between current position and target position and the proportionality parameter p,
which has to be p = 2048 / S. With this, one gets p = 2048 / ( ( ½ * 2048* 256 / a_max ) *
2^(ramp_div-pulse_div) ). This expression can be simplified to
p = a_max / ( 128 * 2^( ramp_div-pulse_div ) ).
To avoid overshooting, the parameter p_mul should be made approximately 5% smaller than
calculated. Alternatively, one can arrange p reduced by an amount of 5%. If the proportionality
parameter p is too small, the target position will be reached slower, because the slow down ramp starts
earlier. The target position is approached with minimal velocity v_min, whenever the internally
calculated target velocity becomes less than v_min. With a good parameter p the minimal velocity
v_min is reached a couple of steps before the target position. With parameter p set a little bit to large
and small v_min overshooting of one step respectively one micro step may occur. Decrementation of
the parameter pmul avoids such one-step overshooting.
Note: Changing at least one parameter out of the triple {a_max, ramp_div, pulse_div} requires re-
calculation of the parameter pair {pmul, pdiv} to update the associated register if necessary.
v
v_max
v(t)
v_min
p too small
p too large
p good
t
1
t
0
t
2
Figure 9-3: Proportionality parameter p and outline of velocity profile(s)
On first approach, to represent the parameter p = p_mul / p_div = (128+pmul) / 2^(3+pdiv) one
chooses a pair of pmul and pdiv that approximates p, with pmul in range 0 ... 127 representing p_mul
in range 128 ... 255 and pdiv one out of {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13} representing p_div
one out of {8, 16 , 32 ,64, 128 , 256, 512, 1024, 2048, 4096, 8192, 16384, 32786, 65536}. There are
only 128 * 14 = 1792 pairs of (pmul, pdiv). So, one can simply try all possible pairs (pmul, pdiv) with a
program and choose a matching pair. To find a pair, one calculates