TMC4671 Datasheet • IC Version V1.00 | Document Revision V1.04 • 2018-Dec-11
20 / 157
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
65535
u16 unsigned 16 bit value
0
-32767
0
s16 signed 16 bit values, 2’th complement
u32 unsigned 32 bit value
32767
232 = 4294967296
s32 signed 32 bit values, 2’th complement
-2147483647 231 - 1 = 2147483647
q8.8 signed fix point value with 8 bit integer part
-32767/256
32767/256
and 8 bit fractional part
q4.12 signed fix point value with 4 bit integer part -32767/4096
-32767/4096
and 12 bit fractional part
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 1. Using
2(n−1) where the largest positive number is 2(n−1)
−
−
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
0x0000h
u16
0
s16
0
q8.8
0.0
q4.12
0.0
0x0001h
1
1
1 / 256
2 / 256
0.5
1 / 4096
2 / 4096
0.03125
0.0625
0x0002h
2
2
0x0080h
128
256
512
16383
128
256
512
16383
0x0100h
1.0
0x0200h
2.0
0.125
0x3FFFh
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