TMC5031 DATASHEET (Rev. 1.11 / 2016-APR-28)
63
15 Clock Oscillator and Clock Input
The clock is the timing reference for all functions: the chopper, the velocity, the acceleration control,
etc. Many parameters are scaled with the clock frequency, thus a precise reference allows a more
deterministic result. The on-chip clock oscillator provides timing in case no external clock is easily
available.
15.1 Using the Internal Clock
Directly tie the CLK input to GND near to the TMC5031 if the internal clock oscillator is to be used. The
internal clock can be calibrated by driving the ramp generator at a certain velocity setting. Reading
out position values via the interface and comparing the resulting velocity to the remote masters’ clock
gives a time reference. This allows scaling acceleration and velocity settings as a result. The
temperature dependency and ageing of the internal clock is comparatively low.
IMPLEMENTING FREQUENCY DEPENDENT SCALING
Frequency dependent scaling allows using the internal clock for a motion control application. The
time reference of the external microcontroller is used to calculate a scaler for all velocity settings. The
following steps are required:
1. You may leave the motor driver disabled during the calibration.
2. Start motor in velocity mode, with VMAX=10000 and AMAX=60000 (for quick acceleration). The
acceleration phase is ended after a few ms.
3. Read out XACTUAL twice, at time point t1 and time point t2, e.g. 100ms later (dt=0.1s). The time
difference between both read accesses shall be exactly timed by the external microcontroller.
4. Stop the motion ramp by setting VMAX=0.
5. The number of steps done in between of t1 and t2 now can be used to calculate the factor
푉푀퐴ꢐ ∗ 푑푡
1000
푓 =
=
ꢐ퐴퐶푇푈퐴ꢑꢍ푡2ꢎ − ꢐ퐴퐶푇푈퐴ꢑꢍ푡1ꢎ
ꢐ퐴퐶푇푈퐴ꢑꢍ푡2ꢎ − ꢐ퐴퐶푇푈퐴ꢑꢍ푡1ꢎ
6. Now multiply each velocity value with this factor f, to normalize the velocity to steps per second.
At a nominal value of the internal clock frequency, 780 steps will be done in 100ms.
Hint
In case well defined velocity settings and precise motor chopper operation are desired, it is supposed
to work with an external clock source.
15.2 Using an External Clock
When an external clock is available, a frequency of 12MHz to 16MHz is recommended for optimum
performance. The duty cycle of the clock signal is uncritical, as long as minimum high or low input
time for the pin is satisfied (refer to electrical characteristics). Up to 18MHz can be used, when the
clock duty cycle is 50%. Make sure, that the clock source supplies clean CMOS output logic levels and
steep slopes when using a high clock frequency. The external clock input is enabled with the first
positive polarity seen on the CLK input.
Attention
Switching off the external clock frequency prevents the driver from operating normally. Therefore be
careful to switch off the motor drivers before switching off the clock (e.g. using the enable input),
because otherwise the chopper would stop and the motor current level could rise uncontrolled. The
short to GND detection stays active even without clock, if enabled.
15.3 Considerations on the Frequency
A higher frequency allows faster step rates, faster SPI operation and higher chopper frequencies. On
the other hand, it may cause more electromagnetic emission of the system and causes more power
dissipation in the TMC5031 digital core and voltage regulator. Generally a frequency of 10MHz to 16
www.trinamic.com