PANDrive PD-110-42 and TMCM-110-42 42mm / NEMA-17 Stepper Motor Mechatronic Module TMCM-110-42 Electronics Manual Version: 1.13 December 23th, 2005 Sternstrae 67 D - 20357 Hamburg, Germany Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60 http://www.trinamic.com TMCM-110-42 Manual Contents 1 2 3 Features ........................................................................................................................................... 3 Life support policy............................................................................................................................. 4 Electrical and Mechanical Interfacing............................................................................................... 5 3.1 Dimensions................................................................................................................................ 5 3.2 Connectors ................................................................................................................................ 5 3.3 Connecting the module ............................................................................................................. 5 3.3.1 Connector 1: Power supply and host interface .................................................................... 6 3.3.2 Connector 2: Motor connector ............................................................................................. 6 3.3.3 Connector 3: Additional I/O .................................................................................................. 7 3.3.4 ISP Connector...................................................................................................................... 7 3.4 Activity LED ............................................................................................................................... 7 4 Operational Ratings.......................................................................................................................... 8 5 Functional Description...................................................................................................................... 9 5.1 System Architecture .................................................................................................................. 9 5.1.1 Microcontroller...................................................................................................................... 9 5.1.2 EEPROM.............................................................................................................................. 9 5.1.3 TMC428 Motion Controller ................................................................................................... 9 5.1.4 TMC246 Motor Driver......................................................................................................... 10 5.2 Power Supply .......................................................................................................................... 10 5.3 Communication Interface ........................................................................................................ 10 5.4 Reference Switches ................................................................................................................ 10 5.5 StallGuardTM - Sensorless Motor Stall Detection .................................................................... 11 5.6 Motor current setting ............................................................................................................... 11 6 Putting the TMCM-110 into Operation............................................................................................ 12 7 TMCM-110 Operational Description............................................................................................... 13 7.1 Calculation: Velocity and Acceleration vs. Microstep- and Fullstep Frequency ..................... 13 8 Software ......................................................................................................................................... 15 9 Revision History.............................................................................................................................. 16 9.1 Documentation Revision ......................................................................................................... 16 9.2 Firmware Revision .................................................................................................................. 16 10 References ..................................................................................................................................... 17 List of Figures Figure 3.1: Mounting holes (all dimensions in millimeters)...................................................................... 5 Figure 3.2: The TMCM-110-42 module ................................................................................................... 6 Figure 5.1: Application Environment........................................................................................................ 9 List of Tables Table 1.1: Order codes ............................................................................................................................ 3 Table 3.1: Connector 1 ............................................................................................................................ 6 Table 3.2: Connector 2 ............................................................................................................................ 6 Table 3.3: Connector 3 ............................................................................................................................ 7 Table 4.1: Operational Ratings................................................................................................................ 8 Table 5.1: Motor Current Examples....................................................................................................... 11 Table 7.1: TMC428 Velocity parameters ............................................................................................... 13 Table 9.1: Documentation Revisions..................................................................................................... 16 Table 9.2: Firmware Revisions .............................................................................................................. 16 Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 2 TMCM-110-42 Manual 1 Features The PD-110-42 is an intelligent stepper motor controller and driver module mounted directly on a 42mm flange motor. The TMCM-110 module converts the motor into a compact mechatronic device with bus oriented or stand-alone control. The motor, switches, power and the multi purpose I/Os can be connected via small pluggable connectors. The TMCM-110 comes with the PC based software development environment TMCL-IDE for the Trinamic Motion Control Language (TMCL). Using predefined TMCL high level commands like "move to position" or "constant rotation" a rapid and fast development of motion control applications is guaranteed. The TMCM-110 can be controlled via an RS-232, RS-485, IC or CAN interface (ordering option). Communication traffic is kept very low since all time critical operations, e.g. ramp calculation, are performed onboard. The TMCL program can be stored in the on board EEPROM for stand-alone operation. The firmware of the module can be updated via the serial interface. With the integrated StallGuardTM feature it is possible to detect motor overload or motor stall. Electrical data * up to 1.1A coil current RMS (1.5A peak) * 7V to 34V motor supply voltage * supports two phase bipolar motors with 0.3A to 1.1A coil current PANdrive Motor data * all PANdrive motors optimized for 1A RMS coil current * please refer to motor data sheet for detailed motor information Interface * RS232, RS485, IC or CAN 2.0b host interface * 2 inputs for reference and stop switches * 1 general purpose input and 1 output Features * up to 16 times microstepping * memory for 2048 TMCL commands * automatic ramp generation in hardware * on the fly alteration of motor parameters (e.g. position, velocity, acceleration) * StallGuardTM for sensorless motor stall detection * full step frequencies up to 20kHz * dynamic current control * TRINAMIC driver technology: No heat sink required Software * stand-alone operation using TMCL or remote controlled operation * PC-based application development software TMCL-IDE included Other * pluggable JST connectors * RoHS compliant latest from 1 July 2006 Order code PD1-110-42 (-option) PD2-110-42 (-option) PD3-110-42 (-option) TMCM-110-42 (-option) Option 232 485 IIC CAN Description Dimensions [mm] PANdrive 0.27Nm 53 x 42 x 42 PANdrive 0.35Nm 59 x 42 x 42 PANdrive 0.49Nm 69 x 42 x 42 Motion control module 15 x 42 x 42 Host interface RS232 interface RS485 interface IIC interface (IC compatible serial 2 wire) CAN interface Table 1.1: Order codes Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 3 TMCM-110-42 Manual 2 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. (c) 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 (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 4 TMCM-110-42 Manual 5 3 Electrical and Mechanical Interfacing 3.1 Dimensions The overall height of the module is 17mm.The components on back of the module have a height of 5mm and on front 10mm. Beware that connectors on the front are upright. 41,8 5,4 5,4 41,8 M3 M3 5,4 5,4 Figure 3.1: Mounting holes (all dimensions in millimeters) 3.2 Connectors Connector type JST 2mm PH series, the following plugs fit for: * Motor connector: PHR-4 * Supply / host interface connector: PHR-5 * Additional I/O connector: PHR-8 3.3 Connecting the module Caveat: Never connect or disconnect a motor when the module is powered, as this may damage the module. Also, the motor driver is not protected against short circuits to ground. Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG TMCM-110-42 Manual 6 Connector 2 Pin 1 Connector 3 Pin 1 Pin 1 Connector 1 Figure 3.2: The TMCM-110-42 module 3.3.1 Connector 1: Power supply and host interface Use this connector to connect the power and the host interface (RS232, RS485, IIC or CAN). The pin assignments are different for the four available versions of the module. Pin 1 2 3 4 5 RS232 GND +7..34V DC GND RxD TxD RS485 1) GND +7..34V DC GND RS485+ RS485 - Function IIC GND +7..34V DC GND SCL SDA CAN 2) GND +7..34V DC GND CAN + CAN - Table 3.1: Connector 1 1) The RS485 version is also equipped with a jumper next to connector 1. Closing this jumper terminates the RS485 bus with a resistor of 100 ohms. 2) The CAN version of this module is also equipped with a jumper next to connector 1. Closing this jumper terminates the CAN bus with a resistor of 120 ohms. 3.3.2 Connector 2: Motor connector Connect a two-phase bipolar stepper motor to this connector. The pin assignment of this connector is as follows: Pin 1 2 3 4 Function Phase A1 Phase A2 Phase B1 Phase B2 Table 3.2: Connector 2 Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG TMCM-110-42 Manual 3.3.3 Connector 3: Additional I/O All other inputs and outputs of the module can be connected here. These are the limit switches, a general purpose input and a general purpose output. The limit switch inputs are equipped with internal pull-up resistors, so they have to be connected to GND via normally closed switches. The general purpose input can either be used as a digital TTL input or as an analogue input (0..5V). The general purpose output is an open collector output for a maximum current of 100mA. A freewheeling diode is also included so that e.g. a relay or a coil can be connected directly. Please note that the freewheeling diode is connected to the supply voltage and not to +5V, so when using e.g. a relay that is connected to +5V a freewheeling diode must be connected externally. The pin assignment of this connector is as follows: Pin 1 2 3 4 5 6 7 8 Name StopL StopR GND GPO VDD GND GPI +5V Function Left limit switch input (integrated 10K pullup to 5V) Left limit switch input (integrated 10K pullup to 5V) Signal Ground General purpose output 0 (open collector, max. 100mA, max. 40V, 1K pullup to 5V integrated) VDD (same as connector 1, pin 2) Signal Ground General purpose input (Analog / Digital) +5V DC output (max. 20mA) Table 3.3: Connector 3 3.3.4 ISP Connector The 6-way (2x3) header on the module is the connector for an Atmel ISP programmer which can be used to program the CPU directly. This is to be done by Trinamic only. The ISP connector is not to be used by the user. Always leave this connector open. 3.4 Activity LED The TMCM-110-42 module is equipped with an LED. Some TMCM-110-42 modules are equipped with a yellow LED and some other TMCM-110-42 modules are equipped with a red LED. During normal operation this LED flashes. After resetting the configuration EEPROM it maybe takes some seconds before the LED starts flashing. When the operating system is being downloaded to the module the LED lights steadily. Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 7 TMCM-110-42 Manual 8 4 Operational Ratings The operational ratings show the intended / the characteristic range for the values and should be used as design values. In no case shall the maximum values be exceeded. Symbol Parameter Min Typ Max Unit VS Power supply voltage for operation 7 12 ... 30 34*) V ICOIL Motor coil current for sine wave peak (chopper regulated, adjustable via software) (adjust via Software) 0 0.4 ... 1.5 1.5 A IMC Continuous motor current (RMS) 0 0.3... 1.1 1.1 A fCHOP Motor chopper frequency IS Power supply current U+5V +5V output (max. 20mA load) VGPO Open collector output, max. 100mA, freewheeling diode included VINPROT Input voltage for StopL, StopR, GPI0 (internal protection, DC) VANA GPI0 analog measurement range VSTOPLO StopL, StopR low level input VSTOPHI StopL, StopR high level input (integrated 10k pullup to +5V) 1.9 TENV Environment temperature at rated current (no forced cooling required) -40 45 C Environment temperature at 80% of rated current or 50% duty cycle (no forced cooling required) -40 60 C 36.8 4.8 -24 kHz << ICOIL 1.4 * ICOIL A 5.0 5.2 V VS V 24 V 0...5 0 ... 5 0 V 0.9 5 V V Table 4.1: Operational Ratings *) Please make sure that you have a TMC246A-PA driver chip on the module when using a supply voltage above 28.5V. All modules produced in 2006 and later have this chip. Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG TMCM-110-42 Manual 9 5 Functional Description In Figure 5.1 the main parts oft the TMCM-110 module are shown. The module mainly consists of the C, a TMC428 motion controller, a TMC246 stepper motor driver, the TMCL program memory (EEPROM) and the host interfaces (RS232, RS485, IIC and CAN). TMCL EEPROM Host RS-232 or RS-485 or IIC or CAN I/O 7..30V DC C PD-110-42 TMC428 Step Driver TMC246 2 Motor +5V REFSwitches 5V Power Supply Figure 5.1: Application Environment 5.1 System Architecture The TMCM-110 integrates a microcontroller with the TMCL (Trinamic Motion Control Language) operating system. The motion control real-time tasks are realized by the TMC428. 5.1.1 Microcontroller On this module, the Atmel ATmega32 is used to run the TMCL operating system and to control the TMC428. The CPU has 32Kbyte flash memory and a 1Kbyte EEPROM. The microcontroller runs the TMCL (Trinamic Motion Control Language) operating system which makes it possible to execute TMCL commands that are sent to the module from the host via the interface. The microcontroller interprets the TMCL commands and controls the TMC428 which executes the motion commands. The flash ROM of the microcontroller holds the TMCL operating system and the EEPROM memory of the microcontroller is used to permanently store configuration data. The TMCL operating system can be updated via the host interface. Please use the latest version of the TMCL IDE to do this. As already mentioned above the Trinamic CANnes card or the Trinamic USB2X interface is needed to connect the module with CAN or IIC interface to the PC to update the OS. 5.1.2 EEPROM To store TMCL programs for stand alone operation the TMCM-110 module is equipped with a 16kByte EEPROM attached to the microcontroller. The EEPROM can store TMCL programs consisting of up to 2048 TMCL commands. 5.1.3 TMC428 Motion Controller The TMC428 is a high-performance stepper motor control IC and can control up to three 2-phase-steppermotors (on this module, only one motor can be used). Motion parameters like speed or acceleration are sent Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG TMCM-110-42 Manual to the TMC428 via SPI by the microcontroller. Calculation of ramps and speed profiles are done internally by hardware based on the target motion parameters. 5.1.4 TMC246 Motor Driver The stepper motor driver used on the TMCM-110 module is the TMC246 chip. This driver is very dependable, because it provides a variety of protection and diagnostic features, which even can be read out by the user software. Its 16x up to 32x microstepping gives a quiet and precise motor operation. As the power dissipation of the TMC246 chips is very low no heat sink or cooling fan is needed. The temperature of the chips does not get too high easily. The coils will be switched off automatically when the temperature or the current exceeds the limits and automatically switched on again when the values are within the limits again. 5.2 Power Supply The TMCM-110-42 is equipped with a linear voltage regulator that generates the 5V supply voltage for the digital components of the module from the motor power supply. So only one supply voltage is needed for the module. The power supply voltage can be 12..30 V DC. A higher voltage gives higher motor dynamics. Please note that there is no protection against reverse polarity or too high voltage. When using supply voltages near the upper limit of 34V, a regulated power supply becomes a must. Please ensure, that enough power filtering capacitors are provided in the system (470F or more recommended per motor), in order to absorb mechanical energy fed back by the motor in stalling conditions. The power supply should be designed in a way, that it supplies the nominal motor voltage at the desired maximum motor power. In no case shall the supply value exceed the upper / lower voltage limit. To ensure reliable operation of the unit, the power supply has to have a sufficient output capacitor and the supply cables should have a low resistance, so that the chopper operation does not lead to an increased power supply ripple directly at the unit. Power supply ripple due to the chopper operation should be kept at a maximum of a few 100mV. This also is important in order to make the users application compatible to any applicable EMC guidelines. Therefore we recommend to a) keep power supply cables as short as possible b) use large diameter for power supply cables c) if the distance to the power supply is large (i.e. more than 2 - 6m), use a robust 470F or larger additional filtering capacitor located near to the motor driver unit. 5.3 Communication Interface The communication between the host and the module takes place via its host interface. This can be either RS232, RS485, IIC or CAN. Please note that the TMCM-110-42 module can only be equipped with one of these interfaces. Communication with the TMCM-110-42 module is done using TMCL commands. The interface the module is equipped with is ready-to-use, so there are no external drivers or level shifters necessary. Please see chapter 3.3.1 for the pin assignments of the interfaces. To use the TMCL IDE with CAN interface either the Trinamic CANnes card or the Trinamic USB2X interface is needed. To use the IIC interface with the TMCL IDE the Trinamic USB2X interface is needed. 5.4 Reference Switches Two digital reference / stop switch inputs are provided (StopL= stop left and StopR = stop right). They are used as an absolute position reference for homing and to set a hardware limit for the motion range. The inputs have internal pullup resistors. Either opto-switches or mechanical switched with normally closed contact can be used. The 5V output can be used as an supply for opto-switches. Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 10 TMCM-110-42 Manual 11 5.5 StallGuardTM - Sensorless Motor Stall Detection The integrated StallGuardTM feature gives a simple means to detect mechanical blocking of the motor. This can be used for precise absolute referencing, when no reference switch is available. The load value can be read using a TMCL command or the module can be programmed so that the motor will be stopped automatically when it has been obstructed or the load has been too high. Just activate StallGuard and then let the traveller run against a mechanical obstacle that is placed at the end of the operation area. When the motor has stopped it is definitely at the end of its way, and this point can be used as the reference position. Please see the TMCL Reference and Programming Manual on how to activate the StallGuard feature. The TMCL IDE also has some tools which let you try out and adjust the StallGuard function in an easy way. This is also described in the TMCL Reference and Programming Manual. Please see the TMCL Reference and Programming Manual on how to activate the StallGuard feature. The TMCL IDE also has some tools which let you try out and adjust the StallGuard function in an easy way. This is also described in the TMCL Reference and Programming Manual. 5.6 Motor current setting The motor current can be set in a range of 0 to 1500, using the TMCL software. 1500 corresponds to the module's maximum ICOIL setting. Setting ICOIL,PP ICOIL,RMS 1500 1410 1100 800 600 400 0 1.5A 1.41A 1.1A 0.8A 0.6A 0.4A 0A 1.06A 1.0A 0.8A 0.6A 0.4A 0.3A 0A Table 5.1: Motor Current Examples Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG TMCM-110-42 Manual 6 Putting the TMCM-110 into Operation On the basis of a small example it is shown step by step how the TMCM-110-42 is set into operation. Users who are already familiar with TMCL and other Trinamic modules may skip this chapter. Example: The following application is to be implemented on the TMCM-110-42 module using the TMCL-IDE Software development environment. A formula how "speed" is converted into a physical unit like rotations per seconds can be found in chapter 7.1. The simple application is: * Move the Motor to position 150000 * Wait 2 seconds * Move the Motor back to position 0 * Wait 1 second * Start again with the first step To implement this simple application on theTMCM-110-42 it is necessary to do the following things: Step 1: Connect the host interface to the PC Step 2: Connect the motor to the motor connector Step 3: Connect the power supply voltage to the module Step 4: Switch on the power supply. The activity LED should start to flash. This indicates the correct configuration of the microcontroller. Step 5: Start the TMCL-IDE Software development environment. Enter the program shown in the following listing. A description of the TMCL commands can be found in the TMCL Reference and Programming Manual. //A simple example for using TMCL and the TMCL-IDE SAP 4, 0, 100 Loop: MVP ABS, 0, 150000 WAIT POS, 0, 0 WAIT TICKS, 0, 200 MVP ABS, 0, 0 WAIT POS, 0, 0 WAIT TICKS, 0, 100 JA Loop //Set the maximum speed //Move to position 150000 //Move back to position 0 //Infinite Loop Step 6: Click the "Assemble" icon to convert the TMCL program into byte code. Then download the program to the TMCM-110-42 module by clicking the "Download" icon. Step 7: Click the "Run" icon. The downloaded program will now be executed. A detailed documentation about the TMCL operations and the TMCL IDE can be found in the TMCL Reference and Programming Manual. The next chapter shows how the velocity and acceleration values are calculated. Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 12 TMCM-110-42 Manual 13 7 TMCM-110 Operational Description 7.1 Calculation: Velocity and Acceleration vs. Microstep- and Fullstep Frequency The values of the parameters sent to the TMC428 do not have typical motor values, like rotations per second as velocity. But these values can be calculated from the TMC428 parameters, as shown in this document. The parameters for the TMC428 are: Parameter fCLK velocity a_max pulse_div ramp_div Usrs Description Clock frequency Maximum acceleration Velocity pre-divider. The higher the value is, the less is the maximum velocity. Default value = 3 Can be changed in TMCL using SAP 154. Acceleration pre-divider. The higher the value is, the less is the maximum acceleration default value = 7 Can be change in TMCL using SAP 153. Microstep resolution (microsteps per fullstep = 2usrs). Can be changed in TMCL using SAP 140. Range 16 MHz 0..2047 0..2047 0..13 0..13 0..6 Table 7.1: TMC428 Velocity parameters The microstep-frequency of the stepper motor is calculated with usf [ Hz ] = f CLK [ Hz ] velocity with usf: microstep-frequency 2 pulse _ div 2048 32 To calculate the fullstep-frequency from the microstep-frequency, the microstep-frequency must be divided by the number of microsteps per fullstep. fsf [ Hz ] = usf [ Hz ] with fsf: fullstep-frequency 2 usrs The change in the pulse rate per time unit (microstep frequency change per second - the acceleration a) is given by 2 a= f CLK a max 2 pulse _ div + ramp _ div + 29 This results in an acceleration in fullsteps of: af = a 2 usrs with af: acceleration in fullsteps Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG TMCM-110-42 Manual Example: f_CLK = 16 MHz on the TMCM-110 module velocity = 1000 a_max = 1000 pulse_div = 1 ramp_div = 1 usrs = 6 msf = 16 MHz 1000 =122070.3125 Hz 21 2048 32 fsf [ Hz ] = a= 122070.3125 = 1907.35Hz 26 (16 Mhz ) 2 1000 MHz =119.208 1+1+ 29 s 2 af = MHz s = 1,863 MHz 6 s 2 119.208 If the stepper motor has e.g. 72 fullsteps per rotation, the number of rotations of the motor is: 1907.35 fsf = = 26.49 72 fullsteps per rotation 1907.35 60 fsf 60 RPM = = = 1589.458 72 fullsteps per rotation RPS = Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 14 TMCM-110-42 Manual 8 Software TMCL, the Trinamic Motion Control Language is used to send commands from the host to the TMCM-110 module and to write programs that can be stored in the EEPROM of the module so that the module can execute the TMCL commands in a stand-alone mode. TMCL is described in a separate documentation, the TMCL Reference and Programming Manual. This document also describes the TMCL Integrated Development Environment (TMCL IDE), a program running on Windows which allows easy development of TMCL applications. All the manuals are provided on the TMC TechLib CD and on the web site of TRINAMIC Motion Control GmbH & Co. KG (http://www.trinamic.com). Also the latest versions of the firmware (TMCL operating system) and PC software (TMCL IDE) can be found there. Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 15 TMCM-110-42 Manual 9 Revision History 9.1 Documentation Revision Version 1.00 1.03 1.10 1.11 1.12 1.13 Comment Initial Release 16-Jul-04 27-Jul-04 1-Oct-04 4-Oct-04 23-Dec-05 Author OK OK OK OK TG BD, HC Description Initial version CAN interface added Major revision Minor error corrections Corrected mounting dimensions Added Pan-Drive documentation and major revision Table 9.1: Documentation Revisions 9.2 Firmware Revision Version 3.24 Comment Initial Release Description Please refer to TMCL documentation Table 9.2: Firmware Revisions Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 16 TMCM-110-42 Manual 10 References [TMCL] TMCL manual (see http://www.trinamic.com) Copyright (c) 2005, TRINAMIC Motion Control GmbH & Co. KG 17