Datasheet
TMC4671 Datasheet • IC Version V1.00 | Document Revision V1.03 • 2018-Sept-06
20 / 158
A duty cycle of 50% equals an input value of 32768. With the offset and scaling factors it can be mapped to
desired range.
4.3 Numerical Representation, Electrical Angle, Mechanical Angle, and Pole Pairs
The TMC4671 uses different numerical representations for different parameters, measured values, and
interim results. The terms electrical angle PHI_E, mechanical angle PHI_M, and number of pole pairs
(N_POLE_PAIRS) of the motor are important for setup of FOC. This section describes the different numerical
representations of parameters and terms.
4.3.1 Numerical Representation
The TMC4671 uses signed and unsigned values of different lengths and fixed point representations for
parameters that require a non-integer granularity.
Symbol Description Min Max
u16 unsigned 16 bit value 0 65535
s16 signed 16 bit values, 2’th complement -32767 32767
u32 unsigned 32 bit value 0 2
32
= 4294967296
s32 signed 32 bit values, 2’th complement -2147483647 2
31
- 1 = 2147483647
q8.8
signed fix point value with 8 bit integer part
and 8 bit fractional part
-32767/256 32767/256
q4.12
signed fix point value with 4 bit integer part
and 12 bit fractional part
-32767/4096 -32767/4096
Table 4: Numerical Representations
Info
Two’s complement of n bit is
−
2
(n−1)
. . .
−
2
(n−1)
−
1. To avoid unwanted overflow,
the range is clipped to −2
(n−1)
+ 1 . . . −2
(n−1)
− 1.
Because the zero is interpreted as a positive number for 2’th complement representation of integer n bit
number, the smallest negative number is
−
2
(n−1)
where the largest positive number is 2
(n−1)
−
1. Using
the smallest negative number
−
2
(n−1)
might cause critical underflow or overflow. Internal clipping takes
this into account by mapping −2
(n−1)
to −2
(n−1)
+ 1.
Hexadecimal Value u16 s16 q8.8 q4.12
0x0000
h
0 0 0.0 0.0
0x0001
h
1 1 1 / 256 1 / 4096
0x0002
h
2 2 2 / 256 2 / 4096
0x0080
h
128 128 0.5 0.03125
0x0100
h
256 256 1.0 0.0625
0x0200
h
512 512 2.0 0.125
0x3FFF
h
16383 16383 16383 / 256 16383 / 4096
©2018 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com