0
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
会员中心
创作中心
发布
  • 发文章

  • 发资料

  • 发帖

  • 提问

  • 发视频

创作活动
TMC4210-I-T

TMC4210-I-T

  • 厂商:

    TRINAMIC

  • 封装:

    SSOP16_150MIL

  • 描述:

    用于 TMC26x 和 TMC389 步进驱动器的低成本 1 轴步进电机控制器 用于微控制器的 SPI 通信接口和驱动器的步进/方向接口

  • 数据手册
  • 价格&库存
TMC4210-I-T 数据手册
MOTION CONTROLLER FOR STEPPER MOTORS INTEGRATED CIRCUITS TMC4210 DATASHEET Low cost 1-Axis Stepper Motor Controller for TMC26x and TMC389 Stepper Driver SPI Communication Interface for Microcontroller and Step/Direction interface to Driver APPLICATIONS CCTV, Security Antenna Positioning Heliostat Controller Battery powered applications Office Automation ATM, Cash recycler, POS Lab Automation Liquid Handling Medical Printer and Scanner Pumps and Valves FEATURES AND DESCRIPTION BENEFITS 1-Axis stepper motor controller 3.3 V or 5 V operation with CMOS / TTL compatible IOs Serial 4-wire interface for µC with easy-to-use protocol Step/Direction interface to driver Clock frequency: up to 32 MHz (can use CPU clock) Internal position counters 24 bit wide Microstep frequency up to 1 MHz Read-out option for all motion parameters Ramp generator for autonomous positioning / speed control On-the-fly change of target motion parameters Low power operation: 1.25 mA at 4 MHz (typ.) Compact Size: ultra small 16 pin SSOP package Directly controls TMC260, TMC261, TMC262, TMC2660, TMC389, TMC2100 and TMC2130 The TMC4210 is a 1-axis miniaturized stepper motor controller with an industry leading feature set. It controls the motor via Step/Direction interface. Based on target positions and velocities - which can be altered on the fly - it performs all real time critical tasks autonomously. The TMC4210 offers high level control functions for robust and reliable operation. The 4 wire serial peripheral interface allows for communication with the microcontroller. Together with a microcontroller the TMC4210 forms a complete motion control system. High integration and small form factor allow for miniaturized designs for cost-effective and highly competitive solutions. BLOCK DIAGRAM Ref. Switches Ref. Switch Processing CLK SPI to µC SDO to µC Muliplexed Output SPI to Master Interrupt Controller Position Comparator Linear RAMP Generator Step/Dir Pulse Generation 24 Bit Target Position Position Counter TRINAMIC Motion Control GmbH & Co. KG Hamburg, Germany TMC4210 Step/Dir OUT TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 2 APPLICATION EXAMPLE: RELIABLE CONTROL USING STEP/DIR The TMC4210 scores with its autonomous handling of all real time critical tasks. By offloading the motion control function to the TMC4210, the stepper motor can be operated reliably with very little demand for service from the microcontroller. Software only needs to send target positions, and the TMC4210 generates precisely timed step pulses by hardware. Parameters for the motor can be changed on the fly while software retains full control. This way, high precision and reliable operation is achieved while costs are kept down. TMC4210+TMC2660-EVAL EVALUATION BOARD This evaluation board is a development platform for applications based on the TMC4210 and the TMC2660 stepper motor driver IC. The board features USB and CAN interfaces for communication with control software running on a PC. The power MOSFETs of the TMC2660 support drive currents up to 2.8A RMS at 29V. The control software provides a user-friendly GUI for setting control parameters and visualizing the dynamic response of the motor. TMC2660 LOGIC OF THE CONTROLLER/DRIVER CHAIN DIAGNOSTICS VELOCITY ACCELERATION TARGET POSITION STEP AND DIRECTION SIGNALS POWER TMC4210 CPU M DRIVER HOME & STOP DIAGNOSTICS SYSTEM WITH TMC4210 AND TMC2660 Mechanical Feedback or virtual stop switch REF_L, REF_R Position counter STEP_IN DIR_IN SPI to master Linear RAMP generator Step & Direction pulse generation STEP_OUT STEP/DIR Position comparator CLK Half Bridge 1 l contro Motion Realtime event trigger +VM VSA / B OA1 OA2 sine table 4*256 entry x S N chopper OB1 Half Bridge 2 Half Bridge 2 DIR_OUT 2 phase stepper motor OB2 BRA / B CSN SCK SDI Interrupt controller step multiplier VCC_IO Reference switch processing nSCS_C SCK_C SDI_C nINT_SDO_C OSFETs incl. M Driver Half Bridge 1 TMC2660 TMC4210 SPI control, Config & diags RSA / B coolStep™ RSENSE RSENSE SDO Protection & diagnostics stallGuard2™ Virtual stop switch 2 x current comparator 2 x DAC SG_TST 1K *) Motion command SPI System interfacing User CPU ntrol m co Syste *) Connect 1K resistor to nINT_SDO_C to use the SPI interface. Another possibility is to use a tristate output (e.g., 74HC1G125) as shown below. nINT_SDO_C SDO nSCS_C ORDER CODES Order code TMC4210-I TMC4210+2660-EVAL www.trinamic.com Description 1-axis Step/Dir motion controller, SSOP16-package Evaluation board for TMC4210 and TMC2660 chipset Size 6 x 5 mm2 55 x 85 mm2 TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 3 TABLE OF CONTENTS 1 1.1 1.2 1.3 1.4 1.5 PRINCIPLES OF OPERATION 4 KEY CONCEPTS CONTROL INTERFACES SOFTWARE VISIBILITY STEP FREQUENCIES MOVING THE MOTOR 4 5 5 6 7 2 GENERAL DEFINITIONS, UNITS, AND NOTATIONS 2.1 2.2 2.3 2.4 3 3.1 3.2 PACKAGE OUTLINE SIGNAL DESCRIPTIONS 8 8 8 8 9 9 9 4 SAMPLE CIRCUIT 11 5 CONTROL INTERFACE 12 5.1 5.2 5.3 6 BUS SIGNALS SERIAL PERIPHERAL INTERFACE FOR µC REGISTER MAPPING REGISTER DESCRIPTION 6.1 6.2 7 AXIS PARAMETER REGISTERS GLOBAL PARAMETER REGISTERS REFERENCE SWITCH INPUTS 7.1 7.2 12 12 17 18 18 34 36 REFERENCE SWITCH CONFIGURATION, MOT1R 36 TRIPLE SWITCH CONFIGURATION 36 www.trinamic.com 8 HOMING PROCEDURE STEP/DIR DRIVERS 8.1 9 TIMING RUNNING A MOTOR 9.1 9.2 37 38 38 39 GETTING STARTED 39 RUNNING A MOTOR WITH START-STOP-SPEED IN RAMP_MODE 39 8 NOTATIONS SIGNAL POLARITIES UNITS OF MOTION PARAMETERS REPRESENTATION OF SIGNED VALUES BY TWO’S COMPLEMENT PACKAGE 7.3 10 ON-CHIP VOLTAGE REGULATOR 40 11 POWER-ON RESET 41 12 ABSOLUTE MAXIMUM RATINGS 42 13 ELECTRICAL CHARACTERISTICS 42 13.1 13.2 13.3 15 POWER DISSIPATION DC CHARACTERISTICS TIMING CHARACTERISTICS 42 43 44 PACKAGE MACHANICAL DATA 45 15.1 DIMENSIONAL DRAWINGS 45 16 MARKING 46 17 DISCLAIMER 47 18 ESD SENSITIVE DEVICE 47 19 TABLE OF FIGURES 48 20 REVISION HISTORY 48 21 REFERENCES 48 TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) GP_IN REF_R Principles of Operation REF_L 1 4 POSCOMP TMC4210 Interrupt Controller M U X nINT_SDO_C SPI to µC nSCS_C SCK_C Serial µC Interface Linear RAMP Generator Step Dir STEPPULS Generator Step/Dir to driver Connect for +3.3V operation SDI_C CLK 4-32MHz TEST 24 Bit Target Position Position Counter Power-on Reset V5 /+5V supply Voltage Regulator V33 470nF GND GND GND 100nF GND Figure 1.1 TMC4210 functional block diagram The TMC4210 is a 1-axis miniaturized high performance stepper motor controller with an outstanding cost-performance ratio. It is designed for high volume automotive as well as for demanding industrial motion control applications. The TMC4210 receives target values for velocity, acceleration, and positioning from the microcontroller and calculates autonomously step and direction signals for the stepper motor driver IC. The motion controller is equipped with an SPI host interface with easy-to-use protocol and with a Step/Dir interface for addressing the stepper motor driver chip. 1.1 Key Concepts The TMC4210 realizes real time critical tasks autonomously and guarantees for a robust and reliable drive. These following features contribute toward greater precision, greater efficiency, higher reliability, and smoother motion in many stepper motor applications. Interfacing The TMC4210 provides an SPI interface for communication with the user CPU and a Step/Dir interface for driver interfacing. Positioning The TMC4210 operates the motor based on user specified target positions and velocities. Modify all motion target parameters on-the-fly during motion. Programming Every parameter can be changed at any time. The uniform access to any TMC4210 register simplifies application programming. A read-back option for all internal registers is available. Microstepping Based on internal position counters the TMC4210 performs up to ±223 (micro)steps completely independent from the microcontroller. Via STEP/DIR signals any microstep resolution can be realized as supported by the driver. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 5 1.2 Control Interfaces 1.2.1 Serial µC Interface Using this interface, the TMC4210 receives target positions, target velocities, and target acceleration values for the microcontroller. Further, it is used for configuration. From the software point of view, the TMC4210 provides a set of registers, accessed by the microcontroller via a serial interface in a uniform way. Each datagram contains address bits, a readwrite selection bit, and data bits to access the registers and the on-chip memory. Each time the microcontroller sends a datagram to the TMC4210 it simultaneously receives a datagram from the TMC4210. This simplifies the communication with the TMC4210 and makes programming easy. Most microcontrollers have an SPI hardware interface, which directly connects to the serial four wire microcontroller interface of the TMC4210. For microcontrollers without SPI hardware software doing the serial communication is sufficient and can easily be implemented. 1.2.2 Step/Dir Driver Interface The TMC4210-I controls the motor position by sending pulses on the STEP signal while indicating the direction on the DIR signal. A programmable step pulse length and step frequencies up to 1MHz allow operation at high speed and high microstep resolution. The driver chip converts these signals into the coil currents which control the position of the motor. The TMC4210-I perfectly fits to the TMC26x smart power Step/Dir driver family. SPI High Level Interface µC SPI TMC4210 Motion Controller Step/Dir Stepper Motor Driver incl. MOSFETs M TMC260/TMC261/ TMC2660 Figure 1.2 Application example using Step/Dir driver interface 1.3 Software Visibility From the software point of view the TMC4210 provides a set of registers and on-chip RAM (see Figure 1.1), accessed via the serial µC interface in a uniform way. The serial interface uses a simple protocol with fixed datagram length for the read- and write-access. These registers are used for initializing the chip as required by the hardware configuration. Afterwards the motor can be moved by writing target positions or velocity and acceleration values. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 6 1.4 Step Frequencies INITIALIZE THE STEP/DIR INTERFACE! The Step/Dir interface has to be initialized by writing 1 to en_sd. Refer to chapter 6.2.1. The desired motor velocity is an important design parameter of an application. Therefore it is important to understand the limiting factors. 1.4.1 Step Frequencies using the Step/Dir Driver Interface The step pulses can directly be fed to a Step/Dir driver. The maximum full step rate (fsfmax) depends on the microstep resolution of the external driver chip. The TMC4210 microstep rate (µsf) is up to 1/32 of the clock frequency: µ𝑠f𝑚𝑎𝑥 = fCLK 32 EXAMPLE FOR FULL STEP FREQUENCY CALCULATION fCLK = 16 MHz µsfmax = 500 kHz µstep resolution of external driver: 16 𝑓𝑠𝑓𝑚𝑎𝑥 = 500 𝑘𝐻𝑧 = 31.25 𝑘𝐻𝑧 16 With a standard motor with 1.8° per full step this results in up to 31.25kHz/200= 156 rotations per second, which is far above realistic motor velocities for this kind of motor and thus imposes no real limit on the application. A 16 microsteps resolution can be extrapolated to 256 microsteps within the driver when using the TMC26x 2-phase stepper driver family or the TMC389 3-phase stepper motor driver. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 7 1.5 Moving the Motor Moving the motor is simple: To move a motor to a new target position, write the target position into the associated register by sending a datagram to the TMC4210. To move a motor with a new target velocity, write the velocity into the register assigned to the stepper motor. 1.5.1 Motion Controller Functionality The ramp generator monitors the motion parameters stored in its registers and calculates velocity profiles. Based on the actual ramp generator velocity, a pulse generator supplies step pulses to the motor driver. 1.5.2 Modes of Motion ramp_mode velocity_mode hold_mode soft_mode 1.5.3 For positioning applications the ramp_mode is most suitable. The user sets the position and the TMC4210 calculates a trapezoidal velocity profile and drives autonomously to the target position. During motion, the position may be altered arbitrarily. For constant velocity applications the velocity_mode is most suitable. In velocity_mode, a target velocity is set by the user and the TMC4210 takes into account user defined limits of velocity and acceleration. In hold_mode, the user sets target velocities, but the TMC4210 ignores any limits of velocity and acceleration, to realize arbitrary velocity profiles, controlled completely by the user. The soft_mode is similar to the ramp_mode, but the decrease of the velocity during deceleration is done with a soft, exponentially shaped velocity profile. Interrupts The TMC4210 has capabilities to generate interrupts. Interrupts are based on ramp generator conditions which can be set using an interrupt mask. The interrupt controller (which continuously monitors reference switches and ramp generator conditions) generates an interrupt if required. nINT_SDO_C is a low active interrupt signal while nSCS_C is high. If the microcontroller disables the interrupt during access to the TMC4210 and enables the interrupt otherwise, the multiplexed interrupt output of the TMC4210 behaves like a dedicated interrupt output. For polling, the TMC4210 sends the status of the interrupt signal to the microcontroller with each datagram. 1.5.4 Reference Switch Handling The TMC4210 has a left (REF_L) and a right (REF_R) reference switch input. Further, the TMC4210 is equipped with a general purpose input (GP_IN). INITIALIZE THE RIGHT REFERENCE SWITCH! The right reference switch REF_R has to be initialized by writing 1 to mot1r. 1.5.5 Access to Status and Error Bits The microcontroller directly controls and monitors the stepper driver. It also needs to take care for advanced current control, e.g. power down in stand still. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 2 8 General Definitions, Units, and Notations 2.1 Notations - Decimal numbers are used as usual without additional identification. Binary numbers are identified by a prefixed % character. Hexadecimal numbers are identified by a prefixed $ character. EXAMPLE Decimal: Binary: Hexadecimal: 42 %101010 $2A TMC4210 DATAGRAMS ARE WRITTEN AS 32 BIT NUMBERS, E.G.: $1234ABCD = %0001 0010 0011 0100 1010 1011 1100 1101 TWO TO THE POWER OF N In addition to the basic arithmetic operators (+, -, *, /) the operator two to the power of n is required at different sections of this data sheet. For better readability instead of 2 n the notation 2^n is used. 2.2 Signal Polarities External and internal signals are high active per default, but the polarity of some signals is programmable to be inverted. A pre-fixed lower case n indicates low active signals (e.g. nSCS_C, nSCS_S). See chapter 6.2, too. 2.3 Units of Motion Parameters The motion parameters position, velocity, and acceleration are given as integer values within TMC4210 specific units. With a given stepper motor resolution one can calculate physical units for angle, angular velocity, angular acceleration. (See chapter 6.1.12) 2.4 Representation of Signed Values by Two’s Complement Motion parameters which have to cover negative and positive motion direction are processed as signed numbers represented by two’s complement as usual. Limit motion parameters are represented as unsigned binary numbers. SIGNED MOTION PARAMETERS ARE: X_TARGET / X_ACTUAL / V_TARGET / V_ACTUAL / A_ACTUAL / A_THRESHOLD UNSIGNED MOTION PARAMETERS ARE: V_MIN / V_MAX / A_MAX www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 3 9 Package The TMC4210 is qualified for the industrial temperature range. The package is RoHS compilant. Order code Package Characteristics JEDEC Drawing TMC4210-I SSOP16 150 mils, 16 pins, plastic package, industrial (-40… +85°C) MO-137 (150 mils) 3.1 Package Outline REF_L GP_IN TEST CLK nSCS_C SCK_C SDI_C 16 2 15 3 14 TMC4210-I REF_R 1 4 5 6 13 12 11 7 10 8 9 n.c. GND V33 V5 n.c. DIR_OUT STEP_OUT Please refer to the application note PCB_Guidelines_TRINAMIC_packages for a practical guideline for all available TRINAMIC IC packages and PCB footprints. The application note covers package dimensions, example footprints and general information on PCB footprints for these packages. It is available on www.trinamic.com. nINT_SDO_C SSOP16 (150 MILS) Figure 3.1 TMC4210 pin out 3.2 Signal Descriptions Pin SSOP16 In/Out Description Reset - - CLK nSCS_C SCK_C SDI_C nINT_SDO_C 5 6 7 8 9 I I I I O n.c. SCK_S SDO_S REF_L 12, 16 11 10 1 O O I GP_IN 2 I REF_R 3 I V5 V33 GND TEST 13 14 15 4 I Internal power-on reset. No external reset input pin is available. Clock input Low active SPI chip select input driven from µC Serial data clock input driven from µC Serial data input driven from µC Serial data output to µC input / Multiplexed nINTERRUPT output if communication with µC is idle (resp. nSCS_C = 1) SDO_C will never be high impedance Leave open DIR output STEP output Left reference/limit switch input. Pull to GND if not used. (no internal pull-up resistor) General purpose input. Pull to GND if not used. (no internal pull-up resistor) Right reference/limit switch input. Pull to GND if not used. (no internal pull-up resistor) +5V supply / +3.3V supply 470nF ceramic capacitor pin / +3.3V supply Ground Must be connected to GND as close as possible to the chip. No user function. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 10 Attention Preferably, long wires to the reference switch inputs and the general purpose input should be avoided. For long wires, a low pass filter for spike suppression should be provided (refer the TMC4210 evaluation board schematic as example). All inputs are Schmitt-Trigger. Unused inputs (REF_L, REF_R, and GP_IN) need to be connected to ground. Unused reference switch inputs have to be connected to ground, too. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 4 11 Sample Circuit This application example shows how to connect the TMC4210 motion controller with the processor and one out of TRINAMICs TMC260, TMC261, and TMC2660 stepper motor driver chips. These stepper motor driver chips have integrated MOSFETs. The TMC262 needs external power transistors. General purpose input GP_IN CLK REF_L REF_R CLK Output SDO_C will nerver be high impedance Reference Switch Inputs active high 1K TMC4210-I SDO_C STEP_OUT SDI_C DIR_OUT SCK_C nSCS_C V33 STEP V5 TEST GND DIR SDO 100nF 10K +5V µC TMC260 TMC261 TMC2660 SDI 1K CLK 1K SCK CSN MISO MOSI SCK CSn_0 CSn_1 Figure 4.1 TMC4210 application environment with TMC260, TMC261 or TMC2660. www.trinamic.com Motor TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 5 12 Control Interface The communication takes place via a four wire serial interface and 32 bit datagrams of fixed length. RESPONSIBILITIES ARE DEFINED AS FOLLOWS: - The microcontroller is the master of the TMC4210. It initializes the motion controller and sets target values for velocity, acceleration, and positioning. The TMC4210 is the master of the stepper motor driver. The motion controller calculates, e.g., ramp profiles for positioning. It sends step and direction signals to the stepper motor driver. The microcontroller initializes the stepper motor driver. Further, the microcontroller can read out status and error flags and thus make the diagnostics. AUTOMATIC POWER-ON RESET: - The TMC4210 cannot be accessed before the power-on reset is completed and the clock is stable. All register bits are initialized with 0 during power-on reset, except the Step/Dir clock pre-devider STPDIV_4210 that is initialized with 15. 5.1 Bus Signals Signal Description Bus clock input Serial data input Serial data output Chip select input TMC4210 SCK_C SDI_C SDO_C nSCS_C Microcontroller 5.2 Serial Peripheral Interface for µC The serial microcontroller interface of the TMC4210 acts as a 32 bit shift register. COMMUNICATION BETWEEN µC AND THE TMC4210 1. 2. 3. 4. 5.2.1 The serial µC interface shifts serial data into SDI_C with each rising edge of the clock signal SCK_C. Then, it copies the content of the 32 bit shift register into a buffer register with the rising edge of the selection signal nSCS_C. The serial interface of the TMC4210 immediately sends back data read from registers or read from internal RAM via the signal SDO_C. The signal SDO_C can be sampled with the rising edge of SCK_C. SDO_C becomes valid at least four CLK clock cycles after SCK_C becomes low as outlined in the timing diagram. Timing A complete serial datagram frame has a fixed length of 32 bit. Because of on-the-fly processing of the input data stream, the serial µC interface of the TMC4210 requires the serial data clock signal SCK_C to have a minimum low / high time of three clock cycles. The SPI signals from the µC interface may be asynchronous to the clock signal CLK of the TMC4210. If the microcontroller and the TMC4210 work on different clock domains that run asynchronously by the timing of the SPI interface of the microcontroller should be made conservative in the way that the length of one SPI clock cycle equals 8 or more clock cycles of the TMC4210 clock CLK. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 13 tCLK tDATAGRAMuC tSUCSC tHDCSC tSCKCL tSCKCH tHDCSC tSUCSC CLK nSCS_C SCK_C tSD sdi_c_bit#31 SDI_C SDOZ_C SDO_C tSD nINT (for TMC429-I) tSD sdi_c_bit#0 sdi_c_bit#30 . . . sdi_c_bit#1 sdo_c_bit#31 sdo_c_bit#30 ... sdo_c_bit#1 sdo_c_bit#31 sdo_c_bit#30 ... sdo_c_bit#1 tIS sdo_c_bit#0 sdo_c_bit#0 tPD nINT tSI 30 x sampled SDI_C 1 x SDI_C sampled 1 x SDI_C sampled one full 32 bit datagram Figure 5.1 Timing diagram of the serial µC interface EXPLANATORY NOTES - While the data transmission from the microcontroller to the TMC4210 is idle, the low active serial chip select input nSCS_C and also the serial data clock signal SCK_C are set to high. While the signal nSCS_C is high, the TMC4210 assigns the status of the internal low active interrupt signal nINT to the serial data output SDO_C. The data signal SDI_C driven by the microcontroller has to be valid at the rising edge of the serial data clock input SCK_C. The maximum duration of the serial data clock period is unlimited. While the µC interface of the TMC4210 is idle, the SDO_C signal is the (active low) interrupt status nINT of the integrated interrupt controller of the TMC4210. The timing of the multiplexed interrupt status signal nINT is characterized by the parameters tIS and tSI (see chapter 13.3). The following SPI clock frequencies are recommended in order to avoid possible issues concerning the SPI frequency between microcontroller and TMC4210: - For fCLK = 16MHz an upper SPI clock frequency of 1MHz is recommended. - For fCLK = 32MHz an upper SPI clock frequency of 2MHz is recommended. PROCEDURE OF DATA TRANSMISSION 1. 2. 3. 4. 5. The signal nSCS_C has to be high for at least three clock cycles before starting a datagram transmission. To initiate a transmission, the signal nSCS_C has to be set to low. Three clock cycles later the serial data clock may go low. The most significant bit (MSB) of a 32 bit wide datagram comes first and the least significant bit (LSB) is transmitted as the last one. A data transmission is finished by setting nSCS_C high three or more CLK cycles after the last rising SCK_C slope. So, nSCS_C and SCK_C change in opposite order from low to high at the end of a data transmission as these signals change from high to low at the beginning. In contrast to most other SPI compatible devices, the serial data output SDO_C of the TMC4210-I is always driven. It will never be high impedance Z. If high impedance is required for the SDO_C connected to the microcontroller, it can be realized using a single gate 74HCT1G125. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 14 TIMING CHARACTERISTICS OF THE SERIAL MICROCONTROLLER INTERFACE Symbol Parameter tSUCSC tHDCSC tSCKCL tSCKCH tSD tIS Setup Clocks for nSCS_C Hold Clocks for nSCS_C Serial Clock Low Serial Clock High SDO_C valid after SCK_C low nINTERRUPT status valid after nSCS_C low SDO_C valid after nSCS_C high Datagram Length Datagram Length Clock Frequency Clock Period tCLK = 1 / fCLK CLK-rising-edge-to-Output Propagation Delay tSI tDAMAGRAMuC tDAMAGRAMuC fCLK tCLK tPD 5.2.2 Min Typ 3 3 3 3 2.5 2.5 Max     3.5 4.5 CLK periods CLK periods µs MHz ns ns   32 3+3+32*6= 198 12.375 0 31.25 Unit CLK CLK CLK CLK CLK CLK  5 periods periods periods periods periods periods Datagram Structure The µC communicates with the TMC4210 via the four wire serial interface. Each datagram sent to the TMC4210 via the pin SDI_C and each datagram received from the TMC4210 via the pin SDO_C is 32 bits long. The first bit sent is the most significant bit (MSB) sdi_c_bit#31. The last bit sent is the least significant bit (LSB) sdi_c_bit#0 (see Figure 5.1). During the reception of a datagram, the TMC4210 immediately sends back a datagram of the same length to the microcontroller. This return datagram consists of requested read data in the lower 24 datagram bits and status bits in the higher 8 datagram bits. A read request is distinguished from a write request by the read/not write datagram bit (RW). 5.2.2.1 Datagrams Sent to the TMC4210 The datagrams sent to the TMC4210 are assorted in four groups of bits: RRS ADDRESS RW DATA The register RAM select (RRS) bit selects either registers or the on-chip RAM. Address bits address memory within the register set or within the RAM area. The read / not write (RW) bit distinguishes between read access and write access: read: RW = 1 / write RW = 0. Data bits are only for write access. For read access these bits are not used (don’t care) and should be set to 0. LSB MSB 32 BIT DATAGRAM SENT FROM µC TO THE TMC4210 VIA PIN SDI_C 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 RW RRS ADDRESS DATA NOTE - Different internal registers of the TMC4210 have different lengths. For some registers only a subset of 24 data bits is used. Unused data bits should be set to 0. Some addresses select a couple of registers mapped together into the 24 data bit space. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 15 5.2.2.2 Datagrams Received by µC from the TMC4210 The datagrams received by the µC from the TMC4210 contain two groups of bits: STATUS BITS The status bits, sent back with each datagram, comprehend the most important internal status bits of the TMC4210 and the settings of the reference switches Data bits are only for write access. DATA BITS The most significant bit MSB is received first; the least significant bit LSB is received last. The TMC4210 only sends datagrams on demand. LSB MSB 32 BIT DATAGRAM SENT BACK FROM THE TMC4210 TO µC VIA PIN SDO_C 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 STATUS BITS DATA BITS - xEQt1 R_L - GP_IN R_R INT - STATUS INFORMATION BITS INT The status bit INT is the internal high active interrupt controller status output signal. Handling of interrupt conditions without using interrupt techniques is possible by polling this status bit. The interrupt signal is available multiplexed with the SPI read back data at the nINT_SDO_C pin of the TMC4210. The pin nINT_SDO_C may additionally be connected to an interrupt input of the microcontroller. Do not set SDO_INT=1 because this setting disables the SPI output. Since the SDO_C / nINT output on TMC4210-I is multiplexed, the microcontroller has to disable its interrupt input while it sends a datagram to the TMC4210. The SDO_C signal driven by the TMC4210 alternates during datagram transmission. R_L The status bit R_L represents the state of the left reference switch input (r_l). R_R r_r is visible here only, while mot1R has not yet been set. GP_IN The GP_IN status bit represents the setting of the general purpose input. Refer to chapter 6.1.10.2, too. xEQt1 The status bit xEQt1 indicates for the stepper motor, if it has reached its target position. The status bits r_r, r_l, and gp_in and the bit xEQt1 can trigger an interrupt or enable simple polling techniques. See chapter 5.3, register 01 1110 for accessing the input bits. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 5.2.3 16 Simple Datagram Examples The % prefix – normally indicating binary representation in this data sheet – is omitted for the following datagram examples. Assuming, one would like to write (RW=0) to a register (RRS=0) at the address %001101 the following data word %0000 0000 0000 0001 0010 0011, one would have to send the following 32 bit datagram 00011010000000000000000100100011 to the TMC4210. With inactive interrupt (INT=0), no cover datagram waiting (CDGW=0), all reference switches inactive (RS3=0, RS2=0, RS1=0), and all stepper motors at target position (xEQt3=1, xEQt2=1, xEQt1=1) the status bits would be %10010101 the TMC4210 would send back the 32 bit datagram: 10010101000000000000000000000000 To read (RW=1) back the register written before, one would have to send the 32 bit datagram 00011011000000000000000000000000 to the TMC4210 and the TMC4210 would reply with the datagram 10010101000000000000000100100011. Write (RW=0) access to on-chip RAM (RRS=1) to an address %111111 occurs similar to register access, but with RRS=1. To write two 6 bit data words %100001 and %100011 to successive pair-wise RAM addresses %1111110 and %1111111 (%100001 to %1111110 and %100011 to %1111111) which are commonly addressed by one datagram, one would have to send the datagram 11111110000000000010001100100001. To read (rw=1) from that on-chip memory address, one would have to send the datagram 11111111000000000000000000000000. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 17 5.3 Register Mapping All register bits are initialized with 0 during power on reset, except the step pulse length setting that is initialized with 15. During power-up, the on-chip RAM of the TMC4210 is initialized internally and the chip does not send any datagrams to the stepper motor driver. CHANGING TARGET POSITION OR TARGET VELOCITY The stepper motor is controlled directly by writing motion parameters into associated registers. Only one register write access is necessary for changing a target motion parameter. Thus the microcontroller has to send one 32 bit datagram to the TMC4210 for altering the target position or the target velocity of the stepper motor. READ AND WRITE Read and write access is selected by the RW bit (sdi_c_bit#24) of the datagram sent from the µC to the TMC4210. The on-chip configuration RAM and the registers are writeable with read-back option. Some addresses are read-only. Write access (RW=0) to some of those read-only registers triggers additional functions, explained in detail later. TMC4210 REGISTER MAPPING 32 BIT DATAGRAM SENT FROM µC TO THE TMC4210 VIA PIN SDI_C 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 RW ADDRESS SMDA 0 0 0 0 1 1 1 1 1 IDX 0 0 0 0 0 1 0 1 1 0 1 0 1 1 1 1 0 0 0 1 0 1 1 0 1 0 1 1 1 1 JDX 1 0 1 0 1 1 0 0 0 0 1 1 STEPPER MOTOR REGISTER SET 0 1 0 1 0 1 0 1 1 0 1 0 1 0 1 0 1 0 0 1 0 V_MIN V_MAX V_TARGET V_ACTUAL A_MAX A_ACTUAL 1 PMUL PDIV REF_CONF R_M INTERRUPT_MASK INTERRUPF_FLAGS PULSE_DIV RAMP_DIV 0 DX_REF_TOLERANCE X_LATCHED USTEP_COUNT_4210 lp GLOBAL PARAMETER REGISTERS (SMDA=11) IF_CONFIGURATION_4210 POS_COMP_4210 POS_COMP_INT_4210 M I POWER-DOWN TYPE_VERSION (= $429101 for TMC4210, read-only) - mot1r 1 1 1 1 0 - gp _in - 0 0 0 0 0 STPDIV_4210 0 0 0 0 0 0 SMDA Stepper motor driver address r_l, r_r, gp_in R_ M RAMP_MODE mask Unused bits I www.trinamic.com (SMDA=00) X_TARGET X_ACTUAL RW=0 : WRITE access / RW=1 : READ access 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 DATA r_l r_r 00 Left switch / right switch / general purpose input (read out) Interrupt TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 6 18 Register Description The TMC4210 provides axis parameter registers and global parameter registers. 6.1 Axis Parameter Registers The registers hold binary coded numbers. Some are unsigned (positive) numbers, some are signed numbers in two’s complement, and some are control bits or single flags. The functionality of different registers depends on the RAMP_MODE (refer to chapter 6.1.10). OVERVIEW AXIS PARAMETER REGISTER MAPPING REGISTER R/W X_TARGET R/W X_ACTUAL R/W*2 TYPE DESCRIPTION This register holds the current target position in units of microsteps. The current position of each stepper motor is available by read out of this register. This register holds the absolute velocity value at or below which the stepper motor can be stopped abruptly. This parameter sets the maximum motor velocity. V_MIN R/W V_MAX R/W V_TARGET R/W 24 bit unsigned 24 bit unsigned 11 bit unsigned 11 bit unsigned 12 bit signed V_ACTUAL R*1 12 bit signed A_MAX R/W 11 bit unsigned R A_ACTUAL PMUL PDIV R/W R/W RAMP_MODE REF_CONF lp R/W R/W R 11 bit unsigned 1+7 bit 4 bit unsigned 2 bit 4 bit 1 bit INTERRUPT_MASK INTERRUPT_FLAGS RAMP_DIV PULSE_DIV R/W R/W R/W R/W R/W 8 8 4 4 2 DX_REF_TOLERANCE R/W 12 bit X_LATCHED USTEP_COUNT_4210 *1 2 * R R/W bit bit bit bit bit 24 bit unsigned 8 bit The V_TARGET register holds the current target velocity. The use of V_TARGET depends on the chosen mode of operation. This read-only register holds the current velocity of the stepper motor. This register defines the absolute value of the desired acceleration for velocity_mode and ramp_mode (resp. soft_mode) with a value range from 0 to 2047. The actual acceleration can be read out by the microcontroller from the A_ACTUAL read-only register. These values form a floating point number with PMUL as mantissa and PDIV as exponent. PMUL and PDIV are used for calculating the deceleration ramp. The two bits RAMP_MODE (R_M) select one of the four possible modes of operation. The configuration bits REF_CONF select the behavior of the reference switches. The bit called lp (latched position) is a read only status bit. The TMC4210 provides one interrupt register of eight flags for the stepper motor. The parameter RAMP_DIV scales the acceleration parameter A_MAX. The pulse generator clock – defining the maximum step pulse rate – is determined by the parameter PULSE_DIV. The parameter PULSE_DIV scales the velocity parameters. DX_REF_TOLERANCE excludes a motion range to allow motion near the reference position. This read-only register stores the actual position X_ACTUAL upon a change of the reference switch state. The read-write register USTEP_COUNT_4210 holds the actual microstep pointer of the internal sequencer. in hold_mode only, this register is a read-write register. before overwriting X_ACTUAL choose velocity_mode or hold_mode. Refer to chapter 6.1.2. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 6.1.1 19 X_TARGET (IDX=%0000) This register holds the current target position in units of microsteps. UNIT OF TARGET POSITION The unit of the target position depends on the setting of the associated stepper driver microstep resolution usrs. POSITIONING - - If the difference X_TARGET to X_ACTUAL is not zero and R_M = ramp_mode or soft_mode, the TMC4210 moves the stepper motor in the direction of X_TARGET in order to position X_ACTUAL to X_TARGET. Usually X_TARGET is modified to start a positioning. The condition | X_TARGET – X_ACTUAL | < 223 must be satisfied for motion into correct direction. Target position X_TARGET and current position X_ACTUAL may be altered on the fly. To move from one position to another, the ramp generator of the TMC4210 automatically generates ramp profiles in consideration of the velocity limits V_MIN and V_MAX and acceleration limit A_MAX. The registers X_TARGET, X_ACTUAL, V_MIN, V_MAX, and A_MAX are initialized with zero after power up. 6.1.2 X_ACTUAL (IDX=%0001) The current position of the stepper motor is available by read out of the registers called X_ACTUAL. The actual position can be overwritten by the microcontroller. This feature is important for the reference switch position calibration controlled by the microcontroller. UNIT OF CURRENT POSITION The unit of the target position depends on the setting of the associated stepper driver microstep resolution usrs. Attention Before overwriting X_ACTUAL choose velocity_mode or hold_mode. If X_ACTUAL is overwritten in ramp_mode or soft_mode the motor directly drives to X_TARGET. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 6.1.3 20 V_MIN (IDX=%0010) This register holds the absolute velocity value at or below which the stepper motor can be stopped abruptly. UNIT OF VELOCITY The unit of velocity parameters is steps per time unit. The scale of velocity parameters (V_MIN, V_MAX, V_TARGET, V_ACTUAL) is defined by the parameter PULSE_DIV (see page 6.1.12 for details) and depends on the clock frequency of the TMC4210. DECELERATION - The parameter V_MIN is relevant for deceleration while reaching a target position. V_MIN should be set greater than zero. This control value allows reaching the target position faster because the stepper motor is not slowed down below V_MIN before the target is reached. Due to the finite numerical representation of integral relations the target position cannot be reached exactly, if the calculated velocity is less than one, before the target is reached. Setting V_MIN to at least one assures reaching each target position exactly. A_ M AX AX _M Δv Δv AX _M -A -A A_ M AX v(t) t t0 Δt01 acceleration t1 t2 constant velocity t3 t4 deceleration t5 Δt56 t6 t7 t8 acceleration deceleration Figure 6.1 Velocity ramp parameters and velocity profiles 6.1.4 V_MAX (IDX=%0011) This parameter sets the maximum motor velocity. The absolute value of the velocity will not exceed this limit, except if the limit V_MAX is changed during motion to a value below the current velocity. UNIT OF VELOCITY The unit of velocity parameters is steps per time unit. The scale of velocity parameters (V_MIN, V_MAX, V_TARGET, V_ACTUAL) is defined by the parameter PULSE_DIV (see page 6.1.12 for details) and depends on the clock frequency of the TMC4210. HOMING PROCEDURE To set target position X_TARGET and current position X_ACTUAL to an equivalent value (e.g. to set both to zero at a reference point) the stepper motor should be stopped first and the parameter V_MAX should be set to zero to hold the stepper motor at rest before writing into the register X_TARGET and X_ACTUAL. Attention Before overwriting X_ACTUAL choose velocity_mode or hold_mode. If X_ACTUAL is overwritten in ramp_mode or soft_mode the motor directly drives to X_TARGET. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 6.1.5 21 V_TARGET (IDX=%0100) The use of V_TARGET depends on the chosen mode of operation: Mode of operation ramp_mode velocity_mode hold_mode soft_mode Functionality of V_TARGET The V_TARGET register holds the current target velocity calculated internally by the ramp generator. A target velocity can be written into the V_TARGET register. The stepper motor accelerates until it reaches the specified target velocity. The velocity is changed according to the motion parameter limits if the register V_TARGET is changed. The register V_TARGET is ignored. The V_TARGET register holds the current target velocity calculated internally by the ramp generator. UNIT OF VELOCITY The unit of velocity parameters is steps per time unit. The scale of velocity parameters (V_MIN, V_MAX, V_TARGET, V_ACTUAL) is defined by the parameter PULSE_DIV (see chapter 6.1.12 for details) and depends on the clock frequency of the TMC4210. 6.1.6 V_ACTUAL (IDX=%0101) This read-only register holds the current velocity of the associated stepper motor. Internally, the ramp generator of the TMC4210 processes with 20 bits while only 12 bits (the most significant bits) can be read out as V_ACTUAL. In hold_mode only, this register is a read-write register. Writing zero to the register V_ACTUAL immediately stops the associated stepper motor, because hidden bits are set to zero with each write access to the register V_ACTUAL. In hold_mode motion parameters are ignored and the microcontroller has the full control to generate a ramp. The TMC4210 only handles the microstepping and datagram generation for the associated stepper motor. UNIT The unit of velocity parameters is steps per time unit. The scale of velocity parameters (V_MIN, V_MAX, V_TARGET, and V_ACTUAL) is defined by the parameter PULSE_DIV (see chapter 6.1.12 for details) and depends on the clock frequency of the TMC4210. An actual velocity of zero read out by the microcontroller means that the current velocity is in an interval between zero and one. Therefore the actual velocity should not be used to detect a stop of the stepper motor. It is advised to detect the target_reached flag instead. 6.1.7 A_MAX (IDX=%0110) This register defines the absolute value of the desired acceleration for velocity_mode and ramp_mode (resp. soft_mode) with a value range from 0 to 2047. Note The motion controller cannot stop the stepper motor if A_MAX is set to zero on the fly because afterwards the velocity cannot be changed automatically any more. UNIT The unit of the acceleration is change of step frequency per time unit divided by 256. The scale of acceleration parameters (A_MAX, A_ACTUAL, and A_THRESHOLD) is defined by the parameter RAMP_DIV (see section 6.1.12) and depends on the clock frequency of the TMC4210. 6.1.7.1 A_MAX in ramp_mode As long as RAMP_DIV  PULSE_DIV – 1 is valid, any value of A_MAX within its range (0… 2047) is allowed and there exists a valid pair {PMUL, PDIV} for each A_MAX. The reason is that the acceleration scaling determined by RAMP_DIV is compatible with the step velocity scaling determined by PULSE_DIV. A large RAMP_DIV stands for low acceleration and a large PULSE_DIV stands for low velocity. Low acceleration is compatible with low speed and high speed as well, but high acceleration is more compatible with high speed. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 22 Changing one parameter out of the triple {A_MAX, RAMP_DIV, PULSE_DIV} requires re-calculation of the parameter pair {PMUL, PDIV} to update the associated register. For description of the parameters PMUL and PDIV see section 6.1.9. 6.1.7.1.1 Deceleration in ramp_mode and soft_mode If RAMP_DIV and PULSE_DIV differ more than one while deceleration in ramp_mode or soft_mode the parameter A_MAX needs to have a lower limit (>1) and an upper limit ( 2048 and the parameter A_MAX might be set to any value up to 2047. CONDITIONS The parameter A_MAX must not be set below A_MAXLOWER_LIMIT except A_MAX is set to 0. The condition A_MAX  A_MAXLOWER_LIMIT as well as A_MAX  A_MAXUPPER_LIMIT must be satisfied to reach any target position without oscillations. If that condition is not satisfied, oscillations around a target position may occur. 6.1.8 A_ACTUAL (IDX=%0111) The actual acceleration can be read out by the microcontroller from the A_ACTUAL read-only register. The actual acceleration is used to select scale factors for the coil currents. It is updated with each clock. The returned value A_ACTUAL is smoothed to avoid oscillations of the readout value. Thus, returned A_ACTUAL values should not be used directly for precise calculations. UNIT The unit of the acceleration is change of step frequency per time unit divided by 256. The scale of acceleration parameters (A_MAX, A_ACTUAL, and A_THRESHOLD) is defined by the parameter RAMP_DIV (see section 6.1.12) and depends on the clock frequency of the TMC4210. 6.1.9 PMUL & PDIV (IDX=%1001) In ramp mode, the TMC4210 uses an internal algorithm to calculate the deceleration ramp on the fly. This algorithm requires an additional proportionality factor P which allows the TMC4210 to calculate the velocity required for stopping in time to exactly reach the target position without overshooting. This calculation is done for each ramp step. The result of this calculation can be read in the register V_TARGET. Whenever V_TARGET falls below the actual velocity, the TMC4210 decelerates. As there is a large range of acceleration and velocity values, p is stored in a floating point representation, using the registers PMUL (mantissa) and PDIV (exponent). Using the proportionality factor P target positions are quickly reached without overshooting. The proportionality factor primarily depends on the acceleration limit A_MAX and on the two clock divider parameters PULSE_DIV and RAMP_DIV. These two separate clock divider parameters (set to the same value for most applications) provide an extremely wide dynamic range for acceleration and velocity. PULSE_DIV and RAMP_DIV allow reaching very high velocities with very low acceleration. Changing one parameter out of the triple {A_MAX, RAMP_DIV, PULSE_DIV} requires re-calculation of the parameter pair {PMUL, PDIV} to update the associated register. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 23 6.1.9.1 Calculation of the Proportionality Factor p The representation of the proportionality factor p by the two parameters PMUL and PDIV is a floating point representation. NOTATIONS Registers are PMUL and PDIV. Operating values are PMUL and PDIV. CALCULATE P AS FOLLOWS: 𝑝= with 𝑃𝑀𝑈𝐿 𝑃𝐷𝐼𝑉 PMUL = 128… 255 representing a factor of 1.000 to 1.992 (=1+127/128) PDIV = {23, 24, 25… 214, 215, 216} PMUL ranges from 128 to 255. PDIV is a power of two with a range from 8 to 65536. Values of p less than 128 can be achieved by increasing PDIV. The TMC4210 does not directly store the PDIV parameter. The motion controller stores PDIV with 𝑃𝐷𝐼𝑉 = 23+𝑃𝐷𝐼𝑉 NOTE - Setting the factor p too small will result in a slow approach to the target position. Setting the factor p too large will cause overshooting and even oscillations around the target position. The parameters PMUL and PDIV share the address IDX=%1001. The MSB of PMUL is fixed set to 1 and cannot be changed. This way, PMUL represents a mantissa in the range 1.000 (%1000 0000) to 1.992 (%1111 1111). PMUL PDIV V_MIN V_MAX A_MAX X_TARGET Target Position Calculation V_TARGET Velocity Ramp Generator V_ACTUAL Puls Generator (Micro-) Step pulses X_ACTUAL RAMP_DIV clk clk32 PULSE_DIV CLOCK_DIV32 Figure 6.2 Target position calculation, ramp generator, and pulse generator 6.1.9.1.1 Calculation of p for a Given Acceleration p and the fitting PMUL and PDIV values can be calculated by the microcontroller. Optionally a pair of matching values of A_MAX, PMUL and PDIV can be stored into the microcontroller memory. The acceleration limit is a stepper motor parameter which is fixed in most applications. If the acceleration limit has to be changed nevertheless, the microcontroller can calculate a pair of PMUL and PDIV on demand for each new acceleration limit A_MAX with RAMP_DIV and PULSE_DIV. Also, pre-calculated pairs of PMUL and PDIV read from a table can be sufficient. 6.1.9.2 Calculation of PMUL and PDIV A pair of PMUL and PDIV has to be calculated for each provided acceleration limit A_MAX. Note, that there may be more than one valid pair of PMUL and PDIV for a given A_MAX acceleration limit. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 24 CONSIDERATIONS FOR THE CALCULATION OF PMUL AND PDIV - - - To accelerate, the ramp generator accumulates the acceleration value to the actual velocity with each time step. The absolute value V_MAX of the velocity internally is represented by 11+8=19 bits, while only the most significant 11 bits and the sign are used as input for the step pulse generator. So, there are 211=2048 values possible for specifying a velocity within a range of 0 to 2047. The ramp generator accumulates 1/256*A_MAX with each time step to the actual velocity value V_ACTUAL during acceleration phases. This accumulation uses 8 bits for decimals. So, the acceleration from a velocity V_ACTUAL=0 to the maximum possible velocity V_MAX=2047 spans over 2048*256 / A_MAX pulse generator clock pulses. Within the acceleration phase the pulse generator generates S = ½ * 2048* 256 / A_MAX * T steps for the (micro) step unit. The parameter T is the clock divider ratio: T = 2RAMP_DIV/ 2PULSE_DIV= 2RAMP_DIV– PULSE_DIV During the acceleration, the velocity has to be increased until the velocity limit V_MAX is reached or deceleration is required in order to exactly reach the target position. The TMC4210 automatically determines the deceleration position in ramp_mode and decelerates. This calculation uses the difference between current position and target position and the proportionality parameter p, which has to be p = 2048 / S. The following formula results: 𝑝= 2048 1 256 ( ∗ 2048 ∗ ) ∗ 2𝑅𝐴𝑀𝑃_𝐷𝐼𝑉−𝑃𝑈𝐿𝑆𝐸_𝐷𝐼𝑉 2 𝐴𝑀𝐴𝑋 This can be simplified to 𝑝= 𝐴_𝑀𝐴𝑋 128 ∗ 2𝑅𝐴𝑀𝑃_𝐷𝐼𝑉−𝑃𝑈𝐿𝑆𝐸_𝐷𝐼𝑉 HINTS - - To avoid overshooting, the parameter PMUL should be made approximately 1% smaller than calculated. Alternatively set p reduced by an amount of 1%. If the proportionality parameter p is too small, the target position will be reached slower, because the slow down ramp starts earlier. The target position is approached with minimal velocity V_MIN, whenever the internally calculated target velocity becomes less than V_MIN. With a good parameter p the minimal velocity V_MIN is reached a couple of steps before the target position. With parameter p set a little bit too large and a small V_MIN overshooting of one step (respectively one microstep) may occur. A decrement of the parameter PMUL avoids this one-step overshooting. v(t) V_MAX p p sma ll od go p to o v to o la rg e V_MIN t0 t1 t2 Figure 6.3 Proportionality parameter p and outline of velocity profile(s) www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 25 6.1.9.2.1 Choosing a Pair of PMUL and PDIV The calculation is based on the formula 𝑝= 𝑃𝑀𝑈𝐿 𝑃𝑀𝑈𝐿 = 3+𝑃𝐷𝐼𝑉 𝑃𝐷𝐼𝑉 2 CALCULATIONS 1. 2. 3. 4. 5. To represent the parameter p choose a pair of PMUL and PDIV which approximates p. Value range for PMUL: 128… 255 Value range for PDIV: one out of {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13} (representing PDIV one out of {8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32786, 65536}) Try all 128 * 14 = 1792 possible pairs of PMUL and PDIV with a program and choose a matching pair. To find a pair, calculate for each pair of PMUL and PDIV 𝑝= 𝐴_𝑀𝐴𝑋 128∗2𝑅𝐴𝑀𝑃_𝐷𝐼𝑉−𝑃𝑈𝐿𝑆𝐸_𝐷𝐼𝑉 𝑝′ = 𝑃𝑀𝑈𝐿 𝑃𝐷𝐼𝑉 = 𝑃𝑀𝑈𝐿 23+𝑃𝐷𝐼𝑉 and and 𝑝′ 𝑝 Select one of the pairs satisfying the condition 0.95 < q < 1.0. The value q interpreted as a function q(a_max, ramp_div, pulse_div, pmul, pdiv) gives the quality criterion required. 𝑞= 6. Although q = 1.0 indicates that the chosen P_MUL and P_DIV perfectly represent the desired p factor for a given A_MAX, overshooting could result because of finite numerical precision. On the other hand in case of high resolution microstepping, overshooting of one microstep is negligible in most applications. To avoid overshooting, use P_MUL-1 instead of the selected P_MUL or select a pair (P_MUL, P_DIV) with q = 0.99. 6.1.9.2.2 Optimized Calculation of PMUL and PDIV The calculation of the parameters PMUL and PDIV can be simplified using the expression 𝑃𝑀𝑈𝐿 = 𝑝 ∗ 23 ∗ 2𝑃𝐷𝐼𝑉 with 𝑝= 𝐴_𝑀𝐴𝑋 128∗2𝑅𝐴𝑀𝑃_𝐷𝐼𝑉−𝑃𝑈𝐿𝑆𝐸_𝐷𝐼𝑉 To avoid overshooting, use 𝑝𝑟𝑒𝑑𝑢𝑐𝑒𝑑 = 𝑝 ∗ (1 − 𝑝𝑟𝑒𝑑𝑢𝑐𝑡𝑖𝑜𝑛 [%]) with p_reduction approximately 1% This results in: 𝑃𝑀𝑈𝐿 = 𝑝𝑟𝑒𝑑𝑢𝑐𝑒𝑑 ∗ 23 ∗ 2𝑃𝐷𝐼𝑉 = 0.99 ∗ 𝑝 ∗ 23 ∗ 2𝑃𝐷𝐼𝑉 PMUL becomes a function of the parameter PDIV. To find a valid pair {PMUL, PDIV} choose one out of 14 pairs for PDIV = {0, 1, 2, 3, ..., 13} with PMUL within the valid range 128  PMUL  255. The C language example pmulpdiv.c can be found on www.trinamic.com. The source code can directly be copied from the PDF datasheet file. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 26 6.1.9.2.3 Calculation Example: PMUL and PDIV /* PROGRAM EXAMPLE ‘pmulpdiv.c’ : How to Calculate p_mul & p_div for the TMC4210 */ #include #include #include #include void CalcPMulPDiv(int a_max, int ramp_div, int pulse_div, float p_reduction, int *p_mul, int *p_div, double *PIdeal, double *PBest, double *PRedu ) { int pdiv, pmul, pm, pd ; double p_ideal, p_best, p, p_reduced; pm=-1; pd=-1; // -1 indicates : no valid pair found p_ideal = a_max / (pow(2, ramp_div-pulse_div)*128.0); p = a_max / ( 128.0 * pow(2, ramp_div-pulse_div) ); p_reduced = p * ( 1.0 – p_reduction ); for (pdiv=0; pdiv a_max_upper_limit]”); printf(“\n\n”); return 0; } /* -------------------------------------------------------------------------- */ www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 27 6.1.10 lp, RAMP_MODE, and REF_CONF (IDX=%1010) The configuration words REF_CONF and RAMP_MODE are accessed via a common address. LP, RAMP_MODE, AND REF_CONF Bit or Register RAMP_MODE lp REF_CONF Function The two bits RAMP_MODE (R_M) select one of the four possible stepping modes. The bit called lp (latched position) is a read only status bit. The configuration bits REF_CONF select the behavior of the reference switches. 6.1.10.1 RAMP_MODE Register TMC4210 MOTION MODES RAMP_MODE bits Mode %00 ramp_mode %01 soft_mode %10 velocity_mode %11 hold_mode www.trinamic.com Function Default mode for positioning applications with trapezoidal ramp. This mode is provided as default mode for positioning tasks. Similar to ramp_mode, but with soft target position approaching. The target position is approached with exponentially reduced velocity. This feature can be useful for applications where vibrations at the target position have to be minimized. Mode for velocity control applications, change of velocities with linear ramps. This mode is for applications, where stepper motors have to be driven precisely with constant velocity. The velocity is controlled by the microcontroller, motion parameter limits are ignored. This mode is provided for motion control applications, where the ramp generation is completely controlled by the microcontroller. TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 28 6.1.10.2 The REF_CONF Register and the lp Read-Only Status Bit A reference switch can be used as an automatic stop switch. The reference switch indicates the reference position within a given tolerance. The automatic stop function of the switches can be enabled or disabled. Also a reference tolerance range (see register DX_REF_TOLERANCE, chapter 0) can be programmed to allow motion within the reference switch active range during homing. When a reference switch is triggered, the actual position can be stored automatically. This allows a precise determination of the reference point. It is initiated by writing a dummy value to the register X_LATCHED (see chapter 6.1.14). The read-only status bit lp (latch position waiting) indicates that the next change of the selected reference switch will trigger latching the position X_ACTUAL. The lp bit is automatically reset after position latching. Motor Left switch Right switch Traveller x1 xleft x2 x3 xright x4 xtraveler Negative direction Positive direction Mechanical inaccuracy of switches (switching hysteresis) DX_REF_TOLERANCE Figure 6.4 Left switch and right switch for reference search and automatic stop function The bits contained in the REF_CONF register control the semantic and the actions of the reference/stop switch modes for interrupt generation as explained later. The stepper motor stops if the reference/stop switch becomes active. This mechanism reacts only to the switch which corresponds to the actual motion direction, e.g. the right switch when moving to a more positive position. The configuration bits named disable_stop_l respectively disable_stop_r disable these automatic stop functions. If the bit soft_stop is set, the motor stops with linear ramp as determined by A_MAX. REFERENCE SWITCH CONFIGURATION BITS REF_CONF AND LP STATUS BIT REF_CONF mnemonic 0 : disable_stop_l 1 : 0 : disable_stop_r 1 : 0 : soft_stop 1 : ref_RnL 0 : 1 : 0 : lp www.trinamic.com 1 : Function The motor will be stopped when the velocity is negative (V_ACTUAL < 0) and the left reference switch becomes active. Left reference switch is disabled as an automatic stop switch. Stops the motor if the velocity is positive (V_ACTUAL > 0) and the right reference switch becomes active. Right reference switch is disabled as an automatic stop switch. Stopping takes place immediately; motion parameter limits are ignored. Stopping takes place in consideration of motion parameter limits; stops with linear ramp. The bit ref_RnL (reference switch Right not Left) defines which switch will be used as the reference switch. The definition of the reference switch by the configuration bit ref_RnL has no effect on the stop function of the reference switches if disable_stop_l = 0 respectively disable_stop_r = 0. The left reference switch controls reference switch functions. The right (not left) reference switch controls reference switch functions. This is the power-on default of the lp (latched position waiting) bit. X_LATCHED has been initialized by a write access to latch the position on a change of the reference switch. It is set to 0 after a position has been latched. TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 29 ATTENTION Per default there is only one switch available: REF_L is configured as left reference switch. For configuring REF_R as right switch, it is necessary to set the mot1r bit in the STEPPER MOTOR GLOBAL PARAMETER REGISTER to 1. Please refer to chapter 6.2.1.5 for further information. There is a functional difference between reference switches and stop switches. Reference switches are used to determine a reference position for the stepper motor. Stop switches are used for automatic stopping the motor when reaching a limit. The signals of switches are processed via the inputs REF_L and REF_R. They might be used as automatic stop switches, reference switches, or both. 32 BIT DATAGRAM SENT FROM A µC TO THE TMC4210 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 REF_CONF RAMP_ MODE %00 : ramp, %01 : soft, %10 : velocity, %11 : hold www.trinamic.com lp disable_stop_l disable_stop_r soft_stop ref_RnL 0 DATA latched position (waiting) 0 0 1 0 1 0 RW RRS ADDRESS TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 30 6.1.11 INTERRUPT_MASK & INTERRUPT_FLAGS (IDX=%1011) The TMC4210 provides one interrupt register of eight flags for the stepper motor. Interrupt bits are named int_. The interrupt out nINT_SDO_C is set active low and the interrupt status bit int is set active high if at least one interrupt flag of the motor becomes set. If the interrupt status is inactive, nINT is high (1) and int is low (0). SETTING MASKS AND FLAGS - - An interrupt flag is set to 1 if its assigned interrupt condition occurs. Each interrupt bit can either be enabled or disabled (1/0) individually by an associated interrupt mask bit named mask_. Interrupt flags are reset to 0 by a write access (RW=0) to their interrupt register address (IDX=%1011). Write 1 at the position of the bit to clear the flag. Writing a 0 to the corresponding position leaves the interrupt flag untouched. Interrupt flags are forced to 0 if the corresponding mask bit is disabled (0). INTERRUPT FLAGS int_ int_pos_end int_ref_wrong int_ref_miss int_stop int_stop_left_low int_stop_right_low int_stop_left_high int_stop_right_high Function If a target position is reached while the interrupt mask mask_pos_end is 1, the bit is set to 1. Reference switch signal was active outside the reference switch tolerance range (defined by the DX_REF_TOLERANCE register). The switches processed via the inputs REF_L and REF_R can be used as stop switches for automatic motion limiting, as reference switches, and for both. If a reference switch becomes active out of the reference switch tolerance range the interrupt flag int_ref_wrong is set if the interrupt mask bit mask_ref_wrong is set. The interrupt flag int_ref_miss is set if the reference switch is inactive at the 0 position and the mask mask_ref_miss is enabled. The int_stop flag is set, if the reference switch has forced a stop during motion and if the interrupt mask mask_stop is set. High to low transition of left reference switch. The int_stop_left_low flag is set if the reference switch changes from high to low and if the interrupt mask bit mask_stop_left_low is set. High to low transition of right reference switch. The int_stop_right_low flag is set if the reference switch changes from high to low and if the interrupt mask bit mask_stop_right_low is set. Low to high transition of left reference switch. The int_stop_left_high flag indicates that the left reference switch input changes from low to high if the mask bit mask_stop_left_high is set. Low to high transition of right reference switch. The int_stop_right_high flag indicates that the right reference switch input changes from low to high if the mask bit mask_stop_right_high is set. INTERRUPT MASK BIT mask_ mask_pos_end mask_ref_wrong mask_ref_miss mask_stop mask_stop_left_low mask_stop_right_low mask_stop_left_high mask_stop_right_high www.trinamic.com Function 1: mask enabled; 1: mask enabled; 1: mask enabled; 1: mask enabled; 1: mask enabled; 1: mask enabled; 1: mask enabled; 1: mask enabled; 0: 0: 0: 0: 0: 0: 0: 0: mask mask mask mask mask mask mask mask disabled. disabled. disabled. disabled. disabled. disabled. disabled. disabled. TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 31 32 BIT DATAGRAM SENT FROM A µC TO THE TMC4210 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 RW RRS ADDRESS DATA 0 0 1 0 1 1 INTERRUPT_MASK INTERRUPT_FLAGS int_pos_end int_ref_wrong int_ref_miss int_stop int_stop_left_low int_stop_right_low int_stop_left_high int_stop_right_high mask_pos_end mask_ref_wrong mask_ref_miss mask_stop mask_stop_left_low mask_stop_right_low mask_stop_left_high mask_stop_right_high 0 The interrupt status is mapped to the most significant bit (31) of each datagram sent back to the µC and it is only available at the nINT_SDO_C pin of the TMC4210 if the pin nSCS_C is high. De-multiplexing of the multiplexed interrupt status signal at the pin nINT_SDO_C can be done using additional hardware. It is not necessary if the microcontroller always disables its interrupt while it sends a datagram to the TMC4210. 6.1.12 PULSE_DIV & RAMP_DIV (IDX=%1100) The frequency of the external clock signal (pin CLK) is divided by 32 (see Figure 6.2). This clock drives two programmable clock dividers: RAMP_DIV for the ramp generator and PULSE_DIV for the pulse generator. RAMP_DIV and PULSE_DIV allow a division of 1/32 fCLK by the following value settings: value division by PULSE_DIV RAMP_DIV 0 1 1 2 2 4 3 8 4 16 5 32 6 64 7 128 8 256 9 512 10 1024 11 2048 12 4096 13 8192 The pulse generator clock – defining the maximum step pulse rate – is determined by the parameter PULSE_DIV. The parameter PULSE_DIV scales the velocity parameters. The parameter RAMP_DIV scales the acceleration parameter A_MAX. 6.1.12.1 Calculating the Step Pulse Rate R 𝑅[𝐻𝑧] = 𝑓𝐶𝐿𝐾 [𝐻𝑍] ∗ 𝑣𝑒𝑙𝑜𝑐𝑖𝑡𝑦 2𝑃𝑈𝐿𝑆𝐸_𝐷𝐼𝑉 ∗ 2048 ∗ 32 where fCLK[Hz] is the frequency of the external clock signal. velocity is in range 0 to 2047 and represents parameters V_MIN, V_MAX, and absolute values of V_TARGET and V_ACTUAL. The pulse generator of the TMC4210 generates one step pulse with each 1/(32*2^PULSE_DIV) clock pulse with a given theoretical velocity setting of 2048. [Attention: Range ±2047] www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 32 The full step frequency RFS is given by 𝑅𝐹𝑆 [𝐻𝑧] = 𝑅[𝐻𝑍] 2𝑈𝑆𝑅𝑆 The change R in the pulse rate per time unit is given by ∆𝑅[𝐻𝑧/𝑠] = 𝑓𝐶𝐿𝐾 [𝐻𝑍] ∗ 𝑓𝐶𝐿𝐾 [𝐻𝑍] ∗ 𝐴_𝑀𝐴𝑋 2𝑃𝑈𝐿𝑆𝐸_𝐷𝐼𝑉+𝑅𝐴𝑀𝑃_𝐷𝐼𝑉+29 where R: 29: 32 256 2048 pulse frequency change per second (acceleration) the constant is derived form 229 = 25 * 25 * 28 * 211 = 32*32*256*2048. comes from fixed clock pre-dividers, comes from the velocity accumulation clock pre-divider, and comes from the velocity accumulation clock divider programmed by A_MAX. The parameter A_MAX is in range 0 to 2047. The change of fullstep frequency RFS in the pulse rate per time unit is given by 𝑅𝐹𝑆 [𝐻𝑧] = 𝑅[𝐻𝑍] 2𝑈𝑆𝑅𝑆 The angular velocity of a stepper motor can be calculated based on the full step frequency RFS[Hz] for a given number of full steps per rotation. Similarly, the angular acceleration of a stepper motor can be calculated based on the change of the full step frequency per second RFS[Hz]. 6.1.12.2 Calculating the Number of Steps During Linear Acceleration 1 𝑣2 ∗ 2 𝑎 where S = number of steps a = linear acceleration v = velocity 𝑆= With v = R[Hz] and a = R[Hz/s] one gets: 𝑆= 1 𝑣2 2𝑅𝐴𝑀𝑃_𝐷𝐼𝑉 ∗ ∗ 𝑃𝑈𝐿𝑆𝐸_𝐷𝐼𝑉 ÷ 23 2 𝐴𝑀𝐴𝑋 2 The number of full steps SFS during linear acceleration is given by 𝑆𝐹𝑆 = 𝑆 2𝑢𝑠𝑟𝑠 Changing PULSE_DIV in velocity_mode or in hold_mode might force an internal microstep (with microstep resolution defined by usrs) depending on the actual microstep position. This behavior can be observed especially when the motor is at rest. In ramp_mode this does not occur. PULSE_DIV should only be changed in ramp_mode! www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 33 6.1.13 DX_REF_TOLERANCE (IDX=%1101) Generally, the switch inputs REF_L and REF_R can be used as stop switches for automatic motion limiting and as reference switches defining a reference position for the stepper motor. To allow the motor to drive near the reference point, it is possible to exclude a motion range of steps from the stop switch function. The parameter DX_REF_TOLERANCE disables automatic stopping by a switch around the origin (see Figure 6.4). To use the DX_REF_TOLERANCE far from the origin, the actual position has to be adapted, e.g. by setting it to zero in the center of the tolerance range. Additionally, the parameter DX_REF_TOLERANCE affects interrupt conditions as described before (section 6.1.11). 6.1.14 X_LATCHED (IDX=%1110) This read-only register stores the actual position X_ACTUAL upon a change of the reference switch state. The reference switch is defined by the bit ref_RnL of the configuration register 6.2.1.5. Writing a dummy value to the (read-only) register X_LATCHED initializes the position storage mechanism. The actual position is saved with the next rising edge or falling edge signal of the reference switch depending on the actual motion direction of the stepper motor. The actual position is latched when the switch defined as the reference switch by the ref_RnL bit changes (see chapter 1.5.4). The status bit lp signals, if latching of a position is pending. This way, a precise reference is available for homing. An event at the reference switch associated to the actual motion direction takes effect only during motion (when V_ACTUAL  0). www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 34 6.2 Global Parameter Registers The registers addressed by RRS=0 with SMDA=%11 are global common parameter registers. To emphasize this difference, the address label JDX is used as index name instead of IDX (see overview in chapter 5.3). OVERVIEW GLOBAL PARAMETER REGISTER MAPPING REGISTER DESCRIPTION IF_CONFIGURATION_4210 This This - STEPPER MOTOR GLOBAL PARAMETER REGISTER 6.2.1 register is used for configuration of the reference switch inputs the Step/Dir interface the association of the position compare output signal to one stepper motor register holds configuration bits for the stepper motor driver chain and defines timing reference switch adjustments IF_CONFIGURATION_4210 (JDX=%0100) The register IF_CONFIGURATION_4210 is the interface configuration register for the TMC4210. It is used for configuration of the reference inputs the interrupt output the Step/Dir interface INTERFACE CONFIGURATION REGISTER CONTROL BITS IF_CONFIGURATION_4210 Function inv_ref Invert common polarity for all reference switches. If this bit is set, a low level on the input signals an active reference switch. step_half Toggle on each step pulse (this halfs the step frequency, both pulse edges represent steps). step_half reduces the required step pulse bandwidth and is useful if for low-bandwidth optocouplers. This function can be used for the TMC262 stepper driver. inv_stp Invert step pulse polarity. This configuration can be used for adaption of the step polarity to external driver stage. inv_dir Invert step pulse polarity. This is for adaption to external driver stages. Alternatively, this can be used as a shaft bit to adjust the direction of motion for the motor, but do not use this as a direction bit because it has no effect on the internal handling of signs (X_ACTUAL, V_ACTUAL…). en_sd Enable the Step/Dir interface by setting this bit to 1 (EN_SD=1). Note: The step pulse timing (length) must be compatible with both, the desired step frequency and the external drivers’ requirements. The step pulse timing is determined by the 4 LSBs of STPDIV_4210. 32 BIT DATAGRAM SENT FROM A µC TO THE TMC4210 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 RW RRS ADDRESS DATA 1 1 0 1 0 0 inv_ref sdo_int=0 step_half inv_stp 0 inv_dir 0 en_sd=1 www.trinamic.com en_refr=0 0 IF_CONFIGURATION_4210 TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 35 INITIALIZE THE STEP/DIR INTERFACE! Enable the Step/Dir interface by setting en_sd=1! After power-on, the output signals are logic high until they become configured for step/direction. 6.2.1.1 POS_COMP_4210 (JDX=%0101) POS_COMP_4210 defines a position, which becomes compared to the motor position. 6.2.1.2 POS_COMP_INT_4210 (JDX=%0110) The position compare interrupt mask (M) and interrupt flag (I) register hold the mask and interrupt concerning the position compare function of the TMC4210. 6.2.1.3 POWER_DOWN (JDX=%1000) A write to the register address POWER_DOWN sets the TMC4210 into the power down mode until it detects a falling edge at the pin nSCS_C. During power down, all internal clocks are stopped. All outputs remain stable, and all register contents are preserved. 6.2.1.4 TYPE_AND_VERSION_4210 (JDX=%1001) Read only register that gives type und version of the design. 6.2.1.5 REFERENCE_SWITCHES (JDX=%1110) The current state of the reference switches can be read out with this register. Per default configuration, only the left reference switch is active (mot1r=0). INITIALIZE THE RIGHT REFERENCE SWITCH! For using both reference switches, write 1 to mot1r. If it is desired to invert the polarity of the reference switches, the bit inv_ref of the IF_CONFIGURATION_4210 register can be set. This allows matching normally open contacts or normally closed contacts. 6.2.2 STEPPER MOTOR GLOBAL PARAMETER REGISTER (JDX=%1111) This register holds different configuration bits for the stepper motor driver chain. The absolute address (RRS & ADDRESS) of the stepper motor global parameter register is %01111110 = $7E. STEPPER MOTOR GLOBAL PARAMETER CONTROL Register STPDIV_4210 mot1r Function The timing of the Step/Dir interface is controlled by four LSBs. Please refer to chapter 8.1 for the calculation of Step/Dir timing. Set mot1r to 1 for a left and a right swicht. In case switches are not to be used, pull the related pins to GND. Refer to chapter 7.1. 32 BIT DATAGRAM SENT FROM A µC TO THE TMC4210 1 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 9 8 7 6 5 4 3 2 1 0 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 0 0 STPDIV_4210 www.trinamic.com DATA mot1r=1 0 1 1 1 1 1 1 RW RRS ADDRESS 0 0 0 0 0 0 00 TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 7 36 Reference Switch Inputs 7.1 Reference Switch Configuration, mot1r mot1r is for configuring the reference switches of the TMC4210. Per default, mot1r=0. REFERENCE INPUTS DEPENDING ON CONFIGURATION BITS mot1r left switch right switch 0 1 REF_L REF_L REF_R 7.2 Triple Switch Configuration The programmable tolerance range around the reference switch position is useful for a triple switch configuration, as outlined in Figure 7.1. In this configuration two switches are used as automatic stop switches and one additional switch is used as the reference switch between the left stop switch and the right stop switch. The left stop switch and the reference switch are connected in series. In order to use the reference switch, program a tolerance range into the register DX_REF_TOLERANCE. This disables the automatic stop within the tolerance range of the reference switch. The homing procedure can use the right switch to make sure, that the reference switch is found properly. The TMC4210 can automatically check the correct position of the driver whenever the reference switch is passed. Motor Reference switch Right stop switch Left stop switch traveller x' 1 x' left x' 2 x traveler x 1 x 0 x 2 x 3 x right x 4 Negative direction Positive direction DX_REF_TOLERANCE Figure 7.1 Triple switch configuration left stop switch – reference switch – right stop switch www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 37 7.3 Homing Procedure In order to home the drive, the reference switch position xref must be determined after each power on (see Figure 7.2). PROCEED AS FOLLOWS: 1. 2. 3. 4. 5. 6. 7. Due to mechanical inaccuracy of switches, the reference switch is active within the following range: x1 < xref < x2, where x1 and x2 may vary. If the traveler is within the range x1 < xtraveler < x2 at the start of the homing procedure, it is necessary to leave this range, because the associated reference switch is active. A dummy write access to X_LATCHED initializes the position latch register. With the traveler within the range x2 < xtraveler < xmax and the register X_LATCHED initialized, the position x2 can simply be determined by motion with a target position X_TARGET set to –xmax. When reaching position x2 the position is latched automatically. With stop switch enabled, the stepper motor automatically stops if the position x2 is reached. Now, set the DX_REF_TOLERANCE in order to allow motion within the active reference switch range x1 < xref < x2 and to move the traveler to a position xtraveler < x1 if desired. Afterwards initialize the register X_LATCHED again to latch the position x1 by a motion to a target position xtraveler < x1. When the positions x1 and x2 are determined the reference position xref = (x1 + x2 ) / 2 can be set. Finally, one should move to the target position X_TARGET = xref and set X_TARGET := 0 and X_ACTUAL := 0 when reached. Motor reference switch traveller dx 1 x 1 xref x 2 dx 2 x traveler Negative direction Positive direction mechanical inaccuracy of switches (switching hysteresis) DX_REF_TOLERANCE Figure 7.2 Reference search www.trinamic.com x max TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 8 38 Step/Dir Drivers Step/Dir drivers contain an internal sequencer. The Step/Dir interface is a simple and universal interface for real time motion control. All additional control functions like current control have to be provided by the microcontroller directly communicating to the driver. The Step/Dir mode is enabled if the control bit en_sd (enable Step/Dir) of the IF_CONFIGURATION_4210 register is set to 1. 8.1 Timing The timing of the Step/Dir interface should be adapted to the requirements of the driver and the transmission line. The minimum pulse width may be limited. The timing of the Step/Dir interface is controlled by four LSBs named STPDIV_4210. For a given clock frequency fCLK [MHz] of the TMC4210, the length tSTEP [µs] of a step pulse is 𝑡𝑆𝑇𝐸𝑃[𝜇𝑠] = 16 ∗ - 1 + 𝑆𝑇𝑃𝐷𝐼𝑉_4210 𝑓𝐶𝐿𝐾[𝑀𝐻𝑧] For a clock frequency fCLK[MHz] of 16MHz the step pulse length can be programmed in integer multiple of 1µs by STPDIV_4210. The STPDIV_4210 has to be set compatible to the upper step frequency fSTEP = 1/tSTEP which is used. The first step pulse after a change of direction is delayed by t DIR2STP which is equal to tSTEP to avoid setup time violations of the Step/Dir power stage. MAXIMUM STEP FREQUENCIES Generally, the maximum step pulse frequency is fSTEP_MAX [MHz] = fCLK [MHz] / 32. For a clock frequency fCLK [MHz] = 16 MHz the maximum step pulse frequency fSTEP_MAX is 500kHz. For a clock frequency fCLK [MHz] = 32 MHz the maximum step pulse frequency fSTEP_MAX is 1MHz. tDIR2STP = tSTEP tDIR2STP = tSTEP DIR STP tSTEP Figure 8.1 Step/Dir timing (en_sd = 1; step_half = 0) www.trinamic.com tSTEP TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 9 39 Running a Motor 9.1 Getting Started For starting a motor proceed as follows: 1. 2. 3. 4. 5. 6. 7. Set en_sd to 1 to enable the Step/Dir interface to the driver IC. Set the velocity parameters V_MIN and V_MAX. Set the clock pre-dividers PULSE_DIV and RAMP_DIV. Set A_MAX with a valid pair of PMUL and PDIV. Choose the ramp mode with RAMP_MODE register. Choose the reference switch configuration. Set mot1r to 1 for a left and a right reference switch. If this bit is not set and the right switch is not to be used, pull REF_R to GND. Now, the TMC4210 runs a motor if you write either X_TARGET or V_TARGET, depending on the choice of the ramp mode. 9.2 Running a Motor with Start-Stop-Speed in ramp_mode The TMC4210 has an integrated automatic start-stop-speed mechanism. This can easily be realized by a simple command sequence. To start and stop with a speed V_START_STOP different from zero, one has to proceed as follows: 1. 2. 3. 4. 5. Set V_MIN := V_START_STOP. Set hold_mode. Set X_TARGET to desired target position. Set V_ACTUAL with correct sign for V_ACTUAL to +V_MIN resp. –V_MIN, depending on the direction of positioning. Set ramp_mode immediately after writing V_ACTUAL. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 40 10 On-Chip Voltage Regulator The on-chip voltage regulator delivers a 3.3 V supply for the chip core. The TMC4210 provides two operational modes to operate in 5 V or in 3.3 V environments. For both operational modes one resp. two external capacitors are required. Please keep all connections as short as possible! OPERATIONAL MODE Operational mode Necessary additional hardware - An external 100nF ceramic capacitor (CBLOCK) has to be connected between pin V5 and ground. - An external 470nF ceramic capacitor has to be connected between the V33 pin and ground. An external 100nF ceramic capacitor is necessary only between pin V33 and ground. 5V 3.3 V CHARACTERISTICS OF THE ON-CHIP VOLTAGE REGULATOR Symbol VDD5REG CBLOCK Parameter Supply voltage vdd5 Block capacitor VDD3REG ICCNLREG tSREG tSREGC TDRFT Supply voltage vdd3 Current consumption Startup time Startup time Temperature drift VRIPPLE Ripple on vdd3 CREG External capacitor COPT Optional capacitor Conditions 5 V Operational Mode 5 V Operational Mode, x7r capacitor 3.3 V Operational Mode No load No external capacitor connected C_load = 470 nF REF_L REF_R Typ 5 100 Max 5.5 Unit V nF 2.9 3.3 50 3.6 100 20 150 300 V µA µs µs ppm / °C mV ceramic With ripple over 50 mV the input thresholds may differ from that specified in the data sheet Use x7r ceramic capacitors on pin 33. Using an external capacitor with capacity other than typical, the ripple should be measured on pin v33 to be sure that requirements are satisfied. Optional parallel capacitor for additional reduction of high frequency ripple, c0g ceramic, unnecessary in most cases 3.3V Operation (CMOS) REF_L STEP_OUT REF_R 470 nF 470 pF STEP_OUT DIR_OUT SDI_ C TMC4210 TMC4210 SCK _ C SCK _ C nINT_SDO_C 33 GP_IN nSCS_ C DIR_OUT SDI_ C 100 5V Operation (TTL) GP_IN nSCS_ C Min 4.5 V 33 V5 TEST GND CLK nINT_SDO_C V 33 V5 TEST Copt +3.3V 100 nF* * Capacitors should be placed as close as possible to the chip. GND and TEST have to be connected to ground as close as possible to the chip. In most cases the optional capacitor Copt is not necessary. Figure 10.1 3 V operation (CMOS) vs. 5 V operation (TTL) www.trinamic.com 470 nF * 100 nF* + 5V GND CLK TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 41 11 Power-On Reset The TMC4210 is equipped with a static and dynamic reset with an internal hysteresis. The chip performs an automatic reset during power-on. If the power supply voltage falls below the threshold VON, an automatic power-on reset is performed. The power-on reset time tRESPOR depends on the power-up time of the on-chip voltage regulator. CHARACTERISTICS OF THE ON-CHIP POWER-ON-RESET Symbol VDD Temp VOP VOFF VON tRESPOR Parameter Power supply range Temperature Reset ON/OFF hysteresis Reset OFF Reset ON Reset time of on-chip power-on-reset Static Min 3.0 -55 Typ 3.3 25 1.58 1.49 2.14 2.13 1.98 3.31 Dynamic VOFF VON VOP 0 VOFF VON VOP 0 tRESPOR Figure 11.1 Operating principle of the power-on-reset www.trinamic.com Max 3.6 125 0.80 2.85 2.70 5.52 Unit V °C V V V µs TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 42 12 Absolute Maximum Ratings The maximum ratings may not be exceeded under any circumstances. Operating the circuit at or near more than one maximum rating at a time for extended periods shall be avoided by application design. Symbol Parameter VDD3 DC supply voltage VI3 VO3 VDD5 VI5 VO5 VESD TEMPD2 TEMPD3 TEMPD4 TSG Conditions Voltage at Pin V33 in 3.3V mode DC input voltage, 3.3 V I/Os DC output voltage, 3.3 V I/Os DC supply voltage DC input voltage, 5V I/Os DC output voltage, 5V I/Os ESD voltage Min -0.3 Max 3.6 Unit V -0.3 VDD3 + 0.3 V -0.3 VDD3 + 0.3 V Voltage at Pin V5 Continuous DC Voltage -0.3 -0.3 V V Continuous DC Voltage -0.3 5.5 VDD5 + 0.3, 5.5 max VDD5 + 0.3, 5.5 max 2000 -40 +85 °C -55 +125 °C -40 +105 °C -60 +150 °C PAD cells are designed to resist ESD voltages according to Human Body Model according to MILSTD-883, with RC = 1 – 10 M, RD = 1.5 K, and CS = 100 pF, but it cannot be guaranteed. Ambient air temperature Industrial / consumer type range Ambient air temperature Automotive type range Ambient air temperature Industrial type range Storage temperature V V 13 Electrical Characteristics 13.1 Power Dissipation General DC characteristics Symbol ISC32MHZ ISC16MHZ ISC8MHZ4210 Parameter Supply current Supply current Supply current ISC4MHZ IPDN25C Supply current Power down current www.trinamic.com Conditions f = 32 MHz at Tc = 25°C f = 16 MHz at Tc = 25°C f = 8 MHz at Tc = 25°C (IOs driven) f = 4 MHz at Tc = 25°C Power down mode at Tc = 25°C, 5V supply Min Typ 15 5 5 Max 1.25 70 2.5 150 10 Unit mA mA mA mA µA TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 43 13.2 DC Characteristics DC characteristics contain the spread of values guaranteed within the specified supply voltage range unless otherwise specified. A device with typical values will not leave Min/Max range within the full temperature range. General DC characteristics Symbol ILC CIN LIL Parameter Input leakage current Input capacitance Input with pull up Conditions VIN = 0V Min -10 -110 Typ Max 10 7 -30 -5 Unit µA pF µA DC characteristics for 3.3V supply mode Symbol VDD3 VI3 VIL3 VIH3 VLTH3 VHTH3 VHYS3 VOL3 VOH3 VOL3 VOH3 Parameter DC supply voltage DC input voltage Low level input voltage High level input voltage Low level input voltage threshold High level input voltage threshold Schmitt-Trigger hysteresis Low level output voltage High level output voltage Low level output voltage High level output voltage Conditions Pin TEST only Pin TEST only All inputs except TEST Min 3.0 0 0 0.7 x VDD3 0.9 All inputs except TEST 1.5 1.9 V 0.4 0.7 V 0.1 V V IOL = 0.3 mA IOH = 0.3 mA VDD3–0.1 IOL = 2 mA IOH = 2 mA VDD3–0.4 Typ 3.3 Max Unit 3.6 V VDD3 V 0.3 x VDD3 V VDD3 + 0.3 V 1.2 V 0.4 V Ripple on VDD3 has to be taken into account when measuring thresholds and hysteresis. DC characteristics for 5V supply mode Symbol VDD5 VI5 VIL5 VIH5 VLTH5 VHTH5 VHYS5 VOL5 VOH5 VOL5 VOH5 Parameter DC supply voltage DC input voltage Low level input voltage High level input voltage Low level input voltage threshold High level input voltage threshold Schmitt-Trigger hysteresis Low level output voltage High level output voltage Low level output voltage High level output voltage www.trinamic.com Conditions Pin TEST only Pin TEST only All inputs except TEST, VDD5=5V All inputs except TEST, VDD5=5V IOL = 0.3 mA IOH = 0.3 mA IOL = 4 mA IOH = 4 mA Min 4.5 0 0 0.7 x VDD5 0.9 Typ 5 Max Unit 5.5 V VDD5 V 0.3 x VDD5 V VDD5 + 0.3 V 1.2 V 1.5 1.9 V 0.4 0.7 V 0.1 V V VDD5–0.1 0.4 VDD5–0.4 V TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 44 13.3 Timing Characteristics General timing parameters (TMC4210 with EMI optimized output drivers) Symbol fCLK tCLK Parameter Operation frequency Clock period tCLK_L tCLK_H tRISE_I Clock time low Clock time high Input signal rise time tFALL_I Input signal fall time tRISE_O_4210 Output signal rise time tFALL_O_4210 Output signal fall time tSU Setup time tHD Hold time tPD_4210 Propagation delay time Conditions fCLK = 1 / tCLK Rising edge to rising edge of CLK 10% to 90% except TEST pin 90% to 10% except TEST pin 10% to 90% 90% to 10% Relative to falling clock edge at CLK Relative to falling clock edge at CLK 50% of rising edge of the clock CLK to the 50% of the output Min 0 31.25 Typ 16 Max 32  Unit MHz ns 12.5 12.5 0.5    ns ns ns 0.5  ns 7 7 1 ns ns ns 1 ns 1 10 ns tCLK tCLK_H CLK tCLK_L 50% tRISE tSU 90% OUTPUT 50% 10% tFALL Figure 13.1 General timing parameters www.trinamic.com tHD tPD TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 45 15 Package Machanical Data 15.1 Dimensional Drawings Attention: Drawings not to scale. S TOP VIEW h x 45° 8 7 6 5 4 3 2 1 LEAD (SIDE VIEW) b b1 E H c1 WITH PLATING 9 10 11 12 13 14 15 16 e c BASE METAL N=16 B h x 45° C A2 A  L D SIDE VIEW A1 END VIEW Figure 15.1 Dimensional drawings SSOP16, 150 MILS, 0.635mm (0.025 inch) pitch DIMENSIONS OF PACKAGE SSOP16, 150 MILS Symbol A A1 A2 b b c c B C D E e H h L N S  Dimensions in MILLIMETERS Typ Max 1.63 1.73 0.15 0.25 1.47 1.55 0.30 0.25 0.28 0.25 0.20 0.23 0.25 0.31 0.20 0.25 4.93 4.98 3.91 best case 0.635 best case 6.02 best case 0.25 0.33 0.41 0.41 0.635 0.89 16 0.051 0.114 0.178 0 5 8 Min 1.55 0.10 1.40 0.20 0.20 0.18 0.18 0.20 0.19 4.80 Min 0.061 0.004 0.055 0.008 0.008 0.007 0.007 0.008 0.0075 0.189 Dimensions in INCHES Typ 0.064 0.006 0.058 0.010 0.016 0.0020 0 0.010 0.008 0.010 0.008 0.194 0.154 best case 0.025 best case 0.237 best case 0.013 0.025 16 0.0045 5 15.1.1 Package Code Device TMC4210 www.trinamic.com Package SSOP16 (RoHS) Temperature range -40° to +105°C Code/ Marking TMC4210-I Max 0.068 0.0098 0.061 0.012 0.011 0.010 0.009 0.012 0.0098 0.196 0.016 0.035 0.0070 8 TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 16 Marking PRODUCT NAME TMC4210-I Package Date code Lot number identifier Logo SSOP16 – 150 MILS WWYY (week WW and year YY) LLLL No TMC4210-I Trinamic WWYYLLLL Zoomed Size www.trinamic.com 46 TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 47 17 Disclaimer 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. 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 from its use. Specifications are subject to change without notice. All trademarks used are property of their respective owners. 18 ESD Sensitive Device The TMC4210 is an ESD-sensitive CMOS device and sensitive to electrostatic discharge. Take special care to use adequate grounding of personnel and machines in manual handling. After soldering the devices to the board, ESD requirements are more relaxed. Failure to do so can result in defects or decreased reliability. PAD cells are designed to resist ESD voltages corresponding to Human Body Model (MIL-STD-883, with RC = 1 – 10 M, RD = 1.5 K, and CS = 100 pF). Note: In a modern SMD manufacturing process, ESD voltages well below 100V are standard. A major source for ESD is hot-plugging the motor during operation. www.trinamic.com TMC4210 DATASHEET (Rev. 1.04 / 2017-AUG-30) 48 19 Table of Figures Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure Figure 1.1 TMC4210 functional block diagram ............................................................................................................. 4 1.2 Application example using Step/Dir driver interface ............................................................................. 5 3.1 TMC4210 pin out ............................................................................................................................................... 9 4.1 TMC4210 application environment with TMC260, TMC261 or TMC2660. ......................................... 11 5.1 Timing diagram of the serial µC interface .............................................................................................. 13 6.1 Velocity ramp parameters and velocity profiles.................................................................................... 20 6.2 Target position calculation, ramp generator, and pulse generator................................................. 23 6.3 Proportionality parameter p and outline of velocity profile(s) ......................................................... 24 6.4 Left switch and right switch for reference search and automatic stop function ....................... 28 7.1 Triple switch configuration left stop switch – reference switch – right stop switch ................ 36 7.2 Reference search ............................................................................................................................................. 37 8.1 Step/Dir timing (en_sd = 1; step_half = 0) ............................................................................................... 38 10.1 3 V operation (CMOS) vs. 5 V operation (TTL) ..................................................................................... 40 11.1 Operating principle of the power-on-reset ........................................................................................... 41 13.1 General timing parameters ........................................................................................................................ 44 15.1 Dimensional drawings SSOP16, 150 MILS, 0.635mm (0.025 inch) pitch ....................................... 45 20 Revision History Version Date Author Description SD – Sonja Dwersteg BD – Bernhard Dwersteg 1.00 1.01 2013-SEP-09 2014-OCT-10 SD SD - 1.03 1.04 2015-JUN-03 2017-AUG-30 BD BD - TMC4210 Datasheet Rev. 1.00 based on TMC429 Datasheet Chapter 6.2 and 6.2.1 corrected. Description of status information bits in chapter 5.2.2.2 corrected. Do not set SDO_INT=1 because this disables the SPI output. Update SPI status Update start/stop speed algorithm, removed reference to USRS register, as this is defined by the driver IC only. 21 References [TMC4210+2660-EVAL] www.trinamic.com TMC4210+2660-EVAL Manual / Evaluation board for S/D
TMC4210-I-T 价格&库存

很抱歉,暂时无法提供与“TMC4210-I-T”相匹配的价格&库存,您可以联系我们找货

免费人工找货