TMC211 DATASHEET (V. 1.04 / January 7, 2005) 1 TMC211 – DATASHEET 11 VCP CPP 10 12 VBAT CPN 9 13 OB2 HW2 8 14 GND GND 7 15 OB1 LIN 6 P +49 - (0) 40 - 51 48 06 - 0 F +49 - (0) 40 - 51 48 06 - 60 www.trinamic.com [email protected] 16 TMC211 SOIC-20 ® TRINAMIC Motion Control GmbH & Co. KG Sternstraße 67 D – 20357 Hamburg GERMANY OA2 TST 5 17 GND GND 4 18 OA1 VDD 3 19 VBAT HW1 2 20 HW0 1 SWI Micro Stepping Stepper Motor Controller / Driver with LIN Interface 1 Features The TMC211 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 TMC211 allows up to four bit of microstepping 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 LIN. Together with an inexpensive microcontroller the TMC211 forms a complete motion control system. The main benefits of the TMC211 are: • Motor driver • Controls one stepper motor with four bit microstepping • Programmable Coil current up to 800 mA • Supply voltage 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 • LIN interface • Physical and Data-Link Layers conform to LIN specification rev. 1.3 • Field-programmable node addresses (128) • Dynamically allocated identifiers • Diagnostics and status information as well as motion parameters accessable • LIN bus short-circuit protection to supply and ground • Lost LIN safe operation Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 2 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 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 2005 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-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 3 Table of Contents 1 FEATURES .....................................................................................................................................1 2 GENERAL DESCRIPTION .............................................................................................................5 2.1 2.2 2.3 2.4 2.5 2.6 BLOCK DIAGRAMM......................................................................................................................5 POSITION CONTROLLER / MAIN CONTROL ...................................................................................5 STEPPER MOTOR DRIVER...........................................................................................................5 LIN INTERFACE ..........................................................................................................................6 MISCELLANEOUS ........................................................................................................................6 PIN AND SIGNAL DESCRIPTIONS ..................................................................................................6 3 TYPICAL APPLICATION................................................................................................................7 4 ORDERING INFORMATION ..........................................................................................................7 5 FUNCTIONAL DESCRIPTION .......................................................................................................8 5.1 POSITION CONTROLLER AND MAIN CONTROLLER .........................................................................8 5.1.1 Stepping Modes ................................................................................................................8 5.1.2 Velocity Ramp...................................................................................................................8 5.1.3 Examples for different Velocity Ramps.............................................................................9 5.1.4 Vmax Parameter.............................................................................................................10 5.1.5 Vmin Parameter..............................................................................................................11 5.1.6 Acceleration Parameter ..................................................................................................11 5.1.7 Position Ranges..............................................................................................................12 5.1.8 Secure Position...............................................................................................................12 5.1.9 External Switch ...............................................................................................................12 5.1.10 Motor Shutdown Management........................................................................................13 5.1.11 Reference Search / Position initialization........................................................................14 5.1.12 Sleep Mode.....................................................................................................................14 5.1.13 Temperature Management .............................................................................................15 5.1.14 Battery Voltage Management .........................................................................................16 5.1.15 Internal handling of commands and flags .......................................................................17 5.2 RAM AND OTP MEMORY .........................................................................................................19 5.2.1 RAM Registers................................................................................................................19 5.2.2 Status Flags ....................................................................................................................20 5.2.3 OTP Memory Structure...................................................................................................21 5.3 STEPPER MOTOR DRIVER.........................................................................................................21 5.3.1 Coil current shapes .........................................................................................................22 5.3.2 Transition Irun to Ihold ....................................................................................................23 5.3.3 Chopper Mechanism.......................................................................................................24 6 LIN INTERFACE ...........................................................................................................................25 6.1 GENERAL DESCRIPTION ...........................................................................................................25 6.2 PHYSICAL LAYER......................................................................................................................25 6.3 ANALOG PART..........................................................................................................................26 6.4 SLAVE OPERATIONAL RANGE FOR PROPER SELF SYNCHRONIZATION ...........................................26 6.5 PHYSICAL ADDRESS OF THE CIRCUIT .........................................................................................27 6.6 ELECTRO MAGNETIC COMPABILITY ...........................................................................................27 6.7 ERROR STATUS REGISTER .......................................................................................................27 6.8 DYNAMIC ASSIGNMENT OF LIN IDENTIFIERS ..............................................................................28 6.9 LIN MESSAGE FRAMES ............................................................................................................29 6.9.1 Writing Frames ...............................................................................................................29 6.9.2 Writing Frame Type#1 (2 or 4 bytes) ..............................................................................30 6.9.3 Writing Frame Type#2 (2, 4 or 8 bytes) ..........................................................................30 6.9.4 Writing Frame Type#3 (2 bytes) .....................................................................................30 6.9.5 Writing Frame Type#4 (8 bytes) .....................................................................................30 Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 4 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.9.6 Reading Frames ............................................................................................................ 31 6.9.7 Reading Frame Type#5 (2, 4 or 8 bytes) ....................................................................... 31 6.9.8 Reading Frame Type#6 (8 bytes) .................................................................................. 31 6.9.9 Reading Frame Type#7 (Preparing frame) .................................................................... 32 6.9.10 Reading Frame Type#8 (Preparing frame) .................................................................... 32 6.10 APPLICATION COMMANDS OVERVIEW ................................................................................... 33 6.11 COMMAND DESCRIPTION ...................................................................................................... 34 6.11.1 GetActualPos ................................................................................................................. 34 6.11.2 GetFullStatus ................................................................................................................. 36 6.11.3 GetOTPParam ............................................................................................................... 38 6.11.4 GetStatus ....................................................................................................................... 39 6.11.5 GotoSecurePosition ....................................................................................................... 39 6.11.6 HardStop ........................................................................................................................ 39 6.11.7 ResetPosition ................................................................................................................. 40 6.11.8 ResetToDefault .............................................................................................................. 40 6.11.9 RunInit............................................................................................................................ 41 6.11.10 SetMotorParam .......................................................................................................... 42 6.11.11 SetOTPParam ............................................................................................................ 42 6.11.12 SetPosition ................................................................................................................. 43 6.11.13 SetPositionShort......................................................................................................... 44 6.11.14 SoftStop...................................................................................................................... 45 6.11.15 Sleep Mode ................................................................................................................ 45 6.12 POSITIONING TASK EXAMPLE ............................................................................................... 46 7 FREQUENTLY ASKED QUESTIONS ......................................................................................... 48 7.1 7.2 7.3 7.4 8 USING THE BUS INTERFACE ...................................................................................................... 48 GENERAL PROBLEMS WHEN GETTING STARTED ......................................................................... 48 USING THE DEVICE .................................................................................................................. 49 FINDING THE REFERENCE POSITION .......................................................................................... 50 PACKAGE OUTLINE ................................................................................................................... 51 8.1 9 SOIC-20 ................................................................................................................................ 51 PACKAGE THERMAL RESISTANCE AND LAYOUT CONSIDERATIONS ............................... 52 9.1 10 10.1 10.2 10.3 10.4 11 SOIC-20 PACKAGE ................................................................................................................. 52 ELECTRICAL CHARACTERISTICS ........................................................................................ 53 ABSOLUTE MAXIMUM RATINGS ............................................................................................. 53 OPERATING RANGES ........................................................................................................... 53 DC PARAMETERS ................................................................................................................ 53 AC PARAMETERS ................................................................................................................ 55 REVISION HISTORY................................................................................................................ 56 Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 5 2 General Description 2.1 Block Diagramm SWI LIN HW0 HW1 HW2 TST LIN transceiver Position controller Decoder DACs Main control & Registers OTP + ROM PWM regulator Y VBAT Voltage regulator Oscillator Charge pump VDD VCP 2.2 Reference voltage & Thermal monitoring CP2 CP1 Position Controller / Main Control Motor parameters, e.g. acceleration, velocity and position parameters are passed to the main control block via the LIN interface. These information are stored internally in RAM or OTP memory and are accessable 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 LIN interface block. 2.3 OA1 OA2 Sinewave table LIN slave controller Synchronous I/O controller (test) PWM regulator X 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. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG OB1 OB2 6 2.4 TMC211 DATASHEET (V. 1.04 / January 7, 2005) LIN Interface Communication between a host and the TMC211 takes places via the bi-directional LIN interface. Motion Instructions and diagnostic information are provided to or from the Main Control block. It is possible to connect up to 128 devices on the same bus. Slave addresses are programmable via OTP memory or external pins. The LIN interface implements the MAC and LLC layers according to the OSI reference model. 2.5 Miscellaneous Besides the main blocks the TMC211 contains the following: • an internal charge pump is used to drive the high side transistors. • an internal oscillator running at 4 MHz +/- 10% to clock the LIN protocol handler, 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. Pin and Signal Descriptions HW1 VDD GND TST LIN GND HW2 CPN CPP Pin SOIC20 HW0 HW1 VDD GND TST LIN HW2 CPN CPP VCP VBAT OB2 OB1 OA2 OA1 SWI 1 2 3 4,7,14,17 5 6 8 9 10 11 12,19 13 15 16 18 20 1 20 2 19 3 18 4 5 17 16 6 15 7 14 8 9 10 TRINAMIC HW0 TMC211 2.6 13 12 11 SWI VBAT OA1 GND OA2 OB1 GND OB2 VBAT VCP Description hard-wired LIN address bit #0 input hard-wired LIN address bit #1 input Internal supply (needs external decoupling capacitor) ground, heat sink test pin (to be tied to ground in normal operation) LIN-bus connection hard-wired LIN address bit #2 input negative connection of external charge pump capacitor positive connection of external charge pump capacitor connection of external charge pump filter capacitor battery voltage supply negative end of phase B coil positive end of phase B coil negative end of phase A coil positive end of phase A coil reference switch input Table 1: TMC211 Signal Description Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 7 3 Typical Application Connect to GND or +5V (VDD, Pin 3) 1 Connect to GND or +5V (VDD, Pin 3) HW0 SWI 20 2 HW1 VBAT 19 3 VDD OA1 18 4 GND GND 17 5 TST OA2 16 6 LIN OB1 15 7 GND GND 14 8 HW2 OB2 13 9 CPN VBAT 12 10 CPP VCP 11 Connect to GND or VBAT SWI 1kΩ /1/4W 2.7 nF 100 nF 100 nF 1 µF Tantalum LIN Bus Connect to GND or VBAT M VDR 27V 1kΩ /1/4W 2.7 nF 220 nF 16 V VBAT 8...29 V 100 nF 220 nF 16 V 100 µF Figure 1: TMC211 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. TMC211-PA20 (pre-series marking, same IC as TMC211-SA) TMC211-SA Package SOIC-20 Peak Current 800 mA Temperature Range -40°C..125°C SOIC-20 800mA -40°C..125°C Table 2: Ordering Information Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 8 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 5 Functional Description 5.1 Position Controller and Main Controller 5.1.1 Stepping Modes The TMC211 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 5.3 Stepper Motor Driver on page 21. • • • • 5.1.2 Half step Mode 1/4 Micro stepping 1/8 Micro stepping 1/16 Micro stepping Velocity Ramp A common velocity ramp where a motor drives to a desired position is shown in the figure below. The motion consists of an 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 LIN interface. These parameters are written via the SetMotorParam command (See Page 42) and read via the GetFullStatus command (See Page 36). Velocity V [FS/s] Vmax Vmin Xstart State of Motion No Movement Acceleration Phase Xtarget Constant Velocity Deceleration Phase Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG No Movement time [s] TMC211 DATASHEET (V. 1.04 / January 7, 2005) 5.1.3 9 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: Motion with change of target position in opposite direction (linear zero crossing) In Figure 5 the motor crosses zero velocity with a linear shape. The velocity can be less than the programmed Vmin value during zero crossing. Linear zero crossing provides very low torque ripple to the stepper motor during crossing. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 10 5.1.4 TMC211 DATASHEET (V. 1.04 / January 7, 2005) Vmax Parameter The desired maximum velocity Vmax can be chosen from the table below: Vmax index Vmax [FS/s] Vmax group 0 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 A B C D Half-Step Mode [half-steps/s] 197 273 334 395 425 456 486 546 607 668 729 790 912 1091 1457 1945 Stepping Mode 1/4 micro 1/8 micro stepping stepping [micro-steps/s] [micro-steps/s] 395 546 668 790 851 912 973 1091 1213 1335 1457 1579 1823 2182 2914 3891 790 1091 1335 1579 1701 1823 1945 2182 2426 2670 2914 3159 3647 4364 5829 7782 1/16 micro stepping [micro-steps/s] 1579 2182 2670 3159 3403 3647 3891 4364 4852 5341 5829 6317 7294 8728 11658 15564 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 TMC211 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-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 5.1.5 11 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. Vmax group [A...D] and Vmax index [0…15] Vmin Vmax A B C index factor 0 1 2 3 4 5 6 7 8 9 10 11 12 99 136 167 197 213 228 243 273 303 334 364 395 456 0 1 4 5 6 6 7 7 8 8 10 10 11 13 1 1/32 3 8 10 11 12 13 14 15 17 19 21 23 27 2 2/32 6 3 3/32 9 12 15 18 19 21 22 25 27 30 32 36 42 4 4/32 12 16 20 24 26 28 30 32 36 40 44 48 55 5 5/32 15 21 26 30 32 35 37 42 46 52 55 61 71 6 6/32 18 25 30 36 39 42 45 50 55 61 67 72 84 7 7/32 22 30 36 43 46 50 52 59 65 72 78 86 99 8 8/32 24 33 41 49 52 56 60 67 74 82 90 97 112 9 9/32 28 38 47 55 59 64 68 76 84 94 101 111 128 10 10/32 30 42 52 61 66 71 75 84 94 103 112 122 141 11 11/32 34 47 57 68 72 78 83 94 103 114 124 135 156 12 12/32 37 50 62 73 79 85 91 101 112 124 135 147 170 13 13/32 40 55 68 80 86 92 98 111 122 135 147 160 185 14 14/32 43 59 72 86 92 99 106 118 132 145 158 172 198 15 15/32 46 64 78 92 99 107 114 128 141 156 170 185 214 13 546 15 30 50 65 84 99 118 134 153 168 187 202 221 236 256 D 14 729 19 42 65 88 111 134 156 179 202 225 248 271 294 317 340 15 973 26 57 88 118 149 179 210 240 271 301 332 362 393 423 454 Table 4: Vmin values 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. 2 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 99 14785 Acc index Acceleration Values in [FS/s ] dependent on Vmax Vmax [FS/s] 136 167 197 213 228 243 273 303 334 364 395 456 546 729 973 49 106 473 218 735 1004 3609 6228 8848 11409 13970 16531 19092 21886 24447 27008 29570 34925 29570 40047 Table 5: Acc Parameter Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 12 TMC211 DATASHEET (V. 1.04 / January 7, 2005) The amount of equivalent full steps during acceleration phase can be computed by the next equation: 2− 2 Nstep = V max V min 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 Half-stepping 1/4 micro-stepping 1/8 micro-stepping 1/16 micro-stepping Position Range -4096…+4095 12 12 (-2 …+2 -1) -8192…+8191 13 13 (-2 …+2 -1) -16384…+16383 14 14 (-2 …+2 -1) -32768…+32767 15 15 (-2 …+2 -1) Full range excursion 8192 half-steps 13 2 16384 micro-steps 14 2 32768 micro-steps 15 2 65536 micro-steps 16 2 Table 6: Position Ranges Target positions can be programmed via LIN interface by using the SetPosition command (see 6.11.11). The actual motor position can be read by the GetActualPos command (see 6.11.1). 5.1.8 Secure Position In case of emergency (communication loss) or GotoSecurePosition command (6.11.5) the motor drives to the secure position. 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 1/4 micro stepping 1/8 micro stepping 1/16 micro stepping Secure Position Resolution 4 half steps th 8 micro steps (1/4 ) th 16 micro steps (1/8 ) th 32 micro steps (1/16 ) Table 7: Secure Position Resolution 5.1.9 External Switch Pin SWI will alternately attempt to source and sink current in/from the external switch (Figure 1: TMC211 Typical Application on page 7). 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 GetFullStatus or the GetActualPos command. As long as the switch is open, the <ESW> flag is set to zero. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 13 5.1.10 Motor Shutdown Management The TMC211 is set into motor shutdown mode as soon as one of the following conditions occur: • • • • The chip temperature rises above the thermal shutdown threshold Ttsd. See 5.1.13 Temperature Management on Page 15 The battery voltage drops below UV2 See 5.1.14 Battery Voltage Management on Page 16. An electrical problem occurred, e.g. short circuit, open circuit, etc. In case of such a 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 LIN 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 GetFullStatus command is performed via LIN 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 TMC211 is ready to execute any positioning command. IMPORTANT NOTE: First, a GetFullStatus command has to be executed after power-on to activate the TMC211. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 14 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 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 a Vmax parameter and also position information about the end of first and second motion. (6.11.9 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 an 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. 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 GetFullStatus command will cause the circuit to leave the deadlock state. Velocity V [FS/s] 2nd Motion 1st Motion Vmax Vmin Pos1 Pos2 Position X [FS] Figure 6: RunInit 5.1.12 Sleep Mode When entering Sleep mode, the stepper-motor is driven to the secure position if the secure position is enabled (SecPos[10:0] different from the most negative decimal value of –1024). Then the circuit is completely powered down, apart from the LIN receiver which remains active to detect a dominant state on the bus. In case sleep mode is entered while a motion is ongoing, a transition will occur towards secure position as described above. The Sleep mode can be entered in the following cases: • • The circuit receives a LIN frame with identifier 0x3C and first data byte containing 0x00, as required by LIN specification rev. 1.3. The LIN bus remains inactive or is lost during more than 25000 LIN bit times (1.30s at 19.2 kbit/s). The circuit will return to normal mode once a valid LIN frame is received while in the Sleep mode (this valid frame can be addressed to another slave). For more information refer to 6.11.15 Sleep Mode on page 45. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 15 5.1.13 Temperature Management The TMC211 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 & GetFullStatus T° < Ttw & GetFullStatus T° > Ttw Thermal Warning <Tinfo> = "10" <TW> = '1' <TSD> = '0' T° > Ttw Post Thermal Warning <Tinfo> = "00" <TW> = '1' <TSD> = '0' T° < Ttw T° > Ttsd Thermal Shutdown <Tinfo> = "11" <TW> = '1' <TSD> = '1' SoftStop, if motion Motion = disabled 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-2005 TRINAMIC Motion Control GmbH & Co. KG 16 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 5.1.14 Battery Voltage Management The TMC211 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 & GetFullStatus Vbat > UV1 & GetFullStatus 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-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 17 5.1.15 Internal handling of commands and flags Due to the sleep mode, 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. 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.11 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. RunInit Thermal Shutdown HardStop Motion finished Power On Reset RunInit SoftStop HardStop Thermal Shutdown SoftStop HardStop HardStop Motion finished HardStop Thermal Shutdown GotoSecurePosition Stopped ShutDown GetFullStatus AND <TSD> + <HS> = 0 <Sleep> or LIN timeout SetPosition GotoPos Motion finished Priorities High Any LIN command Motion finished Sleep <Sleep> AND (not <SecEn>) OR <SecEn> AND ActPos== SecPos OR <Stop> Figure 7: Internal handling of commands and flags Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Low 18 TMC211 DATASHEET (V. 1.04 / January 7, 2005) State → Command ↓ GetActualPos GetOTPParam GetFullStatus or GetStatus [attempt to clear <TSD> and <HS> flags] ResetToDefault [ActPos and TagPos are not altered] Stopped GotoPos RunInit SoftStop HardStop motor stopped, Ihold in coils motor motion ongoing motor decelerating motor forced to stop LIN in-frame response OTP refresh; LIN in-frame LIN in-frame response OTP refresh; LIN in-frame no influence on RAM and TagPos LIN in-frame response OTP refresh; LIN in-frame LIN in-frame response OTP refresh; LIN in-frame LIN in-frame response LIN in-frame response LIN in-frame response LIN in-frame response OTP refresh; OTP to RAM; AccShape reset OTP refresh; OTP to RAM; AccShape reset OTP refresh; OTP to RAM; AccShape reset (note 3) OTP refresh; OTP to RAM; AccShape reset RAM update RAM update RAM update RAM update ShutDown motor stopped, H-bridges in Hi-Z LIN in-frame LIN in-frame response response OTP refresh; OTP refresh; LIN in-frame LIN in-frame LIN in-frame response; if (<TSD> or LIN in-frame <HS>) = ‘1’ response then → Stopped OTP refresh; OTP refresh; OTP to RAM; OTP to RAM; AccShape AccShape reset reset Sleep no power (note 1) SetMotorParam [Master takes care about proper update] ResetPosition SetPosition RAM update TagPos and ActPos reset TagPos updated; TagPos updated TagPos updated →GotoPos RAM update TagPos and ActPos reset SetPositionShor TagPos updated; t TagPos updated TagPos updated [half-step mode only)] →GotoPos If <SecEn> = ‘1’ GotoSecurePosit then TagPos = SecPos; ion →GotoPos →RunInit RunInit HardStop SoftStop Sleep or LIN timeout [ ⇒ <Sleep> = ‘1’, reset by any LIN command received later ] See note 9 If <SecEn> = ‘1’ then TagPos = SecPos If <SecEn> = ‘1’ then TagPos = SecPos →HardStop; <StepLoss> = ‘1’ →SoftStop →HardStop; <StepLoss> = ‘1’ If <SecEn> = ‘1’ If <SecEn> = ‘1’ then TagPos = then TagPos = SecPos; SecPos will be evaluated else → SoftStop after RunInit →HardStop; <StepLoss> = ‘1’ No action; <Sleep> flag will be evaluated when motor stops No action; <Sleep> flag will be evaluated when motor stops →Sleep →Stopped; TagPos =ActPos n.a. HardStop [ ⇔ (<CPFail> or <UV2> or <ElDef>) = ‘1’ ⇒ <HS> = ‘1’ ] Thermal shutdown [ <TSD> = ‘1’ ] Motion finished →Shutdown →HardStop →HardStop →Shutdown →SoftStop →SoftStop n.a. →Stopped →Stopped →HardStop →Stopped; TagPos =ActPos Table 8: Priority Encoder Color code: Command ignored Transition to another state Master is responsible for proper update (see note 7) Notes: 1 2 3 Leaving Sleep state is equivalent to Power on reset. After Power on reset, the Shutdown state is entered. The Shutdown state can only be left after a GetStatus or a GetFullStatus command (so that the Master could read the <VddReset> flag). 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. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG n.a. TMC211 DATASHEET (V. 1.04 / January 7, 2005) 4 5 6 7 8 9 10 11 12 13 14 5.2 19 The <Sleep> flag is set to ‘1’ when a LIN timeout or a Sleep command occurs. It is reset by the next LIN command (<Sleep> is cancelled if not activated yet). 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 GetStatus or GetFullStatus 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 or SetPositionShort command. Some transitions like GotoPos → Sleep are actually done via several states: GotoPos → SoftStop → Stopped → Sleep (see diagram below). Two transitions are possible from state Stopped when <Sleep> = ‘1’: 1) Transition to state Sleep if (<SecEn> = ‘0’) or ((<SecEn> = ‘1’) and (ActPos = SecPos)) or <Stop> = ‘1’ 2) Otherwise transition to state GotoPos, with TagPos = SecPos <SecEn> = ‘1’ when register SecPos is loaded with a value different from the most negative value (i.e. different from 0x400 = “100 0000 0000”) <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. Command for dynamic assignment of IDs is decoded in all states except Sleep and has not effect on the current state While in state Stopped, if ActPos ≠ TagPos there is a transition to state GotoPos. This transition has the lowest priority, meaning that <Sleep>, <Stop>, <TSD>, etc. are first evaluated for possible transitions. If <StepLoss> is active, then SetPosition, SetPositionShort and GotoSecurePosition commands are ignored (they will not modify TagPos register whatever the state), and motion to secure position is forbidden after a Sleep command or a LIN timeout (the circuit will go into Sleep state immediately, without positioning to secure position). Other command like RunInit or ResetPosition will be executed if allowed by current state. <StepLoss> can only be cleared by a GetStatus or GetFullStatus command. RAM and OTP Memory 5.2.1 RAM Registers Register Mnemonic Actual Position Target Position ActPos Length (bit) 16 TagPos 16 Acceleration Shape AccShape 1 Coil Peak Current Irun 4 Coil Hold Current Ihold 4 Minimum Velocity Vmin 4 Maximum Velocity Vmax 4 Shaft Shaft 1 Acceleration Deceleration Acc 4 Secure Position SecPos 11 Stepping Mode StepMode 2 Related commands GetFullStatus ResetPosition SetPosition GetFullStatus ResetPosition GetFullStatus SetMotorParam ResetToDefault GetFullStatus SetMotorParam ResetToDefault GetFullStatus SetMotorParam ResetToDefault GetFullStatus SetMotorParam ResetToDefault GetFullStatus SetMotorParam ResetToDefault GetFullStatus SetMotorParam ResetToDefault GetFullStatus SetMotorParam ResetToDefault GetFullStatus ResetToDefault GetFullStatus ResetToDefault Comment Reset State Actual Position of the Stepper Motor. 16-bit signed Target Position of the Stepper Motor. 16-bit signed 0x0000 0 = Acceleration with Acc Parameter. 1 = Velocity set to Vmin, without acceleration Coil current when motion is ongoing (Table 12: Irun / Ihold Settings) Coil current when motor stands still (Table 12: Irun / Ihold Settings) Start Velocity of the stepper motor (Table 4: Vmin ) Target Velocity of the stepper motor (Table 3: Vmax Parameter) Direction of motion Parameter for acceleration (Table 5: Acc Parameter) Target Position for GotoSecurePosition command (6.11.5 GotoSecurePosition) or when LIN connection fails; 11 MSBs of 16-bit position (LSBs fixed to ‘0’) Micro stepping mode (5.1.1 Stepping Modes) Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG OTP Memory 20 5.2.2 TMC211 DATASHEET (V. 1.04 / January 7, 2005) Status Flags The table below shows the flags which are accessable by the LIN interface in order to receive information about the internal status of the TMC211. Flag Length (bit) 1 Related Command GetFullStatus OVC1 1 GetFullStatus OVC2 1 GetFullStatus StepLoss 1 GetFullStatus SecEn 1 Internal use Sleep 1 Internal use ElDef 1 GetFullStatus Temperature Info Tinfo 2 GetFullStatus Thermal Warning TW 1 GetFullStatus Thermal Shutdown TSD 1 GetFullStatus Motion 3 GetFullStatus ESW 1 GetFullStatus CPFail 1 GetFullStatus HS 1 Internal use Digital supply Reset Over current in coil A Over current in coil B StepLoss Secure position enabled Circuit in Sleep mode Electrical Defect Motion Status External Switch Status Charge Pump failure Electrical flag Mnemonic VddReset Comment 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 GetFullStatus command. Set to ‘1’ if an over current in coil #1 was detected. Is set to ‘0’ after GetFullStatus command. Set to ‘1’ if an over current in coil #2 was detected. Is set to ‘0’ after GetFullStatus command. Set to ‘1’ when under voltage, over current or over temperature event was detected. Is set to ‘0’ after GetFullStatus command. SetPosition and GotoSecurePosition commands are ignored when <StepLoss> = 1 ‘0’ if SecPos = “100 0000 0000” ‘1’ otherwise ‘1’ = Sleep mode reset by LIN command Set to ‘1’ if open circuit or a short was detected, (<OVC1> or <OVC2>). Is set to ‘0’ after GetFullStatus command. Indicates the chip temperature “00” = normal temperature “01 = low temperature warning “10” = high temperature warning “11” = motor shutdown Set to one if temperature raises above 145 °C. Is set to ‘0’ after GetFullStatus command. Set to one if temperature raises above 155° C. Is set to ‘0’ after GetFullStatus command and Tinfo = “00”. Indicates the actual behavior of the position controller. “000”: Actual Position = Target Position; Velocity = 0 “001”: Positive Acceleration; Velocity > 0 “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 Indicates the status of the external switch. ‘0’ = open ‘1’ = close ‘0’ charge pump OK ‘1’ charge pump failure <CPFail> or <UV2> or <ElDef> Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Reset state ‘1’ ‘0’ ‘0’ ‘0’ n.a. ‘0’ ‘0’ “00” ‘0’ ‘0’ “000” ‘0’ ‘0’ ‘0’ TMC211 DATASHEET (V. 1.04 / January 7, 2005) 5.2.3 21 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 been 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 25: DC Parameters Supply and Voltage regulator on page 54), otherwise the circuit will be destroyed. OTP Address 7 OSC3 0x00 EnableLIN 0x01 ADM 0x02 Irun3 0x03 Vmax3 0x04 SecPos10 0x05 SecPos7 0x06 0x07 OTP Bit Order 4 3 6 5 OSC2 TSD2 OSC1 TSD1 OSC0 TSD0 Irun2 Vmax2 SecPos9 SecPos6 Irun1 Vmax1 SecPos8 SecPos5 Irun0 Vmax0 Shaft SecPos4 IREF3 BG3 AD3 Ihold3 Vmin3 Acc3 SecPos3 StepMode1 2 1 0 IREF2 BG2 AD2 Ihold2 Vmin2 Acc2 SecPos2 StepMode0 IREF1 BG1 AD1 Ihold1 Vmin1 Acc1 SecPos1 LOCKBT IREF0 BG0 AD0 Ihold0 Vmin0 Acc0 SecPos0 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. 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. LOCKBT Lock bit (zapped before delivery) LOCKBG Protected byte 0x00 to 0x01 0x02 to 0x07 Table 10: OTP Lock bits The command used to load the application parameters via the LIN 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.11.10 SetMotorParam on page 42) is used to select different stepping modes. Following modes are available: StepMode parameter 00 01 10 11 Mode Half Stepping ¼ µStepping 1/8 µStepping 1/16 µStepping Table 11: StepMode Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 22 5.3.1 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 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-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 5.3.2 23 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 (hexadecimal) 0x0 0x1 0x2 0x3 0x4 0x5 0x6 0x7 0x8 0x9 0xA 0xB 0xC 0xD 0xE 0xF Peak Current [mA] 59 71 84 100 119 141 168 200 238 283 336 400 476 566 673 800 Table 12: Irun / Ihold Settings Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 24 5.3.3 TMC211 DATASHEET (V. 1.04 / January 7, 2005) Chopper Mechanism The chopper frequency is fixed as specified in chapter 10.4 AC Parameters on page 55. The TMC211 uses an intelligent chopper algorithm to provide a smooth operation with low resonance. The TMC211 uses internal measurements to derive current flowing through coils. If the current is less than the desired current, the TMC211 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-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 25 6 LIN Interface 6.1 General Description The LIN (Local Interconnect Network) is a serial communication protocol that is used mainly for distributed mechatronic systems in automotive applications. The LIN implementation in the TMC211 corresponds to one slave node which follows to LIN specification rev. 1.2. Features: • • • • • • • • • Single master / multiple-slave communication Self synchronizing slave nodes / no quartz or ceramics resonator necessary Deterministic latency times for signal transmission Single-wire communication Transmission speed 19.2 kbit/s Selectable length of Message Frame: 2, 4, and 8 bytes Configuration flexibility Data checksum security and error detection Detection of defective nodes in the network For more information about the LIN protocol please refer to the official website and the LIN Protocol Specification. Both can be found at http://www.lin-subbus.org/. 6.2 Physical Layer The physical layer is a single wire with pull-up resistor in every node. The bus is directly powered from the vehicle power net Vbb. Vbb Wake-Up INH Ctrl R R=30KΩ R INH to 5V regulator Receiver EN RxD LIN LIN Protocol Handler Driver + Slope Control TxD HW0 HW1 HW2 Figure 14: LIN Physical Layer Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG to control block 26 6.3 TMC211 DATASHEET (V. 1.04 / January 7, 2005) Analog Part The transmitter is a low-side driver with a pull-up resistor and slope control. The figure below shows the characteristics of the transmitted signal, including the delay between internal TxD Signal and LIN Signal. See Table 32: AC Parameters LIN Transmitter on page 55 and Table 33: AC Parameters LIN Receiver on page 55 for timing values. TxD 50% 50% T_tr_F t T_tr_R LIN 100% 95% 60% 40% 5% t_slope_F 0% t_slope_R t LIN 50% 50% t RxD T_rec_R 50% 50% T_rec_F t Figure 15: LIN Signal Characteristics 6.4 Slave operational range for proper self synchronization The internal oscillator having a ± 10% accuracy over the voltage and temperature range, will synchronize properly in the following conditions: • • Vbb ≥ 8 V Ground shift between Master node and Slave node < ± 1 Volt It is highly recommended to use the same type of reverse battery voltage protection diode for the Master and the Slave nodes. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.5 27 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 LIN bus. This address is coded on seven bits, yielding the theoretical possibility of 128 different circuits on the same bus. It is a combination of four OTP memory bits (see 5.2.3 OTP Memory Structure) and three hardwired address bits (pins HW0, HW1 and HW2). Pins HW0 and HW1 are 5V digital inputs, whereas pin HW2 is compliant with a 12V level. HW2 must either be connected to Vbat or ground. Pin HW2 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 TCM211 supports broadcasting. When the <Broad> bit is set to zero, broadcasting is active and each slave on the LIN bus will be addressed. AD6 AD5 AD4 AD3 AD2 AD1 AD0 OTP_AD3 OTP_AD2 OTP_AD1 OTP_AD0 HW0 HW1 Physical address OTP Memory Hardwired Bits HW2 Figure 16: Physical Slave Address The amount of physical addresses can be expanded by using bit ADM. This bit allows for the following expansion: ADM 0 1 AD6 HW0 PA0 AD5 HW1 HW0 AD4 HW2 HW1 AD3 PA3 HW2 AD2 PA2 PA3 AD1 PA1 PA2 AD0 PA0 PA1 Table 13: Physical Address Expansion 6.6 Electro Magnetic Compability EMC behavior fulfills requirements defined by LIN specification rev. 1.3. 6.7 Error Status Register The LIN interface implements a register containing an error status of the LIN communication. This register is specified as follows: Bit7 Not used Bit6 Not used Bit5 Not used Bit4 Not used Bit3 Timeout Error Flag Bit2 Data Error Flag Table 14: LIN Error Status Register Note: Data Error Flag = Checksum error OR StopBit error OR Length error Header Error Flag = Parity error OR Synch Field error A GetFullStatus command will reset the error status register Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Bit1 Header Error Flag Bit0 Bit Error Flag 28 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.8 Dynamic Assignment of LIN Identifiers The identifier field in the LIN message frame denotes the content of the message. Six identifier bits and two parity bits are used to represent the content. The identifiers 0x3C to 0x3F are reserved for command frames and extended frames. Slave nodes need to be very flexible to adapt itself to a given LIN network in order to avoid conflicts with slave nodes from different manufacturers. Dynamic assignment of identifiers fulfills this requirement by writing identifiers into the circuits RAM. ROM pointers are linking commands and dynamic identifiers together. A writing frame with identifier 0x3C issued by the LIN master writes dynamic identifiers into the RAM. One writing frame is able to assign 4 identifiers, therefore 3 frames are needed to assign all identifiers. Each ROM pointer ROMp_x [3:0] places the corresponding dynamic identifier Dyn_ID_x [5:0] at the correct place in the RAM, see table below. When setting <BROAD> to zero broadcasting is active and each slave on the LIN bus will store the same dynamic identifiers, otherwise only the slave with the corresponding slave address is programmed. Byte Content 0 1 2 3 4 5 6 7 8 Identifier AppCMD CMD Address Data Data Data Data Data Dynamic Identifiers Writing Frame Structure Bit7 Bit6 Bit5 Bit4 Bit3 Bit2 Bit1 Bit0 0x3C 0x80 1 0x11 Broad AD6 AD5 AD4 AD3 AD2 AD1 AD0 DynID_1 [3:0] ROMp_1 [3:0] DynID_2 [1:0] ROMp_2 [3:0] DynID_1 [5:4] ROMp_3 [3:0] DynID_2 [5:2] ROMp_4 [1:0] DynID_3 [5:0] DynID_4 [5:0] ROMp_4 [3:2] Dynamic ID ROM pointer (binary) user defined user defined user defined user defined user defined user defined user defined user defined user defined 0000 0001 0010 0011 0100 0101 0110 0111 1000 Application command General purpose 2 data bytes General purpose 4 data bytes GetActualPosition GetStatus SetPosition (2 data bytes) SetPositionShort (1 Motor) SetPositionShort (2 Motors) SetPositionShort (4 Motors) Preparation frame Dynamic assignment done at start-up Command assignment via Dynamic ID during operation Figure 17: Principle of dynamic command assignment Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) Command Mnemonic GetActualPos GetFullStatus GetOTPParam GetStatus GotoSecurePosition HardStop ResetPosition ResetToDefault RunInit SetMotorParam SetPosition SetPositionShort (1 Motor) SetPositionShort (2 Motors) SetPositionShort (4 Motors) Sleep SoftStop SetOTPParam Dynamic ID assignment General Purpose 2 Data Bytes General Purpose 4 Data Bytes Preparing Frame Command Byte (CMD) binary hex 000000 0x00 000001 0x01 000010 0x02 000011 0x03 000100 0x04 000101 0x05 000110 0x06 000111 0x07 001000 0x08 001001 0x09 001011 0x0B 001100 0x0C 001101 0x0D 001110 0x0E Not used 001111 0x0F 010000 0x10 010001 0x11 29 Dynamic ID ROM pointer (binary; example) (binary) 100xxx Not used Not used 000xxx Not used Not used Not used Not used Not used Not used 010xxx 001001 101001 111001 Not used Not used Not used Not used 011000 101000 011010 0010 0011 0100 0101 0110 0111 0000 0001 1000 Table 15: Commands and Corresponding Dynamic IDs Note: xxx allows to address physically a slave node. Therefore, these dynamic IDs cannot be used for more than 8 stepper motors. 6.9 LIN Message Frames As specified in LIN specification rev. 1.3 a LIN frame consists of an 8-bit identifier field, followed by 2, 4 or 8 data fields and a checksum field. A LIN frame can either be a writing frame, with one of the following tasks: • • Program the OTP memory Provide motion parameters, e.g. velocity, position, torque to the TMC211 Or a LIN frame can be a reading frame which is used to: • • Read actual position or status information of the stepper motor Verify correct programming and configuration 6.9.1 Writing Frames According to the LIN specification there is only a fixed amount of identifiers available. In order to expand the amount of identifiers resp. the amount of commands different types of writing frames are introduced. The TMC211 supports four different writing frames. The following figures illustrate the differences. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 30 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.9.2 Writing Frame Type#1 (2 or 4 bytes) General purpose 2 or 4 data bytes writing frame with a dynamically assigned identifier. This type is used to provide 2 or 4 bytes of data to the slave nodes. When <Broad> is set to zero, broadcasting is active and the command is valid for all slave nodes. When <Broad> is one the command is only valid for one slave node whose physical address corresponds to the one provided by the writing frame. A writing frame of 2 bytes issues only a defined command to the slave node(s), e.g. HardStop command. Whereas a writing frame of 4 bytes issues a command and 2 bytes of data to the slave node(s), e.g. SetPosition command. ID ID [7:0] Data1 1 Data3 Data4 B Physical Address Command Identifier 6.9.3 Data2 CMD [6:0] Parameters Writing Frame Type#2 (2, 4 or 8 bytes) 2, 4 or 8 data bytes writing frame with an identifier dynamically assigned to a particular application command, regardless of the physical address of the circuit. e.g. SetPositionShort command. ID ID [5:0] Data1 pp AD [3:0] Dynamic Identifier 6.9.4 Data2 B physical address Parameter [10:0] Writing Frame Type#3 (2 bytes) 2 data bytes writing frame with an identifier dynamically assigned to a particular slave node and application command. This type of frame requires that there are as many dynamically assigned identifiers as there are TMC211 circuits connected to the LIN bus using this command. ID ID [5:0] Data1 Dynamic Identifier 6.9.5 Data2 pp Parameter [15:0] Writing Frame Type#4 (8 bytes) 8 data bytes writing frame with fixed identifier 0x3C. The structure is similar to type#1 but uses the reserved identifier 0x3C. Using a reserved identifier followed by a particular application command will expand the amount of possible LIN commands. ID 0x3C Data1 00 fixed identifier 0x80 AppCMD Data2 CMD [6:0] Command Data3 1 Data4 Data5 Data6 Data7 B physical address Parameters send from LIN master to LIN slave node Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Data8 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.9.6 31 Reading Frames When using reading frames the master initiates the communication by sending a header field, which contains the synchronization and identifier field. The TMC211 supports two types of identifiers: • • Direct ID: The identifier points to a particular slave node. As described in the LIN specification the slave sends the data as in-frame response. Direct ID gives the fastest access to the required data. Indirect ID: Indirect ID contains of two datagrams. The first datagram, called preparing frame, issues the slave’s physical address to the particular slave node. The second datagram specifies only a reading command by using the reserved identifier 0x3D. Indirect ID has the advantage to use a reserved identifier and therefore provides more flexibility. 6.9.7 Reading Frame Type#5 (2, 4 or 8 bytes) Type#5 is a reading frame, which uses a direct ID, therefore the master initiates the communication and the slave responds after receiving the identifier. Dependent on the identifier the slave transmits 2, 4 or 8 bytes of data. GetActualPos command uses Type#5 reading frame. ID Master Task ID [5:0] Synch Break Synch Field pp Dynamic Identifier In-Frame Slave Response (2, 4 or 8 bytes) 6.9.8 Data1 Data2 Datax Data8 Parameters back to master Reading Frame Type#6 (8 bytes) Reading frame Type#6 uses indirect ID and therefore a preparing frame of Type#7 or #8 is needed. The preparing frame dumps the reading command into a particular slave node. Data from the slave is then transmitted after the next reading frame. The reading frame must always be consecutive to a preparing frame, otherwise it is not valid and not taken into account. Master Task 1. Preparing Frame Type#7 or Type#8 Master Task 2. (Reading Frame) ID ID [7:0] Synch Break Slave Response (8 bytes) Synch Field Identifier 0x3D Data1 Data2 Datax Parameters back to master Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Data8 32 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.9.9 Reading Frame Type#7 (Preparing frame) A preparing frame prepares a particular slave node, that it has to answer after the next reading frame. Preparing frames are needed when using indirect ID. Type#7 preparing frame consists of a dynamically assigned identifier, the command indicating which kind of information is to provide to the master and the physical address of the slave. ID Data1 Data2 ID [7:0] CMD [6:0] AD [6:0] Identifier Command Physical Address 6.9.10 Reading Frame Type#8 (Preparing frame) Type#8 preparing frame uses the reserved identifier 0x3C, followed by the application command 0x80, then the particular reading command and the physical address is provided to the slave. ID Data1 Data2 Data3 Data4 ID [7:0] AppCMD [7:0] CMD [6:0] AD [6:0] 0xFF Identifier 0x3C AppCMD 0x80 Command Slave Address Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Data8 0xFF Data 4...8 = 0xFF 0xFF TMC211 DATASHEET (V. 1.04 / January 7, 2005) 33 6.10 Application Commands Overview Communications between the TMC211 and a LIN 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 TMC211 Writing commands are used to: • Program the OTP Memory • Configure the TMC211 with motion parameters (e.g. max/min speed, acceleration, stepping mode, etc.) • Provide target positions to the Stepper motor Command Mnemonic GetActualPos GetFullStatus GetOTPParam GetStatus GotoSecurePosition HardStop ResetPosition ResetToDefault RunInit SetMotorParam SetPosition SetPositionShort (1 Motor) SetPositionShort (2 Motors) SetPositionShort (4 Motors) SoftStop SetOTPParam Sleep Function Returns actual position of the motor Returns actual, target and secure position and also the complete status of the circuit Returns OTP memory content Returns quick status of the circuit Drives motor to secure position Immediate full stop Actual and target position becomes zero Overwrites the chip RAM with OTP contents Reference Search Sets motor parameter Drives the motor to the target position Drives the motor to the target position (Half stepping mode only) Drives 2 motors to the target position (Half stepping mode only) Drives 4 motors to the target position (Half stepping mode only) Stops the motor with deceleration phase Programs the selected byte of OTP memory Causes circuit to go into sleep mode Table 16: Command Overview Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 34 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.11 Command Description 6.11.1 GetActualPos This command is provided to the circuit by the LIN master to get the actual position of the stepper motor. GetActualPos provides also a quick status of the circuit and of the stepper motor, identical to that obtained by command GetFullStatus. The GetActualPos will not attempt to reset any flags. This command can be sent using direct or indirect ID: 1. Direct ID (immediate in-frame slave response): Source Byte Master 0 1 2 3 4 Slave Note: GetActualPos direct ID reading frame(type#5) Content Structure bit 7 bit 6 bit 5 bit 4 bit 3 Identifier * * 1 0 ID3 Slave Address ESW AD [6:0] Actual Position ActPos [15:8] ActPos [7:0] VddReset StepLoss ElDef UV2 TSD Status bit 2 ID2 TW bit 1 ID1 bit 0 ID0 Tinfo [1:0] * according to parity calculation ID [3:0]: Dynamically allocated identifier to GetActualPos command. Or: 2. Indirect ID (preparing frame followed by indirect ID reading frame): The master sends either type#7 or type#8 preparing frame: Source 0 1 2 Master Note: Byte GetActualPos preparing frame (type#7) Content Structure bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 Identifier * * 0 ID4 ID3 ID2 Command 1 CMD [6:0] = 0x00 Slave Address 1 AD [6:0] bit 1 ID1 bit 0 ID0 bit 1 0 bit 0 0 * according to parity calculation ID [4:0]: Dynamically allocated identifier to type#7 preparing frame. Source Byte Master 0 1 2 3 4 5 6 7 8 GetActualPos preparing frame (type#8) Content Structure bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 Identifier 0 0 1 1 1 1 AppCMD AppCMD = 0x80 Command 1 CMD [6:0] = 0x00 Slave Address 1 AD [6:0] Data4 0xFF Data5 0xFF Data6 0xFF Data7 0xFF Data8 0xFF Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 35 After type#7 or type#8 preparing frame the master sends reading frame type#6 to retrieve the circuit’s in-frame response: Source Master Slave Byte 0 1 2 3 4 5 6 7 8 GetActualPos indirect ID reading frame (type#6) Content Structure bit 7 Bit 6 bit 5 bit 4 bit 3 Identifier 0 1 1 1 1 Slave Address 1 AD [6:0] ActualPosition ActPos [15:8] ActPos [7:0] VddReset StepLoss ElDef Status UV2 TSD Do not care 0xFF Do not care 0xFF Do not care 0xFF Do not care 0xFF Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG bit 2 1 TW bit 1 0 bit 0 1 Tinfo [1:0] 36 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.11.2 GetFullStatus 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 LIN interface to the master are: • • • • • • • coil peak and hold currents value (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 (see further) • motion status <Motion [2:0]> • over current flags for coil #1 <OVC1> and coil #2 <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> The following flags are attempt to reset: <TW>, <TSD>, <UV2>, <ElDef>, <StepLoss>, <CPFail>, <OVC1>, <OVC2> and <VddReset> The master sends either type#7 or type#8 preparing frame: Source Byte Master 0 1 2 Note: GetFullStatus preparing frame (type#7) Content Structure bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 Identifier * * 0 ID4 ID3 ID2 Command 1 CMD [6:0] = 0x01 Slave Address 1 AD [6:0] bit 1 ID1 bit 0 ID0 bit 1 0 bit 0 0 * according to parity calculation ID [4:0]: Dynamically allocated identifier to type#7 preparing frame. Source Byte Master 0 1 2 3 4 5 6 7 8 GetFullStatus preparing frame (type#8) Content Structure bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 Identifier 0 0 1 1 1 1 AppCMD AppCMD = 0x80 Command 1 CMD [6:0] = 0x01 Slave Address 1 AD [6:0] Data4 0xFF Data5 0xFF Data6 0xFF Data7 0xFF Data8 0xFF Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 37 After type#7 or type#8 preparing frame the master sends two successive LIN type#6 reading frames to retrieve the circuit’s in-frame responses. It is not mandatory to send the second reading frame if position information are not needed by the application. Source Byte Master 0 1 2 3 4 5 6 7 Slave 8 Source Byte Master 0 1 2 3 4 5 6 7 8 Slave GetFullStatus indirect ID reading frame 1 (type#6) Content Structure bit 7 bit 6 Bit 5 bit 4 bit 3 bit 2 bit 1 bit 0 Identifier 0 1 1 1 1 1 0 1 Slave Address 1 AD [6:0] Irun + Ihold Irun [3:0] Ihold [3:0] Vmax + Vmin Vmax [3:0] Vmin [3:0] Acc Shape StepMode [1:0] Status + Acc Shaft Acc [3:0] VddReset StepLoss Status ElDef UV2 TSD TW Tinfo [1:0] CPFail Status Motion [2:0] ESW OVC1 OVC2 1 LIN error See Table 14: LIN Error Status Register on page 27 status register Do not care 0xFF GetFullStatus indirect ID reading frame 2 (type#6) Content Structure bit 7 bit 6 Bit 5 bit 4 bit 3 Identifier 0 1 1 1 1 Slave Address 1 AD [6:0] ActualPosition ActPos [15:8] ActPos [7:0] TargetPosition TagPos [15:8] TagPos [7:0] SecurePosition SecPos [7:0] 1 1 1 1 1 Do not care 0xFF Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG bit 2 1 bit 1 0 bit 0 1 SecPos [10:8] 38 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.11.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. The master sends either type#7 or type#8 preparing frame: Source Byte Master 0 1 2 Note: GetOTPParam preparing frame (type#7) Content Structure bit 7 bit 6 Bit 5 bit 4 bit 3 bit 2 Identifier * * 0 ID4 ID3 ID2 Command 1 CMD [6:0] = 0x02 Slave Address 1 AD [6:0] bit 1 ID1 bit 0 ID0 bit 1 0 bit 0 0 * according to parity calculation ID [4:0]: Dynamically allocated identifier to type#7 preparing frame. Source Byte Master 0 1 2 3 4 5 6 7 8 GetOTPParam preparing frame (type#8) Content Structure bit 7 bit 6 bit 5 bit 4 bit 3 bit 2 Identifier 0 0 1 1 1 1 AppCMD AppCMD = 0x80 Command 1 CMD [6:0] = 0x02 Slave Address 1 AD [6:0] Data4 0xFF Data5 0xFF Data6 0xFF Data7 0xFF Data8 0xFF After type#7 or type#8 preparing frame the master sends a type#6 reading frame to retrieve the circuit’s in-frame response: Source Byte Master 0 1 2 3 4 5 6 7 8 Slave GetOTPParam indirect ID reading frame (type#6) Content Structure Bit 7 bit 6 bit 5 bit 4 bit 3 Identifier 0 1 1 1 1 OTP Memory OTP byte @0x00 OTP Memory OTP byte @0x01 OTP Memory ADM HW2 HW1 HW0 PA3 OTP Memory OTP byte @0x03 OTP Memory OTP byte @0x04 OTP Memory OTP byte @0x05 OTP Memory OTP byte @0x06 OTP Memory OTP byte @0x07 bit 2 1 bit 1 0 bit 0 1 PA2 PA1 PA0 HW[2:0]: Not stored in OTP memory, the hardwired address is returned by GetOTPParam as if stored at address 0x02 of the OTP memory. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 39 6.11.4 GetStatus This command is provided to the circuit by the LIN master to get a quick status (compared to that of GetFullStatus command) of the circuit and the stepper motor. The following flags are attempt to reset: <TW>, <TSD>, <UV2>, <ElDef>, <StepLoss>, <CPFail>, <OVC1>, <OVC2> and <VddReset> Source Byte Master 0 1 2 Slave Note: GetStatus direct ID reading frame (type#5) Content Structure Bit 7 bit 6 bit 5 Bit 4 bit 3 Identifier * * 0 ID4 ID3 Slave Address ESW AD [6:0] VddReset StepLoss ElDef Status UV2 TSD bit 2 ID2 TW bit 1 ID1 bit 0 ID0 Tinfo[1:0] * according to parity calculation ID [4:0]: Dynamically allocated identifier to GetStatus command. 6.11.5 GotoSecurePosition This command is provided by the LIN master to one or all stepper motors to move to the secure position SecPos[10:0]. It can also be triggered if the LIN communication is lost or at the end of a RunInit initialization phase. If <Broad> is set to zero all stepper motors connected to the LIN bus will reach their secure position. If SecPos[10:0] equals 0x400 (the most negative decimal value of –1024) the secure position is disabled and the GotoSecurePosition command is ignored. Source Byte Master 0 1 2 Note: GotoSecurePosition general purpose writing frame (type#1) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 bit 2 Identifier * * 0 ID4 ID3 ID2 Command 1 CMD [6:0] = 0x04 Broad Slave Address AD [6:0] bit 1 ID1 bit 0 ID0 * according to parity calculation ID [4:0]: Dynamically allocated identifier to general purpose 2 data bytes writing frame. 6.11.6 HardStop This command is internally triggered when an electrical problem is detected in one or both coils, leading to switching off of the H-bridges. If this problem is detected while the motor is moving, the <StepLoss> flag is raised allowing to warn the Master with the next GetStatus command that steps may have been lost. A HardStop command can also be issued by the Master for some safety reasons. If <Broad> is set to zero all the stepper motors connected to the LIN bus will stop. Source Byte Master 0 1 2 Note: HardStop general purpose writing frame (type#1) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 bit 2 Identifier * * 0 ID4 ID3 ID2 Command 1 CMD [6:0] = 0x05 Slave Address Broad AD [6:0] * according to parity calculation ID [4:0]: Dynamically allocated identifier to general purpose 2 data bytes writing frame. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG bit 1 ID1 bit 0 ID0 40 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.11.7 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. If <Broad> is set to zero all circuits connected to the LIN bus will reset their ActPos and TagPos registers. 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). Source Byte Master 0 1 2 Note: ResetPosition general purpose writing frame (type#1) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 bit 2 Identifier * * 0 ID4 ID3 ID2 Command 1 CMD [6:0] = 0x06 Slave Address Broad AD [6:0] bit 1 ID1 bit 0 ID0 * according to parity calculation ID [4:0]: Dynamically allocated identifier to general purpose 2 data bytes writing frame. 6.11.8 ResetToDefault This command is provided to the circuit by the Master in order to reset the whole Slave node into the initial state. ResetToDefault for instance overloads the RAM contents with the reset state of the 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’. If <Broad> is set to zero all circuits connected to the LIN bus will reset to default. Source Master Note: Byte 0 1 2 ResetToDefault general purpose writing frame (type#1) Content Structure bit 7 bit 6 Bit 5 Bit 4 bit 3 bit 2 Identifier * * 0 ID4 ID3 ID2 Command 1 CMD [6:0] = 0x07 Slave Address Broad AD [6:0] * according to parity calculation ID [4:0]: Dynamically allocated identifier to general purpose 2 data bytes writing frame. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG bit 1 ID1 bit 0 ID0 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 41 6.11.9 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 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 GetFullStatus command will cause the circuit to leave the deadlock state. If <Broad> is set to zero all circuits connected to the LIN bus will run the init sequence. Source Master Note: Byte 0 1 2 3 4 5 6 7 8 RunInit reserved ID writing frame (type#4) Content Structure bit 7 bit 6 Bit 5 Bit 4 bit 3 bit 2 bit 1 Identifier 0 0 1 1 1 1 0 AppCMD AppCMD = 0x80 Command 1 CMD [6:0] = 0x08 Slave Address Broad AD [6:0] Vmax + Vmin Vmax [3:0] Vmin [3:0] Target Position 1 Pos1 [15:8] Pos1 [7:0] Target Position 2 Pos2 [15:8] Pos2 [7:0] Vmax [3:0]: Maximum Velocity for first motion of the run Vmin [3:0]: Minimum Velocity for first motion and maximum velocity for the second motion of the run Pos1 [15:0]: First target position to be reached during the init run. Pos2 [15:0]: Second target position to be reached during the init run. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG bit 0 0 42 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.11.10 SetMotorParam This command is provided to the circuit by the Master to set the values for the Stepper motor parameters in RAM. Note: it is not recommended to change Vmax, Vmin or Acc while a motion is ongoing, otherwise correct positioning is not guaranteed. The following parameter values are set 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) indicator of the Stepper-motor moving direction (Shaft) acceleration (deceleration) for the Stepper-motor (Acc) secure position for the Stepper-motor (SecPos) If <Broad> is set to zero all stepper motors connected to the LIN bus will set the parameters in their RAMs. 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. Source Master 0 1 2 3 4 5 6 7 SetMotorParam reserved ID writing frame (type#4) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 bit 2 bit 1 Identifier 0 0 1 1 1 1 0 AppCMD AppCMD = 0x80 Command 1 CMD [6:0] = 0x09 Slave Address Broad AD [6:0] Irun + Ihold Irun [3:0] Ihold [3:0] Vmax + Vmin Vmax [3:0] Vmin [3:0] SecPos + Acc SecPos [10:8] Shaft Acc [3:0] Secure Position2 SecPos [7:0] 8 Status Byte 1 1 1 Acc Shape StepMode [1:0] 1 bit 0 0 1 6.11.11 SetOTPParam This command is provided to the circuit by the Master in order to zap the OTP memory. If <Broad> is set to zero all circuits connected to the LIN bus will zap their OTP memories. Please refer to Table 25: DC Parameters Supply and Voltage regulator on page 54 to ensure that the correct supply voltage is applied to the chip, otherwise the circuit will be damaged. Source Byte Master 0 1 2 3 4 5 6 7 8 SetOTPParam with reserved ID (type#4) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 bit 2 bit 1 bit 0 Identifier 0 0 1 1 1 1 0 0 AppCMD AppCMD = 0x80 Command 1 CMD [6:0] = 0x10 Slave Address Broad AD [6:0] OTP Address 1 1 1 1 1 OTPA [2:0] OTP Data Data [7 :0] Do not care 0xFF Do not care 0xFF Do not care 0xFF Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 43 6.11.12 SetPosition This command is provided to the circuit by the Master to drive a 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> This command can be sent using dynamic ID, general purpose ID or reserved ID: 1. Dynamic ID: Source 0 1 2 Master Note: Byte SetPosition dynamic ID writing frame (type#3) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 Identifier * * 0 ID4 ID3 TargetPosition TagPos [15:8] TagPos [7:0] bit 2 ID2 bit 1 ID1 bit 0 ID0 bit 1 ID1 bit 0 ID0 bit 1 0 bit 0 0 * according to parity calculation ID [4:0]: Dynamically allocated identifier to SetPosition command for a specific slave. 2. General purpose ID: Source Byte Master 0 1 2 3 4 Note: SetPositon general purpose writing frame (type#1) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 bit 2 Identifier * * 1 0 ID3 ID2 Command 1 CMD [6:0] = 0x0B Slave Address Broad AD [6:0] Target Position TagPos [15:8] TagPos [7:0] * according to parity calculation. ID [3:0]: Dynamically allocated identifier to general purpose 4 data bytes writing frame If <Broad> is set to zero all stepper motors connected to the LIN bus are going to TagPos. 3. Reserved ID (SetPosition for two motors): Source Byte Master 0 1 2 3 4 5 6 7 8 Note: SetPosition for 2 motors with reserved ID (type#4) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 bit 2 Identifier 0 0 1 1 1 1 AppCMD AppCMD = 0x80 Command 1 CMD [6:0] = 0x0B Slave Address 1 1 AD1 [6:0] Target Position 1 TagPos1 [15:8] TagPos1 [7:0] Slave Address 2 1 AD2 [6:0] Target Position 2 TagPos2 [15:8] TagPos2 [7:0] ADn [6:0]: Motor #n physical address TagPosn [15:0]: Signed 16-bit position set-point for motor #n. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 44 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.11.13 SetPositionShort This command is provided to the circuit by the LIN master to drive one, two or four motors to a given absolute position. This command is valid for half stepping mode (<StepMode> = “00”) and is ignored for other stepping modes. If <Broad> is set to zero all circuits connected to the LIN bus will go to the desired position (only valid for SetPositionShort (1 Motor)). The physical address is coded on 4 bits, hence SetPositionShort can only be used within a network implementing a maximum of 16 slave nodes. These 4 bits are normally corresponding to the bits PA [3:0] in OTP memory (Address 0x00), while bits AD [6:4] must be at ‘1’. Two different cases must in fact be considered, depending on the programmed value of bit ADM in the OTP memory. See 5.2.3 OTP Memory Structure on page 21. ADM AD[3] 0 1 1 X 0 1 Pin HW0 Pin HW1 Tied to Vdd Pin HW2 Tied to Vbat Tied to Gnd Tied to Vbat Bit PA0 in OTP memory AD[0] 1 1 Table 17: ADM bit in SetPositionShort Command Source Byte Master 0 1 2 Note: bit 0 ID0 * according to parity calculation ID [4:0]: Dynamically allocated identifier to SetPositionShort command with 2 data bytes. Source Byte Master 0 1 2 3 4 Source Byte Master 0 1 2 3 4 5 6 7 8 Note: SetPositionShort (1 Motor) with dynamic ID (type#2) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 Bit 2 bit 1 Identifier * * 0 ID4 ID3 ID2 ID1 Slave Address Pos [10:8] Broad AD [3:0] Target Position Pos [7:0] SetPositionShort (2 Motors) with dynamic ID (type#2) Content Structure bit 7 Bit 6 bit 5 Bit 4 bit 3 bit 2 bit 1 Identifier * * 1 0 ID3 ID2 ID1 Slave Address 1 Pos1 [10:8] 1 AD1 [3:0] Target Position 1 Pos1 [7:0] Slave Address 2 Pos2 [10:8] 1 AD2 [3:0] Target Position 2 Pos2 [7:0] SetPositionShort (4 Motors) with dynamic ID (type#2) Content Structure bit 7 Bit 6 bit 5 Bit 4 bit 3 bit 2 bit 1 Identifier * * 1 1 ID3 ID2 ID1 Slave Address 1 Pos1 [10:8] 1 AD1 [3:0] Target Position 1 Pos1 [7:0] Slave Address 2 Pos2 [10:8] 1 AD2 [3:0] Target Position 2 Pos2 [7:0] Slave Address 3 Pos3[10:8] 1 AD3 [3:0] Target Position 3 Pos3 [7:0] Slave Address 4 Pos4[10:8] 1 AD4 [3:0] Target Position 4 Pos4 [7:0] * according to parity calculation ID [3:0]: Dynamically allocated identifier to SetPositionShort command with 8 data bytes. ADn [3:0]: Motor #n physical address least significant bits Posn [10:0]: Unsigned 11-bit position set point for Motor #n Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG bit 0 ID0 bit 0 ID0 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 45 6.11.14 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. Once the motor is stopped TagPos register is overwritten with the value in ActPos register to ensure keeping the stop position. This command is executed if: • • the chip temperature rises the Thermal shutdown threshold or the Master sends a SoftStop command If <Broad> is set to zero all the stepper motors connected to the LIN bus will stop with deceleration. Source Byte Master 0 1 2 Note: SoftStop general purpose writing frame (type#1) Content Structure bit 7 Bit 6 bit 5 Bit 4 bit 3 bit 2 Identifier * * 0 ID4 ID3 ID2 Command 1 CMD [6:0] = 0x0F Slave Address Broad AD [6:0] bit 1 ID1 bit 0 ID0 * according to parity calculation ID [4:0]: Dynamically allocated identifier to general purpose 2 data bytes writing frame. 6.11.15 Sleep Mode According to LIN specification rev. 1.3, sleep mode and stand-by mode (wake-up) are implemented. The interface can work in one of the following modes (refer to Figure 14: LIN Physical Layer): • • • Normal mode: EN = ‘1’, Vdd = high, INH = ‘1’ Sleep mode: in the normal mode EN is set to ‘0’ to go to sleep mode after reception of a LIN Sleep command or more than 25,000 bit times (1.30 seconds) of LIN bus inactivity. The interface current consumption is limited to Isleep. Only the receiver is working. Stand-by mode (wake-up): when a LIN message frame is received in sleep mode or when Vbb goes high (power-on), INH is immediately activated. The initial state of INH signal is ensured by an internal power-on-reset circuitry inside the wake-up control. The TMC211 can be immediately forced to sleep mode to reduce current consumption down to Isleep by sending the sleep mode command depicted below: Source Byte Master 0 1 2 3 4 5 6 7 8 Sleep Mode Command with reserved ID (type#4) Content Structure bit 7 bit 6 bit 5 Bit 4 bit 3 Identifier 0 0 1 1 1 Sleep 0x00 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF 0xFF Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG bit 2 1 bit 1 0 bit 0 0 46 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 6.12 Positioning Task Example The TMC211 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 18: Positioning Example: Initial situation. Stop ? Actual Position = unknown ? Target Position = 3000 X [µsteps] ? Position 0 Figure 18: 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): GetFullStatus The command is used to read the current status of the TMC211. Electrical or environmental problems will be reported, furthermore the circuit leaves the shutdown state and is ready for action. Furthermore the circuit provides the actual and target position. This information is very important, because if the actual position corresponds to the first target position of the RunInit command the circuit will enter a deadlock state. The master must take care that both positions are containing different values. See 6.11.2 GetFullStatus command on page 36 and for deadlock problems see 5.1.11 Reference Search / Position initialization on page 14. SetMotorParam In order to drive the stepper motor with desired motion parameters like torque, velocity, a.s.o.. the SetMotorParam command must issued. See 6.11.10 SetMotorParam on page 42. 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.11.9 RunInit command on page 41. After reference search the actual situation looks like as described in Figure 19: Positioning Example: Situation after reference search. 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 19: 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-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 47 SetPosition This command will cause the stepper motor to move to the desired target position. See 6.11.12 SetPosition on page 42. After the motion has been finished the situation looks like as described in Figure 20: Positioning Example: Motion finished. Stop Actual Position = Target Position = 3000 X [µsteps] Figure 20: Positioning Example: Motion finished Afterwards the actual status and position can be verified by using GetFullStatus commands. The master can check if a problem, caused by electrical or temperature problems, occurred. Furthermore the actual position is read. Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 48 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 7 Frequently Asked Questions 7.1 Using the bus interface Q: How many devices can be operated on the same bus? A: 128 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 120. Third, the TMC211 has faster and slower types of the GetActualPos, GetStatus and SetPosition commands. The faster types of course can satisfy harder real-time requirements but can only be addressed to 8 different physical devices. If the faster types shall be used only 8 TMC211 devices can be connected to the same LIN bus. 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 HW0, HW1 or HW2 input as chip select line to address just one device by SetOTPParam. If this is impractible since the HW0/HW1/HW2 inputs are 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 GetActualPos or GetFullStatus commands. 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-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 7.3 49 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: This is ensured by design. ActPos and ESW are latched synchronously by the same internal signal edge. The update period is about one millisecond (typ. 1024 µs). Each time ActPos and ESW are read by the GetActualPos command the result will be a snapshot of both values taken at the same point in time. 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 GetActualPos 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-2005 TRINAMIC Motion Control GmbH & Co. KG 50 TMC211 DATASHEET (V. 1.04 / January 7, 2005) The 11-bit position data fields of the TMC211 SetPositionShort commands are coded in two’s complement format with bit 0 representing half-steps resulting in a position range of –1024…+1023 half-steps. Hence only a quarter of the range of the other position data fields described above is covered. Note, that SetPositionShort command is valid for half-stepping mode only and is ignored for other stepping modes. Furthermore, SetPositionShort can only be used with a maximum of 16 TMC211 devices connected to the LIN bus. 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 commands GetActualPos or GetFullStatus. 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-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 51 8 Package Outline 8.1 SOIC-20 Figure 21: Package Outline SOIC-20 UNIT mm inches A max A1 . 2.65 0.30 0.10 0.10 0.012 0.004 A2 A3 bp 2.45 0.25 0.49 2.25 0.36 0.096 0.01 0.019 0.089 0.014 c D(1) E(1) 0.32 0.23 0.013 0.009 13.0 12.6 0.51 0.49 7.6 1.27 7.4 0.30 0.050 0.29 e HE L 10.65 1.4 10.00 0.419 0.055 0.394 Table 18: SOIC-20 Mechanical Data Note: inch dimensions are derived from the original mm dimensions Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Lp 1.1 0.4 0.043 0.016 Q v w y 1.1 0.25 0.25 0.1 1.0 0.043 0.01 0.01 0.004 0.039 Z(1) Θ 0.9 0.4 0.035 0.016 8° 0° 52 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 9 Package Thermal Resistance and Layout Considerations 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 2 × (10mm × 23mm) Figure 22: Layout consideration Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG TMC211 DATASHEET (V. 1.04 / January 7, 2005) 53 10 Electrical Characteristics 10.1 Absolute Maximum Ratings Parameter Vbat Vlin Tamb Tst Vesd (**) Supply Voltage Bus input voltage Ambient temperature under bias (*) Storage temperature Electrostatic discharge voltage on LIN pin Electrostatic discharge voltage on other pins Min -0.3 -80 -50 -55 -4 -2 Max +35 +80 +150 +160 +4 +2 Unit V V °C °C kV kV Min +8 -40 -40 Max +29 +125 +85 Unit V °C °C Typ 800 Max Unit mA Table 19: Absolute Maximum Ratings (*) The circuit functionality is not guaranteed (**) Human body model (100pF via 1.5 KΩ) 10.2 Operating Ranges Parameter Vbat Supply Voltage Operating temperature range Top Vbat <= 18V Vbat <= 29V Table 20: Operating Ranges 10.3 DC Parameters Motor Driver Symbol Pin(s) IMSmax Peak OA1 IMSmax OA2 RMS OB1 RDSon OB2 IMSL Parameter Max current through motor coil in normal operation Max RMS current through coil in normal operation On resistance for each pin (including bond wire) Leakage current Test condition Min 570 To be confirmed by characterization HZ Mode, 0V < V(pin) < Vbb mA 1 Ω +50 µA Typ Max 30 20 200 47 Unit mA mA µA mA kΩ Max 0.4 1 0.2 Unit Vbb Vbb Vbb -50 Table 21: DC Parameters Motor Driver LIN Transmitter Symbol Pin(s) Ibus_on Ibus_off LIN Ibus_off Ibus_lim Rslave Parameter Dominant state, driver on Dominant state, driver off Recessive state, driver off Current limitation Pull-up resistance Test condition Vbus = 1.4V Vbus = 0V Vbus = Vbat Min 40 -1 50 20 Table 22: DC Parameters LIN Transmitter LIN Receiver Symbol Pin(s) Vbus_dom LIN Vbus_rec Vbus_hys Parameter Receiver dominant state Receiver recessive state Receiver hysteresis Test condition Table 23: DC Parameters LIN Receiver Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Min 0 0.6 0.05 Typ 54 TMC211 DATASHEET (V. 1.04 / January 7, 2005) Thermal Warning and shutdown Symbol Pin(s) Parameter Ttw Thermal Warning Ttsd (*) Thermal Shutdown Tlow Low Temperature Warning Test condition Min 138 Typ 145 Ttw + 10 Ttw - 155 Max 152 Unit °C °C °C Typ Max 18 9.5 9.8 8.9 50 Unit V V V V mA µA 5.25 V 4.4 40 mA V mA Table 24: DC Parameters Thermal Warning and shutdown (*) NO more than 100 cumulated hours in life time above Ttsd Supply and Voltage regulator Symbol Pin(s) Parameter Vbb Nominal operating supply range (*) VbbOTP Supply Voltage for OTP zapping UV1 Low voltage high threshold VBB UV2 Stop voltage low threshold Ibat Total current consumption Isleep Sleep mode current consumption (**) Vdd IddStop VddReset IddLim Internal regulated output VDD (***) Digital current consumption Digital supply reset level (****) Current limitation Test condition Min 6.5 8.5 8.8 8.1 Unloaded Outputs 8V < Vbb < 18V Cload = 1µF (+100nF cer.) Vbb < UV2 9.4 8.5 10 4.75 5 2 Pin shorted to ground Table 25: DC Parameters Supply and Voltage regulator (*) Communication over serial bus is operating. Motordriver is disabled when Vbb < UV2. (**) To be confirmed by measurements. (***) 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 HW2 Symbol Pin(s) Parameter Rt_OFF Switch OFF resistance (*) Rt_ON Switch ON resistance (*) SWI Vbb_sw Vbb range for guaranteed HW2 operation of SWI and HW2 Vmax_sw Maximum Voltage Ilim_sw Current limitation Test condition Switch to GND or Vbat Min 10 Typ 6 T < 1s Short to GND or Vbat Max 2 Unit kΩ kΩ 18 V 40 V mA Max Unit Vdd Vdd Vdd 30 Table 26: DC Parameters Switch Input and hardwired address input (*) External resistance value seen from pin SWI or HW2, including 1kΩ series resistor Hardwired address inputs and Test pin Symbol Pin(s) Parameter Vhigh Input level high HW0 Input level low HW1 Vlow TST HWhyst Hysteresis Test condition Min 0.7 Typ 0.3 0.075 Table 27: DC Parameters and Hardwired address inputs and Test pin Charge Pump Symbol Pin(s) Vcp VCP Cbuffer Cpump CPP CPN Parameter Output Voltage External Buffer Capacitor External pump Capacitor Test condition Vbb > 15V Vbb > 8V Table 28: DC Parameters Charge Pump Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG Min Vbb+10 Vbb+5.8 220 220 Typ Max Vbb+12.5 Vbb+15 470 470 Unit V V nF nF TMC211 DATASHEET (V. 1.04 / January 7, 2005) 55 10.4 AC Parameters Power-Up Symbol Tpu Pin(s) Parameter Power-Up time Test condition Min Typ Max 10 Unit ms Min 921 Typ 1024 1/16 Max 1127 Unit µs Tsw Table 29: AC Parameters Power-Up Switch Input and hardwired address input HW2 Symbol Pin(s) Parameter Tsw Scan Pulse Period SWI HW2 Tsw_on Scan Pulse Duration Test condition Table 30: AC Parameters Switch Input and hardwired address input Motor Driver Symbol Pin(s) Fpwm OA1 OA2 Tbrise OB1 Tbfall OB2 Parameter PWM frequency Turn-On transient time Turn-Off transient time Test condition Min 18 Typ 20 350 250 Max 22 Unit kHz ns ns Min 0.1 2.6 0.1 0.1 -4 -2 Typ Max 3 22.5 4 4 4 2 Unit V/µs µs µs µs µs µs Min Typ Max Unit 0.1 4 6 µs 0.1 4 6 µs -2 50 100 2 200 µs µs Between 10% and 90% Table 31: AC Parameters Motor Driver LIN Transmitter Symbol Pin(s) Slope_F/R t_slope_F/R LIN T_tr_F T_tr_R t_slope_Sym Tsym_tr Parameter Slope falling (or rising) edge Slope time falling (or rising) edge Propagation delay TxD low to bus Propagation delay TxD high to bus Slope time symmetry Transmitter delay symmetry Test condition Between 40% and 60% extrapolated t_slope_F – t_slope_R T_tr_F – T_tr_R 1 1 Table 32: AC Parameters LIN Transmitter LIN Receiver Symbol Pin(s) T_rec_F T_rec_R Tsym,Rec Twake LIN Parameter Test condition Propagation delay bus dominant to TxD low Propagation delay bus recessive to TxD high Receiver delay symmetry Wake-up delay time Table 33: AC Parameters LIN Receiver Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG 56 TMC211 DATASHEET (V. 1.04 / January 7, 2005) 11 Revision History Version up to 0.90p 0.91p 0.92p 0.93p 1.01 1.02 1.03 1.04 Date 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 January 28, 2004 Order Code Update (Table 2: Ordering Information, page 7) March 25, 2004 new logo; table Acc Parameters: combined cells with same value; ESW is zero when switch is open; table Priority Encoder: made shaded cells more distinguishable; added table Status Flags; table OTP Memory Structure: exchanged locations of SecPos10:8 and StepMode1:0; corrected Command Descriptions August 24, 2004 added LIN rev. 1.3 compliance; velocity groups integrated into Vmax table; corrected and enhanced Vmin table; clarified description of commands using frame types #7 and #8; corrected meaning of Shaft bit; FAQ included nd September 15, 2004 Updated ordering information; improved description of 2 motion of RunInit command; combined tables for Irun and Ihold settings; some corrections to DC characteristics; added final travel to secure position during RunInit command; corrected figures Temperature Management and Battery Voltage Management; reworked and clarified Sleep Mode October 1, 2004 New company address January 7, 2005 Order code updated (Table 2: Ordering Information, page 7); hint concerning ResetPosition added (section 6.11.7, page 40) 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 [email protected] Copyright © 2004-2005 TRINAMIC Motion Control GmbH & Co. KG