Trinamic TMCM-310 User guide

TMCM-310
Stepper Motor Motion Control
Module
Manual
Version: 1.13
January 11
, 2006
Trinamic Motion Control GmbH & Co. KG
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
2
TMCM-310 Manual V1.13
Life support policy
TRINAMIC Motion Contr ol GmbH & Co KG does not a uthor i ze or war rant any of its products f or us e i n life support system s, without the specific written cons ent of TRINAMIC Motion Control Gm bH & Co KG. Life support system s are equipment intended to supp ort or sustain life, and whose failure to perform , when properly used in accordance with instruct ions provided, can be reaso nably expected to result in personal injury or death.
Information given in th is manual is believed t o be accurate and reliabl e. However no responsibi lity is assumed for the co nsequences of its use nor for any infringement of patents or other rights of th ird parties which may result from its use. Specification subject to change without notice.
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
3
TMCM-310 Manual V1.13
Version
Version Date Author(s) Remarks
1.00 13-Jun-03 OK Initial version
1.01 7-Nov-03 OK Chapter 3.3.4 added
1.10 21-Jul-04 OK Revised, updated and extended
1.11 27-Jul-04 OK Mounting hole drawing added
1.12 1-Oct-04 OK Address changed
1.13 11-Jan-06 OK Covers hardware rev. 1.1 and 2.0
Table of Contents
1 General Description..........................................................................................................................4
1.1 Ordering information..................................................................................................................4
2 Technical Data..................................................................................................................................5
3 Main Features...................................................................................................................................6
3.1 The TMCM-310 Module ............................................................................................................6
3.2 TMCM-310 Application Environment.........................................................................................7
3.2.1 Communication Interface...................................................................................................7
3.2.2 Power Supply.....................................................................................................................7
3.2.3 Microcontroller....................................................................................................................8
3.2.4 EEPROM............................................................................................................................8
3.2.5 TMC428..............................................................................................................................8
3.2.6 Stepper Motor Drivers........................................................................................................8
3.3 StallGuard..................................................................................................................................8
4 Connecting the Module.....................................................................................................................9
4.1 Host communication..................................................................................................................9
4.2 Connecting the motors ..............................................................................................................9
4.3 Reference switches.................................................................................................................10
4.3.1 Left and right limit switches..............................................................................................10
4.3.2 Triple Switch Configuration..............................................................................................10
4.3.3 One reference switch .......................................................................................................10
4.4 Additional inputs and outputs..................................................................................................11
4.5 Jumpers, other connectors and LEDs.....................................................................................11
4.5.1 Blank time.........................................................................................................................11
4.5.2 Programmer connector and jumper J101 (rev. 1.1).........................................................12
4.5.3 Programmer connector (rev. 2.0).....................................................................................12
4.5.4 SPI jumpers......................................................................................................................12
4.5.5 Shutdown jumper .............................................................................................................12
4.5.6 Reset button.....................................................................................................................12
4.5.7 Power LED.......................................................................................................................13
4.5.8 Activity LED......................................................................................................................13
5 Putting the TMCM-310 into Operation............................................................................................14
6 TMCM-310 Operational Description...............................................................................................16
6.1 Calculation: Velocity and Acceleration vs. Microstep- and Fullstep Frequency......................16
7 TMCL..............................................................................................................................................18
8 Differences between Hardware rev. 1.1 and 2.0............................................................................19
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
4
TMCM-310 Manual V1.13
1 General Description
The TMCM-310 is a triple axis 2-phase stepper motor motion control module based on the high­performance TMC-428 m otion controller. The module pr ovides a complete motion control s ystem at low cost and small physical size. The TMCM-310 can be rem ote controlled via the RS-232 or the optional CAN interface. Stan d-alone operation is also pos sible by executing T MCL programs . Communication traf fic is kept very lo w since all CPU-intensive operations, e.g. ramp calculation are performed by the TMC-428 motion controller. The StallGuard ( SG ) opt io n al lo ws det ec tin g of s tep l o s s c aused by too high load s on t he motors or by obstructing the m otors. StallGuard can a lso be used to detect a mechanical reference p oint, without the need for reference switches. The TMCM-310 provid es of a com plete sof tware deve lopm ent environm ent and b y using the T rinam ic Motion Control Language (TMCL) rapid and fast development of motion control applications is guaranteed. TMCL programs can be downloaded to the module via its different interfaces and are stored in the on-board 16K B yte EEPROM. So a TMCL program can then be ex ec uted i n a s tand a lon e mode, without the need for a host computer.
1.1 Ordering information
The following table summarises the available options:
Order code Features
TMCM-310 Only RS232 interface, no StallGuar d (sta ndar d produc t ) TMCM-310/SG Only RS232 interface, StallGuard (standard product) TMCM-310-CAN RS232 and CAN interface, no StallGuard (available on demand) TMCM-310/SG-CAN RS232 and CAN interface, StallGuard (standard product)
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
5
TMCM-310 Manual V1.13
2 Technical Data
Directly controls and drives up to three 2-phase stepper motors
CPU: ATmega32, 16MHz clock frequency
Motion controller: TMC428 high-performance motion controller
o Hardware ramp generator for autonomous positioning and speed control o Hardware sequencing o On the f ly alteration of target m otion parameters (e.g. pos ition, velocity, acce leration)
possible
o Full step frequencies up to 20 KHz
Limit and reference switch inputs
Motor drivers: TMC236 (TMCM-310 and TMCM-310-CAN) or TMC246 (TMCM-310/SG and
TMCM-301/SG-CAN)
Maximum coil current: 1500mA (adjustable by software)
Smart multi level current control to keep driver and motor cool
Microstepping: Max. 16 microsteps
H ost communication:
o RS232, default 9600bps, max. 115200bps (software selectable) o optional: CAN 2.0B, max 500kBit/s (software selectable), controller: MCP2510,
transceiver: PCA82C250
Operating system: Trinamic Motion Control Language (TMCL)
Firmware update possible via RS232 interface
TMCL program storage: 16 KByte EEPROM (2048 TMCL commands)
Supply voltage: rev 1.1: 9 to 30 VDC or 7..21 VAC, rev 2.0: 7..28VDC only
Size: 160x100mm
Height: 20mm
Dimensions and mounting holes
2
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
6
TMCM-310 Manual V1.13
3 Main Features
3.1 The TMCM-310 Module
Figure 1 gives an over view of the module a nd helps to locate all im portant parts. I t also sh ows how t o connect the stepper motors and reference switches (if needed).
Motor 0 Motor 1 Motor 2 M
M M
for Hardware
rev. 2.0:
GND
+
7..28V DC
Blank1
(J400)
Blank2
(J401)
CAN Termination
Pin 1
CAN bus
(optional)
TMC236
or
TMC246
(J500)
TMC236
or
TMC246
TMC428
SPI jumpers (J200)
(always closed,
rev. 1.0 only)
Pin 1
Additional Inputs and
Figure 1: TMCM-310 Overview
TMC236
or
TMC246
Outputs (X300)
J100, J101: rev 1.0 only
X102: rev 2.0 only
ATmega
32
Programmer / SPI
J101
J100
Reset button
RS232
X102
Pin 1
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
7
TMCM-310 Manual V1.13
3.2 TMCM-310 Application Environment
Reference Switches
TMCM-310
+5V
Communication
TMCL program download
firmware download
RS232
Driver
Motor 1
Host
CAN
TMC428
Driver Motor 2
µC
7..28VDC
EEPROM
Driver
Motor 3
Figure 2: Application Environment
3.2.1 Communication Interface
The communication between the host and the m odule can be done via the RS232 interface or the optional CAN Inter face. Comm unication with the TMCM-310 module is done usin g TMCL com mands. The interfaces on the board are ready-to-use, so there are no external drivers or level shifters necessary. Please see chapter 4 for the pin assignments of the interfaces.
3.2.2 Power Supply
The TMCM-310 is equippe d with a switching voltage regulator tha t generates the 5V supply voltage for the digital components of the module from the m otor power supply. So only one suppl y voltage is needed for the m odule. The c urrent hard ware revisio n 2.0 of th e TMCM-310 m odule is equipped with a protection diode aga inst reverse polarity that sh orts the power supply if it is connec ted with wrong polarity. The supply voltage must be 7..28V DC. The old hardware re vision 1.0 of the TMCM-310 is also equipped with a bridge rectifier. So for this version of the module th e power supply voltage can be 9.. 30 V DC or 7..21 V AC. For com patibility with the new hardware rev ision 2.0 of the TMCM- 310 also the old vers ion 1.0 should not be po wered with AC. The power supply ca n either be connected to t he screw terminal X504 or to the power socket X500 (industry standard p ower sock et with 2.1mm pin diameter). Bo th connections are electrica lly identica l. Hardware revision and supply voltage polarity are printed on the PCB.
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
8
TMCM-310 Manual V1.13
3.2.3 Microcontroller
On this module, the Atm el ATmega32 is used to r un the TMCL operating system and to control the TMC428. The CPU has 32Kb yte flash memory and a 1Kb yte EEPROM. The microc ontroller 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 RS232 or CAN interface. The microcontroller int erprets the TMCL comm ands and controls the TMC428 whic h executes the motion commands. The flash ROM of the microcontr oller ho lds the T MCL operatin g system and the EEPROM m em ory of the microcontroller is used to permanently store configuration data. The TMCL operating system can be updated via the RS232 interface. Use the TMCL IDE to do this.
3.2.4 EEPROM
To store TMCL programs for stand alone operation the TMCM-310 module is equipped wit h a 1 6kByte EEPROM attached to th e microcontroller. T he EEPROM can store TMCL progr a m s c onsis ting of up to 2048 TMCL commands.
3.2.5 TMC428
The TMC428 is a high-performance stepper motor control IC and can control up to three 2-phase­stepper-motors. Motio n parameters like speed or acce leration are sent to the TMC428 vi a SPI by the microcontroller. Ca lculati on of ram ps and spee d prof ile s are don e inter nall y by har dware b ased on the target motion parameters.
3.2.6 Stepper Motor Drivers
The stepper motor drivers used on the TMCM-310 module without the StallGuard options are the TMC236 chips. These dr ivers are ver y easy to use. They can contr ol the curren ts for the two phas es of the stepper motor s. 16x microstepping and max imum output current of 1500m A are supported by these driver ICs. On TMCM-310 modules with StallGuard option (TMCM-310/SG or TMCM-310/SG-CAN) the TMCM246 chips are used. These chips are fully compatible with the TMC236 chips, but have the additional StallGu ard feature. As the power dissipation of the TMC236 and TMC246 chips is very lo w no heat sink or cooling f an is needed. The temperatur e of the chips does not get high. The coils will be switched off autom atically when the temperature or t he current ex ceeds the l imits and aut om atically switch ed on agai n when the values are within the limits again.
3.3 StallGuard
The TMCM-310/SG and T MCM-310/SG-CAN module s are equipped with the St allGuard option. The StallGuard optio n makes it possible to detect if the mechanical load o n a s tep per motor is too high or if the traveler has been obs tructed. The lo ad value can be r ead using a T MCL comm and or the module can be programm ed so that the motor will be stopped automaticall y when it has been obstructed or the load has been to high. StallGuard can also b e used f or finding the ref erence pos ition with out the need f or a ref erence switch: Just activate StallG uard and then let the tr aveler run against a m echanical obstacle that is placed at the end of the way. W hen the motor has stopped it is def initely at the end of its wa y, and t his po in t can be used as the reference position. Please see the T MCL Ref er ence and Progr am m ing Manual on ho w to acti vate t he S tallG uard f eature . The TMCL IDE also has s o me tools which let you try out and adjus t th e Sta llG u ar d function in an easy way. This is also described in the TMCL Reference and Programming Manual.
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
9
TMCM-310 Manual V1.13
4 Connecting the Module
4.1 Host communication
Communication to a host takes place via the onboard communication interfaces. The module is equipped with an RS-232 interf ace and optio nal ly with a CAN interface. The pin assignments of the RS232 interface are:
Pin number Signal name
2 RxD 3 TxD 5 Ground All other pins are not connected.
To connect the RS232 int erf ac e of the m odule to a PC you c a n us e a stan dar d n ul l m odem cable (with female plugs at both en ds) or you can make a cable yourself that connects pin 2 of the TMCM-310 with pin 3 of the PC, pin 3 of the T MCM-310 with pin 2 of the PC and p in 5 of the T MCM-310 with pin 5 of the PC (so you have to cross pin 2 and 3) . The baud rate of the RS232 interfac e can be set by software, as desc ribed in the TMCL Reference and Programming Manual. The defaul t baud rate is 9600bps.
The optional CAN interface uses an industry standard 10-way box header with the following pin assignments (all other pins are not connected):
Pin number Signal name
2 CAN­7 CAN+ 3 Ground 6 Ground
Pin 1 is mark ed with an arro w on the board. The row near t he edge of the board c ontains all th e pins with odd numbers and the other row cont ains all the p ins with ev en num bers. So an indus try standar d 10-way (2x5) ribbon cable plug (2.54mm pitch) can be used. Closing the jumper J500 terminates the CAN bus with a 120 ohms resistor.
The CAN bit rate and CAN ID can be set by software (please see the TMCL Reference and Programming Manual). The maximum CAN bit rate is 500kBit/s.
4.2 Connecting the motors
Warning
The TMCM-310 controls u p to three 2-phase stepper motors. The screw term inals for the motors are marked on the board with “Motor 0”, “Motor 1” and “Motor 2”. Connect one co il of the motor to the terminals marked with “A0” and “ A1” and th e oth er c oil to the ter minals marked with “B0” and “B1”. If a stepper motor should run in the wrong direction just change the polarity of one (not both) of its coils. Before connecting a m otor please make s ure which cable belongs to which c oil. Wrong connections may lead to damage of the driver chips or the motor.
: Never connect or disconnect the motors while the TMCM-310 Module is switched on.
Doing this will destroy the driver ICs!
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
10
TMCM-310 Manual V1.13
4.3 Reference switches
Reference switches can be used to find the reference point at startup of a system. They can be connected to the screw ter minals marked “ST OP 0 L/R”, “ST OP 1L/R” and “ST OP 2 L/R”. Eac h of the reference switch screw terminal blocks also has a GND terminal which is connected to ground. Pull up resistors for reference switches are included on the module.
In TMCL, a reference sear ch function is avai lable . This ref erence s earch func tion s upports one , two or three switches. Please s ee the T MCL Reference and Programming Manual for more information about the reference search function of TMCL.
4.3.1 Left and right limit switches
The TMCM-310 can be c onfigured so that a motor has a left and a right lim it switch (Figure 3). T he motor then stops when the traveller has reached one of the limit switches.
REF_L_x REF_R_x
left stop
switch
motor
traveller
right stop
switch
Figure 3: Left and right limit switches
4.3.2 Triple Switch Configuration
It is possible to pro gram a tolerance range ar ound the reference swit ch position. This is usef ul for a triple switch configuration, as outlined in Figure 4. In that configuration two switches are used as automatic stop switc hes, and one additional switch is used as the reference s witch between the left stop switch and the right stop switch. The left stop switch and the reference switch are wired or.
REF_L_x
left stop
switch
motor
reference switch
traveller
Figure 4: Limit switch and reference switch
REF_R_x
right stop
switch
4.3.3 One reference switch
If a circular system is used (Figure 5), but also with so me linear travell ing system s only one r eference switch is used. When using only one reference switch, connect it to the left limit switch input (the terminal marked “L”) and leave the other limit switch input open.
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
11
TMCM-310 Manual V1.13
REF_L_x
ref switch
Figure 5: One reference switch
motor
eccentric
4.4 Additional inputs and outputs
The module also provides 8 digital (TT L) outputs and 8 inputs that c an be used as dig ital (TTL) or as analogue inputs (0..5V, 1 0 bit accurac y). Hardware revisi on 2.0 also provides an alarm input which is also a dgdital TT L level input. The f unctionality of this input can be selected b y the TMCL command “SGP 80, 0, n”. These inputs and outputs are located on the 2 0-way box header on the m odule. The pin assignments are as follows:
Pin Signal Pin Signal
1 Output 0 2 Output 1 3 Output 2 4 Output 3 5 Output 4 6 Output 5 7 Output 6 8 Output 7 9 rev. 2.0: Alarm Input
rev 1.1: +5V (Output) 11 Input 0 12 Input 1 13 Input 2 14 Input 3 15 Input 4 16 Input 5 17 Input 6 18 Input 7 19 +5V (Output) 20 GND
An industry standard 20- way (2x10, 2.54mm pitc h) box header is used. Pin 1 is marked by an arrow on the board. The row ne ar the edge of the board contains the pi ns with odd num bers and the other row contains the pins with even numbers.
10 GND
4.5 Jumpers, other connectors and LEDs
4.5.1 Blank time
The blank tim e of the TMC236 or T MC246 motor drivers can be set using th e jumpers “Blank 1” and “Blank2”. The following blank times can be set:
Blank1 Blank2 Blank time
close close 0.6µs open close 0.9µs close open 1.2µs open open 1.5µs
Normally the shortest blank time (both jumpers closed) gives best microstepping results, but with some motors or for EMC reasons it can be necessary to set a longer blank time. Please see the TMC236 or TMC246 data sheet for more information about this matter.
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
12
TMCM-310 Manual V1.13
4.5.2 Programmer connector and jumper J101 (rev. 1.1)
On hardware rev. 1. 1, the progr ammer c onnector (2x3-wa y header m arked with “Programm er” on the board) serves for two purposes: either for reprogramming the CPU or for attaching other external devices with SPI interfac e.
If jumper J101 connects pins 1 and 2, the programmer connec tor can be used to reprogram the microcontroller using an Atm el ISP programm er. This is to be done by TRINAMIC only! Do not use an ISP to update the TMCL operating system. Updating can be done by the user only via the RS232 interface, using the TMCL IDE.
If the jumper J101 connects its pins 2 and 3 the programmer port can be used to attach external devices with SPI i nterface. T o access such a device special s oftware dri vers mus t be written. Please get in touc h with the Trinam ic customer support if you wish to attach external SPI devices.
4.5.3 Programmer connector (rev. 2.0)
On hardware rev. 2.0, t he programmer connector a lso s erves f or two purposes: for reprogram ming the CPU (by Trinamic only) and for connecting external SPI devices (together with the soldering holes X102).
For reprogramming the CPU, an Atmle ISP pr o gram mer can be connected here. This is to be done by TRINAMIC only! Do not use an ISP to update the TMCL operating system. Updating can be done by the user only via the RS232 interface, using the TMCL IDE.
To use this connector for connecting external SPI devices, the SPI MISO, MOSI and CLK lines must be conn ecting to this port. The + 5V and GND pins of this conn ector can also be used for powering the ex ternal SPI de vice . The c onnec tor X102 ( sold ering ho les) prov ides the chip select lines f or the exter nal SPI devices (Pin 1 = SPI_SELECT 0, Pin 2 = SP I_SELECT 1, Pin 3 = SPI_SELECT 2). To access such a device special s oftware drivers must be written. Please get in touch with the Trinamic customer support if you wish to attach external SPI devices.
4.5.4 SPI jumpers
With hardware revision 1. 1 of the TMCM-310, the jumpers m arked SCK, SDI, SDO and SCS can be used to disconnect the TMC428 from the microcontroller. This feature can be used to connect the TMC428 to a different CPU . Please get in touch with the T rinamic cus tomer support if you wish to do so.Normally this is not needed and all these jumpers always have to be closed. On hardware revision 2.0 these jumpers have been eliminated, but it is still possible to connect a different CPU, b y cutting four wires on the PCB. Please get in touch with Trinamic if you wish t o do this.
4.5.5 Shutdown jumper
The shutdown jumper only exists on hardware revision 1.1 of the TMCM-310. When this jumper is closed, the motor dri vers ar e al ways enabled. When this j um per is ope n th e e nab l e s ignal of the motor drivers can be control led by the CPU so that the CPU c an shut down the dr ivers (using th e shutdown functions in TMCL). Normally this jumper is closed. On hardware revision 2.0 o f the m odule the shutdown jum per has been r ep laced b y the al arm input on the additional input/o utp ut c onnector of the module. Ple ase s ee c hapter 4.4 for more inform ation abou t this input.
4.5.6 Reset button
Pressing the reset but ton interrupts a ll tasks and re- starts the TMCL o perating system which then re­initializes the module. So, pressing the reset button has the same effect as cycling the supply voltage.
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
13
TMCM-310 Manual V1.13
4.5.7 Power LED
The power LED (D503) lights steadily when the TMCM-310 is powered.
4.5.8 Activity LED
The activity LED (D100) flashes when th e TMCM-310 is r unning normall y. During a firm ware upgrade process the LED lights steadily.
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
14
TMCM-310 Manual V1.13
5 Putting the TMCM-310 into Operation
On the basis of a sm all example it is shown step by st ep how the TMCM-310 is set into operat ion. Users who are already familiar with TMCL and other Trinamic modules may skip this chapter.
Example IDE Software developm ent environment. For data tra nsfer between the host PC and t he module the RS-232 interface is employed.
A formula how “speed” is converted into a ph ysical unit like rotations per seconds can be found in chapter 6.1.
The simple application is:
Turn Motor 0 left with speed 500
Turn Motor 1 right with speed 500
Turn Motor 2 with speed 500, acceleration 5 and move between position +10000 and –10000.
To implement this simple application on theTMCM-310 it is necessary to do the following things: Step 1: Step 2: Step 3: Step 4:
Step 5: A description of the TMCL commands can be found in the TMCL Reference and
: The following applica tion is to be im plemented on the T MCM-310 module us ing the TMCL-
Connect the RS-232 Interface to the PC Connect the motors to the motor connectors Connect the power supply voltage to the power connector Switch on the power supply. The power LED should light up and the activity LED
should start to flash. This indicates the correct configuration of the microcontroller.
Start the TMCL-IDE Soft ware development environment. O pen file test2.tmc or enter
the program shown in the following listing manually. Programming Manual.
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
15
TMCM-310 Manual V1.13
//test2.tmc – A simple example for using TMCL and the TMCL-IDE
ROL 0, 500 //Rotate motor with speed 500 WAIT TICKS, 0, 500 MST 0 ROR 1, 500 //Rotate to other direction with same speed WAIT TICKS, 0, 500 MST 1
SAP 4, 2, 500 //Set max. Velocity
Loop: MVP ABS, 2, 10000 //Move to Position 10000
SAP 5, 2, 5 //Set max. Acceleration WAIT POS, 2, 0 //Wait until position reached
MVP ABS, 2, -10000 //Move to Position -10000 WAIT POS, 2, 0 //Wait until position reached JA Loop //Infinite Loop
Step 6:
Click the “Assemble” icon to convert the TMCL program into byte code.
Then download the program to the TMCM-310 module by clicking the “Download”
icon.
Step 7:
Click the “Run” icon. The downloaded program will now be executed.
A detailed documentat ion about the TMCL oper ations and the TMCL IDE can b e found in the TMCL Reference and Programming Manual. The next chapter shows how the velocity and acceleration values are calculated.
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
16
TMCM-310 Manual V1.13
6 TMCM-310 Operational Description
6.1 Calculation: Velocity and Acceleration vs. Microstep- and Fullstep Frequency
The values of the param eters sent to the T MC428 do not ha ve typica l motor values , like rotations per second as velocit y. But the s e val ues c an be c alc u lat e d f r om the T MC428 par am eter s, as s hown in t his document. The parameters for the TMC428 are:
Parameter Description Range
f
Clock frequency 16 MHz
CLK
velocity 0..2047 a_max Maximum acceleration 0..2047 pulse_div Velocity pre- divider. The higher the value is, t he less
is the maximum velocity. Default value = 3 Can be changed in TMCL using SAP 154.
ramp_div Acceleration pre-d ivider. The higher the v alue is, the
less is the maximum acceleration default value = 7 Can be change in TMCL using SAP 153.
Usrs Microstep resolution (microsteps per fullstep = 2
Can be changed in TMCL using SAP 140.
usrs
).
0..13
0..13
0..6
Table 1: TMC428 Velocity parameters
The microstep-frequency of the stepper motor is calculated with
][
CLK
][
=
Hzusf
To calculate the fullstep-frequency from the microstep-frequency, the m icrostep-frequency must be multiplied with the number of microsteps per fullstep.
Hzfsf
][ =
The change in the pulse rat e per tim e unit ( pulse f requenc y change p er sec ond – the ac celeratio n (a) is given by
This results in an acceleration in fullsteps of:
af2=
velocityHzf
_
divpulse
Hzusf
usrs
2
=
a
2
a
with af: acceleration in fullsteps
usrs
with usf: microstep-frequency
3220482
][
with fsf: fullstep-frequency
2
af
CLK
max
29__
++
divrampdivpulse
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
17
TMCM-310 Manual V1.13
Example:
f_CLK = 16 MHz on the TMCM-310 module velocity = 1000 a_max = 1000 pulse_div = 1 ramp_div = 1 usrs = 6
MHz
100016
msf 3125.122070
=
][
a 208.119
Mhz
=
af 863,1
If the stepper motor has e.g. 72 fullsteps per rotation, the number of rotations of the motor is:
RPS
1
2
1000)16(
2911
++
2
MHz
208.119
6
2
=
3220482
3125.122070
6
2
==
=
s
==
MHz
s
fsf
rotationperfullsteps
RPM
=
fsf
rotationperfullsteps
MHz
s
=
Hz
HzHzfsf 35.1907
35.1907
49.26
===
72
6035.190760
=
458.1589
72
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
18
TMCM-310 Manual V1.13
7 TMCL
TMCL, the Trinamic Motion Control L anguag e is used to send comm ands from the host t o the T MCM­310 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 (http://www.trinamic .com). Also the latest vers ions of the firmware (TMCL op erating system) and P C software (TMCL IDE) can be found there.
Trinamic Motion Control GmbH & Co KG
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Sternstraße 67
D - 20357 Hamburg, Germany
Phone +49-40-51 48 06 - 0 FAX: +49-40-51 48 06 - 60
http://www.trinamic.com
19
TMCM-310 Manual V1.13
8 Differences between Hardware rev.
1.1 and 2.0
There are two versions of the TMCM-310: hardware rev 1.1 and hardware rev. 2.0. Both of these versions of the TMCM-310 are compatible with each other, but there are some slight differences. These differences are listed here:
Power supply: rev. 1.1 is equipped with a brid ge rectifier, and thus the polarit y of the supply voltage does not matter and can even be alternating current. But as this caused problems when connecting externa l SPI devices (grounding probl ems), the recfier has been el iminated on hardware revision 2.0. The rev. 2.0 module is equipped with a diode that protects the module against wrong polarity (the suplly voltage will be shorted if the polarity is wrong!).
Alarm input: rev 1.1 is equipped with a jumper that controls the shutdown functions of the motor drivers. On r ev. 2.0 this j umper has been el iminated. Inste ad, an alarm inp ut has been introduced on the addition al I/O connec tor. This leads to more f lexibilit y, as the functional ity of this input can be configured by TMCL. It also makes the external I/O connector fully compatible with the one on the TMCM-610 and TMCM-612.
Connecting external SPI devices: T his has b een sim plified on har dware rev .2.0 of the T MCM­310 module. Please see chapter 4.5.3 for more information about this.
SPI jumpers: As these jumpers were hardl y needed they have been eliminated on hardware rev. 2.0 and replaced by cuttable PCB wires and soldering pads.
Voltage regulator: The voltage regulator of the module has been improved for better EMC behaviour.
The hardware revision number is printed on the PCB.
Copyright 2004, 2005, 2006 by Trinamic Motion Control GmbH & Co KG
Loading...