TMC222-PI20 [TRINAMIC]
Micro Stepping Stepper Motor Controller;型号: | TMC222-PI20 |
厂家: | TRINAMIC MOTION CONTROL GMBH & CO. KG. |
描述: | Micro Stepping Stepper Motor Controller 电动机控制 光电二极管 |
文件: | 总48页 (文件大小:462K) |
中文: | 中文翻译 | 下载: | 下载PDF数据表文档文件 |
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
1
TMC222 – DATASHEET
Micro Stepping Stepper Motor
Controller / Driver with Two Wire Serial Interface
TRINAMIC Motion Control GmbH & Co. KG
Waterloohain 5
D – 22769 Hamburg
1
2
20
19
18
17
16
15
14
13
12
11
SDA
SCL
VDD
GND
TST
SWI
GERMANY
32 31 30 29 28 27 26 25
VBAT
OA1
GND
OA2
OB1
GND
OB2
VBAT
VCP
3
OA1
OB2
OB2
4
OA1
www.trinamic.com
VBAT
VBAT
5
VBAT
VBAT
TMC 222
QFN32
6
VBAT
SWI
NC
VBAT
VCP
CPP
CPN
open
GND
HW
7
SDA
8
9
10 11 12 13 14 15 16
9
CPN
CPP
10
Top view
1 Features
The TMC222 is a combined micro-stepping stepper motor motion controller and driver with RAM and
OTP memory. The RAM or OTP memory is used to store motor parameters and configuration settings.
The TMC222 allows up to four bit of micro stepping and a coil current of up to 800 mA. After
initialization it performs all time critical tasks autonomously based on target positions and velocity
parameters. Communications to a host takes place via a two wire serial interface. Together with an
inexpensive micro controller the TMC222 forms a complete motion control system. The main benefits
of the TMC222 are:
•
Motor driver
•
•
•
•
•
•
Controls one stepper motor with four bit micro stepping
Programmable Coil current up to 800 mA
Supply voltage range operating range 8V ... 29V
Fixed frequency PWM current control with automatic selection of fast and slow decay mode
Full step frequencies up to 1 kHz
High temperature, open circuit, short, over-current and under-voltage diagnostics
•
•
Motion controller
•
•
•
•
•
Internal 16-bit wide position counter
Configurable speed and acceleration settings
Build-in ramp generator for autonomous positioning and speed control
On-the-fly alteration of target position
reference switch input available for read out
Two wire serial interface
•
•
•
Transfer rates up to 350 kbps
Diagnostics and status information as well as motion parameters accessible
Field-programmable node addresses (32)
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
2
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
Life support policy
TRINAMIC Motion Control GmbH & Co. KG does
not authorize or warrant any of its products for
use in life support systems, without the specific
written consent of TRINAMIC Motion Control
GmbH & Co. KG.
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.
© TRINAMIC Motion Control GmbH & Co. KG 2011
Information given in this data sheet 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 form
its use.
Specifications subject to change without notice.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
3
Table of Contents
1
2
FEATURES...................................................................................................................................... 1
GENERAL DESCRIPTION .............................................................................................................. 5
2.1
Block Diagramm........................................................................................................................ 5
Position Controller / Main Control ............................................................................................. 5
Stepper Motor Driver................................................................................................................. 5
Two Wire Serial Interface.......................................................................................................... 5
Miscellaneous ........................................................................................................................... 6
Pin and Signal Descriptions ...................................................................................................... 6
2.2
2.3
2.4
2.5
2.6
3
4
5
TYPICAL APPLICATION................................................................................................................. 7
ORDERING INFORMATION ........................................................................................................... 7
FUNCTIONAL DESCRIPTION ........................................................................................................ 8
5.1
Position Controller and Main Controller .................................................................................... 8
5.1.1
Stepping Modes................................................................................................................. 8
Velocity Ramp.................................................................................................................... 8
Examples for different Velocity Ramps.............................................................................. 9
Vmax Parameter.............................................................................................................. 10
Vmin Parameter............................................................................................................... 11
Acceleration Parameter ................................................................................................... 11
Position Ranges............................................................................................................... 12
Secure Position................................................................................................................ 12
External Switch ................................................................................................................ 12
5.1.2
5.1.3
5.1.4
5.1.5
5.1.6
5.1.7
5.1.8
5.1.9
5.1.10 Motor Shutdown Management......................................................................................... 13
5.1.11 Reference Search / Position initialization......................................................................... 14
5.1.12 Temperature Management.............................................................................................. 15
5.1.13 Battery Voltage Management .......................................................................................... 16
5.1.14 Internal handling of commands and flags........................................................................ 17
5.2
RAM and OTP Memory........................................................................................................... 19
5.2.1
5.2.2
5.2.3
RAM Registers................................................................................................................. 19
Status Flags..................................................................................................................... 20
OTP Memory Structure.................................................................................................... 21
5.3
5.3.1
5.3.2
5.3.3
Stepper Motor Driver............................................................................................................... 21
Coil current shapes.......................................................................................................... 22
Transition Irun to Ihold..................................................................................................... 23
Chopper Mechanism........................................................................................................ 24
6
TWO-WIRE SERIAL INTERFACE................................................................................................. 25
6.1
Physical Layer......................................................................................................................... 25
Communication on Two Wire Serial Bus Interface ................................................................. 25
Physical Address of the circuit ................................................................................................ 26
Write data to TMC222............................................................................................................. 26
Read data from TMC222 ........................................................................................................ 27
Timing characteristics of the serial interface........................................................................... 28
Application Commands Overview........................................................................................... 29
Command Description ............................................................................................................ 30
6.2
6.3
6.4
6.5
6.6
6.7
6.8
6.8.1
6.8.2
6.8.3
6.8.4
6.8.5
6.8.6
GetFullStatus1 ................................................................................................................. 30
GetFullStatus2 ................................................................................................................. 31
GetOTPParam................................................................................................................. 31
GotoSecurePosition......................................................................................................... 32
HardStop.......................................................................................................................... 32
ResetPosition................................................................................................................... 32
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
4
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
6.8.7
6.8.8
6.8.9
ResetToDefault................................................................................................................ 33
RunInit.............................................................................................................................. 33
SetMotorParam................................................................................................................ 34
6.8.10 SetOTPParam.................................................................................................................. 34
6.8.11 SetPosition....................................................................................................................... 35
6.8.12 SoftStop ........................................................................................................................... 35
6.9
Positioning Task Example....................................................................................................... 36
7
8
FREQUENTLY ASKED QUESTIONS ........................................................................................... 38
7.1
Using the bus interface............................................................................................................ 38
General problems when getting started .................................................................................. 38
Using the device...................................................................................................................... 39
Finding the reference position................................................................................................. 40
7.2
7.3
7.4
PACKAGE OUTLINE..................................................................................................................... 41
8.1
8.2
SOIC-20 .................................................................................................................................. 41
QFN32..................................................................................................................................... 42
9
PACKAGE THERMAL RESISTANCE........................................................................................... 43
9.1
SOIC-20 Package ................................................................................................................... 43
10
ELECTRICAL CHARACTERISTICS.......................................................................................... 44
10.1
Absolute Maximum Ratings................................................................................................. 44
Operating Ranges................................................................................................................ 44
DC Parameters.................................................................................................................... 44
AC Parameters.................................................................................................................... 46
10.2
10.3
10.4
REVISION HISTORY............................................................................................................................. 47
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
5
2 General Description
2.1 Block Diagramm
SWI
OA1
OA2
PWM
regulator
X
SDA
SCL
Two Wire
Serial
Interface
Decoder
Position Controller
Sinewave
table
Serial
Interface
Controller
HW
OB1
OB2
PWM
regulator
Y
DACs
Main control
& Registers
TST
Test
OTP + ROM
VBAT
VDD
Voltage
Regulator
Oscillator
Reference Voltage
&
Thermal Monitoring
Charge
Pump
VCP CP2 CP1
2.2 Position Controller / Main Control
Motor parameters, e.g. acceleration, velocity and position parameters are passed to the main control
block via the serial interface. These information are stored internally in RAM or OTP memory and are
accessible by the position controller. This block takes over all time critical tasks to drive a stepper
motor to the desired position under abiding the desired motion parameters.
The main controller gets feedback from the stepper motor driver block and is able to arrange internal
actions in case of possible problems. Diagnostics information about problems and errors are
transferred to the serial interface block.
2.3 Stepper Motor Driver
Two H-bridges are employed to drive both windings of a bipolar stepper motor. The internal transistors
can reach an output current of up to 800 mA. The PWM principle is used to force the given current
through the coils. The regulation loop performs a comparison between the sensed output current and
the internal reference. The PWM signals to drive the power transistors are derived from the output of
the current comparator.
2.4 Two Wire Serial Interface
Communication between a host and the TMC222 takes places via the two wire bi-directional serial
interface. Motion instructions and diagnostics information are provided to or from the Main Control
block. It is possible to connect up to 32 devices on the same bus. Slave addresses are programmable
via OTP memory or an external pin.
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
6
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
2.5 Miscellaneous
Besides the main blocks the TMC222 contains the following:
•
•
an internal charge pump used to drive the high side transistors.
an internal oscillator running at 4 MHz +/- 10% to clock the two wire serial interface, the
positioning unit, and the main control block
•
•
•
internal voltage reference for precise referencing
a 5 Volts voltage regulator to supply the digital logic
protection block featuring Thermal Shutdown, Power-On-Reset, etc.
2.6 Pin and Signal Descriptions
1
20
SDA
SCL
VDD
GND
TST
SWI
2
19
18
17
16
15
14
13
12
11
32 31 30 29 28 27 26 25
VBAT
OA1
GND
OA2
OB1
GND
OB2
VBAT
VCP
3
OA1
OB2
4
OA1
OB2
VBAT
VBAT
5
VBAT
VBAT
TMC 222
QFN32
6
VBAT
SWI
NC
VBAT
VCP
CPP
CPN
open
GND
HW
7
SDA
8
9
10 11 12 13 14 15 16
9
CPN
CPP
10
Top view
Name
SOIC20
QFN32
Description
SDA
SCL
VDD
GND
1
2
3
8
9
SDA Serial Data input/output
SCL Serial Clock input
internal supply (needs external decoupling capacitor)
10
4,7,14,17 11,14,25,26, ground, heat sink
31,32
TST
open
HW
5
6
8
12
13
15
test pin (to be tied to ground in normal operation)
must be left open
hard-wired serial interface address bit input
Hint: This is not a logic level input as usual; it needs to be
connected via 1K resistor either to +VBAT or GND;
negative connection of external charge pump capacitor
positive connection of external charge pump capacitor
connection of external charge pump filter capacitor
CPN
CPP
VCP
VBAT
OB2
OB1
OA2
OA1
SWI
9
10
17
18
19
11
12, 19
13
15
3-5,20-22 battery voltage supply (Vbb)
23,24
27,28
29,30
1,2
negative end of phase B coil
positive end of phase B coil
16
18
negative end of phase A coil
positive end of phase A coil
reference switch input;
20
6
Hint: This is not a logic level input as usual; it needs to be
connected via 1K resistor either to +VBAT or GND;
internally not connected (shields when connected to ground)
NC
7,16
Table 1: TMC222 Signal Description
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
7
3 Typical Application
External
Switch
Connect to
GND or VBAT
Two wire serial Interface
1
2
3
4
5
SDA
SCL
VDD
GND
TST
open
GND
HW
SWI
VBAT
OA1
20
19
18
17
16
15
14
13
12
11
SWI
1k
Ω /1/4W
2.7 nF
100 nF
1 µF
Tantalum
100 nF
GND
OA2
M
6
OB1
VBAT
7
GND
OB2
Connect to
GND or VBAT
8...29 V
8
1k
Ω
/1/4W
100 nF
2.7 nF
9
CPN
CPP
VBAT
VCP
220 nF
16 V
220 nF
16 V
100 µF
10
Figure 1: TMC222 Typical Application
Notes :
•
•
•
•
•
Resistors tolerance +- 5%
2.7nF capacitors: 2.7nF is the minimum value, 10nF is the maximum value
the 1µF and 100µF must have a low ESR value
100nF capacitors must be close to pins VBB and VDD
220nF capacitors must be as close as possible to pins CPN, CPP, VCP and VBB to reduce EMC radiation.
4 Ordering Information
Part No.
Package
Peak Current
Temperature Range
TMC222-PI20
(pre-series marking,
same IC as TMC222-SI)
SOIC-20
800 mA
-40°C..125°C
TMC222-SI
TMC222-LI
SOIC-20
QFN32
800mA
800mA
-40°C..125°C
-40°C..125°C
Table 2: Ordering Information
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
8
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
5 Functional Description
5.1 Position Controller and Main Controller
5.1.1 Stepping Modes
The TMC222 supports up to 16 micro steps per full step, which leads to smooth and low torque ripple
motion of the stepping motor. Four stepping modes (micro step resolutions) are selectable by the user
(see also Table 11):
•
•
•
•
Half step Mode
1/4 Micro stepping
1/8 Micro stepping
1/16 Micro stepping
5.1.2 Velocity Ramp
A common velocity ramp where a motor drives to a desired position is shown in the figure below. The
motion consists of a acceleration phase, a phase of constant speed and a final deceleration phase.
Both the acceleration and the deceleration are symmetrical. The acceleration factor can be chosen
from a table with 16 entries. (Table 5: Acc Parameter on page 11). A typical motion begins with a start
velocity Vmin. During acceleration phase the velocity is increased until Vmax is reached. After
acceleration phase the motion is continued with velocity Vmax until the velocity has to be decreased in
order to stop at the desired target position. Both velocity parameters Vmin and Vmax are
programmable, whereas Vmin is a programmable ratio of Vmax. (See Table 3: Vmax Parameter on
page 10 and Table 4: Vmin on page 11). The user has to take into account that Vmin is not allowed to
change while a motion is ongoing. Vmax is only allowed to change under special circumstances. (See
5.1.4 Vmax Parameter on page 10).
The peak current value to be fed to each coil of the stepper-motor is selectable from a table with 16
possible values. It has to be distinguished between the run current Irun and the hold current Ihold. Irun
is fed through the stepper motor coils while a motion is performed, whereas Ihold is the current to hold
the stepper motor before or after a motion. More details about Irun and Ihold can be found in 5.3.1. and
5.3.2.
Velocity resp. acceleration parameters are accessable via the serial interface. These parameters are
written via the SetMotorParam command (see 6.8.9) and read via the GetFullStatus1 command (see
6.8.1).
Velocity V
[FS/s]
Vmax
Vmin
time
[s]
Xstart
Xtarget
No
Movement
Acceleration
Phase
Deceleration
Phase
No
Movement
State of Motion
Constant Velocity
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
9
5.1.3 Examples for different Velocity Ramps
The following figures show some examples of typical motions under different conditions:
Velocity V
Vmax
Vmin
Xstart
Xtarget_1
Xtarget_2
time
Figure 2: Motion with change of target position
Velocity V
Vmax
Vmin
Xstart
Xtarget_1
Xtarget_2
time
Figure 3: Motion with change of target position while in deceleration phase
Velocity V
Vmax
Vmin
Xstart
Xtarget
time
Figure 4: Short Motion Vmax is not reached
Velocity V
Vmax
Vmin
Xstart
Xtarget_1
Xtarget_2
time
Figure 5: Linear Zero crossing (change of target position in opposite direction)
The motor crosses zero velocity with a linear shape. The velocity can be smaller than the programmed
Vmin value during zero crossing. Linear zero crossing provides very low torque ripple to the stepper
motor during crossing.
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
10
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
5.1.4 Vmax Parameter
The desired maximum velocity Vmax can be chosen from the table below:
Vmax Vmax Vmax
index [FS/s] group
Stepping Mode
Half-Step 1/4 micro
Mode stepping
[half-steps/s] [micro-steps/s]
1/8 micro
stepping
[micro-steps/s]
790
1/16 micro
stepping
[micro-steps/s]
1579
A
B
99
197
273
334
395
425
456
486
546
607
668
729
790
912
1091
1457
1945
395
546
0
1
136
167
197
213
228
243
273
303
334
364
395
456
546
729
973
1091
2182
668
1335
2670
2
790
1579
3159
3
851
1701
3403
4
912
1823
3647
5
973
1945
3891
6
1091
1213
1335
1457
1579
1823
2182
2914
3891
2182
4364
7
2426
4852
8
2670
5341
9
C
D
2914
5829
10
11
12
13
14
15
3159
6317
3647
7294
4364
8728
5829
11658
15564
7782
Table 3: Vmax Parameter
Under special circumstances it is possible to change the Vmax parameters while a motion is ongoing.
All 16 entries for the Vmax parameter are divided into four groups A, B, C and D. When changing
Vmax during a motion take care that the new Vmax value is within the same group. Background: The
TMC222 uses an internal pre-divider for positioning calculations. Within one group the pre-divider is
equal. When changing Vmax between different groups during a motion, correct positioning is not
ensured anymore.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
11
5.1.5 Vmin Parameter
The minimum velocity parameter is a programmable ratio between 1/32 and 15/32 of Vmax. It is also
possible to set Vmin to the same velocity as Vmax by setting Vmin index to zero. The table below
shows the possible rounded values of Vmin given within unit [FS/s].
Vmax group [A...D] and Vmax index [0…15]
Vmin Vmax
index factor
A
0
B
C
D
1
2
3
4
5
6
7
8
9
10 11 12 13 14 15
99 136 167 197 213 228 243 273 303 334 364 395 456 546 729 973
0
1
2
3
4
5
6
7
8
9
1
3
6
9
4
8
5
6
6
7
7
8
8
10 10 11 13 15 19 26
1/32
2/32
3/32
4/32
5/32
6/32
7/32
8/32
9/32
10 11 12 13 14 15 17 19 21 23 27 30 42 57
12 15 18 19 21 22 25 27 30 32 36 42 50 65 88
12 16 20 24 26 28 30 32 36 40 44 48 55 65 88 118
15 21 26 30 32 35 37 42 46 52 55 61 71 84 111 149
18 25 30 36 39 42 45 50 55 61 67 72 84 99 134 179
22 30 36 43 46 50 52 59 65 72 78 86 99 118 156 210
24 33 41 49 52 56 60 67 74 82 90 97 112 134 179 240
28 38 47 55 59 64 68 76 84 94 101 111 128 153 202 271
30 42 52 61 66 71 75 84 94 103 112 122 141 168 225 301
34 47 57 68 72 78 83 94 103 114 124 135 156 187 248 332
37 50 62 73 79 85 91 101 112 124 135 147 170 202 271 362
40 55 68 80 86 92 98 111 122 135 147 160 185 221 294 393
43 59 72 86 92 99 106 118 132 145 158 172 198 236 317 423
46 64 78 92 99 107 114 128 141 156 170 185 214 256 340 454
10 10/32
11 11/32
12 12/32
13 13/32
14 14/32
15 15/32
Table 4: Vmin values [FS/s] for all Vmin index – Vmax index combinations
5.1.6 Acceleration Parameter
The acceleration parameter can be chosen from a wide range of available values as described in the
table below. Please note that the acceleration parameter is not to change while a motion is ongoing.
Acceleration Values in [FS/s2] dependent on Vmax
Vmax [FS/s]
Acc index
99 136 167 197 213 228 243 273 303 334 364 395 456 546 729 973
49
106
473
735
0
1
218
1004
3609
2
3
6228
4
8848
5
11409
13970
16531
6
7
8
19092
9
21886
24447
27008
29570
10
11
12
13
14
15
34925
40047
29570
Table 5: Acc Parameter
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
12
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
The amount of equivalent full steps during acceleration phase can be computed by the next equation:
2
2
min
−
V
max
V
N
step
=
2⋅ Acc
5.1.7 Position Ranges
Position information is coded by using two’s complement format. Depending on the stepping mode
(See 5.1.1) the position ranges are as listed in the following table:
Stepping Mode
Position Range
Full range excursion
Half-stepping
-4096…+4095
(-212…+212-1)
-8192…+8191
(-213…+213-1)
-16384…+16383
(-214…+214-1)
-32768…+32767
(-215…+215-1)
8192 half-steps
213
16384 micro-steps
1/4 micro-stepping
1/8 micro-stepping
1/16 micro-stepping
214
32768 micro-steps
215
65536 micro-steps
216
Table 6: Position Ranges
Target positions can be programmed via serial interface by using the SetPosition command (see
6.8.11). The actual motor position can be read by the GetFullStatus2 command (see 6.8.2).
5.1.8 Secure Position
The GotoSecurePosition command drives the motor to a pre-programmed secure position (see 6.8.4).
The secure position is programmable by the user. Secure position is coded with 11 bits, therefore the
resolution is lower than for normal positioning commands, as shown in the following table.
Stepping Mode
Half-stepping
Secure Position Resolution
4 half steps
1/4 micro stepping
1/8 micro stepping
1/16 micro stepping
8 micro steps (1/4th)
16 micro steps (1/8th)
32 micro steps (1/16th)
Table 7: Secure Position Resolution
5.1.9 External Switch SWI
Pin SWI (see Figure 1, on page 7) will attempt to source and sink current in/from the external switch
pin. This is to check whether the external switch is open or closed, resp. if the pin is connected to
ground or Vbat. The status of the switch can be read by using the GetFullStatus1 command. As long
as the switch is open, the <ESW> flag is set to zero.
The ESW flag just represents the status of the input switch. The SWI input is intended as a physical
interface for a mechanical switch that requires a cleaning current for proper operation. The SWI input
detects if the switch is open or connected either to ground or to Vbat. The SWI input is not a digital
logic level input. The status of the switch does not automatically perform actions as latching of the
actual position. Those actions have to be realized by the application software.
Important Hint: The SWI is not a logic level input as usual; it needs to be connected via 1K resistor
either to +VBAT or GND;
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
13
5.1.10 Motor Shutdown Management
The TMC222 is set into motor shutdown mode as soon as one of the following condition occurs:
•
The chip temperature rises above the thermal shutdown threshold Ttsd. See 5.1.12 Temperature
Management on Page 15
•
•
The battery voltage drops below UV2 See 5.1.13 Battery Voltage Management on Page 16.
An electrical problem occurred, e.g. short circuit, open circuit, etc. In case of such an problem flag
<ElDef> is set to one.
•
Chargepump failure, indicated by <CPFail> flag set to one.
During motor shutdown the following actions are performed by the main controller:
•
•
H-bridges are set into high impedance mode
The target position register TagPos is loaded with the contents of the actual position register
ActPos.
The two-wire-serial-interface remains active during motor shutdown. To leave the motor shutdown
state the following conditions must be true:
•
•
Conditions which led to a motor shutdown are not active anymore
A GetFullStatus1 command is performed via serial interface.
Leaving the motor shutdown state initiates the following
•
•
•
H-bridges in Ihold mode
Clock for the motor control digital circuitry is enabled
The charge pump is active again
Now the TMC222 is ready to execute any positioning command.
IMPORTANT NOTE:
First, a GetFullStatus1 command has to be executed after power-on to activate the TMC222.
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
14
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
5.1.11 Reference Search / Position initialization
A stepper motor does not provide information about the actual position of the motor. Therefore it is
recommended to perform a reference drive after power-up or if a motor shutdown happened in case of
a problem. The RunInit command initiates the reference search. The RunInit command consists of a
Vmin and Vmax parameter and also position information about the end of first and second motion
(6.8.8 RunInit).
A reference drive consists of two motions (Figure 6: RunInit): The first motion is to drive the motor into
a stall position or a reference switch. The first motion is performed under compliance of the selected
Vmax and Vmin parameter and the acceleration parameter specified in the RAM. The second motion
has got a rectangular shape, without a acceleration phase and is to drive the motor out of the stall
position or slowly towards the stall position again to compensate for the bouncing of the faster first
motion to stop as close to the stall position as possible. The maximum velocity of the second motion
equals to Vmin. The positions of Pos1 and Pos2 can be chosen freely (Pos1 > Pos2 or Pos1 < Pos2).
After the second motion the actual position register is set to zero. Finally, the secure position will be
traveled to if it is enabled (different from the most negative decimal value of –1024).
Once the RunInit command is started it can not be interrupted by any other command except a
condition occurs which leads to a motor shutdown (See 5.1.10 Motor Shutdown Management) or a
HardStop command is received. Furthermore the master has to ensure that the target position of the
first motion is not equal to the actual position of the stepper motor and that the target positions of the
first and the second motion are not equal. This is very important otherwise the circuit goes into a
deadlock state. Once the circuit finds itself in a deadlock state only a HardStop command followed by a
GetFullStatus1 command will cause the circuit to leave the deadlock state.
Velocity V
[FS/s]
2nd Motion
1st Motion
Vmax
Vmin
Position X
[FS]
Pos1
Figure 6: RunInit
Pos2
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
15
5.1.12 Temperature Management
The TMC222 provides an internal temperature monitoring. The circuit goes into shutdown mode if the
temperature exceeds threshold Ttsd, furthermore two thresholds are implemented to generate a
temperature pre-warning.
Low Temperatur
<Tinfo> = "01"
<TW> = '0'
<TSD> = '0'
T°< Tlow
T°> Tlow
Normal Temp.
<Tinfo> = "00"
<TW> = '0'
<TSD> = '0'
T°< Ttw &
GetFullStatus1
T°< Ttw &
GetFullStatus1
T°> Ttw
Thermal Warning
<Tinfo> = "10"
<TW> = '1'
<TSD> = '0'
T°> Ttw
T°< Ttw
T°> Ttsd
Post
Thermal Warning
Thermal Shutdown
<Tinfo> = "11"
<TW> = '1'
<TSD> = '1'
SoftStop, if motion
Motion = disabled
<Tinfo> = "00"
<TW> = '1'
<TSD> = '0'
T°> Ttsd
T°< Ttsd
Post Thermal
Shutdown 1
<Tinfo> = "10"
<TW> = '1'
<TSD> = '1'
Motion = disabled
T°> Ttw
T°< Ttw
Post Thermal
Shutdown 2
<Tinfo> = "00"
<TW> = '1'
<TSD> = '1'
Motion = disabled
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
16
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
5.1.13 Battery Voltage Management
The TMC222 provides an internal battery voltage monitoring. The circuit goes into shutdown mode if
the battery voltage falls below threshold UV2, furthermore one threshold UV1 is implemented to
generate a low voltage warning.
Vbat > UV1 &
GetFullStatus1
Vbat > UV1 &
GetFullStatus1
Normal Voltage
<UV2> = '0'
<StepLoss> = '0'
Motion = enabled
Vbat > UV1
Vbat < UV1
Low Voltage
<UV2> = '0'
<StepLoss> = '0'
Motion = enabled
Vbat < UV2
(no Motion)
Vbat < UV2
(Motion)
Stop Mode 1
Stop Mode 2
<UV2> = '1'
<StepLoss> = '0'
Motion = disabled
<UV2> = '1'
<StepLoss> = '1'
HardStop
Motion = disabled
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
17
5.1.14 Internal handling of commands and flags
The internal handling of commands and flags differs. Commands are handled with different priorities
depending on the current state and the current status of internal flags, see figure below. SetPosition or
GotoSecurePosition commands are ignored as long as the <StepLoss> flag is set. Details can be
found in Table 8: Priority Encoder.
Note: A HardStop command is sent by the master or triggered internally in case of an electrical defect
or over temperature.
A description of the available commands can be found in 6.8 Command Description. A list of the
internal flags can be found in 5.2.2 Status Flags.
As an example: When the circuit drives the motor to its programmed target position, state “GotoPos” is
entered. There are three events which can cause to leave this state: HardStop command received,
SoftStop command received or target position reached. If all three events occur at the same time the
HardStop command is executed since it has the highest priority. The Motion finished event (target
position reached) has the lowest priority and thus will only cause transition to “Stopped” state when
both other events do not occur.
Thermal Shutdown
RunInit
SoftStop
HardStop
HardStop
Thermal Shutdown
SoftStop
Motion finished
RunInit
HardStop
Power On
Reset
HardStop
Motion finished
HardStop
Thermal Shutdown
GotoSecurePosition
SetPosition
ShutDown
Stopped
GotoPos
Priorities
Motion finished
GetFullStatus1
AND <TSD> + <HS> = 0
High
Low
Motion finished
Figure 7: Internal handling of commands and flags
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
18
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
Stopped
motor stopped,
Ihold in coils
GotoPos
motor motion
ongoing
RunInit
SoftStop
motor
decelerating
HardStop
motor forced to
stop
ShutDown
State →
no influence on
RAM and
TagPos
motor stopped,
H-bridges in
Hi-Z
Command
↓
GetFullStatus2
I²C in-frame
response
I²C in-frame
response
I²C in-frame
response
I²C in-frame
response
I²C in-frame
response
I²C in-frame
response
OTP refresh;
I²C in-frame
OTP refresh;
I²C in-frame
OTP refresh;
I²C in-frame
OTP refresh;
I²C in-frame
OTP refresh;
I²C in-frame
OTP refresh;
I²C in-frame
I²C in-frame
response;
GetOTPParam
GetFullStatus1
if (<TSD>or
<HS>) = ‘1’
then
I²C in-frame
response
I²C in-frame
response
I²C in-frame
response
I²C in-frame
response
I²C in-frame
response
[attempt to clear
<TSD> and <HS>
flags]
→ Stopped
OTP refresh;
OTP to RAM;
AccShapereset
(note 2)
ResetToDefault
OTP refresh; OTP refresh;
OTP to RAM; OTP to RAM;
AccShapereset AccShapereset
OTP refresh;
OTP to RAM;
OTP refresh;
OTP to RAM;
AccShapereset AccShapereset AccShapereset
OTP refresh;
OTP to RAM;
[ActPosand TagPos
are not altered]
SetMotorParam
RAM update
RAM update
RAM update
RAM update
RAM update
RAM update
[Master takes care
about proper update]
TagPosand
ActPosreset
TagPosupdated;
→GotoPos
TagPosand
ActPosreset
ResetPosition
SetPosition
TagPosupdated TagPosupdated
If <SecEn> = ‘1’ If <SecEn> = ‘1’
If <SecEn> = ‘1’
then TagPos
SecPos;
→GotoPos
=
GotoSecurePosi
tion
then TagPos = then TagPos
SecPos SecPos
=
RunInit
→RunInit
→HardStop;
<StepLoss>=
‘1’
→HardStop;
<StepLoss>=
‘1’
→HardStop;
<StepLoss>=
‘1’
HardStop
SoftStop
HardStop
→SoftStop
[ ⇔ (<CPFail>or
<UV2>or <ElDef>) =
‘1’ ⇒ <HS>= ‘1’ ]
→Shutdown
→HardStop
→HardStop
→HardStop
Thermal shutdown
→Shutdown
→SoftStop
→Stopped
→SoftStop
→Stopped
[ <TSD> = ‘1’ ]
→Stopped;
TagPos
→Stopped;
TagPos
Motion finished
n.a.
n.a.
=ActPos
=ActPos
Table 8: Priority Encoder
Color code:
Command ignored
Transition to another state
Master is responsible for proper update (see note 5)
Notes:
1
After Power on reset, the Shutdown state is entered. The Shutdown state can only be left after a GetFullStatus1
command (so that the Master could read the <VddReset> flag).
2
A RunInit sequence runs with a separate set of RAM registers. The parameters which are not specified in a RunInit
command are loaded with the values stored in RAM at the moment the RunInit sequence starts. AccShape is forced to
‘1’ during second motion even if a ResetToDefault command is issued during a RunInit sequence, in which case
AccShape at ‘0’ will be taken into account after the RunInit sequence. A GetFullStatus1 command will return the
default parameters for Vmax and Vmin stored in RAM.
3
4
Shutdown state can be left only when <TSD> and <HS> flags are reset.
Flags can be reset only after the master could read them via a GetFullStatus1 command, and provided the physical
conditions allow for it (normal temperature, correct battery voltage and no electrical or charge pump defect).
A SetMotorParam command sent while a motion is ongoing (state GotoPos) should not attempt to modify Acc and
Vmin values. This can be done during a RunInit sequence since this motion uses its own parameters, the new
parameters will be taken into account at the next SetPosition command.
5
6
<SecEn> = ‘1’ when register SecPos is loaded with a value different from the most negative value (i.e. different from
0x400 = “100 0000 0000”)
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
19
7
8
9
<Stop> flag allows to distinguish whether state Stopped was entered after HardStop/SoftStop or not. <Stop> is set to
‘1’ when leaving state HardStop or SoftStop and is reset during first clock edge occurring in state Stopped.
While in state Stopped, if ActPos ≠ TagPos there is a transition to state GotoPos. This transition has the lowest
priority, meaning that <Stop>, <TSD>, etc. are first evaluated for possible transitions.
If <StepLoss> is active, then SetPosition and GotoSecurePosition commands are ignored (they will not modify TagPos
register whatever the state) and motion to secure position is forbidden. Other commands like RunInit or ResetPosition
will be executed if allowed by current state. <StepLoss> can only be cleared by a GetFullStatus1 command.
5.2 RAM and OTP Memory
Some RAM registers (e.g. Ihold, Irun) are initialized with the content of the OTP (One Time
Programmable) memory. The content of RAM registers that are initialized via OTP can be changed
afterwards. This allows user initialization default values, whereas the default values are one time
programmable by the user. Some OTP bits are address bits of the TMC222.
5.2.1 RAM Registers
Register
Mnemonic
Length
(bit)
Related commands
Comment
Reset
State
Actual Position
Target Position
ActPos
TagPos
16
GetFullStatus2
ResetPosition
SetPosition
Actual Position of the Stepper Motor. 16-bit
signed
16
Target Position of the Stepper Motor. 16-bit
signed
GetFullStatus2
ResetPosition
GetFullStatus1
SetMotorParam
ResetToDefault
GetFullStatus1
SetMotorParam
ResetToDefault
GetFullStatus1
SetMotorParam
ResetToDefault
GetFullStatus1
SetMotorParam
ResetToDefault
GetFullStatus1
SetMotorParam
ResetToDefault
GetFullStatus1
SetMotorParam
ResetToDefault
GetFullStatus1
SetMotorParam
ResetToDefault
0x0000
Acceleration
Shape
AccShape
Irun
1
4
0 = Acceleration with Acc Parameter.
1 = Velocity set to Vmin, without
acceleration
Coil Peak Current
Coil Hold Current
Minimum Velocity
Maximum Velocity
Shaft
Coil current when motion is ongoing
(Table 12: Irun / Ihold Settings)
Ihold
4
Coil current when motor stands still
(Table 12: Irun / Ihold Settings)
Vmin
4
Start Velocity of the stepper motor
(Table 4: Vmin )
Vmax
Shaft
4
Target Velocity of the stepper motor
(Table 3: Vmax Parameter)
OTP
Memory
1
Direction of motion
Acceleration /
Deceleration
Acc
4
Parameter for acceleration
(Table 5: Acc Parameter)
Secure Position
Stepping Mode
SecPos
StepMode
11
2
Target Position for GotoSecurePosition
command (6.8.4 GotoSecurePosition); 11
MSBs of 16-bit position (LSBs fixed to ‘0’)
Micro stepping mode
GetFullStatus2
ResetToDefault
GetFullStatus1
GetFullStatus2
ResetToDefault
(5.1.1 Stepping Modes)
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
20
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
5.2.2 Status Flags
The table below shows the flags which are accessable by the serial interface in order to receive
information about the internal status of the TMC222.
Flag
Mnemonic Length
(bit)
Related
Command
Comment
Reset
state
Digital supply
Reset
VddReset
1
GetFullStatus1 Set to ‘1’ after power-up or after a micro-cut in the supply
voltage to warn that RAM contents may have been lost.
Is set to ‘0’ after GetFullStatus1 command.
‘1’
Over current in coil OVC1
A
1
1
1
GetFullStatus1 Set to ‘1’ if an over current in coil #1 was detected. Is set to
‘0’ after GetFullStatus1 command.
‘0’
‘0’
‘0’
Over current in coil OVC2
B
GetFullStatus1 Set to ‘1’ if an over current in coil #2 was detected. Is set to
‘0’ after GetFullStatus1 command.
StepLoss
StepLoss
GetFullStatus1 Set to ‘1’ when under voltage, over current or over
temperature event was detected. Is set to ‘0’ after
GetFullStatus1 command. SetPosition and
GotoSecurePosition commands are ignored when
<StepLoss> = 1
‘0’ if SecPos = “100 0000 0000”
Secure position
enabled
Electrical Defect
SecEn
ElDef
1
1
Internal use
‘1’ otherwise
n.a.
‘0’
GetFullStatus1 Set to ‘1’ if open circuit or a short was detected, (<OVC1>
or <OVC2>). Is. Is set to ‘0’ after GetFullStatus1 command.
GetFullStatus1 Indicates the chip temperature
“00” = normal temperature
Temperature Info Tinfo
2
“00”
“01 = low temperature warning
“10” = high temperature warning
“11” = motor shutdown
GetFullStatus1 Set to one if temperature raises above 145 °C. Is set to ‘0’
after GetFullStatus1 command.
Thermal Warning TW
Thermal Shutdown TSD
1
1
3
‘0’
‘0’
GetFullStatus1 Set to one if temperature raises above 155°C. Is set to ‘0’
after GetFullStatus1 command and Tinfo = “00”.
GetFullStatus1 Indicates the actual behavior of the position controller.
“000”: Actual Position = Target Position; Velocity = 0
“001”: Positive Acceleration; Velocity > 0
Motion Status
Motion
“000”
“010”: Negative Acceleration; Velocity > 0
“011”: Acceleration = 0 Velocity = maximum pos Velocity
“100”: Actual Position /= Target Position; Velocity = 0
“101”: Positive Acceleration; Velocity < 0
“110”: Positive Acceleration; Velocity < 0
“111”: Acceleration = 0 Velocity = maximum neg Velocity
GetFullStatus1 Indicates the status of the external switch.
‘0’ = open
External Switch
Status
ESW
1
‘0’
‘1’ = close
GetFullStatus1 ‘0’ charge pump OK
Charge Pump
failure
Electrical flag
CPFail
HS
1
1
‘0’
‘0’
‘1’ charge pump failure
<CPFail> or <UV2> or <ElDef>
Internal use
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
21
5.2.3 OTP Memory Structure
The table below shows where the OTP parameters are stored in the OTP memory.
Note: If the OTP memory has not been programmed, or if the RAM has not be programmed by a
SetMotorParam command, or if anyhow <VddReset> = ‘1’, any positioning command will be ignored, in
order to avoid any consequence due to unwanted RAM content. Please check that the correct supply
voltage is applied to the circuit before zapping the OTP (See: Table 21: DC Parameters Supply and
Voltage regulator on page 45), otherwise the circuit will be destroyed.
OTP Bit Order
OTP
Address
7
OSC3
6
5
4
3
2
1
0
0x00
0x01
0x02
0x03
0x04
0x05
0x06
0x07
OSC2
TSD2
OSC1
TSD1
OSC0
TSD0
IREF3
BG3
IREF2
BG2
IREF1
BG1
IREF0
BG0
AD3
AD2
AD1
AD0
Irun3
Irun2
Irun1
Vmax1
Irun0
Vmax0
Shaft
Ihold3
Vmin3
Acc3
Ihold2
Vmin2
Acc2
Ihold1
Vmin1
Acc1
Ihold0
Vmin0
Acc0
Vmax3
Vmax2
SecPos10. SecPos9
SecPos7 SecPos6
SecPos8
SecPos5 SecPos4
SecPos3
SecPos2
SecPos1 SecPos0
StepMode1 StepMode0 LOCKBT LOCKBG
Table 9 : OTP Memory Structure
Parameters stored at address 0x00 and 0x01 and bit LOCKBT are already programmed in the OTP
memory at circuit delivery, they correspond to the calibration of the circuit and are just documented
here as an indication. These might vary between different components. These bits (gray within Table 9
: OTP Memory Structure) should not be used after readout. Each OPT bit is at ‘0’ when not zapped.
Zapping a bit will set it to ‘1’. Thus only bits having to be at ‘1’ must be zapped. Zapping of a bit already
at ‘1’ is disabled, to avoid any damage of the Zener diode. It is important to note that only one single
OTP byte can be programmed at the same time (see command SetOTPParam).
Once OTP programming is completed, bit LOCKBG can be zapped, to disable unwanted future
zapping, otherwise any OTP bit at ‘0’ could still be zapped.
Lock bit
Protected byte
LOCKBT (zapped before delivery)
LOCKBG
0x00 to 0x01
0x02 to 0x07
Table 10 : OTP Lock bits
The command used to load the application parameters via the serial bus into the RAM prior to an OTP
Memory programming is SetMotorParam. This allows for a functional verification before using a
SetOTPParam command to program and zap separately one OTP memory byte. A GetOTPParam
command issued after each SetOTPParam command allows to verify the correct byte zapping.
5.3 Stepper Motor Driver
The StepMode parameter in SetMotorParam command (6.8.9 SetMotorParam on page 34) is used to
select between different stepping modes. Following modes are available:
StepMode parameter
Mode
00
01
10
11
Half Stepping
1/4 µStepping
1/8 µStepping
1/16 µStepping
Table 11: StepMode
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
22
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
5.3.1 Coil current shapes
The next four figures show the current shapes fed to each coil of the motor in different stepping
modes.
i
t
Figure 8: Coil Current for Half Stepping Mode
i
t
Figure 9: Coil Current for 1/4 Micro Stepping Mode
i
t
Figure 10: Coil Current for 1/8 Micro Stepping Mode
i
t
Figure 11: Coil Current for 1/16 Micro Stepping Mode
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
23
5.3.2 Transition Irun to Ihold
At the end of a motor motion the actual coil currents Irun are maintained in the coils at their actual DC
level for a quarter of an electrical period (two half steps) at minimum velocity. Afterwards the currents
are then set to their hold values Ihold. The figure below illustrates the mechanism:
i
t
I = Irun
I = Ihold
Figure 12: Transition Irun to Ihold
Both currents Irun and Ihold are parameterizeable using the command SetMotorParam. 16 values are
available for Irun current and 16 values for Ihold current. The table below shows the corresponding
current values.
Irun / Ihold setting Peak Current
(hexadecimal)
0x0
0x1
[mA]
59
71
0x2
0x3
84
100
119
141
168
200
238
283
336
400
476
566
673
800
0x4
0x5
0x6
0x7
0x8
0x9
0xA
0xB
0xC
0xD
0xE
0xF
Table 12: Irun / Ihold Settings
Copyright © 2004-2009 TRINAMIC Motion Control GmbH & Co. KG
24
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
5.3.3 Chopper Mechanism
The chopper frequency is fixed as specified in chapter 10.4 AC Parameters on page 46. The TMC222
uses an intelligent chopper algorithm to provide a smooth operation with low resonance. The TMC222
uses internal measurements to derive current flowing through coils. If the current is less than the
desired current, the TMC222 switches a H-bridge in a way that the current will increase. Otherwise if
the current is too high, the H-bridge will be switched to decrease the current. For decreasing two
modes are available, slow decay and fast decay, whereas fast decay decreases the current faster than
slow decay. The figure below shows the chopper behavior.
Figure 13: Different Chopper Cycles with Fast and Slow Decay
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
25
6 Two-Wire Serial Interface
6.1 Physical Layer
Both SDA and SCL lines are connected to positive supply voltage via a current source or pull-up
resistor (see figure below). When there is no traffic on the bus both lines are high. Analog glitch filters
are implemented to suppress spikes with a length of up to 50 ns.
+ 5V
SDA line
SCL line
SCL_IN
SCL_IN
SDA_IN
SDA_IN
SCL_OUT
SDA_OUT
SCL_OUT
SDA_OUT
TMC222
Master
Figure 14: Two Wire Serial Interface - Physical Layer
6.2 Communication on Two Wire Serial Bus Interface
Each datagram starts with a Start condition and ends with a Stop condition. Both conditions are unique
and cannot be confused with data. A high to low transition on the SDA line while SCL is high indicates
a Start condition. A low to high transition on the SDA line while SCL is high defines a Stop condition
(see figure below).
SDA
SCL
STOP
condition
START
condition
Figure 15: Two Wire Serial Interface - Start / Stop Conditions
The SCL clock is always generated by the master. On every rising transition of the SCL line the data
on SDA is valid. Data on SDA line is only allowed to change as long as SCL is low (see figure below).
SDA
SCL
data line
stable,
data valid
data change
allowed
Figure 16: Two Wire Serial Interface - Bit transfer
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
26
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
Every byte put on the SDA line must have a length of 8 bits, where the most significant bit (MSB) is
transferred first. The number of bytes that can be transmitted to the TCM222 is restricted to 8 bytes.
Each byte is followed by an acknowledge bit, which is issued by the receiving node (see figure below).
MSB
1
ACK
9
ACK
9
SDA
SCL
2
7
8
1
STOP
condition
START
condition
Figure 17: Two Wire Serial Interface - Data Transfer
6.3 Physical Address of the circuit
The circuit must be provided with a physical address in order to discriminate this circuit from other
ones on the serial bus. This address is coded on seven bits (two bits are internally hardwired to ‘1’),
yielding the theoretical possibility of 32 different circuits on the same bus. It is a combination of four
OTP memory bits (see Table 9 : OTP Memory Structure) and one hardwired address bit (pin HW). HW
must either be connected to ground or Vbat. When HW is not connected and left floating correct
functionality of the serial interface is not guaranteed. Pin HW uses the same principle to check whether
it is connected to ground or Vbat like the SWI input (see 5.1.9 External Switch).
The TMC222 supports a “general call” address. Therefore the circuit is addressable using either the
physical slave address or address “000 0000”.
AD6
'1'
AD5
'1'
AD4
AD3
AD2
AD1
AD0
Physical address
OTP Memory
OTP_AD3 OTP_AD2OTP_AD1 OTP_AD0
Hardwired Bit
(Connect to 0 or 1)
HW2
Figure 18: Two Wire Serial Interface - Physical Address resp. Address Field
With un-programmed OTP address bits (OTP_AD3=o, OTP_AD2=o, OTP_AD1=o, OTP_AD0=o) and
HW='0' (pin HW @ GND), the slave address resp. the address field of the TMC222 for reading is
11oooo01 (0xC1, 193) and for writing the slave address resp. the address field is 11oooo00 (0xC0,
192). The LSB of the address field selects read (='1') and write (='0'). With un-programmed OTP
address bits and HW='1' (pin HW @ Vbat), the slave address resp. the address field of the TMC222
for reading is 11oooo11 (0xC3, 195) and for writing the salve address resp. the address field is
11oooo10 (0xC2, 194).
Important Hint: The HW is not a logic level input as usual; it needs to be connected via 1K resistor
either to +VBAT or GND;
6.4 Write data to TMC222
A complete datagram consists of the following: a Start condition, the slave address (7 bit), a read/write
bit (‘0’ = write, ‘1’ = read), an acknowledge bit, a number of data bytes (8 bit) each followed by an
acknowledge bit, and a Stop condition. The acknowledge bit is used to signal to the transmitter the
correct reception of the preceding byte, in this case the TMC222 pulls the SDA line low.
The TMC222 reads the incoming data at SDA with every rising edge of the SCL line. To finish the
transmission the master has to transmit a Stop condition. Some commands for the TMC222 are
supporting eight bytes of data, other commands are transmitting two bytes of data.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
27
DATA
DATA
A
A
A
S
Slave addr
R/W
P
(n Bytes + acknowledge)
'0' (Write)
master to slave
slave to master
S: Start Condition
P: Stop Condition
A: Acknowledge (SDA low)
A: not Acknowledge (SDA high)
Figure 19: Two Wire Serial Interface - Writing Data to Slave
6.5 Read data from TMC222
When reading data from a slave two datagrams are needed. The first datagram consists of two bytes
of data. The first byte consists of the slave address and the write bit. The second byte consists of the
address of an internal register of the TMC222. The internal register address is stored in the circuits
RAM. The second datagram consists of the slave address and the read bit. Then the master can read
the data bits on the SDA line with every rising edge of the SCL line. After each byte of data the master
has to acknowledge correct data reception by pulling SDA low. The last byte must not be
acknowledged by the master so that the slave knows the end of transmission (see figure below).
Dump Internal Address to Slave
S
Slave addr
R/W
A
internal addr
A
P
'0' (Write)
Read Data from Slave
Slave addr
S
R/W
A
DATA
A
DATA
A
P
(n Bytes + acknowledge)
'1' (Read)
master to slave
slave to master
S: Start Condition
P: Stop Condition
A: Acknowledge (SDA low)
A: not Acknowledge (SDA high)
Figure 20: Two Wire Serial Interface - Read Data from Slave
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
28
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
6.6 Timing characteristics of the serial interface
START
START
STOP
START
SDA
SCL
tf
tLOW
tr
tSU;DAT tf
tHD;STA
tr
tBUF
tHD;STA
tHD;DAT tHIGH
tSU;STA
tSU;STO
Figure 21: Definition of Timing
SCL Clk frequency <= 100KHz
SCL Clk frequency <= 350KHz
Parameter
Symbol
Unit
Min.
Max.
1.5
(2)
Min.
Max.
0.3VDD
(2)
Low level input voltage:
Fixed input levels
VIL
VIH
-0.5(1)
-0.5(1)
V
V
High level input voltage:
Fixed input levels
3.0
0.7VDD
Pulse width of spikes which must be
suppressed by the input filter
Capacitance for each I/O pin
tSP
Ci
n/a
-
n/a
10
50
-
50
10
ns
pF
Table 13: Two Wire Serial Interface - Characteristics of the SDA and SCL I/O Stages
Notes
(1): If Input voltage = < -0.3 Volts, then 20…100 Ohms resistor must be added in series
(2): Maximum VIH = VDDmax + 0.5 Volt
n/a: not applicable
SCL Clk frequency <= 100KHz
SCL Clk frequency <= 350KHz
Parameter
Symbol
Unit
Min.
Max.
Min.
Max.
SCL clock frequency
fSCL
0
100
0
350
KHz
Hold time (repeated) START
condition. After this period, the
first clock pulse is generated.
LOW period of the SCL clock
HIGH period of the SCL clock
Set-up time for a repeated START
condition
tHD;STA
4.0
-
0.6
-
µs
tLOW
tHIGH
4.7
4.0
-
-
1.3
0.6
-
-
µs
µs
tSU;STA
tSU;DAT
tr
4.7
250
-
-
-
0.6
100
-
-
µs
ns
ns
Data set-up time
Rise time of both SDA and SCL
signals
(1)
(1)
1000
20+0.1Cb
300
Fall time of both SDA and SCL
signals
tf
tSU;STO
tBUF
Cb
-
300
20+0.1Cb
300
ns
µs
µs
pF
Set-up time for STOP condition
Bus free time between a STOP
and START condition
4.0
4.7
0
-
-
0.6
1.3
-
-
-
Capacitive load for each bus line
Noise margin at the LOW level for
each connected device (including
hysteresis)
400
400
VnL
0.1VDD
0.2VDD
-
-
0.1VDD
0.2VDD
-
-
V
V
Noise margin at the HIGH level for
each connected device (including
hysteresis)
VnH
Table 14: Two Wire Serial Interface - Characteristics of the SDA and SCL bus lines
Notes
(1): Cb = total capacitance of one bus line in pF.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
29
6.7 Application Commands Overview
Communications between the TMC222 and a Two Wire Serial Bus Master takes place via a set of
commands.
Reading commands are used to:
•
•
•
Get actual status information, e.g. error flags
Get actual position of the Stepper Motor
Verify the right programming and configuration of the TMC222
Writing commands are used to:
•
•
Program the OTP Memory
Configure the TMC222 with motion parameters (e.g. max/min speed, acceleration, stepping mode,
etc.)
•
Provide target positions to the Stepper motor
Command
Mnemonic
Command Byte
(hexadecimal)
0x81
Function
GetFullStatus1
GetFullStatus2
GetOTPParam
Returns complete status of the chip
Returns actual, target and secure position
Returns OTP parameter
0xFC
0x82
GotoSecurePosition Drives motor to secure position
Immediate full stop
0x84
0x85
HardStop
ResetPosition
ResetToDefault
RunInit
Sets actual position to zero
Overwrites the chip RAM with OTP contents
Reference Search
0x86
0x87
0x88
0x89
SetMotorParam
SetOTPParam
SetPosition
SoftStop
Sets motor parameter
Zaps the OTP memory
0x90
0x8B
0x8F
Programmers a target and secure position
Motor stopping with deceleration phase
Table 15: Two-Wire-Serial-Interface - Command Overview (in alphabetical order)
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
30
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
6.8 Command Description
There are data fields labeled as "N/A = not applicable". Within the command description tables, the
contend is normally given as '1'. Data fields labeled by N/A might be reserved for later variants of the
TMC222 and the content should be ignored for the TMC222.
Concerning response datagrams, the byte 0 is the slave address that is applied for addressing, where
the byte 1 is the slave address that is sent back within the response data frame.
6.8.1 GetFullStatus1
This command is provided to the circuit by the Master to get a complete status of the circuit and of the
stepper-motor. The parameters sent via the two wire serial bus to the Master are:
•
•
•
•
•
•
•
coil peak and hold current values (Irun and Ihold)
maximum and minimum velocities for the stepper-motor (Vmax and Vmin)
direction of motion clockwise / counterclockwise (Shaft)
stepping mode (StepMode) (Table 11: StepMode on page 21)
acceleration (deceleration) for the Stepper motor (Acc)
acceleration shape (AccShape)
status information:
•
•
•
•
•
•
•
•
•
•
•
motion status <Motion [2:0]>
over current flags for coil A <OVC1> and coil B <OVC2>
digital supply reset <VddReset>
charge pump status <CPFail>
external switch status <ESW>
step loss <StepLoss>
electrical defect <ElDef>
under voltage <UV2>
temperature information <Tinfo>
temperature warning <TW>
temperature shutdown <TSD>
GetFullStatus1 command
Byte
Content
Structure
bit 7
1
bit 6
1
bit 5
OTP3
0
bit 4
bit 3
OTP1
0
bit 2
OTP0
0
bit 1
HW
0
bit 0
0
0
1
Slave Address
GetFullStatus1
OTP2
0
1
0
1
GetFullStatus1 command (Response)
Structure
Byte
Content
bit 7
1
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
HW
bit 0
1
0
1
2
3
4
5
6
7
8
Slave Address
Address
Irun & Ihold
Vmax & Vmin
Status 1
Status 2
Status 3
N/A
1
OTP3 OTP2 OTP1 OTP0
OTP3 OTP2 OTP1
1
1
1
OTP0
HW
Irun (3:0)
Vmax (3:0)
StepMode(1:0)
Ihold (3:0)
Vmin (3:0)
ACC(3:0)
AccShape
Shaft
UV2
ESW
1
VddReset StepLoss ElDef
Motion(2:0)
TSD TW
OVC1 OVC2
Tinfo(1:0)
1
1
1
CPFail
1
1
1
1
1
1
1
1
1
1
1
1
N/A
1
Note: N/A = not applicable
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
31
6.8.2 GetFullStatus2
This command is provided to the circuit by the Master to get the actual position of the stepper-motor.
The position is provided by the circuit in 16-bit format, with the 3 LSBs at ‘0’ when in half stepping
mode (StepMode = “00”). Furthermore programmed target position and secure position are also
provided.
GetFullStatus2 command
Byte
Content
Structure
bit 7
1
bit 6
1
bit 5
OTP3
1
bit 4
bit 3
OTP1
1
bit 2
OTP0
1
bit 1
HW
0
bit 0
0
0
1
Slave Address
GetFullStatus2
OTP2
1
1
1
0
GetFullStatus2 command (Response)
Structure
Byte
Content
bit 7
1
bit 6
1
bit 5
bit 4
bit 3
bit 2
bit 1
HW
bit 0
1
0
1
2
3
4
5
6
7
8
Slave Address
Address
OTP3 OTP2 OTP1 OTP0
1
1
1
OTP3 OTP2 OTP1
ActPos(15:8)
ActPos(7:0)
OTP0
HW
Actual Position 1
Actual Position 2
Target Position 1
Target Position 2
Secure Position
Secure Position
N/A
TagPos(15:8)
TagPos(7:0)
SecPos(7:0)
1
1
1
1
1
1
1
1
1
1
SecPos(10:8)
1
1
1
Note: N/A = not applicable
6.8.3 GetOTPParam
This command is provided to the circuit by the master to read the content of the OTP Memory. For
more information refer to Table 9 : OTP Memory Structure on page 21.
GetOTPParam command
Byte
Content
Structure
bit 7
1
bit 6
1
bit 5
OTP3
0
bit 4
bit 3
OTP1
0
bit 2
OTP0
0
bit 1
HW
1
bit 0
0
0
1
Slave Address
GetOTPParam
OTP2
0
1
0
0
GetOTPParam command (Response)
Structure
Byte
Content
bit 7
1
bit 6
1
bit 5
bit 4
bit 3
bit 2
bit 1
HW
bit 0
1
0
1
2
3
4
5
6
7
8
Slave Address
OTP byte 0
OTP byte 1
OTP byte 2
OTP byte 3
OTP byte 4
OTP byte 5
OTP byte 6
OTP byte 7
OTP3 OTP2 OTP1 OTP0
OTP@0x00
OTP@0x01
OTP@0x02
OTP@0x03
OTP@0x04
OTP@0x05
OTP@0x06
OTP@0x07
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
32
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
6.8.4 GotoSecurePosition
This command is provided by the Master to one or all the stepper-motors to move to the secure
position SecPos[10:0]. It can also be triggered at the end of a RunInit initialization phase. If
SecPos[10:0] equals 0x400 (the most negative decimal value of -1024) the secure position is disabled
and the GotoSecurePosition command is ignored.
GotoSecurePosition command
Byte
Content
Structure
bit 7
1
bit 6
bit 5
OTP3
0
bit 4
OTP2
0
bit 3
OTP1
0
bit 2
OTP0
1
bit 1
HW
0
bit 0
0
0
1
Slave Address
1
0
GotoSecurePosition 1
0
6.8.5 HardStop
This command is internally triggered when an electrical problem is detected in one or both coils,
leading to switch off the H-bridges. If this problem is detected while the motor is moving, the
<StepLoss> flag is raised allowing to warn the Master that steps may have been lost at the next
GetFullStatus1 command. A HardStop command can also be issued by the Master for some safety
reasons.
HardStop command
Byte
Content
Structure
bit 7
1
bit 6
1
bit 5
OTP3
0
bit 4
OTP2
0
bit 3
OTP1
0
bit 2
OTP0
1
bit 1
HW
0
bit 0
0
0
1
Slave Address
HardStop
1
0
1
6.8.6 ResetPosition
This command is provided to the circuit by the Master to reset ActPos and TagPos registers, in order
to allow for an initialization of the stepper-motor position.
Hint: This command is ignored during motion. It has no effect during motion. The Status Flags (section
5.2.2, page 20) named 'Motion Status' indicate if the motor is at rest (velocity=0).
ResetPosition command
Byte
Content
Structure
bit 7
1
bit 6
1
bit 5
OTP3
0
bit 4
bit 3
OTP1
0
bit 2
OTP0
1
bit 1
HW
1
bit 0
0
0
1
Slave Address
ResetPosition
OTP2
0
1
0
0
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
33
6.8.7 ResetToDefault
This command is provided to the circuit by the Master in order to reset the whole slave node into the
initial state. ResetToDefault will for instance overload the RAM with the reset state of the register
parameters. This is another way for the Master to initialize a slave node in case of emergency, or
simply to refresh the RAM content.
Note: ActPos is not modified by a ResetToDefault command, and it’s value is copied into TagPos
register in order to avoid an attempt to position the motor to ‘0’.
ResetToDefault command
Byte
Content
Structure
bit 7
1
bit 6
1
bit 5
OTP3
0
bit 4
bit 3
OTP1
0
bit 2
OTP0
1
bit 1
HW
1
bit 0
0
0
1
Slave Address
ResetToDefault
OTP2
0
1
0
1
6.8.8 RunInit
This command is provided to the circuit by the Master in order to initialize positioning of the motor by
seeking the zero (or reference) position. Refer to 5.1.11 Reference Search / Position initialization on
page 14. It leads to a sequence of the following commands:
•
•
•
•
•
•
SetMotorParam(Vmax, Vmin);
SetPosition(Pos1);
SetMotorParam(Vmin, Vmin);
SetPosition(Pos2);
ResetPosition
GotoSecurePosition
Once the RunInit command is started it can not be interrupted by any other command except when a
condition occurs which leads to a motor shutdown (See 5.1.10 Motor Shutdown Management) or a
HardStop command is received. If SecPos[10:0] equals 0x400 (the most negative decimal value of
-1024) the final travel to the secure position is omitted.
The master has to ensure that the target position of the first motion is not equal to the actual position
of the stepper motor and that the target positions of the first and second motion are different, too. This
is very important otherwise the circuit goes into a deadlock state. Once the circuit is in deadlock state
only a HardStop command followed by a GetFullStatus1 command will cause the circuit to leave the
deadlock state.
RunInit command
Byte
Content
Structure
bit 4 bit 3
OTP3 OTP2 OTP1 OTP0
bit 7
1
bit 6
bit 5
bit 2
bit 1
HW
0
bit 0
0
0
1
2
3
4
5
6
7
8
Slave Address
RunInit
N/A
1
1
0
0
1
1
0
1
1
1
1
1
0
1
1
0
1
1
1
1
N/A
1
1
Vmax(3:0)
1
1
Vmax Vmin
Position1 byte 1
Position1 byte 2
Position2 byte 1
Position2 byte 2
Vmin(3:0)
TagPos1(15:8)
TagPos1(7:0)
TagPos2(15:8)
TagPos2(7:0)
Note: N/A = not applicable
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
34
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
6.8.9 SetMotorParam
This command is provided to the circuit by the Master to set the values for the following stepper motor
parameters in RAM:
•
•
•
•
•
•
•
•
•
coil peak current value (Irun)
coil hold current value (Ihold)
maximum velocity for the Stepper-motor (Vmax)
minimum velocity for the Stepper-motor (Vmin)
acceleration shape (AccShape)
stepping mode (StepMode)
direction of the Stepper-motor motion (Shaft)
acceleration (deceleration) for the Stepper-motor (Acc)
secure position for the Stepper-motor (SecPos)
If SecPos[10:0] is set to 0x400 (the most negative decimal value of –1024) the secure position is
disabled and the GotoSecurePosition command is ignored.
SetMotorParam command
Byte
Content
Structure
bit 4 bit 3
OTP1 OTP0
bit 7
1
bit 6
1
bit 5
bit 2
bit 1
HW
0
bit 0
0
0
1
2
3
4
5
6
7
8
Slave Address
SetMotorParam
N/A
OTP3
0
OTP2
1
0
0
1
1
1
1
1
0
1
1
1
1
1
1
1
1
1
N/A
1
1
1
1
Irun & I hold
Vmax & Vmin
Status
Irun(3:0)
Vmax(3:0)
Ihold(3:0)
Vmin(3:0)
Acc(3:0)
SecPos(10:8)
Shaft
SecPos(7:0)
AccShape StepMode[1:0]
SecurePos
StepMode
Note: N/A = not applicable
6.8.10 SetOTPParam
This command is provided to the circuit by the Master in order to zap the OTP memory. The OTPA
address (OTPA) addresses the OTP word (please refer section 5.2.3, page 21) within the OTP
Memory structure. The Pbit byte represents the bit pattern to be programmed, where a one programs
an un-programmed OTP bit. For example, if one wants to OTP the defaults to Irun := 0xD and Ihold =
0x5, one has to execute the SetOTPParam with OTPA = 0x03 and Pbit := 0xD5. Those OTP bits that
are un-programmed can be programmed to '1' by corresponding Pbit chosen as '1' . For OTP the
supply voltage Vbat has to be within the valid range specified as VbbOTP within Table 21, page 45.
SetOTPParam command
Byte
Content
Structure
bit 4
bit 7
1
bit 6
1
bit 5
bit 3
bit 2
bit 1
bit 0
0
0
1
2
3
4
5
Slave Address
SetOTPParam
N/A
OTP3 OTP2 OTP1 OTP0
HW
0
1
0
0
1
1
1
1
0
1
1
1
0
1
1
0
1
1
1
1
1
1
N/A
OTP Address
Pbit
1
1
1
1
1
1
1
Pbit(7:0)
OTPA(2:0)
Note: N/A = not applicable
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
35
6.8.11 SetPosition
This command is provided to the circuit by the Master to drive the motor to a given position relative to
the zero position, defined in number of half or micro steps, according to StepMode[1:0] value.
SetPosition will not be performed if one of the following flags is set to one:
•
•
•
•
temperature shutdown <TSD>
under voltage <UV2>
step loss <StepLoss>
electrical defect <ElDef>
SetPosition command
Structure
bit 4 bit 3
OTP3 OTP2 OTP1 OTP0
Byte
Content
bit 7
1
bit 6
1
bit 5
bit 2
bit 1
HW
1
bit 0
0
0
1
2
3
4
5
Slave Address
SetPosition
N/A
1
0
0
1
1
0
1
1
1
1
1
0
1
1
1
1
1
1
1
N/A
Position byte1
Position byte2
1
1
1
1
TagPos(15:8)
TagPos(7:0)
Note: N/A = not applicable
6.8.12 SoftStop
If a SoftStop command occurs during a motion of the Stepper motor, it provokes an immediate
deceleration to Vmin followed by a stop, regardless of the position reached. This command occurs in
the following cases:
•
•
The chip temperature rises above the Thermal shutdown threshold.
The Master requests a SoftStop.
SoftStop command
Byte
Content
Structure
bit 7
1
bit 6
1
bit 5
OTP3
0
bit 4
bit 3
OTP1
1
bit 2
OTP0
1
bit 1
HW
1
bit 0
0
0
1
Slave Address
SoftStop
OTP2
0
1
0
1
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
36
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
6.9 Positioning Task Example
The TMC222 has to perform a positioning task, where the actual position of the stepper motor is
unknown. The desired target position is 3000 µsteps away from position 0. See figure below.
Stop
Actual
Target
Position
Position
=
= 3000
unknown
?
?
X [µsteps]
?
Position 0
Figure 22: Positioning Example: Initial situation
The following sequence of commands has to be sent to the slave in order to complete the scenario
described above (assumed after power on):
GetFullStatus1
The command is used to read the current status of the TMC222. Electrical or environmental problems
will be reported, furthermore the circuit leaves the shutdown state and is ready for action. See 6.8.1
GetFullStatus1 on page 30.
GetFullStatus2
The circuit will enter a deadlock state if the actual position corresponds to the first target position of the
RunInit command. This command is used to read the actual position. The master must take care that
both positions are containing different values. For deadlock conditions see 5.1.11 Reference Search /
Position initialization on page 14.
SetMotorParam
In order to drive the stepper motor with a desired motion parameters like torque, velocity, aso. the
SetMotorParam command must issued. See 6.8.9 SetMotorParam on page 34.
RunInit
Hence the actual position is unknown, a position initialization has to be performed. The first motion
must drive the stepper motor into the stop for sure. The second motion is a very short motion to bring
the motor out of the stop. The actual position is then set to zero automatically after the second motion
is finished. See 6.8.8 RunInit on page 33.
After reference search the situation is as depicted in the figure below. Actual position of the stepper
motor corresponds to zero, the target position is 3000 µsteps away from the actual position.
Stop
Actual
Position
= 0
Target
Position
= 3000
X [µsteps]
Figure 23: Positioning Example: Situation after reference search
Now the positioning command SetPosition can be issued in order to drive the stepper motor to the
desired position.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
37
SetPosition
This command will cause the stepper motor to move to the desired target position. See 6.8.11
SetPosition on page 35. After the motion has been finished, the situation is as depicted in the figure
below.
Stop
Actual Position
= Target Position
= 3000
X [µsteps]
Figure 24: Positioning Example: Motion finished
Afterwards the actual status and position can be verified by GetFullStatus1 and GetFullStatus2
commands. The master can check if a problem, caused by electrical or temperature problems,
occurred. Furthermore the actual position is read.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
38
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
7 Frequently Asked Questions
7.1 Using the bus interface
Q: How many devices can be operated on the same bus?
A: 32 devices can be discriminated by means of the physical address. However, it depends on some
factors if this high number really makes sense. First of all it has to be checked if each device can be
serviced under any circumstances in the maximum allowed time taking the bus speed and the
individual real-time requirements of each device into account. Second, the idea of reserving address 0
for OTP physical address programming during system installation and defective parts replacement
reduces the number to 30.
Q: How to program the OTP physical address bits of a device if there are more devices
connected to the same bus?
A: The problem here is that all new devices are shipped with the OTP physical address bits set to zero
making it difficult to address just one device with the SetOTPParam command. Use HW input as chip
select line to address just one device by SetOTPParam. If this is impractible since the HW input is
hardwired or not controllable for any other reason the only alternative is to assemble and program one
device after the other. I.e., assemble only first device and program the desired non-zero address, then
assemble the second device and program the desired non-zero address, and so on until all devices are
assembled and programmed. This is also a good service concept when replacing defective devices in
the field: The idea is that all devices are programmed to different non-zero physical addresses at
production/installation time. Once a defective device is being replaced the replacement part can easily
be addressed by SetOTPParam since it is the only part with physical address zero.
7.2 General problems when getting started
Q: What is the meaning of ElDef?
A: The ElDef flag (‘Electrical Defect’) is the logical ORing of the OVC1 and OVC2 flags. OVC1 is set to
one in case of an overcurrent (coil short) or open load condition (selected coil current is not reached)
for coil A. OVC2 is the equivalent for coil B.
Q: What could be the reason for ElDef / OVC1 / OVC2 being set to one?
A: There are a number of possible causes:
•
•
•
•
Motor not connected (ꢀ open load)
Connected motor has shorted coils (ꢀ overcurrent) or broken coils (ꢀ open load)
Motor coils connected to the wrong device pins
Selected coil current can not be reached (ꢀ open load) due to high coil impedance or low
supply voltage. Solution: Select a lower coil run/hold current or rise the supply voltage.
Generally: the calculated voltage required to reach a desired coil current at a given coil
resistance (V = I • R) must be significantly lower than actual supply voltage due to the coil
inductivity.
Q: Should the external switch be normally closed or open when the reference position is hit?
A: The SWI input resp. the ESW flag have neither effect on any internal state machine nor on
command processing, even not on the RunInit command. ESW must be polled by software using
GetFullStatus1 command. The software can simply be adapted to whatever state the switch is in when
the reference position is hit, i.e. closed or open.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
39
7.3 Using the device
Q: What is the meaning of the ‘Shaft’ bit?
A: The Shaft bit determines the rotating direction of the motor, i.e. clockwise or counter-clockwise
rotation.
Q: How to generate an interrupt when the target position is reached?
A: This is not possible. The device hasn’t any interrupt output at all. Just poll ActPos or Motion[2:0]
using an appropriate command.
Q: How can I ensure that I always get consistent data for ActPos and ESW?
A: There isn’t a single command to read both ActPos and ESW simultaneously. GetFullStatus1 will
read ESW whereas GetFullStatus2 will read ActPos. Thus it is not possible to read consistent values
as long as a motion is in progress.
Q: How to specify a second target position to go to immediately after a first target position has
been reached?
A: This is possible using the RunInit command. Note, that after the second target position has been
reached the internal position counter ActPos is reset to zero.
Q: Is it possible to change Vmax on-the-fly?
A: Yes, it is, if the new velocity is in the same group as the old one (see Vmax Parameters). Otherwise
correct positioning is not ensured anymore. Vmax values are divided into four groups:
•
•
•
•
group A: Vmax index = 0
group B: Vmax index = 1, 2, 3, 4 ,5 or 6
group C: Vmax index = 7, 8, 9, 10 ,11 or 12
group D: Vmax index = 13, 14 or 15
Q: Is it possible to change the stepping mode on-the-fly?
A: Yes, it is possible and it has immediate effect on the current motion.
Q: How to operate in continuous velocity mode rather than positioning (ramp) mode?
A: There is no velocity mode. The device was designed primarily for positioning tasks so for each
motion there has to be specified a target position by the respective command. However, velocity mode
can be emulated by repeating the following two commands again and again:
•
•
Read ActPos using GetFullStatus2 command
Set lower 16 bits of [ActPos+32767] as the next target position using SetPosition command
For real continuous motion this sequence has to be repeated before the current target position has
been reached.
Q: Which units, formats and ranges does position information have?
A: All 16-bit position data fields in commands and responses are coded in two’s complement format
with bit 0 representing 1/16 micro-steps. Hence a position range of –32768…+32767 in units of 1/16
micro-steps is covered regardless of the selected stepping mode (1/2, 1/4, 1/8 or 1/16 micro-stepping).
The difference between the stepping modes is the resolution resp. the position of the LSB in the 16-bit
position data field: it’s bit 0 for 1/16, bit 1 for 1/8, bit 2 for 1/4 and bit 3 for 1/2 micro-stepping. The
position range can be regarded as a circle since position –32768 is just 1/16 micro-step away from
position +32767. The device will always take the shortest way from the current to the target position,
i.e., if the current position is +32767 and the target position is –32768 just 1/16 micro-step will be
executed. 65535 1/16 micro-steps in the opposite direction can be achieved for example by two
consecutive SetPosition commands with target positions 0 and –32768.
The 11-bit secure position data field can be treated as the upper 11 MSBs of the 16-bit position data
fields described above with the 5 LSBs hardwired to zero. Hence it covers the same position range with
a reduced resolution: The position range is –1024…+1023 in units of two full-steps.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
40
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
7.4 Finding the reference position
Q: How do I find a reference position?
A: The recommended way is to use the RunInit command. Two motions are specified through RunInit.
The first motion is to reach the mechanical stop. Its target position should be specified far away
enough so that the mechanical stop will be reached from any possible starting position. There is no
internal stall detection so that at the end of the first motion the step motor will bounce against the
mechanical stop loosing steps until the internal target position is reached. The second motion then can
be used either to drive in the opposite direction out of the mechanical stop right into the reference
position which is a known number of steps away from the mechanical stop. Or the second motion can
slowly drive a few steps in the same direction against the mechanical stop to compensate for the
bouncing of the faster first motion and stop as close to the mechanical stop as possible.
Q: Can the SWI input help in finding a reference position?
Not directly. The current state of the SWI input is reflected by the ESW flag which can only be polled
using the command GetFullStatus1. The SWI input resp. the ESW flag have neither influence on any
internal state machine nor on command processing. The recommended way to find a reference
position is to use the RunInit command. Alternatively one could initiate a long distance motion at very
low speed using SetPosition and then poll ESW as frequently as possible to be able to stop the motion
using HardStop right in the moment the switch position is reached. Then one would reset the internal
position counters ActPos and TagPos using the ResetPosition command.
Q: What is the logic of the ESW flag?
A: The ESW flag reflects the state of the SWI input. ESW is set to one if SWI is high or low, i.e. pulled
to VBAT or to GND. ESW is set to zero if SWI is left open, i.e. floating. ESW is updated synchronously
with ActPos every 1024 µs.
Q: Is it possible to swap the logic of the ESW flag?
A: No, it’s not. Actually this is not necessary since the ESW flag must be polled and evaluated by
software anyway. The state of ESW has neither effect on any internal state machine nor on command
processing.
Q: What else is important for the RunInit command?
A: The first target position of RunInit must be different from the current position before sending RunInit
and the second target position must be different from the first one. Otherwise a deadlock situation can
occur. During execution of RunInit only Get… commands should be sent to the device.
Q: Does the second motion of RunInit stop when the ESW flag changes, or does it continue
into the mechanical stop?
A: Neither nor. The SWI input resp. the ESW flag have neither effect on any internal state machine nor
on command processing, i.e. the RunInit command is not influenced by SWI / ESW. The same is true
for the mechanical stop: as there isn’t any internal stall detection the RunInit command can not detect a
mechanical stop. When the mechanical stop is hit the first or second motion of RunInit (or the motion
of any other motion command) will be continued until the internal position counter ActPos has reached
the target position of this motion. This results in the motor bouncing against the mechanical stop and
loosing steps. The intention of the second motion of RunInit is to drive out of the mechanical stop
(reached by the first motion) to the desired reference position at a known distance from the mechanical
stop or to drive slowly against the mechanical stop again to compensate for the bouncing of the first
motion and to come to a standstill as close to the mechanical stop as possible.
Q: Does RunInit reset the position?
A: Yes, it does. After the second motion of RunInit has been finished the internal position counter
ActPos is reset to zero.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
41
8 Package Outline
8.1 SOIC-20
Figure 25: Package Outline SOIC-20
A
UNIT max
.
A1
A2
A3
bp
c
D(1) E(1)
e
HE
L
Lp
Q
v
w
y
Z(1)
theta
mm
2.65 0.30 2.45 0.25 0.49 0.32 13.0 7.6 1.27 10.65 1.4
0.10 2.25 0.36 0.23 12.6 7.4 10.00
inches 0.10 0.012 0.096 0.01 0.019 0.013 0.51 0.30 0.050 0.419 0.055 0.043 0.043 0.01 0.01 0.004 0.035
0.004 0.089 0.014 0.009 0.49 0.29 0.394 0.016 0.039 0.016
1.1
0.4
1.1
1.0
0.25 0.25 0.1
0.9
0.4
8°
0°
Table 16: SOIC-20 Mechanical Data
Note: inch dimensions are derived from the original mm dimensions
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
42
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
8.2 QFN32
D
D1
32
1
Top view
J
C
17
24
Side view
16
25
EXPOSED DIE
ATTACH PAD
0°~12°
P
R 0.2
PIN1 I.D.
9
32
8
1
L
b
Bottom view
Figure 26: Package Outline QFN32
REF
MIN
A
A1
A2
A3
b
C
D
D1
E
E1
e
J
K
L
P
R
0.80
0.00 0.576
0.02 0.615 0.203
0.05 0.654
0.25
0.3
0.24
0.42
0.6
5.37
5.47
5.57
mm
5.37
5.47
5.57
mm
0.35
0.4
2.185
NOM
MAX
Unit
7
6.75
mm
7
6.75
mm
0.65
mm
45
deg.
0.90
mm
0.35
mm
0.45
mm
2.385
mm
mm
mm
mm
mm
mm
mm
Hint: The exposed die attached pad is electrical ground. This pad should be connected to ground or can be left open. It is
recommended to connect it to ground for cooling.
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
43
9 Package Thermal Resistance
9.1 SOIC-20 Package
The junction case thermal resistance is 28°C/W, leading to a junction ambient thermal resistance of
63°C/W, with the PCB ground plane layout condition given in the figure below and with
•
•
•
PCB thickness = 1.6mm
1 layer
Copper thickness = 35µm
×
×
(10mm 23mm)
2
Figure 27: Layout consideration
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
44
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
10 Electrical Characteristics
10.1 Absolute Maximum Ratings
Parameter
Min
-0.3
-50
-55
-2
Max
+35
Unit
V
Vbat
Tamb
Tst
Vesd (**)
Supply Voltage
Ambient temperature under bias (*)
Storage temperature
Electrostatic discharge voltage on pins
+150
+160
+2
°C
°C
kV
Table 17: Absolute Maximum Ratings
(*) The circuit functionality is not guaranteed
(**) Human body model (100pF via 1.5 KΩ)
10.2 Operating Ranges
Parameter
Min
+8
Max
+29
Unit
V
Vbat
Supply Voltage (Vbb)
Operating temperature range
Vbat <= 18V
Vbat <= 29V
-40
-40
+125
+85
°C
°C
Top
Table 18: Operating Ranges
10.3 DC Parameters
Motor Driver
Symbol
Pin(s)
Parameter
Test condition
Min
Typ
Max
Unit
IMSmax
Peak
Max current through motor coil in
normal operation
800
mA
OA1
OA2
OB1
OB2
IMSmax
RMS
RDSon
Max RMS current through coil in
normal operation
570
mA
Ω
On resistance for each pin
(including bond wire)
Leakage current
To be confirmed by
characterization
HZ Mode, 0V < V(pin) < Vbb
1
IMSL
-50
+50
µA
Table 19: DC Parameters Motor Driver
Thermal Warning and shutdown
Symbol
Ttw
Ttsd (*)
Tlow
Pin(s)
Parameter
Test condition
Min
Typ
145
Max
Unit
°C
Thermal Warning
Thermal Shutdown
Low Temperature Warning
138
152
Ttw + 10
Ttw - 155
°C
°C
Table 20: DC Parameters Thermal Warning and shutdown
(*) NO more than 100 cumulated hours in life time above Ttsd
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
45
Supply and Voltage regulator
Symbol
Vbb
Pin(s)
Parameter
Test condition
Min
6.5
6.5
Typ
Max
18
Unit
V
Nominal operating supply range (*)
VbbT85
Nominal operating supply range (*)
for temperature < 85°C
29
V
VbbOTP
UV1
UV2
VBB
Supply Voltage for OTP zapping
Low voltage high threshold
Stop voltage low threshold
Total current consumption
8.5
8.8
8.1
9.5
9.8
8.9
V
V
9.4
8.5
10
V
mA
Ibat
Unloaded Outputs
8V < Vbb < 18V
Cload = 1µF (+100nF cer.)
Vbb < UV2
Vdd
Internal regulated output (**)
4.75
5
2
5.25
V
IddStop
VddReset
IddLim
Digital current consumption
Digital supply reset level (***)
Current limitation
mA
V
VDD
4.4
40
Pin shorted to ground
mA
Table 21: DC Parameters Supply and Voltage regulator
(*) Communication over serial bus is operating. Motor driver is disabled when Vbb < UV2.
(**) Pin VDD must not be used for any external supply.
(***) The RAM content will not be altered above this voltage
Switch Input and hardwired address input HW
Symbol
Rt_OFF
Rt_ON
Pin(s)
Parameter
Switch OFF resistance (*)
Switch ON resistance (*)
Test condition
Min
Typ
Max
Unit
kΩ
10
Switch to GND or Vbat
2
kΩ
SWI
HW
Vbb_sw
Vbb range for guaranteed
operation of SWI and HW
Maximum Voltage
6
18
40
V
Vmax_sw
Ilim_sw
T < 1s
Short to GND or Vbat
V
mA
Current limitation
30
Table 22: DC Parameters Switch Input and hardwired address input
(*) External resistance value seen from pin SWI or HW, including 1kΩ series resistor
Test pin
Symbol
Vhigh
Vlow
Pin(s)
Parameter
Test condition
Min
Typ
Max
Unit
Input level high
Input level low
0.7
Vdd
Vdd
TST
0.3
HWhyst
Hysteresis
0.075
Vdd
Table 23: DC Parameters Test pin
Charge Pump
Symbol
Pin(s)
Parameter
Test condition
Vbb > 15V
Vbb > 8V
Min
Typ
Max
Unit
Vcp
Vbb+10 Vbb+12.5 Vbb+15
Vbb+5.8
V
V
Output Voltage
VCP
Cbuffer
Cpump
External Buffer Capacitor
External pump Capacitor
220
220
470
470
nF
nF
CPP
CPN
Table 24: DC Parameters Charge Pump
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
46
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
10.4 AC Parameters
Power-Up
Symbol
Pin(s)
Parameter
Test condition
Min
Typ
Max
Unit
Tpu
Power-Up time
10
ms
Table 25: AC Parameters Power-Up
Switch Input and hardwired address input HW
Symbol
Tsw
Tsw_on
Pin(s)
Parameter
Test condition
Min
Typ
1024
1/16
Max
Unit
µs
SWI
HW
Scan Pulse Period
Scan Pulse Duration
921
1127
Tsw
Table 26: AC Parameters Switch Input and hardwired address input
Motor Driver
Symbol
Fpwm
Tbrise
Tbfall
Pin(s)
Parameter
Test condition
Min
Typ
20
Max
Unit
kHz
ns
OA1
OA2
OB1
OB2
PWM frequency
Turn-On transient time
Turn-Off transient time
18
22
Between 10% and 90%
350
250
ns
Table 27: AC Parameters Motor Driver
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
47
Revision History
Version
up to 0.90p
0.91p
Date (Initials)
Comments
July 9, 2003 before v. 0.90 changes on unpublished internal versions only
September 18, 2003 pins renamed according to TRINAMIC conventions; corrections
concerning cross references, drawings in PDF
0.92p
0.93p
January 28, 2004 Order Code Update (Table 2: Ordering Information, page 7)
April 23, 2004 New TRINAMIC logo; Table 5: Acc Parameter, page 11: combined cells
with same value; ESW is zero when switch is open (section 5.1.9, page
12); Table 9 : OTP Memory Structure on page 21: corrections concerning
bit mappings (exchanged locations of SecPos10… SecPos8 and
StepMode1… StepMode 0); corrected command descriptions
1.01
1.02
August 24, 2004 velocity groups integrated into Vmax table; corrected and enhanced Vmin
table; corrected meaning of Shaft bit; FAQ included
September 15, 2004 Updated Ordering Information; improved description of 2nd motion of
RunInit in Reference Search / Position initialization; combined tables for
Irun and Ihold; some corrections to DC Parameters; added final travel to
secure position during RunInit; reworked Internal handling of commands
and flags
1.03
1.04
October 1, 2004 New company address
January 7, 2005 Order code updated (Table 2: Ordering Information, page 7);
GetFullStatus1 (section 6.8.1, page 30) byte 1 (address) corrected; hint
concerning ResetPosition added (section 6.8.6, page 32)
1.05
October 21, 2005 Unit [FS/s] for Vmin added for Table 4 page 11, hint concerning OTP
memory (section 5.2, page 19); notes concerning "N/A = not applicable"
added due to customer requests, general hint concerning N/A added and
hint concerning slave address (byte 0) vs. slave address (byte) of
response datagrams added (section 6.8, page 30); hints added
concerning the SWI switch input and its ESW flag (section 5.1.9, page
12); hints concerning physical address (section 6.3, page 26);
GetFullStatus1 command (Response) Byte 1 Structure corrected (section
6.8.1, page 30); GetFullStatus2 command (Response) Byte 1 Structure
corrected (section 6.8.2, page 31); explanations and cross reference for
OTP from section 6.8.10, page 34 to section 5.2.3 page 21; labeling
indices of contend for TagPos 1 & 2 corrected for the RunInit Command
(section 6.8.8, page 33)
1.06
March 15, 2007 QFN32 package information added: Pin and Signal description to section
2.6 page 6, Ordering information to 4 page 7, Package Outline
information to 8 page 41;
Comment to 5.1.11, page 14: positions of Pos1 and Pos2; orientation of
marking outline for TMC222 symbols referring to the SOIC package
adapted to real marking (p. 1, p. 6)
1.07
1.08
August 8, 2007 QFN pinning on page 1 corrected, was bottom view before.
July 14, 2008 fixed MSBs (bit #7, bit #6, bit #5) of return byte #1 (Address) of
GetFullStatus1 (section 6.8.1 GetFullStatus1, page 30) corrected to ‘1’;
fixed MSBs (bit #7, bit #6, bit #5) of return byte #1 (Address) of
GetFullStatus2 (section 6.8.2 GetFullStatus2, page 31) corrected to ‘1’;
internal calibration parameters that can be read out via GetOTPParam
grayed within table Table 9 : OTP Memory Structure (section 5.2.3 OTP
Memory Structure, page 21) and hint added that these bits should not be
used after read out;
1.09
1.10
July 17, 2008 references to Table 9 : OTP Memory Structure corrected; color of fixed
MSBs of GetFullStatus1/2 corrected (were green); numbering of tables
corrected (#10 was missing)
March 2nd, 2009 (LL) GetActualPos (part of GetFullStatus2) corrected in Table 8: Priority
Encoder, page 18 (GetActualPos => GetFullStatus2)
1.11 November 25, 2009 (LL) Hint concerning connecting exposed ground for cooling added (section
8.2, page 42); operating supply voltage range (VbbT85 parameter added
for temperature < 85°C (VbbT85 Table 21, page 45)
1.12 March 7, 2011 (LL)
Hints concerning usage of HW pin and SWI pin added Table 1: TMC222
Signal Description, page 6; section 5.1.9 External Switch SWI, page 12;
section 6.3 Physical Address of the circuit, page 26;
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
48
TMC222 DATASHEET (V. 1.12 / March 7, 2011)
Please refer to www.trinamic.com for updated data sheets and application notes on this
product and on other products.
The TMCtechLIB CD-ROM including data sheets, application notes, schematics of evaluation
boards, software of evaluation boards, source code examples, parameter calculation
spreadsheets, tools, and more is available from TRINAMIC Motion Control GmbH & Co. KG by
request to tmc_info@trinamic.com
Copyright © 2004-2011 TRINAMIC Motion Control GmbH & Co. KG
相关型号:
TMC222-SI
Micro Stepping Stepper Motor ControllerWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC2220-TA
POWER DRIVER FOR STEPPER MOTORSWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC2224-LA
POWER DRIVER FOR STEPPER MOTORSWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC2225-SA
POWER DRIVER FOR STEPPER MOTORSWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC2226
POWER DRIVER FOR STEPPER MOTORS INTEGRATED CIRCUITSWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC2226-EVAL
POWER DRIVER FOR STEPPER MOTORS INTEGRATED CIRCUITSWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC2226-SA
POWER DRIVER FOR STEPPER MOTORS INTEGRATED CIRCUITSWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC2226-SA-T
POWER DRIVER FOR STEPPER MOTORS INTEGRATED CIRCUITSWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC22290R2C
Color Signal Encoder, CMOS, PQCC44, PLASTIC, LCC-44Warning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
RAYTHEON
TMC223
Micro Stepping Stepper Motor ControllerWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC223-LI
IC MOTOR DRIVER SER 32QFNWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
TMC223-SI
Micro Stepping Stepper Motor ControllerWarning: Undefined variable $rtag in /www/wwwroot/website_ic37/www.icpdf.com/pdf/pdf/index.php on line 217
-
TRINAMIC
©2020 ICPDF网 联系我们和版权申明