Datasheet
TMC2660 DATASHEET (Rev. 1.05 / 2016-JUL-14) 10
www.trinamic.com
Status word
Description
Range
Comment
SG
10-bit unsigned integer stallGuard2
measurement value. A higher value indicates
lower mechanical load. A lower value indicates
a higher load and therefore a higher load angle.
For stall detection, adjust SGT to return an SG
value of 0 or slightly higher upon maximum
motor load before stall.
0… 1023
0: highest load
low value: high load
high value: less load
4.1 Tuning the stallGuard2 Threshold
Due to the dependency of the stallGuard2 value SG from motor-specific characteristics and application-
specific demands on load and velocity the easiest way to tune the stallGuard2 threshold SGT for a
specific motor type and operating conditions is interactive tuning in the actual application.
The procedure is:
1. Operate the motor at a reasonable velocity for your application and monitor SG.
2. Apply slowly increasing mechanical load to the motor. If the motor stalls before SG reaches
zero, decrease SGT. If SG reaches zero before the motor stalls, increase SGT. A good SGT
starting value is zero. SGT is signed, so it can have negative or positive values.
3. The optimum setting is reached when SG is between 0 and 400 at increasing load shortly
before the motor stalls, and SG increases by 100 or more without load. SGT in most cases can
be tuned together with the motion velocity in a way that SG goes to zero when the motor
stalls and the stall output SG_TST is asserted. This indicates that a step has been lost.
The system clock frequency affects SG. An external crystal-stabilized clock should be used for
applications that demand the highest precision. The power supply voltage also affects SG, so tighter
regulation results in more accurate values. SG measurement has a high resolution, and there are a
few ways to enhance its accuracy, as described in the following sections.
4.1.1 Variable Velocity Operation
Across a range of velocities, on-the-fly adjustment of the stallGuard2 threshold SGT improves the
accuracy of the load measurement SG. This also improves the power reduction provided by coolStep,
which is driven by SG. Linear interpolation between two SGT values optimized at different velocities is
a simple algorithm for obtaining most of the benefits of on-the-fly SGT adjustment, as shown in
Figure 4.2. An optimal SGT curve in black and a two-point interpolated SGT curve in red are shown.
back EMF reaches
supply voltage
optimum
SGT setting
Motor RPM
(200 FS motor)
stallGuard2
reading at
no load
2
4
6
8
10
12
14
16
100
200
300
400
500
600
700
800
900
1000
18
20
0 0 50 100 150 200 250 300 350 400 450 500 550 600
lower limit for stall
detection 4 RPM
simplified
SGT setting
Figure 4.2 Linear interpolation for optimizing SGT with changes in velocity.