打開「TMC4671-LA datasheet rev2.06」
打開「TMC4671-LA datasheet rev2.06」
打開「TMC4671-LA datasheet rev2.06」
TMC4671 Datasheet
IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12
The TMC4671 is a fully integrated servo controller, providing Field Oriented Control for BLDC/PMSM
and 2-phase Stepper Motors as well as DC motors and voice coils. All control functions are imple-
mented in hardware. Integrated ADCs, position sensor interfaces, position interpolators, enable
a fully functional servo controller for a wide range of servo applications.
Features
• Servo Controller
w/ Field Oriented Control (FOC)
• Torque Control (FOC),
Velocity Control, Position Control
• Integrated ADCs, ⌃-ADC Frontend
• Encoder Engine: Hall analog/digital,
Encoder analog/digital
• Supports 3-Phase PMSM/BLDC,
2-Phase Stepper Motors,
and 1-Phase DC Motors
• Fast PWM Engine (25kHz . . . 100kHz)
• Application SPI + Debug (UART, SPI)
Applications • Step-Direction Interface (S/D)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at: www.trinamic.com
Contents
1 Order Codes 6
2 Functional Summary 7
3 FOC Basics 9
3.1 Why FOC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.2 What is FOC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.3 Why FOC as pure Hardware Solution? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3.4 How does FOC work? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5 What is Required for FOC? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3.5.1 Coordinate Transformations - Clarke, Park, iClarke, iPark . . . . . . . . . . . . . . . . 11
3.5.2 Measurement of Stator Coil Currents . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.5.3 Stator Coil Currents I_U, I_V, I_W and Association to Terminal Voltages U_U, U_V, U_W 11
3.5.4 IgainADC[A/LSB] - ADC Integer Current Value to Real World Unit . . . . . . . . . . . . 12
3.5.5 UgainADC[V/LSB] - ADC Integer Voltage Value to Real World Unit . . . . . . . . . . . . 12
3.5.6 Measurement of Rotor Angle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.5.7 Measured Rotor Angle vs. Magnetic Axis of Rotor vs. Magnetic Axis of Stator . . . . 12
3.5.8 Knowledge of Relevant Motor Parameters and Position Sensor (Encoder) Parameters 13
3.5.9 Proportional Integral (PI) Controllers for Closed Loop Current Control . . . . . . . . 14
3.5.10 Pulse Width Modulation (PWM) and Space Vector Pulse Width Modulation (SVPWM) 14
3.5.11 Orientations, Models of Motors, and Coordinate Transformations . . . . . . . . . . . 15
4 Functional Description 16
4.1 Functional Blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
4.2 Communication Interfaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2.1 SPI Slave User Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4.2.2 TRINAMIC Real-Time Monitoring Interface (SPI Master) . . . . . . . . . . . . . . . . . . 20
4.2.3 UART Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2.4 Step/Direction Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2.5 Single Pin Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.2.6 GPIO Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3 Numerical Representation, Electrical Angle, Mechanical Angle, and Pole Pairs . . . . . . . . . 24
4.3.1 Numerical Representation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3.2 N_POLE_PAIRS, PHI_E, PHI_M . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
4.3.3 Numerical Representation of Angles PHI . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.4 ADC Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4.1 ADC current sensing channels ADC_I1 and ADC_I0 . . . . . . . . . . . . . . . . . . . . 28
4.4.2 ADC for analog Hall signals or analog sin-cos-encoders AENC_UX, AENC_VN, AENC_WY 28
4.4.3 ADC supply voltage measurement ADC_VM . . . . . . . . . . . . . . . . . . . . . . . . 28
4.4.4 ADC_VM for Brake Choppper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4.5 ADC EXT register option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4.6 ADC general purpose analog inputs AGPI_A and AGPI_B . . . . . . . . . . . . . . . . . 29
4.4.7 ADC RAW values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4.8 ADC_SCALE and ADC_OFFSET . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4.9 ADC Gain Factors for Real World Values . . . . . . . . . . . . . . . . . . . . . . . . . . 29
4.4.10 Internal Delta Sigma ADCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
4.4.11 Internal Delta Sigma ADC Input Stage Con guration . . . . . . . . . . . . . . . . . . . 30
4.4.12 External Delta Sigma ADCs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.4.13 ADC Group A and ADC Group B . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
4.4.14 Delta Sigma Con guration and Timing Con guration . . . . . . . . . . . . . . . . . . . 32
4.4.15 Internal Delta Sigma Modulators - Mapping of V_RAW to ADC_RAW . . . . . . . . . . 36
4.4.16 External Delta Sigma Modulator Interface . . . . . . . . . . . . . . . . . . . . . . . . . 37
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 3 / 152
5 Safety Functions 66
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 4 / 152
7 Register Map 71
7.1 Register Map - Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
7.2 Register Map - Functional Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
7.3 Register Map - Defaults, Data Fields (Bit Masks), min, max . . . . . . . . . . . . . . . . . . . . . 110
8 Pinning 128
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 5 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 6 / 152
1 Order Codes
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 7 / 152
2 Functional Summary
• Servo Controller with Field Oriented Control (FOC)
– FOC3 : 3-phase permanent magnet synchronous motors (PMSM) / brushless DC motor (BLDC)
– FOC2 : 2-phase stepper motors
– FOC1 : 1-phase brushed DC motors, or linear voice coil motors
• ADC Engine with Offset Correction and Scaling
– Integrated Delta Sigma ADCs for current sense voltage, supply voltage, analog encoder, AGPIs
– Interface for isolated external current sensing Delta Sigma modulators
• Position Feedback
– Open loop position generator (programmable [rpm], [rpm/s]) for initial setup
– Digital incremental encoder (ABN resp. ABZ, up to 2 MHz)
– Secondary digital incremental encoder
– Digital Hall sensor interface (H1, H2, H3 resp. H_U, H_V, H_W) with interim position interpolation
– Analog encoder/analog Hall sensor interface (SinCos (0°, 90°) or 0°, 120°, 240°)
– Position target, velocity and target torque lters (Biquad)
– multi-turn position counter (32-bit)
• PWM Engine Including SVPWM
– Programmable PWM frequency within the range of 25 kHz . . . 100 kHz
– PWM auto scaling for transparent change of PWM frequency during motion
– Programmable Brake-Before-Make (BBM) times (0 ns . . . 2.5 µs) for digital gate control signals
– Single bit SVPWM control (on/off) for Space Vector Modulation (switchable during operation)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 8 / 152
• Supply Voltages
– 5V and 3.3V; VCC_CORE is internally generated
• IO Voltage
– 3.3V for all digital IOs (choosable by VCCIO Supply)
– 5V common mode analog input voltage range (1.25V ... 2.5V differential operating range)
• Clock Frequency
– 25 MHz (from external oscillator)
• Packages
– QFN76
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 9 / 152
3 FOC Basics
This section gives a short introduction into some basics of Field Oriented Control (FOC) of electric motors.
Figure 1: Illustration of the FOC basic principle by cartoon: Maximize active power and minimize idle power
and power dissipation by intelligent closed-loop control.
The hardware FOC as an existing standard building block drastically reduces the effort in system setup.
With that off the shelf building block, the starting point of FOC is the setup of the parameters for the FOC.
Setting up and implement the FOC itself and building and programming required interface blocks is no
longer necessary. The real parallel processing of hardware blocks de-couples the higher lever application
software from high speed real-time tasks and simpli es the development of application software. With
the TMC4671, the user is free to use its quali ed CPU together with its quali ed tool chain, freeing the
user from ghting with processer-speci c challenges concerning interrupt handling and direct memory
access. There is no need for a dedicated tool chain to access the TMC4671 registers and to operate it -
just SPI (or UART) communication needs to be enabled for any given CPU.
The hardware integration of the FOC drastically reduces the number of required components and reduces
the required PCB space. This is in contrast to classical FOC servos formed by motor block and separate
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 10 / 152
controller box wired with motor cable and encoder cable. The high integration of FOC, together with
velocity controller and position controller, enables the FOC as a standard peripheral component that
transforms digital information into physical motion. Compact size together with high performance and
energy e ciency especially for battery powered mobile systems are enabling factors when embedded
goes autonomous.
Figure 2: FOC optimizes torque by closed loop control while maximizing IQ and minimizing ID to 0
From top point of view, the FOC for 3-phase motors uses three phase currents of the stator interpreted
as a current vector (Iu; Iv; Iw) and calculates three voltages interpreted as a voltage vector (Uu; Uv; Uw)
taking the orientation of the rotor into account in a way that only a torque generating current IQ results.
From top point of view, the FOC for 2-phase motors uses two phase currents of the stator interpreted
as a current vector (Ix; Iy) and calculates two voltages interpreted as a voltage vector (Ux; Uy) taking the
orientation of the rotor into account in a way that only a torque generating current IQ results.
To do so, the knowledge of some static parameters (number of pole pairs of the motor, number of pulses
per revolution of an used encoder, orientation of encoder relative to magnetic axis of the rotor, count
direction of the encoder) is required together with some dynamic parameters (phase currents, orientation
of the rotor).
The adjustment of P parameter P and I parameters of two PI controllers for closed loop control of the
phase currents depends on electrical parameters of the motor (resistance, inductance, back EMF constant
of the motor that is also the torque constant of the motor, supply voltage).
The FOC needs to know the direction of the magnetic axis of the rotor of the motor in reference to the
magnetic axis of the stator of the motor. The magnetic ux of the stator is calculated from the currents
through the phases of the motor. The magnetic ux of the rotor is xed to the rotor and thereby deter-
mined by an encoder device.
For the FOC, the user needs to measure the currents through the coils of the stator and the angle of the
rotor. The measured angle of the rotor needs to be adjusted to the magnetic axes.
The challenge of the FOC is the high number of degrees of freedom in all parameters.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 11 / 152
The FOC requires different coordinate transformations formulated as a set of matrix multiplications. These
are the Clarke Transformation (Clarke), the Park Transformation (Park), the inverse Park Transformation
(iPark) and the inverse Clarke Transformation (iClarke). The Park transformation is also known as DQ
transformation, whereas the Clarke transformation is known as ↵ transformation.
The TMC4671 takes care of the required transformations so the user no longer has to ght with imple-
mentation details of these transformations.
The measurement of the stator coil currents is required for the FOC to calculate a magnetic axis out of
the stator eld caused by the currents owing through the stator coils.
Coil current stands for motor torque in context of FOC. This is because motor torque is proportional
to motor current, de ned by the torque constant of a motor. In addition, the torque depends on the
orientation of the rotor of the motor relative to the magnetic eld produced by the current through the
coils of the stator of the motor.
3.5.3 Stator Coil Currents I_U, I_V, I_W and Association to Terminal Voltages U_U, U_V, U_W
The correct association between stator terminal voltages U_U, U_V, U_W and stator coil currents I_U, I_V,
I_W is essential for the FOC. In addition to the association, the signs of each current channel need to
t. Signs of the current can be adapted numerically by the ADC scaler. The mapping of ADC channels is
programmable via con guration registers for the ADC selector. Initial setup is supported by the integrated
open loop encoder block, that can support the user to turn a motor open loop.
The ADC_GAIN is a result of a chain of gains with individual signs. The sign of the ADC_GAIN is positive
or negative, depending on the association of connections between sense ampli er inputs and the sense
resistor terminals. The ADC_OFFSET is the result of electrical offsets of the phase current measurement
signal path. For the TMC4671, the maximum ADC_RAW value ADC_RAW_MAX = (216 1) and the minimum
ADC raw value is ADC_RAW_MIN = 0.
For the FOC, the ADC_RAW is scaled by the ADC scaler of the TMC4671 together with subtraction of offset
to compensate it. Internally, the TMC4671 FOC engine calculates with s16 values. Thus, the ADC scaling
needs to be chosen so that the measured currents t into the s16 range. With the ADC scaler, the user
can choose a scaling with physical units like [mA].
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 12 / 152
Together with ADC_I0_SCALE and ADC_I0_OFFSET and ADC_I1_SCALE and ADC_I1_OFFSET, measured ADC
currents represented as 16 bit signed interger numbers (s16) represent real world currents. Multiplication
of integer current value with gain scaling factor in unit Ampere per LSB (Low Signi cant Bit) gives the real
world value of current in unit Ampere.
Different scalings between two associated current ADC channels can be trimmed by programing ADC_I0_SCALE
and ADC_I1_SCALE. The IgainADC[A/LSB] needs to be determined from ADC gain factors, ADC reference
voltage selection, and actual ADC scaling factor settings.
Measured ADC voltages represented as 16 bit signed interger numbers (s16) represent real world voltages.
Multiplication of integer voltage value with gain scaling factor in unit Volt per LSB (Low Signi cant Bit) gives
the real world value of voltage in unit Volt.
The UgainADC[V/LSB] needs to be determined from ADC gain factors, actual ADC gains, and ADC reference
voltage settings.
Determination of the rotor angle is either done by sensors (digital encoder, analog encoder, digital Hall
sensors, analog Hall sensors) or sensorless by a reconstruction of the rotor angle. Currently, there are no
sensorless methods available for FOC that work in a general purpose way as a sensor down to velocity
zero.
3.5.7 Measured Rotor Angle vs. Magnetic Axis of Rotor vs. Magnetic Axis of Stator
The rotor angle, measured by an encoder, needs to be adjusted to the magnetic axis of the rotor. This
is because an incremental encoder has an arbitrary orientation relative to the magnetic axis of the rotor,
and the rotor has an arbitrary orientation to magnetic axis of the stator.
The direction of counting depends on the encoder, its mounting, and wiring and polarities of encoder
signals and motor type. So, the direction of encoder counting is programmable for comfortable de nition
for a given combination of motor and encoder.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 13 / 152
For FOC it is essential, that the direction of revolution of the magnetic eld is compatible with the direc-
tion of motion of the rotor position reconstructed from encoder signals: For revolution of magnetic eld
with positive direction, the decoder position needs to turn into the same positive direction. For revolu-
tion of magnetic eld with negative direction, the decoder position needs to turn into the same negative
direction.
With an absolute encoder, once adjusted to the relative orientation of the rotor and to the relative orien-
tation of the stator, one could start the FOC without initialization of the relative orientations.
A Bang-Bang initialization is an initialization where the motor is forced with high current into a speci c
position. For Bang-Bang initialization, the user sets a current into direction D that is strong enough to
move the rotor into the desired direction. Other initialization methods ramp up the current smoothly
and adjust the current vector to rotor movement detected by the encoder.
The encoder can be initialized using digital Hall sensor signals. Digital Hall sensor signals give absolute
positions within each electrical period with a resolution of sixty degrees. If the Hall sensor signals are
used to initialize the encoder position on the rst change of a Hall sensor signal, an absolute reference
within the electrical period for commutation is given.
For minimal movement initialization of the encoder, the user slowly increases a current into direction D
and adjusts an offset of the measured angle in a way that the rotor of the motor does not move during
initialization while the offset of the measured angle is determined.
3.5.8 Knowledge of Relevant Motor Parameters and Position Sensor (Encoder) Parameters
The number of pole pairs is an essential motor parameter. It de nes the ratio between electrical revolu-
tions and mechanical revolutions. For a motor with one pole pair, one mechanical revolution is equivalent
to one electrical revolution. For a motor with npp pole pairs, one mechanical revolution is equivalent to
npp electrical revolutions, with n = 1, 2, 3, 4, . . . .
Some de ne the number of poles NP instead of number of pole pairs NPP for a motor, which results in a
factor of two that might cause confusion. For the TMC4671, we use NPP number of pole pairs.
For the encoder, the number of positions per revolution (PPR) is an essential parameter. The number of
positions per revolution is essential for the FOC.
Some encoder vendors give the number of lines per revolution (LPR) or just named line count (LC) as
encoder parameter. Line count and positions per revolution might differ by a factor of four. This is be-
cause of the quadrature encoding - A signal and B signal with phase shift - that give four positions per
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 14 / 152
line, enabling the determination of the direction of revolution. Some encoder vendors associate counts
per revolution (CPR) or pulses per revolution associated to PPR acronym.
3.5.9 Proportional Integral (PI) Controllers for Closed Loop Current Control
Last but not least, two PI controllers are required for the FOC. The TMC4671 is equipped with two PI
controllers - one for control of torque generating current I_Q and one to control current I_D to zero.
3.5.10 Pulse Width Modulation (PWM) and Space Vector Pulse Width Modulation (SVPWM)
The PWM power stage is a must-have for energy e cient motor control. The PWM engine of the TMC4671
just needs a couple of parameters to set PWM frequency fPWM and switching pauses for both high side
switches tBBM_H and low side switches tBBM_L. Some control bits are for the programming of power
switch polarities for maximum exibility in the selection in gate drivers for the power MOS-FETs. An addi-
tional control bit selects SVPWM on or off. The TMC4671 allows for change of PWM frequency by a single
parameter during operation.
With this, the TMC4671 is advanced compared to software solutions where PWM and SVPM con guration
of CPU internal peripherals normally needs settings of many parameters.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 15 / 152
The orientation of magnetic axes (U, V, W for FOC3 resp. X, Y for FOC2) is essential for the FOC together
with the relative orientation of the rotor. Here, the rotor is modeled by a bar magnet with one pole pair
(n_pole_pairs = 1) with magnetic axis in north-south direction.
The actual magnetic axis of the stator - formed by the motor coils - is determined by measurement of the
coil currents.
The actual magnetic axis of the rotor is determined by incremental encoder or by Hall sensors. Incremen-
tal encoders need an initialization of orientation, where Hall sensors give an absolute orientation, but with
low resolution. A combination of Hall sensor and incremental encoder is useful for start-up initialization.
Figure 4: Compass Motor Model w/ 3 Phases UVW (FOC3) and Compass Motor Model w/ 2 Phases (FOC2)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 16 / 152
4 Functional Description
The TMC4671 is a fully integrated controller for eld-oriented control (FOC) of either one 3-phase brush-
less motor (FOC3) or one 2-phase stepper motor (FOC2) or, as well as 1-phase DC motor or voice coil
actuator (FOC1). Containing the complete control loop core architecture (position, velocity, torque), the
TMC4671 also has the required peripheral interfaces for communication with an application controller,
for feedback (digital encoder, analog interpolator encoder, digital Hall with interpolator, analog inputs for
current and voltage measurement), and helpful additional IOs. The TMC4671 supports highest control
loop speed and PWM frequencies.
The TMC4671 is the building block which takes care of all real-time critical tasks of eld-oriented motor
control. It decouples the real-time eld-oriented motor control and its real-time sub-tasks such as current
measurement, real-time sensor signal processing, and real-time PWM signal generation from the user
application layer as outlined by gure 5.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 17 / 152
The ADC engine interfaces the integrated ADC channels and maps raw ADC values to signed 16 bit (s16)
values for the inner FOC current control loop based on programmable offset and scaling factors. The FOC
torque PI controller forms the inner base component including required transformations (Clark, Park,
inverse Park, inverse Clark). All functional blocks are pure hardware.
The SPI of the TMC4671 for the user application has an easy command and control structure. The TMC4671
user SPI acts as a slave. The SPI datagram length is 40 bit with a clock rate up to 8 MHz (1 MHz for the
TMC4671-ES).
• The MSB (bit#39) is sent rst. The LSB (bit#0) is sent last.
• The MSB (bit#39) is the WRITE_notREAD (WRnRD) bit.
• The bits (bit#39 to bit#32) are the address bits (ADDR).
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 18 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 19 / 152
Info SPI write access can be performed up to 8 MHz SPI clock frequency. SPI read
access can be performed up to 8 MHz SPI clock frequency if a pause of at least
500 ns is inserted after transfer of the address byte of the SPI datagram. Without
a pause of 500 ns after address byte, SPI read access can be performed up to 2
MHz SPI clock frequency.
Figure 9: SPI Timing of Write Access without pause with fSCK up to 8MHz
Figure 10: SPI Timing of Read Access with pause (tPAUSE) of 500 ns with fSCK up to 8MHz.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 20 / 152
The TRINAMIC Real-Time Monitoring Interface (RTMI, SPI Master) is an additional fast interface enabling
real-time identi cation of motor and system parameters. The user can check con guration and access
registers in the TMC4671 via the TMCL-IDE with its build-in con guration wizards for FOC setup in parallel
to the user rmware. TRINAMIC provides a Monitoring Adapter to access the interface, which connects
easily to a single 10 pin high density connector (Type: Hirose DF20F-10DP-1V) on the user’s PCB or on the
evaluation board. If the interface is not needed, pins can be left open or can be used as GPIOs according
to the speci cation. The connector needs to be placed near the TMC4671. Its assignment is pictured in
gure 11.
Figure 11: Connector for Real-Time Monitoring Interface (Connector Type: Hirose DF20F-10DP-1V)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 21 / 152
The UART interface is a simple three pin (GND, RxD, TxD) 3.3V UART interface with up to 3 Mbit/s transfer
speed with one start bit, eight data bits, one stop bit, and no parity bits (1N8). The default speed is 9600
bps. Other supported speeds are 115200 bps, 921600 bps, and 3000000 bps. The speed must be changed
manually in register 0x79 UART_BPS.
Info The baudrates must be entered as hexadecimal numbers. Table 3 lists the regis-
ter value and its corresponding baudrate.
With an 3.3V-UART-to-USB adapter cable (e.g. FTDI TTL-232R-RPi), the user can use the full maximum data
rate. The UART port enables In-System-Setup-Support by multiple-ported register access.
An UART datagram consists of ve bytes - similar to the datagrams of the SPI. In contrast to SPI, the UART
interface has a time out feature. So, the ve bytes of a UART datagram need to be send within one second.
A pause of sending more than one second causes a time out and sets the UART protocol handler back
into IDLE state. In other words, waiting for more than one second in sending via UART ensures that the
UART protocol handler is in IDLE state.
Why UART Interface? It might become necessary during the system setup phase to simply access some in-
ternal registers without disturbing the application, without changing the actual user application software,
and without adding additional debugging code that might disturb the application software itself. The
UART enables this supporting function. In addition, it also enables easy access for monitoring purposes
with its very simple and direct ve byte protocol. The UART interface is available to write periodically po-
sitions into the TMC4671 via an external CPU used as a protocol translator to enable absolute encoders
for the TMC4671.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 22 / 152
Figure 12: UART Read Datagram (TMC4671 register read via UART)
Figure 13: UART Write Datagram (TMC4671 register write via UART)
The user can manipulate the target position via the step direction interface. It can be enabled by setting
the STEP_WIDTH (s32) register to a proper step width. The power-on default value of STEP_WIDTH is 0
that causes position target update with 0 step width that is no stepping. With STEP_WIDTH = 6 0 each step
pulse on STEP input causes incrementing or decrementing of target position depending on polarity of DIR
input. For positive STEP_WIDTH, DIR = 0 causes incrementing and the DIR = 1 causes decrementing of the
target position. For negative STEP_WIDTH, DIR = 0 causes decrementing and DIR = 1 causes incrementing
of the target position. This is because the STEP_WIDTH is represented as a signed number.
The TMC4671 can be operated in Motion Modes in which the main target value is calculated from either
a PWM input signal on PIN PWM_I or by analog input to AGPI_A.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 23 / 152
Registers SINGLE_PIN_IF_OFFSET and SINGLE_PIN_IF_SCALE can be used to scale the value to desired
range. In case of the PWM input, a permanent low input signal or permanent high signal is treated as
input error and chosen target value is set to zero.
Register SINGLE_PIN_IF_CFG con gures the length of a digital lter for the PWM_I signal. Spikes on the
signal can be thereby suppressed. Bit 0 in register SINGLE_PIN_IF_STATUS is set high when PWM_I is
constant low, Bit 1 is set high when the PWM_I is constant high. Writing to this register resets these ags.
Maximum PWM period of the PWM signal must be 65000 x 40 ns. The calculation of the normalized duty
cycle is started on the rising edge of PWM_I. The PWM frequency needs to be constant as big variations
(tolerance of 4 us in PWM period) in the PWM frequency are treated as error.
A duty cycle of 50% equals an input value of 32768. With the offset and scaling factors it can be mapped
to desired range.
The TMC4671 has eight GPIO-pins that are arranged in group A (GPIO 0 to 3) and group B (GPIO 4 to 7).
These pins can be con gured using bits 0 to 6 of the register GPIO_dsADCI_CONFIG (0x7B). The con gu-
rations include RTMI, GPI or GPO as well as clock signals, in and out, for external delta sigma modulators.
Groups A and B can individually be con gured as in or outputs. Single pins within these groups can not be
individually con gured. Bits 16 to 19 set the GPO values for group A and bits 20 to 23 set the GPO values
for group B. If con gured as GPIs bits 24 to 27 display the input on group A whereas bits 28 to 31 display
the input on the group B GPIs.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 24 / 152
Info When the RTMI-option is selected it is not possible to use the GPIOs and the other
way around. On default the RTMI-Mode is chosen and the unused GPIOs 0,1 and
2 are con gured as inputs on high impedance Z.
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 numer-
ical representations of parameters and terms.
The TMC4671 uses signed and unsigned values of different lengths and xed point representations for
parameters that require a non-integer granularity.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 25 / 152
Info Two’s complement of n bit is 2(n 1) . . . 2(n 1) 1. To avoid unwanted over ow,
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 under ow or over ow. Internal clipping takes
this into account by mapping 2(n 1) to 2(n 1) + 1.
The q8.8 and q4.12 are used for P and I parameters which are positive numbers. Note that q8.8 and q4.12
are used as signed numbers. This is because theses values are multiplied with signed error values resp.
error integral values.
The parameter N_POLE_PAIRS de nes the factor between electrical angle PHI_E and mechanical angle
PHI_M of a motor (pls. refer gure 14).
A motor with one (1) pole pair turns once for each electrical period. A motor with two (2) pole pairs turns
once for every two electrical periods. A motor with three (3) pole pairs turns once for every three electrical
periods. A motor with four pole (4) pairs turns once for every four electrical periods.
The electrical angle PHI_E is relevant for the commutation of the motor. It is relevant for the torque control
of the inner FOC loop.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 26 / 152
The mechanical angle PHI_M is primarily relevant for velocity control and for positioning. This is because
one wants to control the motor speed in terms of mechanical turns and not in terms of electrical turns.
Different encoders give different kinds of position angles. Digital Hall sensors normally give the electrical
position PHI_E that can be used for commutation. Analog encoders give - depending on their resolution -
angles that have to be scaled rst to mechanical angles PHI_M and to electrical angles PHI_E for commu-
tation.
Electrical angles and mechanical angles are represented as 16 bit integer values. One full revolution of
360 deg is equivalent to 216 = 65536 steps. Any position coming from a sensor is mapped to this integer
range. Adding an offset of PHI_OFFSET causes a rotation of an angle PHI_OFFSET/216 . Subtraction of an
offset causes a rotation of an angle PHI_OFFSET in opposite direction.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 27 / 152
Figure 15: Integer Representation of Angles as 16 Bit signed (s16) resp. 16 Bit unsigned (u16)
The option of adding an offset is for adjustment of angle shift between the motor and stator and the rotor
and encoder. Finally, the relative orientations between the motor and stator and the rotor and encoder
can be adjusted by just one offset. Alternatively, one can set the counter position of an incremental
encoder to zero on initial position. For absolute encoders, one needs to use the offset to set an initial
position.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 28 / 152
The ADC channels (ADC_I0_POS, ADC_I0_NEG, ADC_I1_POS, ADC_I1_NEG) are for current sensing in differ-
ential input con guration. In differential con guration, the ADC_I0_POS and ADC_I0_POS are the inputs
for the sense ampli er output signals where ADC_I1_NEG and ADC_I0_NEG) are for the zero current sens-
ing reference of the sense ampli ers. In single ended con guration, the ADC_I0_POS and ADC_I0_POS
are the inputs for the sense ampli er output signals where ADC_I1_NEG and ADC_I0_NEG) are internally
connected to ground. The third current channel ADC_I2 as required for three phase FOC is calculated
using Kirchhoff’s law ADC_I2 = - (ADC_I1 + ADC_I0).
Info ADC_I0_POS, ADC_I0_NEG, ADC_I1_POS, ADC_I1_NEG are low voltage analog in-
puts and must not directly connected to in-line sense resistors. The TMC4671
requires external dfferential motor supply common mode range current sens-
ing ampli ers for in-line current sensing.
4.4.2 ADC for analog Hall signals or analog sin-cos-encoders AENC_UX, AENC_VN, AENC_WY
For analog Hall and for analog encoder, the ADC engine has three disserential input channles (AENC_UX_POS,
AENC_UX_NEG), (AENC_VN_POS, AENC_VN_NEG), and AENC_WY_POS, AENC_WY_NEG). The analog encoder
ADC inputs can be con gured single ended (AENC_UX_POS, AENC_VN_POS, AENC_WY_POS) with negative
inputs (AENC_UX_NEG, AENC_VN_NEG, AENC_WY_NEG) internally connected to ground.
The three channels AENC_UX, AENC_VN, AENC_WY are for three phase analog sine (with +/-120° phase
shift) wave Hall signals. The Signals AENC_UX and AENC_WY are for two phase analog sine wave and cosin
wave Hall signals. The Signals AENC_UX and AENC_WY are for analog sin-cos-encoder. The AENC_VN is
for an optional zero pulse channel of sin-cos-encoders. The AENC_VN is available for read out by the
application software but it is not hardware handled by the TMC4671 for position zerroing.
For long analog signal lines, it might be necessary to use external differential receivers with twisted pair
line termination resistors to drive the single ended analog encoder inputs of the TMC4671.
The ADC channel for measurement of supply voltage (ADC_VM) and is associated with the brake chopper.
The ADC_VM is available as raw value only without digital scaling. This is because it is not directly processed
by the FOC engine.
Info ADC_VM must be scaled down electrically by voltage divider to the allowed volt-
age range, and might require additional supply voltage spike protection.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 29 / 152
The ADC_VM is available as input for optional brake chopper as raw value u16. The brake chopper thresh-
olds have to be set as absolute u16 values to activate and deactivate the brake chopper output depending
on the ADC_VM value.
The user can write ADC values into the ADC_EXT registers of the register bank from external sources or
for evaluation purposes. These values can be selected as raw current ADC values by selection. ADC_EXT
registers are primarily intended for test purposes as optional inputs for external current measurement
sources.
Two general purpose ADC channels are single-ended analog inputs (AGPI_A, AGPI_B). The general pur-
pose analog ADC inputs AGPI_A and AGPI_B are available as raw values only without digital scaling. This is
because these values are not directly processed by the FOC engine. These general purpose analog inputs
(AGPI) are intended to monitor analog voltage signals representing MOSFET temperature or motor tem-
perature. They are two additional ADC channels for the user. Optional, the AGPI_A is availabe as analog
target value signal.
The sampled raw ADC values are available for read out by the user. This is important during the system
setup phase to determine offset and scaling factors.
The FOC engine expects offset corrected ADC current values scaled to the used 16 bit (s16) xed point
representation. The integrated scaler and offset compensator maps raw ADC samples of current measure-
ment channels to 16 bit two’s complement values (s16). While the offset is compensated by subtraction,
the offset is represented as an unsigned value. The scaling value is signed to compensate wrong measure-
ment direction. The s16 scaled ADC values are available for read out from the register (ADC_I1, ADC_I0)
resp. (AENC_UX, AENC_VN, AENC_WY) by the user.
Info Wrong scaling factors (ADC_SCALE) or wrong offsets (ADC_OFFSET) might cause
damages when the FOC is active. Integrated hardware limiters allow protection -
especially in the setup phase when using careful limits.
Each ADC channel of the TMC4671 has an individual gain factor determined by its associated chain of gain
factors and by digital scaling factors if available for an ADC channel. ADC register values are either 16 bit
unsigned vaulues (u16) or 16 bit signed vaules (s16). With gain factors one can calculate ADC values as
real world values if required.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 30 / 152
Gain factors IgainADC for ADC current values are typical in units [A/LSB] or [mA/LSB]. Gain factors UgainADC
for ADC voltage values are typical in units [V/LSB] or [mV/LSB].
The TMC4671 is equipped with internal delta sigma ADCs for current measurement, supply voltage mea-
surement, analog GPIs and analog encoder signal measurement. Delta sigma ADCs, as integrated within
the TMC4671, together with programmable digital lters are exible in parameterizing concerning reso-
lution vs. speed. The advantage of delta sigma ADCs is that the user can adjust measurement from lower
speed with higher resolution to higher speed with lower resolution. This ts with motor control applica-
tion. Higher resolution is required for low speed signals, while lower resolution satis es the needs for
high speed signals.
Due to high oversampling, the analog input front-end is easier to implement than for successive approx-
imation register ADCs as anti aliasing lters can be chosen to a much higher cutoff frequency. The ADC
Engine processes all ADC channels in parallel hardware - avoiding phase shifts between the channels
compared to ADC channels integrated in MCUs.
ADC channels can be con gured either as differential ended analog inputs (ADC_I0, ADC_I1, AENC_UX,
AENC_VN, AENC_WY) or as single ended analog inputs (ADC_VM, AGPI_A, AGPI_B). Additionally, the ADC
all channels can be set to xed voltages (0V, VREF/4, VREF/2, 3*VREF/4) for calibrations purposes.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 31 / 152
con gures the associated delta sigma ADC input stages according to table 17. For association of the bit
position (bit n+2 to bit n) refere register bank section 7.2.
Figure 16: Input Voltage Ranges of internal Delta Sigma ADC Channels)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 32 / 152
Figure 16 illustrates typical relation between input voltage and corresponding raw ADC output. For differ-
ential operation the input range between 25% and 75% corresponds to voltage values between 1.25V to
3.75V. This is the recommended operation area of the ADC. Below 25% and above 75% the ADC shows
signi cant non-linearity due to the Delta Sigma measurement principle.
In single ended operation the recommended input range starts at 0V and ends at 1.25V. Measurement
below GND might be distorted and is not recommended.
The delta sigma front-end of the ADC engine supports external delta sigma modulators to enable iso-
lated delta sigma modulators for the TMC4671. Additionally, the delta sigma front-end supports low-cost
comparators together with two resistors and one capacitor (R-C-R-CMP) forming rst order delta sigma
modulators, as generic analog front-end for pure digital variants of the TMC4671 core.
ADC channels of the TMC4671 are grouped into two groups, to enable different sample rates for two
groups of analog signals if needed. Running both ADC groups with same sampling frequency is recom-
mended for almost all applications. It might be necessary to run its ADC channels of analog encoder
with a much higher frequency than the ADC channels for current measurement in case of using a high
resolution analog encoder.
The delta sigma con guration is programmed via MCFG register that selects the mode (internal/external
delta sigma modulator with programmable MCLK; delta sigma modulator clock mode (MCLK output, MCLK
input, MCLK used as MDAC output with external R-C-R-CMP con guration); delta sigma modulator clock
and its polarity; and the polarity of the delta sigma modulator data signal MDAT).
Info The power-on delta sigma con guration should t with most applications when
using the intergated delta sigma ADCs of the TMC4671. Primarily, the default
delta sigma con guration needs to be adapted when using external delta sigma
modulators or to select differential ADC input con gurations, or in case of en-
hanced sampling requirenment for high resolution analog encoders.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 33 / 152
Figure 17: Delta Sigma ADC Con gurations dsADC_CONFIG (internal: ANALOG vs. external: MCLKO, MCLKI,
MDAC)
Table 11: Delta Sigma ADC Con gurations ( gure 17), selected with dsADC_MCFG_A and dsADC_MCFG_B.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 34 / 152
register function
dsADC_MCFG_B delta sigma modulator con guration MCFG (ANALOG, MCLKI, MCLKO, MDAC), group B
dsADC_MCFG_A delta sigma modulator con guration MCFG (ANALOG, MCLKI, MCLKO, MDAC), group A
dsADC_MCLK_B delta sigma modulator clock MCLK, group B
dsADC_MCLK_A delta sigma modulator clock MCLK, group A
dsADC_MDEC_B delta sigma decimation parameter MDEC, group B
dsADC_MDEC_A delta sigma decimation parameter MDEC, group A
When the programmable MCLK is selected, the MCLK_A and MCLK_B parameter registers de ne the pro-
grammable clock frequency fMCLK of the delta sigma modulator clock signal MCLK for delta sigma modu-
lator group A and group B. For a given target delta sigma modulator frequency fMCLK, together with the
internal clock frequency fCLK = 100MHz, the MCLK frequency parameter is calculated by
Due to the 32 bit’s length of the MCLK frequency parameter, the resulting frequency fMCLK might differ
from the desired frequency fMCLK. The back calculation of the resulting frequency fMCLK for a calculated
MCLK parameter with 32 bit length is de ned by
The precise programming of the MCLK frequency is primarily intended for external delta sigma modula-
tors to meet given EMI requirements. With that, the user can programm frequencies fMCLK with a reso-
lution better than 0.1 Hz. This advantage concerning EMI might cause trouble when using external delta
sigma modulators if they are sensitive to slight frequency alternating. This is not an issue when using ex-
ternal rst-order delta sigma modulators based on R-C-R-CMP (e.g. LM339). But for external second-order
delta sigma modulators, it is recommended to con gure the MCLK parameter for frequencies fMCLK with
kHz quantization (e.g. 10,001,000 Hz instead of 10,000,001 Hz).
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 35 / 152
The high oversampled single bit delta sigma data stream (MDAT) is digitally ltered by Sinc3 lters. To get
raw ADC data, the actual digitally ltered values need to be sampled periodically with a lower rate called
decimation ratio. The decimation is controlled by parameter MDEC_A for ADC group A and MDEC_B for
ADC group B. A new ADC_RAW value is available after MDEC delta sigma pulses of MCLK. As such, the
parameters MCLK and MDEC together de ne the sampling rate of the 16 bit ADC_RAW values.
The delta sigma modulator with Sinc3 lter works with best noise reduction performance when the length
of the step response time tSINC3 of the Sinc3 lter is equal to the length of the PWM period tPWM =
(PWM_MAXCNT+1) / fPWMCLK = ((PWM_MAXCNT+1) * 10 ns) of the period. The length of the step function
response of a Sinc3 lter is
tPWM
MDECrecommended = 2 (13)
3 · tMCLK
fMCLK tMCLK MDEC25 (25 kHz, 40µs) MDEC50 (50 kHz, 20µs) MDEC100 (100 kHz, 10µs)
50 MHz 20 ns 665 331 165
25 MHz 40 ns 331 165 81
20 MHz 50 ns 265 131 65
12.5 MHz 80 ns 165 81 40
10 MHz 100 ns 131 65 31
Table 14: Optimal Decimation Parameter MDEC (according to equation (13) for different PWM frequencies
fPWM (MDEC25 for fPWM=25kHz w/ PWM_MAXCNT=3999, MDEC50 for fPWM=50kHz w/
PWM_MAXCNT=1999, MDEC100 for fPWM=100kHz w/ PWM_MAXCNT=999).
Info MDEC parameter can be changed during operation. This enables adaptive
adjustment of performance with respect to resolution versus speed on demand.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 36 / 152
Generally, delta sigma modulators work best for a typical input voltage range of 25% V_MAX . . . 75% V_MAX
(unsigned 0% ... 100%) resp. -75% V_MAX . . . +75% V_MAX (signed -100% ... +100%). For the integrated
delta sigma modulators, this input voltage operation range is recommended with V_MAX = 5V where
V_MAX = 3.3V is possible. The table 15 de nes the recommended voltage ranges for both 5V and 3.3V
analog supply voltages.
Table 15: Recommended input voltage range from V_MIN25%[V] to V_MAX75%[V] for internal Delta Sigma
Modulators; V_SUPPLY[V] = 5V is recommended for the analog part of the TMC4671.
8
>
> V_MAX for V_IN > V_MAX
>
<
V_RAW = (V_IN V_REF) for V_MIN < (V_IN V_REF) < V_MAX (14)
>
>
>
: V_MIN for V_IN < V_MIN
V_RAW
ADC_RAW = (216 1) · for V_MIN25%[V] < V_RAW < V_MAX75%[V]. (15)
V_MAX
The idealized expression (equation 14) is valid for recommended voltage ranges (table 15) neglecting de-
viations in linearities. These deviations primarily depend on different impedance on the analog signal
path, but also on digital parameterization. Finally, the deviation is quanti ed in terms of resulting ADC
resolution. So, the Delta Sigma ADC engine maps the analog input voltages V_RAW = V_IN - V_REF of volt-
age range V_MIN < V_RAW < V_MAX to ADC_RAW values of range {0 . . . (216 ) 1} <=> {0 . . . 65535} <=>
0x0000 . . . 0xFFFF.
Table 16: Delta Sigma input voltage mapping of internal Delta Sigma Modulators
Info For calibrating purposes, the input voltage of the delta sigma ADC inputs can be
programmed to xed voltages (25%, 50%, 75% of analog supply voltage) via the
associated con guration register DS_ANALOG_INPUT_STAGE_CFG.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 37 / 152
The TMC4671 is equipped with integrated digital lters for extraction of ADC raw values from delta sigma
data stream for both internal and external delta sigma modulators. The interface for external delta sigma
modulators is intended for external isolated sigma delta modulators, such as AD7401 (with MCLK input
driven by TMC4671), or AD7402 (with MCLK output to drive TMC4671). In addition, the external delta
sigma interface supports the use of simple comparator with a R-C-R network as external low cost delta
sigma modulators (R-C-R-CMP, e.g. LM339).
Info When selecting the external delta sigma ADC Interface, the high-performance
Debug SPI Interface (RTMI) it not available in parallel due to pin sharing. The
UART is always available, but with less performance than the RTMI.
Each external delta sigma modulator channel (dsMOD) has two signals (pls. refer gure 17), one dedicated
input, and one programmable input/output. The con guration of the external delta sigma modulator
interface is de ned by programming associated registers. When selecting external delta sigma ADC, the
associated analog ADC inputs are con gured as digital inputs for the delta sigma signal data stream MDAT.
In the MDAC delta sigma modulator, the delay of the comparator CMP determines the MCLK of the com-
parator modulator. A capacitor CM CCM P within a range of 100 pF . . . 1nF ts in most cases. The time
constant ⌧ RC should be in a range of 0.1 tCMP . . . tCMP of the comparator. The resistors should be in the
range of 1K to 10K. The fMAXtyp depends also on the choice of the decimation ratio.
CMP tCMPtyp [ns] RMCMP [k⌦] RMDAC [k⌦] CMCMP [pF ] fMCLKmaxTYP
LM339 1000 1 1 100 1 MHz
LM339 1000 10 10 100 100 kHz
LM339 1000 100 100 100 10 kHz
Table 17: Delta Sigma R-C-R-CMP Con gurations (pls. refer 17)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 38 / 152
For external Delta Sigma R-C-R-CMP modulators, one gets the Delta Sigma input voltage mapping accord-
ing to table 18. The support of low-cost external comparators used as rst order delta sigmal modulators
is intended as an generic analog interface option for compatibility of the TMC4671 core in case it would
be embedded within a pure digital technology environment.
Table 18: Delta Sigma input voltage mapping of external comparator (CMP)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 39 / 152
An ADC raw value is a result of a chain of gains that determine it. A coil current I_SENSE owing through a
sense resistor causes a voltage difference according to Ohm’s law. Finally, a current is mapped to an ADC
raw value
The ADC_GAIN is a result of a chain of gains with individual signs. The sign of the ADC_GAIN is positive
or negative, depending on the association of connections between sense ampli er inputs and the sense
resistor terminals. The ADC_OFFSET is the result of electrical offsets of the phase current measurement
signal path. For the TMC4671, the maximum ADC_RAW value is ADC_RAW_MAX = (216 1) and the mini-
mum ADC raw value is ADC_RAW_MIN = 0.
Rsense [m⌦] Isense [A] Usense [mV ] GAIN[V /V ] ADC_GAIN[A/V ] Sense Ampli er
5 10 50 20 10 AD8418
10 5 50 20 5 AD8418
For the FOC, the ADC_RAW is scaled by the ADC scaler of the TMC4671 together with subtraction of offset
to compensate it. Internally, the TMC4671 FOC engine calculates with s16 values. So, the ADC scaling
needs to be chosen so that the measured currents t into the s16 range. With the ADC scaler, the user can
choose a scaling with physical units like [mA]. A scaling to [mA] covers a current range of 32A . . .+32A with
m[A] resolution. For higher currents, the user can choose unusual units like centi Ampere [cA] covering
327A . . . + 327A or deci Ampere 3276A . . . + 3276A.
ADC scaler and offset compensators are for mapping raw ADC values to s16 scaled and offset cleaned
current measurement values that are adequate for the FOC.
4.5.1 FOC3 - Stator Coil Currents I_U, I_V, I_W and associated Voltages U_U, U_V, U_W
The correct association between stator terminal voltages U_U, U_V, U_W and stator coil currents I_U, I_V,
I_W is essential for the FOC.
For three-phase motors with three terminals U, V, W, the voltage U_U is in phase with the current I_U, U_V
is in phase with I_V, and U_W is in phase with I_W according to equations (18) and (19) for FOC3.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 40 / 152
8
>
> U ( ) = UD · sin( e )
>
< U e
U_UVW_FOC3(U_D, PHI_E) = UV ( e ) = UD · sin( e + 120o ) (18)
>
>
>
: U ( )=U
W e D · sin( e 120o )
8
>
> I ( ) = ID · sin( e )
>
< U e
I_UVW_FOC3(I_D, PHI_E) = IV ( e ) = ID · sin( e + 120o ) (19)
>
>
>
: I ( )=I
W e D · sin( e 120o )
4.5.2 FOC2 - Stepper Coil Currents I_X, I_Y and associated Voltages U_X, U_Y
For two-phase motors (stepper) with four terminals UX1, VX2, and WY1, Y2, voltage U_Ux = U_X1 - U_X2
is in phase with the measured current I_X and U_Wy = U_Y1 - U_Y2 is in phase with the measured current
I_Y according to equations (20) and (21) for FOC2.
8
< U ( ·
X e) = UX sin( e)
U_XY_FOC2 = (20)
: U ( · + 90o )
Y e) = UY sin( e
8
< I ( )=I · sin(
X e D e)
I_XY_FOC2 = (21)
: I ( )=I · sin( + 90o )
Y e D e
4.5.3 FOC1 - DC Motor Coil Current I_X1, I_X2, and associated Voltage U_X1, U_X2
For DC motor with with two terminals UX1, VX2, voltage U_X = U_X1 - U_X2 is in phase (same sign) with the
measured current I_X. U_X is in phase (same sign) with the measured current I_X according to equations
(22) and (23) for FOC1.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 41 / 152
The ADC selector selects ADC channels for FOC. The 3-phase FOC uses two ADC channels for measurement
and calculates the third channel via Kirchhoff’s Law using the scaled and offset-corrected ADC values.
The 2-phase FOC just uses two ADC channels because for a 2-phase stepper motor, the two phases are
independent from each other.
Note The open-loop encoder is useful for setting up ADC channel selection, scaling,
and offset by running a motor open-loop.
The FOC23 Engine processes currents as 16 bit signed (s16) values. Raw ADC values are expanded to 16
bit width, regardless of their resolution. With this, each ADC is available for read out as a 16 bit number.
The ADC scaler w/ offset correction is for the preprocessing of measured raw current values. It might be
used to map to user’s own units (e.g. A or mA). For scaling, gains of current ampli ers, reference voltages,
and offsets have to be taken into account.
Info Raw ADC values generally are of 16 bit width, regardless of their real resolution.
Info The ADC scaler maps raw ADC values to the 16 bit signed (s16) range and centers
the values to zero by removing offsets.
ADC offsets and ADC scalers for the analog current measurement input channels need to be programmed
into the associated registers. Each ADC_I_U, ADC_I_V, ADC_I0_EXT, and ADC_I1_EXT are mapped either to
ADC_I0_RAW or to ADC_I1_RAW by ADC_I0_SELECT and ADC_I1_SELECT.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 42 / 152
In addition, the ADC_OFFSET is for conversion of unsigned ADC values into signed ADC values as required
for the FOC. For FOC3, the third current ADC_I2 is calculated via Kirchhoff’s Law. This requires the correct
scaling and offset correction beforehand. For FOC2, there is no calculation of a third current. The scaling
factors ADC_I0_SCALE and ADC_I1_SCALE are displayed in a Q8.8 format which results in the following
equations:
The ADC_UX_SELECT selects one of the three ADC channels ADC_I0, ADC_I1, or ADC_I2 for ADC_UX.
The ADC_V_SELECT selects one of the three ADC channels ADC_I0, ADC_I1, or ADC_I2 for ADC_V.
The ADC_WY_SELECT selects one of the three ADC channels ADC_I0, ADC_I1, or ADC_I2 for ADC_WY.
The ADC_UX, ADC_V, and ADC_WY are for the FOC3 (U, V, W).
The ADC_UX and ADC_WY (X, Y) are for the FOC2 (UX, WY).
Note The open-loop encoder is useful to run a motor open loop for setting up the ADC
channel selection with correct association between phase currents I_U, I_V, I_W
and phase voltages U_U, U_V, U_W.
The different position sensors are the position sources for torque and ux control via FOC, for velocity
control, and for position control. The PHI_E_SELECTION selects the source of the electrical angle phi_e
for the inner FOC control loop. VELOCITY_SELECTION selects the source for velocity measurement. With
phi_e selected as source for velocity measurement, one gets the electrical velocity. With the mechanical
angle phi_m selected as source for velocity measurement, one gets the mechanical velocity taking the
set number of pole pairs (N_POLE_PAIRS) of the motor into account. Nevertheless, for a highly precise
positioning, it might be useful to do positioning based on the electrical angle phi_e.
For initial system setup, the encoder engine is equipped with an open-loop position generator. This allows
for turning the motor open-loop by specifying speed in rpm and acceleration in rpm/s, together with a
voltage UD_EXT in D direction. As such, the open-loop encoder is not a real encoder. It simply gives
positions as an encoder does. The open-loop decoder has a direction bit to de ne direction of motion for
the application.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 43 / 152
Note The open-loop encoder is useful for initial ADC setup, encoder setup, Hall signal
validation, and for validation of the number of pole pairs of a motor. The open-
loop encoder turns a motor open with programmable velocity in unit [RPM] with
programmable acceleration in unit [RPM/s].
With the open-loop encoder, the user can turn a motor without any position sensor and without any
current measurement as a rst step of doing the system setup. With the turning motor, the user can
adjust the ADC scales and offsets and set up positions sensors (Hall, incremental encoder, . . . ) according
to resolution, orientation, and direction of rotation.
The incremental encoders give two phase shifted incremental pulse signals A and B. Some incremental
encoders have an additional null position signal N or zero pulse signal Z. An incremental encoder (called
ABN encoder or ABZ encoder) has an individual number of incremental pulses per revolution. The number
of incremental pulses de ne the number of positions per revolution (PPR). The PPR might mean pulses
per revolution or periods per revolution. Instead of positions per revolution, some incremental encoder
vendors call these CPR counts per revolution.
The PPR parameter is the most important parameter of the incremental encoder interface. With that, it
forms a modulo (PPR) counter, counting from 0 to (PPR-1). Depending on the direction, it counts up or
down. The modulo PPR counter is mapped into the register bank as a dual ported register. The user can
overwrite it with an initial position. The ABN encoder interface provides both the electrical position and
the multi-turn position, which are accessible through dual-ported read-write registers.
Note The PPR parameter must be set exactly according to the used encoder.
Figure 20: Number of Pole Pairs NPP vs. mechanical angle phi_m and electrical angle phi_e
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 44 / 152
The goal of the initialization of an incremental encoder is to set it up so that the magnetic axis of the rotor
ts with the electrical angle phi_e with the angle zero on D axis. For this, one needs to know the number of
pole pairs NPP, the resolution of the incremental encoder in pulses per revolution PPR, and the orientation
between measured encoder angle of the rotor and the electrical angle of the eld orientation. An encoder
measures mechanical angle phi_m were the FOC needs the electrical angle phi_e for commutation. The
number of pole pairs NPP determines the ratio between mechanical angle phi_m and electrical angle
phi_e. The parameters phi_m_offset and phi_e_offset are for compensation of differences in orientation
angle by adjustments.
The N pulse from an encoder triggers either sampling of the actual encoder count to fetch the position
at the N pulse or it re-writes the fetched n position on an N pulse. The N pulse can either be used as
stand alone pulse or and-ed with NAB = N and A and B. It depends on the decoder what kind of N pulse
has to be used - either N or NAB. For those encoders with precise N pulse within one AB quadrant, the N
pulse must be used. For those encoders with N pulse over four AB quadrants the user can enhance the
precision of the N pulse position detection by using NAB instead of N.
Note Incremental encoders are available with N pulse and without N pulse.
The polarity of N pulse, A pulse and B pulse are programmable. The N pulse is for re-initialization with
each turn of the motor. Once fetched, the ABN decoder can be con gured to write back the fetched N
pulse position with each N pulse.
Note The ABN encoder interface has a direction bit to set to match wiring of motor to
direction of encoder.
Logical ABN = A and B and N might be useful for incremental encoders with low resolution N pulse to
enhance the resolution. On the other hand, for incremental encoders with high resolution N pulse a
logical ABN = A and B and N might totally suppress the resulting N pulse.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 45 / 152
Figure 22: Encoder ABN Timing - high precise N pulse and less precise N pulse
For commutating a motor with FOC, the user selects a position sensor source (digital incremental encoder,
digital Hall, analog Hall, analog incremental encoder, . . . ) that is mounted close to the motor. The inner
FOC loop controls torque and ux of the motor based on the measured phase currents and the electrical
angle of the rotor.
The TMC4671 is equipped with a secondary incremental encoder interface. This secondary encoder inter-
face is available as source for velocity control or position control. This is for applications where a motor
with a gearing positions an object.
Info The secondary incremental encoder is not available for commutation (phi_e) for
the inner FOC. In others words, there is no electrical angle phi_e selectable from
the secondary encoder.
4.6.4 Digital Hall Sensor Interface with optional Interim Position Interpolation
The digital Hall interface is the position sensor interface for digital Hall signals. The digital Hall signal
interface rst maps the digital Hall signals to an electrical position PHI_E_RAW. An offset PHI_E_OFFSET
can be used to rotate the orientation of the Hall signal angle. The electrical angle PHI_E is for commutation.
Optionally, the default electrical positions of the Hall sensors can be adjusted by writes into the associated
registers.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 46 / 152
Hall sensors give absolute positions within an electrical period with a resolution of 60° as 16 bit positions
(s16 resp. u16) PHI. With activated interim Hall position interpolation, the user gets high resolution interim
positions when the motor is running at a speed above 60 rpm.
For lower torque ripple the user can switch on the position interpolation of interim Hall positions. This
function is useful for motors that are compatible with sine wave commutation, but equipped with digital
Hall sensors. When the position interpolation is switched on, it becomes active on speeds above 60 rpm.
For lower speeds it automatically disables itself. This is especially important when the motor has to be at
rest. Hall sensor position interpolation might fail when Hall sensors are not properly placed in the motor.
Please adjust Hall sensor positions for this case.
Info Hall interpolation is not intended for positioning applications, especially not with
changes of direction. Please check errata section if you want to use hall interpo-
lation and positioning. When using interpolated angles PID_POSITION_ACTUAL
might glitch when direction is changed or the motor operates at very low velocity.
4.6.6 Digital Hall Sensors - Masking, Filtering, and PWM center sampling
Sometimes digital Hall sensor signals get disturbed by switching events in the power stage. The TMC4671
can automatically mask switching distortions by correct setting of the HALL_MASKING register. When a
switching event occurs, the Hall sensor signals are held for HALL_MASKING value times 10 ns. This way,
Hall sensor distortions are eliminated.
Uncorrelated distortions can be ltered via a digital lter of con gurable length. If the input signal to the
lter does not change for HALL_DIG_FILTER_LENGTH times 5 us, the signal can pass the lter. This lter
eliminates issues with bouncing Hall signals. naming with Elliot: Masking is better then Blanking
Spikes on Hall signals (Hx that stands for H1, H2, H3) disturb the FOC loop when Hall signals are used for
commutation or for initialization of incremental encoders. Spikes on hall signal lines might occur when
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 47 / 152
Hall signals are feed on singled ended signal lines in parallel to motor power lines due to electromagnetic
cross talk in a single cable. Long Hall signal lines might cause digital Hall signal cross talk even in separate
fed cables. Cables that provide Hall signals without spikes should be preferred. A good ground for digital
Hall signals is important for clean Hall signals. A good ground shield of the motor might help for clean Hall
signals. In best case, Hall signals are fed within separate shielded signal lines together with differential
line drivers.
Figure 24: Outline of noisy Hall signals (left) due to electromagnetic interference with PWM switching and noise
cleaned Hall signals (right) by PWM center synced sampling of Hall signal vector (H1 H2 H3)
The best is avoiding spikes on digital Hall signals. Nevertheless, to enable lower cost motors with lower
performance Hall signal shielding, the TMC4671 is equipped with Hall Signal spike suppression and PWM
centered Hall signal vector sampling.
To reduce possible current ripple that might be caused by noisy Hall signals, the sampling of the Hall signal
vector can be programmed for sampling once per PWM period at its center for the desired noise reduc-
tion. The PWM centered Hall signal sampling is programmable by HALL_MODE(4) control bit. Continuous
sampling is default. This function is not available for TMC4671-ES engineering samples.
The PWM center synchronization needs to be quali ed for high speed applications due to reduction of
Hall signals for PWM frequency. The PWM center might have an in uence on Hall signal interpolation and
needs to be quali ed if Hall signal interpolation is enabled.
For additional spike suppression, the TMC4671 is equipped with a digital hall signal blanking, to sup-
port lower performance cabling environments. The blank time for the Hall signals is programmable
(HALL_BLANK) in steps of 10 ns from 0 ns up to 4095 ns. The Hall signal blanking time should be pro-
grammed as long as necessary for safe suppression of spikes of maximum duration. On the other side,
the Hall signal blanking should be programmed as short as possible to avoid disturbance by too strong
ltering that might also disturbe the FOC.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 48 / 152
If a motor is equipped with both Hall sensors and incremental encoder, the Hall sensors can be used for
the initialization as a low resolution absolute position sensor. Later on, the incremental encoder can be
used as a high resolution sensor for commutation.
4.6.8 Analog Hall and Analog Encoder Interface (SinCos of 0° 90° or 0° 120° 240°)
An analog encoder interface is part of the decoder engine. It is able to handle analog position signals of 0°
and 90° and of 0° 120° 240°. The analog decoder engine adds offsets and scales the raw analog encoder
signals, while also calculating the electrical angle PHI_E from these analog position signals by an ATAN2
algorithm.
SIN/COS Hall
Track SIN
Track COS
An individual signed offset is added to each associated raw ADC channel and scaled by its associated
scaling factors according to
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 49 / 152
In addition, the AENC_OFFSET is for conversion of unsigned ADC values into signed ADC values as required
for the FOC.
Info The control bit 0 in register AENC_DECODER_MODE (0x3B) selects either process-
ing of analog position signals of 0° and 90° (0b0) or analog signals of 0° 120° 240°
on (0b1).
Figure 28: Analog Encoder (AENC) Selector & Scaler w/ Offset Correction
In Fig. 27 possible waveforms are shown. The graphs show usual SIN/COS track signals with one and mul-
tiple periods per revolution as well as typical waveforms of three phase analog Hall signals for one electri-
cal revolution. The number of periods per revolution can be con gured by register AENC_DECODER_PPR.
The position in one period (AENC_DECODER_PHI_A) is calculated by an ATAN2 algorithm. The periods
are counted with respect to the number of periods per revolution to calculate AENC_DECODER_PHI_E
and AENC_DECODER_PHI_M. If PPR is the same as the number of pole pairs, AENC_DECODER_PHI_E and
AENC_DECODER_PHI_A are identical. This is usually the case for analog hall signals.
Info The analog N pulse is just a raw ADC value. Handling of analog N pulse similar
to N pulse handling of digital encoder N pulse is not implemented for analog
encoder.
The extracted positions from the analog decoder are available for read out from registers.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 50 / 152
Electrical angles are mapped to a multi-turn position counter. The user can overwrite this multi-turn
position for initialization purposes.
The angle selector selects the source for the commutation angle PHI_E. That electrical angle is available
for commutation.
A register value written into the register bank via the application interface is available for commutation
as well. With this, the user can interface to any encoder by just writing positions extracted from external
encoder into this regulator. From the decoder engine point of view this is just one more selectable encoder
source.
The TMC4671 needs proper feedback for correct and stable operation. One main parameter is the com-
mutation angle offset PHI_E_OFFSET. This offset must not be calculated when an absolute sensor system
like analog or digital Hall sensors is used. All other supported feedback systems need to be initialized -
their PHI_E_OFFSETs need to be identi ed. The user has several options to determine PHI_E_OFFSET with
support of the TMC4671.
In the case of a free driving motor, the motor can be switched to Open-Loop Mode. In this mode, the
used commutation angle (PHI_OPEN_LOOP) can be used to match the measured PHI_E. This method is
supported by the TMCL-IDE.
The TMC4671 can calculate PHI_E_OFFSET very precisely at a Hall state change for a second encoder sys-
tem, when Hall sensors are correctly aligned. Therefore, the function needs to be enabled and calculate a
new offset at the next Hall state change. After disabling of the module, the process can be started again.
This function can also be used as a rough plausibility check during longer operation.
After determination of a correct offset, the value can be used again after power cycle. The encoder’s N
pulse can be used as reference for this. For starters the user can drive the motor in open-loop mode or
by using digital Hall sensor signals. After passing the encoder’s N pulse, the ABN encoder is initialized and
can be used for operation.
Servo control comprises position, velocity and current control. The position and the current are measured
by separate sensors. The actual velocity has to be calculated by time discrete differentiation from the
position signal. the user can choose a calculated position from the various encoder interfaces for velocity
measurement by parameter VELOCITY_SELECTION.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 51 / 152
The user can switch between two different velocity calculation algorithms with the parameter VELOC-
ITY_METER_SELECTION. Default setting (VELOCITY_METER_SELECTION = 0) is the standard velocity meter,
which calculates the velocity at a sampling rate of about 4369.067 Hz by differentiation. Output value is
displayed in rpm (revolutions per minute). This option is recommended for usage with the standard PI
controller structure.
By choosing the second option (VELOCITY_METER_SELECTION = 1), the sampling frequency is synchro-
nized to the PWM frequency. This option is recommended for usage with the advanced PI controller
structure. Otherwise, the controller structure might tend to be unstable due to non-matched sampling.
Velocity lters can be applied to reduce noise on velocity signals. Section 4.8 describes ltering opportu-
nities in detail.
The TMC4671 is equipped with three input pins for reference switches (REF_SW_L, REF_SW_H and REF_SW_R).
These pins can be used to determine three reference positions. The TMC4671 displays the status of the
reference switches in the register TMC_INPUTS_RAW and is able to store the actual position at rising edge
of the corresponding signal. The signal polarities are programmable and the module reacts only on tog-
gling the ENABLE register. The signals can be ltered with a con gurable digital lter, which suppresses
spike errors.
With the STATUS_FLAGS and STATUS_MASK register the STATUS output can be con gured as an IRQ for
passing a reference switch.
The actual position can be latched when passing a reference switch. The latched positions can be dis-
played in register INTERIM_DATA (0x6E). Register INTERIM_ADDR (0x6F) selects the data displayed in IN-
TERIM_DATA with HOME_POSITION at address 31, LEFT_POSITION at adress 32 and RIGHT_POSITION at
adress 33.
The position latching can be enabled via register CONFIG_DATA (0x4D) with CONFIG_ADDR (0x4E) set
to 51 (ref_switch_con g). Position latching is enabled by setting bit 0 of ref_switch_con g to 1.If a ref-
erence switched is passed the corresponding status bit (HOME_SWITCH_PASSED, LEFT_SWITCH_PASSED,
and RIGHT_SWITCH_PASSED) in REF_SWITCH_STATUS (INTERIM_DATA with INTERIM_ADDRESS = 30) is en-
abled. The bits can only be cleared by toggling/disabling the enable bit in ref_switch_con g.
Info The polarity registers do not affect the status registers. The status ag only rep-
resents the current logical state of the switch.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 52 / 152
The ENI (Enable input) can be used to start and stop control action. During reset ENO (Enable out) is low
and afterwards it forwards ENI signal. Thereby it can be used to enable the power stage. When ENI is low,
all controllers are deactivated and PWM operates at 50% duty cycle. ENI input value can be read through
TMC4671_INPUTS_RAW register.
4.7.2 PI Controllers
PI controllers are used for current control and velocity control. A P controller is used for position control.
The derivative part is not yet supported but might be added in the future. The user can choose between
two PI controller structures: The classic PI controller structure, which is also used in the TMC4670, and
the advanced PI controller structure. The advanced PI controller structure shows better performance in
dynamics and is recommended for high performance applications. User can switch between controllers
by setting register MODE_PID_TYPE. Controller type can not be switched individually for each cascade
level.
with
e = X_TARGET X (28)
where X_TARGET stands for target ux (s16), target torque (s16), target velocity (s32), or target position
(s32) with error e, which is the difference between target value and actual values. The Y stands for the
output of the PI controller feed as target input to the successive PI controller of the FOC servo controller
cascade (position ! PI ! velocity ! PI ! current ! PI ! voltage).
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 53 / 152
Table 20: Scalings and Change Rate Timings of PID controllers (classic structure) for currents, velocity, and
position for clock frequency fCLK = 25MHz
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 54 / 152
Info Changing the I-parameter of the classic PI controller during operation causes
the controller output to jump, as the control error is rst integrated and then
gained by the I parameter. Jumps can be avoided by incremental changes of
I-parameter.
Info Support for the TMC4671 is integrated into the TMCL-IDE including wizards for
set up and con guration. With the TMCL-IDE, con guration and operation can be
done in a few steps and the user gets direct access to all registers of the TMC4671.
with
e = X_TARGET X (30)
where X_TARGET represents target ux, target torque, target velocity, or target position with control error
e, which is the difference between target value and actual values. The time constant dt is set according
to the PWM period but can be downsampled for the position controller by register MODE_PID_SMPL.
Position controller evaluation can be downsampled by a constant factor when needed.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 55 / 152
Info The P Factor normalization as Q8.8 of the advanced PI controller of the TMC4671-
ES is selectable for the TMC4671-LA as either Q8.8 or Q4.12. This can be con g-
ured in register 0x4D CONFIG_DATA when register 0x4E CONFIG_ADDR is set to
0x3E. For more information refer to section 7.2. Using Q4.12 needs changes in
the user’s application controller software when using the Advanced PI position
controller.
The transfer function of the advanced PI controller can be described by the following pseudo code:
dXdT = e · P + integrator
(31)
integrator = integrator + P · I · e
P and I are either displayed as Q8.8 (P = P_FAK/256) or Q4.12 (P = P_FAK/4096). This is individually con g-
urable for each controller parameter in the controller cascade.
Downsampling of the advanced position controller can be con gured by register MODE_PID_SMPL. When
the register is 0 the controllers will sample on the PWM-frequency fPWM . The new samplerate will be de-
rived from fPWM and the downsampling-value assigned to register MODE_PID_SMPL (range: 0 to 127). The
derived sampling frequency is calculated as follows:
fPWM
Sampleratenew = (32)
downsampling + 1
The limiting of target values for PI controllers and output values of PI controllers is programmable. Per
power on default these limits are set to maximum values. During initialization, these limits should be set
properly for correct operation and clipping.
The target input is clipped to X_TARGET_LIMIT. The output of a PI controller is named dXdT because it gives
the desired derivative d/dt as a target value to the following stage: The position (x) controller gives velocity
(dx/dt). The output of the PI Controller is clipped to dXdT_LIMIT. The error integral of (27) is clipped to
dXdT_LIMIT / I in the classic controller structure, and the integrator output is clipped to dXdT_output_limit
in the advanced controller structure.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 56 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 57 / 152
For the position regulator, the P part is represented as q4.12 to be compatible with the high resolution
positions - one single rotation is handled as an s16. For the advanced controller structure the P part is
represented by q8.8.
The inner FOC loop ( gure 32) controls the ux current to the ux target value and the torque current
to the desired torque target. The inner FOC loop performs the desired transformations according to
gure 33 for 3-phase motors (FOC3). For 2-phase motors (FOC2) both Clarke (CLARKE) transformation
and inverse Clarke (iCLARKE) are bypassed. For control of DC motors, transformations are bypassed and
only the rst full bridge (connected to X1 and X2) is used.
The inner FOC control loop gets a target torque value (I_Q_TARGET) which represents acceleration, the ro-
tor position, and the measured currents as input data. Together with the programmed P and I parameters,
the inner FOC loop calculates the target voltage values as input for the PWM engine.
4.7.10 FOC Transformations and PI(D) for control of Flux & Torque
The Clarke transformation (CLARKE) maps three motor phase currents (IU , IV , IW ) to a two-dimensional
coordinate system with two currents (I↵ , I ). Based on the actual rotor angle determined by an encoder
or via sensorless techniques, the Park transformation (PARK) maps these two currents to a quasi-static
coordinate system with two currents (ID , IQ ). The current ID represents ux and the current IQ represents
torque. The ux just pulls on the rotor but does not affect torque. The torque is affected by IQ . Two PI
controllers determine two voltages (UD , UQ ) to drive desired currents for a target torque and a target
ux. The determined voltages (UD , UQ ) are re-transformed into the stator system by the inverse Park
transformation (iPARK). The inverse Clarke Transformation (iCLARKE) transforms these two currents into
three voltages (UU , UV , UW ). Theses three voltage are the input of the PWM engine to drive the power
stage.
In case of the FOC2, Clarke transformation CLARKE and inverse Clarke Transformation iCLARKE are skipped.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 58 / 152
Figure 33: FOC3 Transformations (FOC2 just skips CLARKE and iCLARKE)
The user can operate the TMC4671 in several motion modes. Standard motion modes are position control,
velocity control and torque control, where target values are fed into the controllers via register access. The
motion mode UD_UQ_EXTERN allows the user to set voltages for open-loop operation and for tests during
setup.
In position control mode, the user can feed the step and direction interface to generate a position target
value for the controller cascade. In additional motion modes target values are fed into the TMC4671 via
PWM interface (Pin: PWM_IN) or analog input via pin AGPI_A.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 59 / 152
There are additional motion modes, which are using input from the PWM_I input or the AGPI_A input.
Input signals can be scaled via a standard scaler providing offset and gain correction. The interface can
be con gured via the registers SINGLE_PIN_IF_OFFSET_SCALE and SINGLE_PIN_IF_STATUS_CFG, where the
status of the interface can be monitored as well. PWM input signals which are out of frequency range can
be neglected. In case of wrong input data, last correct position is used or velocity and torque are set to
zero.
During regenerative braking of the motor, current is driven into the DC link. If the power frontend is not
actively controlled, the DC link voltage will rise. The brake chopper output pin (BRAKE) can be used for
control of an external brake chopper, which burns energy over a brake resistor. The BRAKE pin is set to
high for a complete PWM cycle if measured voltage is higher then ADC_VM_LIMIT_HIGH. Once active it will
be deactivated when voltage drops below ADC_VM_LIMIT_LOW. This acts like a hysteresis. BRAKE can be
deactivated by setting both registers to Zero. By setting proper values in the registers it is automatically
enabled.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 60 / 152
The TMC4671 uses standard biquad lters (standard IIR lter of second order, Wikipedia Article) in the
following structure.
Y(n) = X(n) · b_0 + X(n-1) · b_1 + X(n-2) · b_2 + Y(n-1) · a_1 + Y(n-2) · a_2 (33)
In this equation X(n) is the actual input sample, while Y(n-1) is the lter output of the last cycle. All coe -
cients are S32 values and are normalized to a Q3.29 format. Users must take care of correct parametriza-
tion of the lter. There is no built-in plausibility or stability check. All lters can be disabled or enabled
via register access. Biquad state variables are reset when parameters are changed. The TRINAMIC IDE
supports parametrization with wizards.
A standard biquad lter has the following transfer function in the Laplace-Domain:
The transfer function needs to be transformed to time discrete domain by Z-Transformation and coe -
cients need to be normalized. This is done by the following equations.
while T is the sampling time according to PWM_MAX_COUNT · 10 ns and variables with index z are auxiliary
variables.
A standard second order lowpass lter with given cutoff frequency !c and damping factor D has the fol-
lowing transfer function in the Laplace-Domain:
1
GLP (s) = 1 2D
(45)
!c2 · s2 + !c ·s+1
Users can determine lter coe cients with the upper equations by comparing coe cients of both transfer
functions. The TMCL-IDE also provides a dimensioning tool.
There are four biquad lters in the control structure. Figure 35 illustrates their placement in the control
structure.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 61 / 152
The biquad lter for the position target value is intended to be used as a low-pass lter for smoothening
position input to the control structure. It is evaluated in every PWM cycle, or down-sampled according to
the down-sampling factor for the position controller. After powering on it is disabled.
The biquad lter for the ux target value is also intended to be used as a low-pass lter for input values
from the user’s microcontroller. Sampling frequency is xed to the PWM frequency.
The biquad lter for the torque target value can be used as a low-pass lter for bandwidth limitation
and noise suppression. Moreover, it can be designed to suppress a resonance or anti-resonance. Same
statements are correct for the velocity biquad lter. Both lters’ sampling times are xed to the PWM
period.
The velocity target value biquad is con gured as a second order low-pass with a cutoff frequency at 200 Hz
- by default at a sampling frequency of 25 kHz. Biquad lters can be activated separately.
By using the standard velocity measurement algorithm, the default velocity lter is enabled and can not
be switched off. The standard velocity lter is a low-pass lter with a cutoff frequency of 20 Hz (slope of
-20 dB/Decade). In this con guration, a new velocity is calculated at a sample rate of approx. 4369.067 Hz.
This con guration is intended to be used in low-performance applications with a simple position feedback
system like digital Hall sensors.
Note Software feed forward control via offset registers is recommended, due to miss-
ing ampli cation possibility. Utilize feedforward to actively increase the tar-
get value of a controller besides the normal target input. For Torque/Flux use
register 0x65 PID_TORQUE_FLUX_OFFSET and for the velocity use register 0x67
PID_VELOCITY_OFFSET.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 62 / 152
The ease-of-use PWM engine requires just a couple of parameter settings. Primarily, the polarities for the
gate control signal of high-side and low-side must be set. The power on default PWM mode is 0, meaning
PWM = OFF. For operation, the centered PWM mode must be switched on by setting the PWM mode to 7.
A single bit switches the space vector PWM (SVPWM) on. For 3-phase PMSM, the SVPWM = ON gives more
effective voltage. Nevertheless, for some applications it makes sense to switch the SVPWM = OFF to keep
the star point voltage of a motor almost at rest.
The PWM polarities register (PWM_POLARITIES) controls the polarities of the logic level gate control sig-
nals. The polarities of the gate control signals are individually programmable for low-side gate control
and for high-side gate control. The PWM polarities register controls the polarity of other control sig-
nals as well. PWM_POLARITIES[1] controls the polarity of the logic level high side gate control signal.
PWM_POLARITIES[0] controls the polarity of the logic level low side gate control signal.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 63 / 152
The PWM engine of the TMC4671 has eight gate control outputs to control up to four power MOS half
bridges. For three-phase motors three half bridges are used (U, V, W). For two-phase stepper motors four
half bridges are used for (U, V, W, Y). For DC motor control, the rst two half bridges (U, V) are used.
Gate Control Signals FOC3: 3 Phase Motor FOC2: 2 Phase Stepper FOC1: Single Phase DC Motor
PWM_UX1_H
U X1 X1
PWM_UX1_L
PWM_VX2_H
V X2 X2
PWM_VX2_L
PWM_WY1_H
W Y1 -
PWM_WY1_L
PWM_Y2_H
- Y2 -
PWM_Y2_L
For the DC motor current control (here named FOC1), the number of pole pairs is not relevant - in contrast
to closed loop current control of two-phase stepper motors (FOC2) and three-phase permanent magnet
motors (FOC3). For DC motor control, the number of pole pairs should be set to 1 to equal mechanical
angle and electrical angle for velocity control and for position control.
Figure 37: FOC3 (three phase motor), FOC2 (two phase stepper motor), FOC1 (single phase DC motor)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 64 / 152
The PWM counter maximum length register PWM_MAXCNT controls the PWM frequency. For a clock
frequency fCLK = 25 MHz, the PWM frequency fPWM[Hz] = (4.0 · fCLK [Hz]) / (PWM_MAXCNT + 1). With
fCLK = 25 MHz and power-on reset (POR) default of PWM_MAXCNT=3999, the PWM frequency fPWM =
25 kHz.
Note The PWM frequency is the fundamental frequency of the control system. It can
be changed at any time, also during motion for the classic PI controller structure.
The advanced PI controller structure is tied to the PWM frequency and integra-
tor gains have to be changed. Please make sure to set current measurement
decimation rates to t PWM period in high performance applications.
The base resolution of the PWM is 12 bit internally mapped to 16 bit range. The minimal PWM increment
is 20ns due to the symmetrical PWM with 100 MHz counter frequency. MAX_PWMCNT = 4095 gives the
full resolution of 12 bit with ⇡ 25 kHz w/ fCLK=25 MHz. MAX_PWMCNT=2047 results in 11 bit resolution,
but with ⇡ 50kHz w/ fCLK=25 MHz. So the PWM_MAXCNT de nes the PWM frequency, but also affects the
resolution of the PWM.
The power-on reset (POR) default of the PWM is OFF. The standard PWM scheme is the centered PWM.
Passive braking and freewheeling modes are available on demand. Please refer to section 7 concerning
the settings.
One register controls BBM time for the high side, another register controls BBM time for the low side. The
BBM times are programmable in 10 ns steps. The BBM time can be set to zero for gate drivers that have
their own integrated BBM timers.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 65 / 152
Info Measured BBM times at MOS-FET gates differ from programmed BBM times due
to driver delays and possible additional gate driver BBM times. The programmed
BBM times are for the digital control signals.
Note Too short BBM times cause electrical shortcuts of the MOS-FET bridges - so called
shoot through - that short the power supply and might damage the power stage
and the power supply.
A single bit enables the Space Vector PWM (SVPWM). No further settings are required for the space vector
PWM - just ON or OFF. The power on default for the SVPWM is OFF. Space Vector PWM can be enabled
to maximize voltage utilization in the case of an isolated star point of the motor. If the star point is not
isolated, SVPWM might cause unintended current ows through the star point. Space Vector PWM is only
used for three-phase motors. For other motors the SVPWM must be switched off.
Note For engineering samples TMC4671-ES, the Space Vector PWM does not allow
higher voltage utilization. This is xed for the release version TMC4671-LA.
The TMC4671 displays voltages and currents as integer values. The following tables show how one can
convert integer values to real values, see table 25, and the other way round, see table 26. Equation 2
in section 4.5.0.1 describes the chain of gains and introduces ADC_GAIN. This variable depends on resis-
tance of the shuntresistor as well as the properties of the senseampli er. It is needed for the current
conversions. The voltage conversion depends on the supply voltage VM .
Senseamps and their respective shunt resistors can deviate in their properties due to part tolerances or
aging. However, their values must still be comparable. This is done by using a scaling factor for both ADCs
in order to harmonize their signals.
ADC_SCALE
ADC_GAINscaled = (ADC_GAIN · ) (46)
256
integer to real
Iuvw,real
Iuvw,s16
ADC_GAINscaled
I↵
I↵ ,s16
,real ADC_GAINscaled
Idq,real
Idq,s16
ADC_GAINscaled
Udq,real Udq,s16 · VM
215
U↵ ,real U↵ ,s16 · VM
215
FOCuvw,real FOCuvw,s16 · VM
215
PWMuvw,real PWMuvw,s16 · VM
215
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 66 / 152
real to integer
Iuvw,s16 Iuvw,real · ADC_GAINscaled
I↵ ,s16 I↵ ,real · ADC_GAINscaled
Idq,s16 Idq,real · ADC_GAINscaled
215
Udq,s16 Udq,real · VM
215
U↵ ,s16 U↵ ,real · VM
215
FOCuvw,s16 FOCuvw,real · VM
215
PWMuvw,s16 PWMdq,real · VM
The PWM value de nes the outputvoltage. It is calculated using the content of register INTERIM_DATA
while INTERIM_ADDR is 0x11 or 0x12. The s16 PWM value is converted to an u16 value by adding 0x8000.
Equation 47 applies for the highside PWM when connected to a DC- or Stepper-motor as well as the three
phases of a BLDC-motor when spacevector pwm is inactive:
VM
Uclamp = (PWMuvw,s16 + 0x8000) · (47)
216
Equation 48 describes the outputvoltage on the clamps for the lowside PWM when connected to a DC- or
Stepper-motor:
VM
Uclamp = ( PWMuxwy,s16 + 0x8000) · 16 (48)
2
The following equation describes the integer to real transformation for three-phase spacevector-PWM:
5 Safety Functions
Different safety functions are integrated and mapped to status bits. A programmable mask register se-
lects bits for activation of the STATUS output.
Internal hardware limiters for real time clipping and monitoring of interim values are available. LIMIT or
LIMITS is part of register names of registers associated to internal limiters. Please refer to table 27.
Bit Source
0 pid_x_target_limit
1 pid_x_target_ddt_limit
2 pid_x_errsum_limit
3 pid_x_output_limit
4 pid_v_target_limit
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 67 / 152
5 pid_v_target_ddt_limit
6 pid_v_errsum_limit
7 pid_v_output_limit
8 pid_id_target_limit
9 pid_id_target_ddt_limit
10 pid_id_errsum_limit
11 pid_id_output_limit
12 pid_iq_target_limit
13 pid_iq_target_ddt_limit
14 pid_iq_errsum_limit
15 pid_iq_output_limit
16 ipark_cirlim_limit_u_d
17 ipark_cirlim_limit_u_q
18 ipark_cirlim_limit_u_r
19 not_PLL_locked
20 ref_sw_r
21 ref_sw_h
22 ref_sw_l
23 ——-
24 pwm_min
25 pwm_max
26 adc_i_clipped
27 adc_aenc_clipped
28 ENC_N
29 ENC2_N
30 AENC_N
31 reserved
All controllers have input limiters as offsets can be added to target values and they can be limited to
remain in certain ranges. Also all controller outputs can be limited and the integrating parts (error sum)
of the PI controllers are also limited to controller outputs. If d/dt-limiters are enabled they are also capable
of limiting target values.
If one of these limiters gets active, the ag will go to high state. This is usually a normal operation, when
controllers are working on the borders of their working area. With STATUS_MASK register corresponding
ags can be activated.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 68 / 152
Other status ags go to high state whether the voltage limitation is reached (circular limiter in iPark trans-
formation) or PWM is saturated (pwm_min and pwm_max). This is also usual operation as the current
controller has to deal with voltage limitation at high velocity operation.
The user can also use the status output to generate an IRQ on reference switch or N-channel of encoder.
Also ADC clipping can be monitored which is a good indicator of wrong or faulty behavior.
Remaining wd_error status ag indicates an error on the clock input of the TMC4671 (see following sec-
tion).
Status ags register can be written directly. It is not possible to clear individual bits.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 69 / 152
Note TRINAMIC recommends to use a TMC4671 evaluation kit together with the TMCL-
IDE with its integrated wizards for initial evaluation and setup.
In order to create own application software please check TRINAMIC’s API to reduce software development
efforts.
In case of DC motor, the mechanical commutator of the DC motor realizes something like mechanical eld
oriented control where the TMC4671 just realizes closed loop current control of the DC motor. From FOC
point of view, the FOC converts a brushless motor (BLDC) resp. Permanent Magnet Synchronous Motor
(PMSM) into a closed loop current controlled DC motor.
From closed loop velocity control point of view and from closed loop position control point of view there
is no difference between electronically FOC controlled BLDC motor or PMSM motor and a mechanical
commutated DC motor with electronic closed loop current control.
The TMC4671 is able to turn a two-phase stepper motor with FOC by internal skip of Clarke transformation
and iClarke transformation. A special feature of stepper motors is the high number of pole pairs (NPP)
that are typical 50. For stepper motors it is usual to give the number of full steps (FS) per revolution, with
NPP = (FS/revolution) / 4. A stepper with 200 full steps per revolution has 50 pole pairs.
6.1.3 FOC3 Setup - How to Turn a Three Phase Motor (PMSM or BLDC)
A three phase motor is the classical FOC controlled brushless motor. Users have to take care concerning
number of pole pairs (NPP) and the number of poles (NP) with NPP = NP/2.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 70 / 152
For starters, the motor should be turned open loop to measure ADC offsets and set ADC scaler offset.
Additionally, the open loop turn is useful to validate (or to determine) the association between motor
phase currents and motor phase terminal voltages. This association is essential for the FOC. With proper
ADC channel selection setup, voltage U_UX1 is in phase with current I_UX1, voltage U_VX2 is in phase
with current I_VX2, and voltage U_WY1 is in phase with I_WY1. For two phase stepper motor, the voltage
U_Y2 is in phase with current I_Y2. Only two currents are measured and the other current is calculated by
TMC4671. For DC motor only one current is measured.
For absolute position sensors like Hall sensors, the phase shift an the direction of rotation only need to
be determined once initially. For relative position sensors, like incremental encoders, the direction of
turning needs to be determined everytime after power cycle. The relative orientation between measured
incremental encoder angle and rotor angle needs to be determined on each power-up.
One sensor needs to be selected for the FOC to measure the electrical angle PHI_E. This sensor is used
for the inner closed loop control loop for closed loop current control.
One sensor needs to be selected for measurement of velocity. This can be the sensor selected for mea-
surement of PHI_E but it is more common to use the mechanical angle PHI_M for measurement of velocity.
Using electrical angles can give advantages for applications with slow motion for NPP more than one be-
cause the minimum velocity in RPM [revolutions per minute] is one and the electrical angles have higher
speed than mechanical angles.
One sensor needs to be selected for measurement of position of the rotor, the angle of the rotor. This can
be the sensor selected for measurement PHI_E but it is more usual to use the mechanical angle PHI_M for
measurement of position. For stepper motors it might make sense to select the electrical angle PHI_E for
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 71 / 152
positioning to have a bene t from higher resolution using electrical angles. This is because each period -
electrical or mechanical - is normalized to 216 = 65536 positions.
7 Register Map
The TMC4671 has an register address range of 128 addresses with registers up to 32 bit data width. Some
registers hold 32 bit data elds, some hold 2 x 16 bit data leds and other hold combinations of different
data elds with individual data types. Data elds need to extracted by masking and shifting after read from
a TMC4671 register within the application. Data elds need to be composed by masking and shifting by
the application before writing into a TMC4671 register. Please check TRINAMIC’s API to reduce software
development efforts. This section describes the register bank of the TMC4671.
Section 7.1 gives an overview over all registers. It is is intended to give an initial over view of all registers.
Section 7.2 is the detailed reference of all registers and the register elds.
Section 7.3 gives the description of power-on-reset default values of all registers.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 72 / 152
The TMC4671 has an address space of 128 addresses. In order to display more then 128 registers, so called
stacked registers were added. These are CHIPINFO_DATA, ADC_RAW_DATA, PID_ERROR_DATA, CONFIG_DATA
and INTERIM_DATA. These data registers display or give access to different subregisters according to their
corresponding address registers (CHIPINFO_ADDR, ADC_RAW_ADDR, PID_ERROR_ADDR, CONFIG_ADDR
and INTERIM_ADDR). Read access to a subregister requires a write access to address register and a read
access to the data register.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 73 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 74 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 75 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 76 / 152
DATA TYPE
ADDR NAME (BIT MASK) FUNCTION
0x00h CHIPINFO_DATA This register displays name and
version information of the ac-
cessed IC. It can be used for test
of communication.
SI_TYPE u32(31:0) 0: Hardware type (ASCII).
SI_VERSION u32(31:0) 0: Hardware version (u16.u16).
SI_DATE u32(31:0) 0: Hardware date (nibble wise
date stamp yyyymmdd).
SI_TIME u32(31:0) 0: Hardware time (nibble wise
time stamp –hhmmss)
SI_VARIANT u32(31:0)
SI_BUILD u32(31:0)
0x01h CHIPINFO_ADDR This register is used to change
displayed information in register
CHIPINFO_DATA.
CHIP_INFO_ADDRESS u8(7:0) 0: SI_TYPE
1: SI_VERSION
2: SI_DATE
3: SI_TIME
4: SI_VARIANT
5: SI_BUILD
0x02h ADC_RAW_DATA This registers displays ADC val-
ues. Th displayed registers can be
switched by register ADC_RAW_
ADDR.
ADC_I0_RAW u16(15:0) Raw phase current I0
ADC_I1_RAW u16(31:16) Raw phase current I1
ADC_VM_RAW u16(15:0) Raw supply voltage value.
ADC_AGPI_A_RAW u16(31:16) Raw analog gpi A value.
ADC_AGPI_B_RAW u16(15:0) Raw analog gpi B value.
ADC_AENC_UX_RAW u16(31:16) Raw analog encoder signal.
ADC_AENC_VN_RAW u16(15:0) Raw analog encoder signal.
ADC_AENC_WY_RAW u16(31:16) Raw analog encoder signal.
0x03h ADC_RAW_ADDR This register is used to change
displayed information in register
ADC_RAW_DATA.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 77 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 78 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 79 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 80 / 152
6: VDD/4
7: 3*VDD/4
ADC_I1 u4(7:4) 0: INP vs. INN
1: GND vs. INN
2: VDD/4
3: 3*VDD/4
4: INP vs. GND
5: VDD/2
6: VDD/4
7: 3*VDD/4
ADC_VM u4(11:8) 0: INP vs. INN
1: GND vs. INN
2: VDD/4
3: 3*VDD/4
4: INP vs. GND
5: VDD/2
6: VDD/4
7: 3*VDD/4
ADC_AGPI_A u4(15:12) 0: INP vs. INN
1: GND vs. INN
2: VDD/4
3: 3*VDD/4
4: INP vs. GND
5: VDD/2
6: VDD/4
7: 3*VDD/4
ADC_AGPI_B u4(19:16) 0: INP vs. INN
1: GND vs. INN
2: VDD/4
3: 3*VDD/4
4: INP vs. GND
5: VDD/2
6: VDD/4
7: 3*VDD/4
ADC_AENC_UX u4(23:20) 0: INP vs. INN
1: GND vs. INN
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 81 / 152
2: VDD/4
3: 3*VDD/4
4: INP vs. GND
5: VDD/2
6: VDD/4
7: 3*VDD/4
ADC_AENC_VN u4(27:24) 0: INP vs. INN
1: GND vs. INN
2: VDD/4
3: 3*VDD/4
4: INP vs. GND
5: VDD/2
6: VDD/4
7: 3*VDD/4
ADC_AENC_WY u4(31:28) 0: INP vs. INN
1: GND vs. INN
2: VDD/4
3: 3*VDD/4
4: INP vs. GND
5: VDD/2
6: VDD/4
7: 3*VDD/4
0x0Dh AENC_0_SCALE_OFFSET This register is used to set calibra-
tion data for ADC channel AENC 0
(Offset and amplitude correction).
AENC_0_OFFSET u16(15:0) Offset for Analog Encoder ADC
channel 0.
AENC_0_SCALE s16(31:16) Scaling factor for Analog Encoder
ADC channel 0.
0x0Eh AENC_1_SCALE_OFFSET This register is used to set calibra-
tion data for ADC channel AENC 1
(Offset and amplitude correction).
AENC_1_OFFSET u16(15:0) Offset for Analog Encoder ADC
channel 1.
AENC_1_SCALE s16(31:16) Scaling factor for Analog Encoder
ADC channel 1.
0x0Fh AENC_2_SCALE_OFFSET This register is used to set calibra-
tion data for ADC channel AENC 2
(Offset and amplitude correction).
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 82 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 83 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 84 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 85 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 86 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 87 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 88 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 89 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 90 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 91 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 92 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 93 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 94 / 152
26: biquad_f_a_2
28: biquad_f_b_0
29: biquad_f_b_1
30: biquad_f_b_2
31: biquad_f_enable
32: prbs_amplitude
33: prbs_down_sampling_ratio
51: ref_switch_con g
52: Encoder_Init_hall_Enable
60: SINGLE_PIN_IF_STATUS_CFG
61: SINGLE_PIN_IF_SCALE_OFFSET
62: ADVANCED_PI_REPRESENT.
0x50h VELOCITY_SELECTION This register is used to select an
angle signal for the velocity con-
trol loop and velocity calculation.
VELOCITY_SELECTION u8(7:0) Selects the source of the velocity
source for velocity measurement.
0: PHI_E_SELECTION
1: phi_e_ext
2: phi_e_openloop
3: phi_e_abn
4: reserved
5: phi_e_hal
6: phi_e_aenc
7: phi_a_aenc
8: reserved
9: phi_m_abn
10: phi_m_abn_2
11: phi_m_aenc
12: phi_m_hal
VELOCITY_METER_SELECTION u8(15:8) 0: default
1: advanced
0x51h POSITION_SELECTION This register is used to select an
angle signal for the position calcu-
lation and control loop.
POSITION_SELECTION u8(7:0) 0: phi_e selected via PHI_E_
SELECTION
1: phi_e_ext
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 95 / 152
2: phi_e_openloop
3: phi_e_abn
4: reserved
5: phi_e_hal
6: phi_e_aenc
7: phi_a_aenc
8: reserved
9: phi_m_abn
10: phi_m_abn_2
11: phi_m_aenc
12: phi_m_hal
0x52h PHI_E_SELECTION This register is used to select an
angle signal for FOC transforma-
tion as electrical angle of the mo-
tor.
PHI_E_SELECTION u8(7:0) 0: reserved
1: phi_e_ext
2: phi_e_openloop
3: phi_e_abn
4: reserved
5: phi_e_hal
6: phi_e_aenc
7: phi_a_aenc
0x53h PHI_E This register displays the actual
chosen electrical angle value.
PHI_E s16(15:0) Angle used for the inner FOC loop.
0x54h PID_FLUX_P_FLUX_I This registers sets control param-
eters for ux controller.
PID_FLUX_I s16(15:0)
PID_FLUX_P s16(31:16)
0x56h PID_TORQUE_P_TORQUE_I This registers sets control param-
eters for torque controller.
PID_TORQUE_I s16(15:0)
PID_TORQUE_P s16(31:16)
0x58h PID_VELOCITY_P_VELOCITY_I This registers sets control param-
eters for velocity controller.
PID_VELOCITY_I s16(15:0)
PID_VELOCITY_P s16(31:16)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 96 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 97 / 152
7: prbs_position_mode
8: uq_ud_ext
9: reserved
10: AGPI_A torque_mode
11: AGPI_A velocity_mode
12: AGPI_A position_mode
13: PWM_I torque_mode
14: PWM_I velocity_mode
15: PWM_I position_mode
MODE_PID_SMPL u7(30:24)
MODE_PID_TYPE bit(31) 0: parallel/classic PI
1: sequential/advanced PI
0x64h PID_TORQUE_FLUX_TARGET Target values for torque and ux
controllers in torque mode.
PID_FLUX_TARGET s16(15:0)
PID_TORQUE_TARGET s16(31:16)
0x65h PID_TORQUE_FLUX_OFFSET Offsets for software torque and
ux control loop inputs for feed-
forward control.
PID_FLUX_OFFSET s16(15:0) Flux offset for feed forward con-
trol.
PID_TORQUE_OFFSET s16(31:16) Torque offset for feed forward
control.
0x66h PID_VELOCITY_TARGET Target velocity value for velocity
controller in velocity mode.
PID_VELOCITY_TARGET s32(31:0) Target velocity register (for veloc-
ity mode).
0x67h PID_VELOCITY_OFFSET Offset velocity value for velocity
controller in velocity and position
mode.
PID_VELOCITY_OFFSET s32(31:0) Velocity offset for feed forward
control.
0x68h PID_POSITION_TARGET Target position value for position
controller in position mode.
PID_POSITION_TARGET s32(31:0) Target position register (for posi-
tion mode).
0x69h PID_TORQUE_FLUX_ACTUAL Target position offset value for po-
sition controller in position mode.
PID_FLUX_ACTUAL s16(15:0)
PID_TORQUE_ACTUAL s16(31:16)
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 98 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 99 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 100 / 152
PID_VELOCITY_TARGET_DIV256 s16(31:16)
PID_VELOCITY_ACTUAL_LSB s16(15:0)
PID_VELOCITY_TARGET_LSB s16(31:16)
PID_POSITION_ACTUAL_DIV256 s16(15:0)
PID_POSITION_TARGET_DIV256 s16(31:16)
PID_POSITION_ACTUAL_LSB s16(15:0)
PID_POSITION_TARGET_LSB s16(31:16)
FF_VELOCITY s32(31:0)
FF_TORQUE s16(15:0)
ACTUAL_VELOCITY_PPTM s32(31:0)
REF_SWITCH_STATUS u16(15:0)
HOME_POSITION s32(31:0)
LEFT_POSITION s32(31:0)
RIGHT_POSITION s32(31:0)
ENC_INIT_HALL_STATUS u16(15:0)
ENC_INIT_HALL_PHI_E_ABN_OFFSET u16(15:0)
ENC_INIT_HALL_PHI_E_AENC_OFFSET u16(15:0)
ENC_INIT_HALL_PHI_A_AENC_OFFSET u16(15:0)
SINGLE_PIN_IF_TARGET_TORQUE s16(15:0)
SINGLE_PIN_IF_PWM_DUTY_CYCLE s16(31:16)
SINGLE_PIN_IF_TARGET_VELOCITY s32(31:0)
SINGLE_PIN_IF_TARGET_POSITION s32(31:0)
0x6Fh INTERIM_ADDR Sets function of register INTERIM_
DATA.
INTERIM_ADDR u8(7:0) 0: PIDIN_TARGET_TORQUE
1: PIDIN_TARGET_FLUX
2: PIDIN_TARGET_VELOCITY
3: PIDIN_TARGET_POSITION
4: PIDOUT_TARGET_TORQUE
5: PIDOUT_TARGET_FLUX
6: PIDOUT_TARGET_VELOCITY
7: PIDOUT_TARGET_POSITION
8: FOC_IWY_IUX
9: FOC_IV
10: FOC_IB_IA
11: FOC_IQ_ID
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 101 / 152
12: FOC_UQ_UD
13: FOC_UQ_UD_LIMITED
14: FOC_UB_UA
15: FOC_UWY_UUX
16: FOC_UV
17: PWM_WY_UX
18: PWM_UV
19: ADC_I1_I0
20: PID_TORQUE_TARGET_FLUX_
TARGET_TORQUE_ACTUAL_FLUX_
ACTUAL_DIV256
21: PID_TORQUE_TARGET_
TORQUE_ACTUAL
22: PID_FLUX_TARGET_FLUX_
ACTUAL
23: PID_VELOCITY_TARGET_
VELOCITY_ACTUAL_DIV256
24: PID_VELOCITY_TARGET_
VELOCITY_ACTUAL
25: PID_POSITION_TARGET_
POSITION_ACTUAL_DIV256
26: PID_POSITION_TARGET_
POSITION_ACTUAL
27: FF_VELOCITY
28: FF_TORQUE
29: ACTUAL_VELOCITY_PPTM
30: REF_SWITCH_STATUS
31: HOME_POSITION
32: LEFT_POSITION
33: RIGHT_POSITION
34: ENC_INIT_HALL_STATUS
35: ENC_INIT_HALL_PHI_E_ABN_
OFFSET
36: ENC_INIT_HALL_PHI_E_AENC_
OFFSET
37: ENC_INIT_HALL_PHI_A_AENC_
OFFSET
42: SINGLE_PIN_IF_PWM_DUTY_
CYCLE_TORQUE_TARGET
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 102 / 152
43: SINGLE_PIN_IF_VELOCITY_
TARGET
44: SINGLE_PIN_IF_POSITION_
TARGET
0x75h ADC_VM_LIMITS Sets supply voltage limits for
brake chopper output action.
ADC_VM_LIMIT_LOW u16(15:0) Low limit for brake chopper out-
put BRAKE_OUT.
ADC_VM_LIMIT_HIGH u16(31:16) High limit for brake chopper out-
put BRAKE_OUT.
0x76h TMC4671_INPUTS_RAW Displays actual input signals of
IC for monitoring and connection
testing.
A of ABN_RAW bit(0) A of ABN_RAW
0: off
1: on
B of ABN_RAW bit(1) B of ABN_RAW
0: off
1: on
N of ABN_RAW bit(2) N of ABN_RAW
0: off
1: on
- bit(3) —
0: off
1: on
A of ABN_2_RAW bit(4) A of ABN_2_RAW
0: off
1: on
B of ABN_2_RAW bit(5) B of ABN_2_RAW
0: off
1: on
N of ABN_2_RAW bit(6) N of ABN_2_RAW
0: off
1: on
- bit(7) —
0: off
1: on
HALL_UX of HALL_RAW bit(8) HALL_UX of HALL_RAW
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 103 / 152
0: off
1: on
HALL_V of HALL_RAW bit(9) HALL_V of HALL_RAW
0: off
1: on
HALL_WY of HALL_RAW bit(10) HALL_WY of HALL_RAW
0: off
1: on
- bit(11) —
0: off
1: on
REF_SW_R_RAW bit(12) REF_SW_R_RAW
0: off
1: on
REF_SW_H_RAW bit(13) REF_SW_H_RAW
0: off
1: on
REF_SW_L_RAW bit(14) REF_SW_L_RAW
0: off
1: on
ENABLE_IN_RAW bit(15) ENABLE_IN_RAW
0: off
1: on
STP of DIRSTP_RAW bit(16) STP of DIRSTP_RAW
0: off
1: on
DIR of DIRSTP_RAW bit(17) DIR of DIRSTP_RAW
0: off
1: on
PWM_IN_RAW bit(18) PWM_IN_RAW
0: off
1: on
- bit(19) —
0: off
1: on
HALL_UX_FILT bit(20) ESI_0 of ESI_RAW
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 104 / 152
0: off
1: on
HALL_V_FILT bit(21) ESI_1 of ESI_RAW
0: off
1: on
HALL_WY_FILT bit(22) ESI_2 of ESI_RAW
0: off
1: on
- bit(23) —
0: off
1: on
- bit(24) CFG_0 of CFG
0: off
1: on
- bit(25) CFG_1 of CFG
0: off
1: on
- bit(26) CFG_2 of CFG
0: off
1: on
- bit(27) CFG_3 of CFG
0: off
1: on
PWM_IDLE_L_RAW bit(28) PWM_IDLE_L_RAW
0: off
1: on
PWM_IDLE_H_RAW bit(29) PWM_IDLE_H_RAW
0: off
1: on
- bit(30) DRV_ERR_IN_RAW
0: off
1: on
- bit(31) —
0: off
1: on
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 105 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 106 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 107 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 108 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 109 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 110 / 152
7.3 Register Map - Defaults, Data Fields (Bit Masks), min, max
R 0x02h ADC_RAW_DATA
ADC_I0_RAW 0x0h 0x0h 0xFFFFh
ADC_I1_RAW 0x0h 0x0h 0xFFFFh
ADC_VM_RAW 0x0h 0x0h 0xFFFFh
ADC_AGPI_A_RAW 0x0h 0x0h 0xFFFFh
ADC_AGPI_B_RAW 0x0h 0x0h 0xFFFFh
ADC_AENC_UX_RAW 0x0h 0x0h 0xFFFFh
ADC_AENC_VN_RAW 0x0h 0x0h 0xFFFFh
ADC_AENC_WY_RAW 0x0h 0x0h 0xFFFFh
RW 0x03h ADC_RAW_ADDR
ADC_RAW_ADDR 0x0h 0x0h 0x3h
RW 0x04h dsADC_MCFG_B_
MCFG_A
cfg_dsmodulator_a 0x0h 0x0h 0x3h
mclk_polarity_a 0x0h 0x0h 0x1h
mdat_polarity_a 0x0h 0x0h 0x1h
sel_nclk_mclk_i_a 0x0h 0x0h 0x1h
blanking_a 0x0h 0x0h 0xFFh
cfg_dsmodulator_b 0x0h 0x0h 0x3h
mclk_polarity_b 0x0h 0x0h 0x1h
mdat_polarity_b 0x0h 0x0h 0x1h
sel_nclk_mclk_i_b 0x0h 0x0h 0x1h
blanking_b 0x0h 0x0h 0xFFh
RW 0x05h dsADC_MCLK_A
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 111 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 112 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 113 / 152
RW 0x21h OPENLOOP_
VELOCITY_TARGET
OPENLOOP_ 0x0h -0x80000000h 0x7FFFFFFFh
VELOCITY_TARGET
RW 0x22h OPENLOOP_
VELOCITY_ACTUAL
OPENLOOP_ 0x0h -0x80000000h 0x7FFFFFFFh
VELOCITY_ACTUAL
RWI 0x23h OPENLOOP_PHI
OPENLOOP_PHI 0x0h -0x8000h 0x7FFFh
RW 0x24h UQ_UD_EXT
UD_EXT 0x0h -0x8000h 0x7FFFh
UQ_EXT 0x0h -0x8000h 0x7FFFh
RW 0x25h ABN_DECODER_
MODE
apol 0x0h 0x0h 0x1h
bpol 0x0h 0x0h 0x1h
npol 0x0h 0x0h 0x1h
use_abn_as_n 0x0h 0x0h 0x1h
cln 0x0h 0x0h 0x1h
direction 0x0h 0x0h 0x1h
RW 0x26h ABN_DECODER_PPR
ABN_DECODER_PPR 0x10000h 0x0h 0xFFFFFFh
RW 0x27h ABN_DECODER_
COUNT
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 114 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 115 / 152
R 0x3Ah HALL_PHI_M
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 116 / 152
R 0x41h AENC_DECODER_
COUNT
AENC_DECODER_ 0x0h -0x80000000h 0x7FFFFFFFh
COUNT
RW 0x42h AENC_DECODER_
COUNT_N
AENC_DECODER_ 0x0h -0x80000000h 0x7FFFFFFFh
COUNT_N
RW 0x45h AENC_DECODER_
PHI_E_PHI_M_OFFSET
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 117 / 152
R 0x46h AENC_DECODER_
PHI_E_PHI_M
AENC_DECODER_ 0x0h -0x8000h 0x7FFFh
PHI_M
AENC_DECODER_ 0x0h -0x8000h 0x7FFFh
PHI_E
RW 0x4Dh CONFIG_DATA
biquad_x_a_1 0x0h -0x80000000h 0x7FFFFFFFh
biquad_x_a_2 0x0h -0x80000000h 0x7FFFFFFFh
biquad_x_b_0 0x0h -0x80000000h 0x7FFFFFFFh
biquad_x_b_1 0x0h -0x80000000h 0x7FFFFFFFh
biquad_x_b_2 0x0h -0x80000000h 0x7FFFFFFFh
biquad_x_enable 0x0h 0x0h 0x1h
biquad_v_a_1 0x0h -0x80000000h 0x7FFFFFFFh
biquad_v_a_2 0x0h -0x80000000h 0x7FFFFFFFh
biquad_v_b_0 0x0h -0x80000000h 0x7FFFFFFFh
biquad_v_b_1 0x0h -0x80000000h 0x7FFFFFFFh
biquad_v_b_2 0x0h -0x80000000h 0x7FFFFFFFh
biquad_v_enable 0x0h 0x0h 0x1h
biquad_t_a_1 0x0h -0x80000000h 0x7FFFFFFFh
biquad_t_a_2 0x0h -0x80000000h 0x7FFFFFFFh
biquad_t_b_0 0x0h -0x80000000h 0x7FFFFFFFh
biquad_t_b_1 0x0h -0x80000000h 0x7FFFFFFFh
biquad_t_b_2 0x0h -0x80000000h 0x7FFFFFFFh
biquad_t_enable 0x0h 0x0h 0x1h
biquad_f_a_1 0x0h -0x80000000h 0x7FFFFFFFh
biquad_f_a_2 0x0h -0x80000000h 0x7FFFFFFFh
biquad_f_b_0 0x0h -0x80000000h 0x7FFFFFFFh
biquad_f_b_1 0x0h -0x80000000h 0x7FFFFFFFh
biquad_f_b_2 0x0h -0x80000000h 0x7FFFFFFFh
biquad_f_enable 0x0h 0x0h 0x1h
prbs_amplitude 0x0h -0x80000000h 0x7FFFFFFFh
prbs_down_ 0x0h -0x80000000h 0x7FFFFFFFh
sampling_ratio
feed_forward_ 0x0h -0x80000000h 0x7FFFFFFFh
velocity_gain
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 118 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 119 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 120 / 152
RW 0x62h PID_POSITION_
LIMIT_HIGH
PID_POSITION_ 0x7FFFFFFFh -0x80000000h 0x7FFFFFFFh
LIMIT_HIGH
RW 0x63h MODE_RAMP_
MODE_MOTION
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 121 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 122 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 123 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 124 / 152
RW 0x75h ADC_VM_LIMITS
ADC_VM_LIMIT_LOW 0xFFFFh 0x0h 0xFFFFh
ADC_VM_LIMIT_HIGH 0xFFFFh 0x0h 0xFFFFh
R 0x76h TMC4671_INPUTS_
RAW
A of ABN_RAW 0x0h 0x0h 0x1h
B of ABN_RAW 0x0h 0x0h 0x1h
N of ABN_RAW 0x0h 0x0h 0x1h
- 0x0h 0x0h 0x1h
A of ABN_2_RAW 0x0h 0x0h 0x1h
B of ABN_2_RAW 0x0h 0x0h 0x1h
N of ABN_2_RAW 0x0h 0x0h 0x1h
- 0x0h 0x0h 0x1h
HALL_UX of HALL_ 0x0h 0x0h 0x1h
RAW
HALL_V of HALL_RAW 0x0h 0x0h 0x1h
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 125 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 126 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 127 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 128 / 152
8 Pinning
Figure 39: TMC4671 Pinout with 3 phase Power stage and BLDC Motor
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 129 / 152
Analog inputs (AI) are 5V single ended or differential inputs (Input range: GNDA
to V5). Use voltage dividers or operational ampli ers to scale down higher input
voltages.
Digital inputs (I) resp. (IO) are 3.3V single ended inputs.
IO Description
AI analog input, 3.3V
I digital input, 3.3V
IO digital input or digital output, direction programmable, 3.3V
O digital output, 3.3V
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 130 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 131 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 132 / 152
Feedback input pins that are not needed in target application can be left open or tied to GND.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 133 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 134 / 152
10 Electrical Characteristics
10.1 Absolute Maximum Ratings
The maximum ratings may not be exceeded under any circumstances. Operating the circuit at or
near more than one maximum rating at a time for extended periods shall be avoided by application
design.
VCCCORE is generated internally from VCCIO and shall not be overpowered by external supply.
The ⌃ ADCs can operate in differential or single ended mode. In differential mode the differential input
voltage range must be in between -2.5V and +2.5V. However, it is recommended to use the input voltage
range from -1.25V to 1.25V, due to non-linearity of ⌃ ADCs. In Single ended mode the operational in-
put range of the positive input channel should be between 0V and 2.5V. Recommended maximum input
voltage is 1.25V. ADCs have
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 135 / 152
10.2.2 DC Characteristics
DC characteristics contain the spread of values guaranteed within the speci ed supply voltage range un-
less otherwise speci ed. Typical values represent the average value of all parts measured at +25 °C. Tem-
perature variation also causes stray to some values. A device with typical values will not leave Min/Max
range within the full temperature range.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 136 / 152
11 Sample Circuits
Please consider electrical characteristics while designing electrical circuitry. Most Sample Circuits in this
chapter were taken from the evalutation board for the TMC4671 (TMC4671-EVAL).
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 137 / 152
Application RP U RP D RLN CP
5 V Encoder signal 4K7 n.c. 100R 100pF
The raw signal (ENC_A_RAW) is divided by a voltage divider and ltered by a low-pass lter. A pull up
resistor is applied for open collector encoder output signals. Diodes protect the input pin (ENC_A) against
over- and undervoltage. The cutoff-frequency of the low-pass is:
1
fc = (50)
2 ⇡ RP D CP
Figure 43: Sample Circuit for Interfacing of a single ended analog signal
If the power stage and the TMC4671 share a common ground, the ADC_VM input signal can be generated
by a voltage divider to scale the voltage down to the needed range.
If the analog encoder has differential output signals, these can be used without signal conditioning (no OP
AMPs), when voltage range matches. Differential analog inputs can be used to digitize differential analog
input signals with high common mode voltage error suppression.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 138 / 152
Figure 44: Phase current measurement: Current directions for 2 and 3 phase motors
Figure 45: Phase current measurement: Current direction for DC or Voice Coil Motor
There are two main options for measuring the phase currents as described above. First option is to use
a shunt resistor and a shunt ampli er like the LT1999 or the AD8418A. The other option is to use a real
current sensor, which uses the Hall effect or other magnetic effects to implement an isolated current
measurement. Shunt measurement might be the more cost-effective solution for low voltage applications
up to 100V, while current sensors are more useful at higher voltage levels.
In general the sample circuit in g. 46 can be used for shunt measurement circuitry. Please consider
design guidelines of shunt ampli er supplier additionally. TRINAMIC also supplies power stage boards
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 139 / 152
with current shunt measurement circuitry (TMC-UPS10A/70V-EVAL). For current measurement also cur-
rent sensors with voltage output can be used. These could use the Hall effect or other magnetic effects.
Main concerns to take about is bandwidth, accuracy and measurement range.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 140 / 152
12 Setup Guidelines
For easy setup of the TMC4671 on a given hardware platform like the TMC4671 Evaluation-Kit, the user
should follow these general guidelines in order to safely set up the system for various modes of operation.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 141 / 152
13 Package Dimensions
Package: QFN76, 0.4 mm pitch, size 11.5 mm x 6.5 mm.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 142 / 152
Figure 48 shows the package from top view. Decals for some CAD programs are available on the product’s
website.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 143 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 144 / 152
14 Supplemental Directives
14.1 Producer Information
14.2 Copyright
TRINAMIC owns the content of this user manual in its entirety, including but not limited to pictures, logos,
trademarks, and resources. © Copyright 2021 TRINAMIC. All rights reserved. Electronically published by
TRINAMIC, Germany.
Redistributions of source or derived format (for example, Portable Document Format or Hypertext Markup
Language) must retain the above copyright notice, and the complete Datasheet User Manual documen-
tation of this product including associated Application Notes; and a reference to other available product-
related documentation.
This Datasheet is a non-commercial publication that seeks to provide concise scienti c and technical user
information to the target user. Thus, trademark designations and symbols are only entered in the Short
Spec of this document that introduces the product at a quick glance. The trademark designation /symbol
is also entered when the product or feature name occurs for the rst time in the document. All trademarks
and brand names used are property of their respective owners.
The Target User knows how to responsibly make use of this product without causing harm to himself or
others, and without causing damage to systems or devices, in which the user incorporates the product.
Life support systems are equipment intended to support or sustain life, and whose failure to perform,
when properly used in accordance with instructions provided, can be reasonably expected to result in
personal injury or death.
Information given in this document is believed to be accurate and reliable. However, no responsibility
is assumed for the consequences of its use nor for any infringement of patents or other rights of third
parties which may result from its use. Speci cations are subject to change without notice.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 145 / 152
or of any other nature are made hereunder with respect to information/speci cation or the products to
which information refers and no guarantee with respect to compliance to the intended use is given.
In particular, this also applies to the stated possible applications or areas of applications of the product.
TRINAMIC products are not designed for and must not be used in connection with any applications where
the failure of such products would reasonably be expected to result in signi cant personal injury or death
(safety-Critical Applications) without TRINAMIC’s speci c written consent.
TRINAMIC products are not designed nor intended for use in military or aerospace applications or environ-
ments or in automotive applications unless speci cally designated for such use by TRINAMIC. TRINAMIC
conveys no patent, copyright, mask work right or other trade mark right to this product. TRINAMIC as-
sumes no liability for any patent and/or other trade mark rights of a third party resulting from processing
or handling of the product and/or any other use of the product.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 146 / 152
15 Errata of TMC4671-LA/-ES2/-ES
15.1 Errata of TMC4671-LA
PID_POSITION_ACTUAL glitches when calculated from Hall sensor angle and Hall Interpolation is
activated
Hall interpolation is not intended for positioning applications, especially not with changes of direction.
In the following register con guration glitches on PID_POSITION_ACTUAL 0x6B can occur:
In this con guration PID_POSITION_ACTUAL might not be able to count full revolutions correctly as the
interpolated PHI_E_HALL might glitch when motor stops. As a result a full revolution is counted where
there was not one completed. If the user does not rely on correct position information in register PID_
POSITION_ACTUAL the silicon error does not affect the application.
Workaround
The hall sensor interpolation needs to be switched off.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 147 / 152
9 ENI and ENO function updated ENI and ENO act as enable signals
10 - Hall sync PWM sample optional Hall sampling at PWM cen-
ter
11 - PWM_POLARITIES regis- Active high PWM signal polarity is pre-
ter initialized to 0x0 ferred
12 - Registers PHI_M_EXT Registers were not used
and POSITION_EXT
removed
13 Watchdog not properly working Watchdog removed Watchdog was intended to monitor
CLK. Watchdog ag can not be reset.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 148 / 152
• update P and I parameter for the advanced PI controller in case of switching numerical representa-
tion from Q8.8 to Q4.12 (classical PI controller is un-changed)
• mount pull-up resistors if required for gate driver control signals during power-on reset
• check setting of SVPWM control bit to avoid un-wanted speed-up by SVPWM in torque mode (power-
on default is disable without speed-up)
• check setting of additional hall_sync_pwm_enable bit for high speed application with usage of Hall
signals (power-on default is disable)
15.5 Recommendations
• TMC4671-LA (TMC4671-ES2) is drop-in compatible to the TMC4671-ES. Nevertheless, the TMC4671-
LA needs to be functional quali ed as replacement to avoid un-wanted behavior caused by correc-
tions of errata of TMC4671-ES.
For example: The space vector PWM /SVPWM) control bit does not have an effect for the TMC4671-ES
in torque mode. The space vector PWM is corrected for the TMC4671-LA. So, if the SVPWM control bit
is un-wanted enabled for the TMC4671-ES, the TMC4671-LA would run approximately +12% faster
in torque mode with the same settings.
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 149 / 152
16 Figures Index
1 FOC Basic Principle . . . . . . . . . . . 9 24 Outline of noisy Hall signals (left) due
2 PID Architectures and Motion Modes 10 to electromagnetic interference with
3 Orientations UVW (FOC3) and XY (FOC2) 15 PWM switching and noise cleaned
4 Compass Motor Model w/ 3 Phases Hall signals (right) by PWM center
UVW (FOC3) and Compass Motor synced sampling of Hall signal vector
Model w/ 2 Phases (FOC2) . . . . . . . 15 (H1 H2 H3) . . . . . . . . . . . . . . . . 47
5 Hardware FOC Application Diagram . 16 25 Hall Signal PWM Center Sampling on
6 Hardware FOC Block Diagram . . . . . 16 PWM_CENTER . . . . . . . . . . . . . . 47
7 SPI Datagram Structure . . . . . . . . 17 26 Hall Signal Blanking . . . . . . . . . . . 48
8 SPI Timing . . . . . . . . . . . . . . . . 18 27 Analog Encoder (AENC) signal wave-
9 SPI Timing of Write Access without forms . . . . . . . . . . . . . . . . . . . 48
pause with fSCK up to 8MHz . . . . . 19 28 Analog Encoder (AENC) Selector &
10 SPI Timing of Read Access with pause Scaler w/ Offset Correction . . . . . . 49
(tPAUSE) of 500 ns with fSCK up to 29 Classic PI Controller Structure . . . . . 54
8MHz. . . . . . . . . . . . . . . . . . . . 19 30 Advanced PI Controller Structure . . . 55
11 Connector for Real-Time Monitoring 31 PI Controllers for position, velocity
Interface (Connector Type: Hirose and current . . . . . . . . . . . . . . . 56
DF20F-10DP-1V) . . . . . . . . . . . . . 20 32 Inner FOC Control Loop . . . . . . . . 57
12 UART Read Datagram (TMC4671 reg- 33 FOC Transformations . . . . . . . . . . 58
ister read via UART) . . . . . . . . . . . 22 34 Motion Modes . . . . . . . . . . . . . . 58
13 UART Write Datagram (TMC4671 reg- 35 Biquad Filters in Control Structure . . 61
ister write via UART) . . . . . . . . . . 22 36 PWM Gate Driver Control Polarities . 62
14 N_POLE_PAIRS - Number of Pole Pairs 37 FOC3 (three phase motor), FOC2 (two
(Number of Poles) . . . . . . . . . . . . 26 phase stepper motor), FOC1 (single
15 Integer Representation of Angles as phase DC motor) . . . . . . . . . . . . 63
16 bit signed (s16) resp. 16 bit un- 38 BBM Timing . . . . . . . . . . . . . . . 64
signed (u16) . . . . . . . . . . . . . . . 27 39 TMC4671 Pinout with 3 phase Power
16 Input Voltage Ranges of internaql stage and BLDC Motor . . . . . . . . . 128
Delta Sigma ADC Channels . . . . . . 31 40 TMC4671 Pinout with Stepper Motor 128
17 Delta Sigma ADC Con gurations 41 TMC4671 Pinout with DC Motor or
dsADC_CONFIG (ANALOG (internal), Voice Coil . . . . . . . . . . . . . . . . . 129
MCLKO, MCLKI, MDAC) . . . . . . . . . 33 42 Sample Circuit for Interfacing of an En-
18 ⌃ ADC Con gurations - MDAC coder Signal . . . . . . . . . . . . . . . 136
(Comparator-R-C-R as ⌃-Modulator) 37 43 Sample Circuit for Interfacing of a sin-
19 ADC Selector and Scaler with Offset gle ended analog signal . . . . . . . . 137
Correction . . . . . . . . . . . . . . . . 41 44 Phase current measurement: Current
20 Number of Pole Pairs npp vs. mechan- directions for 2 and 3 phase motors . 138
ical angle phi_m and electrical angle 45 Phase current measurement: Current
phi_e . . . . . . . . . . . . . . . . . . . 43 direction for DC or Voice Coil Motor . 138
21 ABN Incremental Encoder N Pulse . . 44 46 Current Shunt Ampli er Sample Circuit 139
22 Encoder ABN Timing . . . . . . . . . . 45 47 QFN76 Package Outline . . . . . . . . 141
23 Hall Sensor Angles . . . . . . . . . . . 46 48 Pinout of TMC4671 (Top View) . . . . 143
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 150 / 152
17 Tables Index
1 Order codes . . . . . . . . . . . . . . . 6 19 Example Parameters for ADC_GAIN . 39
2 SPI Timing Parameter . . . . . . . . . 18 20 Scalings and Change Rate Timings of
3 Possible baudrates and correspond- classical PID controllers for currents,
ing values for register 0x79 . . . . . . 21 velocity, and position . . . . . . . . . . 53
4 Single Pin Interface Motion Modes . . 23 21 Motion Modes . . . . . . . . . . . . . . 53
5 GPIO Con guration Overview with ’x’ 22 Motion Modes . . . . . . . . . . . . . . 59
as don’t care . . . . . . . . . . . . . . . 24 23 TABSTatusFlags . . . . . . . . . . . . . 62
6 Numerical Representations . . . . . . 24 24 FOC321 Gate Control Signal Con gu-
7 Examples of u16, s16, q8.8, q4.12 . . 25 rations . . . . . . . . . . . . . . . . . . 63
8 Examples of u16, s16, q8.8 . . . . . . 27 25 Factors for integer to real conversion 65
9 Delta Sigma ⌃ ADC Input Stage Con- 26 Factors for real to integer conversion 66
gurations . . . . . . . . . . . . . . . . 30 27 TABSTatusFlags . . . . . . . . . . . . . 67
10 Delta Sigma ⌃ ADC Input Stage Con- 28 TMC4671 Registers . . . . . . . . . . . 75
gurations . . . . . . . . . . . . . . . . 31 31 Pin Type De nition . . . . . . . . . . . 129
11 ⌃ ADC Con gurations . . . . . . . . 33 32 Functional Pin Description . . . . . . . 132
12 Registers for Delta Sigma Con guration 34 33 Supply Voltage Pins and Ground Pins 133
13 Delta Sigma MCLK Con gurations . . 34 34 Absolute Maximum Ratings . . . . . . 134
14 Recommended Decimation Parame- 35 Operational Range . . . . . . . . . . . 134
ter MDEC . . . . . . . . . . . . . . . . . 35 36 DC Characteristics . . . . . . . . . . . 135
15 Recommended input voltage range 37 Additional decoupling capacitors for
from V_MIN25%[V] to V_MAX75%[V] supply voltages . . . . . . . . . . . . . 136
for internal Delta Sigma Modulators; 38 Reference Values for circuitry compo-
V_SUPPLY[V] = 5V is recommended nents . . . . . . . . . . . . . . . . . . . 137
for the analog part of the TMC4671. . 36 39 Package Outline Dimensions . . . . . 142
16 Delta Sigma input voltage mapping of 40 Registersettings susceptible to glitches 146
internal Delta Sigma Modulators . . . 36 41 TMC4671-ES Errata vs. TMC4671-
17 Delta Sigma R-C-R-CMP Con gurations 37 ES2/-LS Fixes . . . . . . . . . . . . . . . 147
18 Delta Sigma input voltage mapping of 42 IC Revision . . . . . . . . . . . . . . . . 151
external comparator (CMP) . . . . . . 38 43 Document Revision . . . . . . . . . . . 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 151 / 152
18 Revision History
18.1 IC Revision
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com
TMC4671 Datasheet • IC Version V1.3 | Document Revision V2.06 • 2021-Apr-12 152 / 152
©2021 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com