Trinamic TMCM-310 Manual Download Page 87

TMCM-310 TMCL™ Firmware Manual (V1.02/2011-JAN-11) 

87 

 

 
Copyright © 2011, TRINAMIC Motion Control GmbH & Co. KG 

 

Number  Global parameter 

Description 

Range 

Access 

128 

TMCL

TM

 application 

status 

0 –stop 
1 – run 
2 – step 
3 – reset 

0…3 

129  

download mode 

0 – normal mode 
1 – download mode 

0/1 

130  

TMCL

TM

 program 

counter 

The index of the currently executed TMCL

TM

 instruction.  

 

132 

tick timer 

A  32  bit  counter  that  gets  incremented  by  one  every 
millisecond. It can also be reset to any start value. 

 

RW 

133 

random number 

Choose a random number. 

Read only!

 

0…21474
83647 

 
 

 

Summary of Contents for TMCM-310

Page 1: ...TMCM 310 TMCLTM Firmware Manual Version 1 02 2011 JAN 11 Trinamic Motion Control GmbH Co KG Sternstraße 67 D 20 357 Hamburg Germany http www trinamic com ...

Page 2: ...interface 20 6 7 Commands 22 6 7 1 ROR rotate right 22 6 7 2 ROL rotate left 23 6 7 3 MST motor stop 24 6 7 4 MVP move to position 25 6 7 5 SAP set axis parameter 27 6 7 6 GAP get axis parameter 31 6 7 7 STAP store axis parameter 35 6 7 8 RSAP restore axis parameter 38 6 7 9 SGP set global parameter 41 6 7 10 GGP get global parameter 44 6 7 11 STGP store global parameter 47 6 7 12 RSGP restore glo...

Page 3: ...33 Request target position reached event 77 6 7 34 BIN return to binary mode 78 6 7 35 TMCL Control Functions 79 7 Axis parameters 81 7 1 Axis parameters 81 8 Global parameters 85 8 1 Bank 0 85 8 2 Bank 1 88 8 3 Bank 2 89 9 Hints and tips 90 9 1 Reference search 90 9 2 Stall detection 91 9 3 Fixing microstep errors 91 10 Revision history 92 10 1 Firmware revision 92 10 2 Document revision 92 11 Re...

Page 4: ...equipment intended to support or sustain life and whose failure to perform when properly used in accordance with instructions provided can be reasonably expected to result in personal injury or death TRINAMIC Motion Control GmbH Co KG 2011 Information given in this data sheet is believed to be accurate and reliable However neither responsibility is assumed for the consequences of its use nor for a...

Page 5: ... onboard EEPROM for stand alone operation The firmware of the module can be updated via the serial interface With the optional stallGuard feature it is possible to detect overload and stall of the motor Applications Controller driver board for control of up to 3 Axis Versatile possibilities of applications in stand alone or pc controlled mode Motor type Coil current from 300mA to 1 1A RMS 1 5A pea...

Page 6: ...3 axis controller driver RS232 CAN 165 x 100 x 25 TMCM 310 SG 3 axis controller driver StallGuard RS232 165 x 100 x 25 TMCM 310 SG CAN 3 axis controller driver StallGuard RS232 CAN 165 x 100 x 25 Related products QSH4218 35 10 027 QMot stepper motor 42mm 1A 0 27Nm 42 3 x 42 3 x 33 5 QSH4218 41 10 035 QMot stepper motor 42mm 1A 0 35Nm 42 3 x 42 3 x 38 QSH4218 51 10 049 QMot stepper motor 42mm 1A 0 ...

Page 7: ...e lifetime the firmware can be updated by the user New versions can be downloaded free of charge from the TRINAMIC website http www trinamic com The firmware shipped with this module is related to the standard TMCL firmware TMCL shipped with most of TRINAMIC modules with regard to protocol and commands Corresponding the module is based on the TMC428 I stepper motor controller and the TMC236 or TMC...

Page 8: ...per motors The screw terminals for the motors are marked on the board with Motor 0 Motor 1 and Motor 2 2 54mm pitch connectors Additionally there are electrically identical 4 pin connectors 2 54mm pitch for motor and stop switches Connect one coil of the motor to the terminals marked with A0 and A1 and the other coil to the terminals marked with B0 and B1 If a stepper motor should run in the wrong...

Page 9: ...ply There are two possibilities for connecting the power supply The power supply can either be connected to the X504 X505 TRINAMIC standard 5 08mm power plug or to the power socket X503 industry standard power socket with 2 0mm pin diameter Both connections are electrically identical Plug X504 X505 Socket X503 Function VS Pin 8 34V DC power supply V2 0 GND Ring Ground Attention Do not exceed the m...

Page 10: ...TMCM 310 TMCL Firmware Manual V1 02 2011 JAN 11 10 Copyright 2011 TRINAMIC Motion Control GmbH Co KG Choose COM port and type with the parameters shown below baud rate 9600 for RS232 Click OK ...

Page 11: ... download the program to the TMCM 310 module via the icon Download 9 Press icon Run The desired program will be executed 10 Click Stop button to stop the program A simple example for using TMCL and TMCL IDE ROL 0 500 Rotate motor 0 with speed 500 WAIT TICKS 0 500 MST 0 ROR 1 250 Rotate motor 1 with 250 WAIT TICKS 0 500 MST 1 SAP 4 2 500 Set max Velocity SAP 5 2 50 Set max Acceleration Loop MVP ABS...

Page 12: ... the module is not detected please check all points above cables interface power supply COM port baud rate 3 Issue a command by choosing instruction type if necessary motor and value and click Execute to send it to the module Examples ROR rotate right motor 0 value 500 Click Execute The first motor is rotating now MST motor stop motor 0 Click Execute The first motor stops now Please use the TMCL I...

Page 13: ...t also commands to control the program structure like conditional jumps compare and calculating Every command has a binary representation and a mnemonic The binary format is used to send commands from the host to a module in direct mode The mnemonic format is used for easy usage of the commands when developing stand alone TMCL applications with the TMCL IDE IDE means Integrated Development Environ...

Page 14: ... var i Checksum byte Command array 0 8 of byte Set the Command array to the desired command Calculate the Checksum Checksum Command 0 for i 1 to 7 do Checksum Checksum Command i Command 8 Checksum Now send the Command array 9 bytes to the module 6 2 Reply format Every time a command has been sent to a module the module sends a reply The reply format for RS232 is as follows Bytes Meaning 1 Reply ad...

Page 15: ... load your program down into the EEPROM and then they will run on the module The TMCL IDE contains an editor and a TMCL assembler where the commands can be entered using their mnemonic format They will be assembled automatically into their binary representations Afterwards this code can be downloaded into the module to be executed there 6 4 TMCL command overview In this section a short overview of...

Page 16: ... Get global parameter STGP 11 Store global parameter into EEPROM RSGP 12 Restore global parameter from EEPROM 6 4 3 I O port commands These commands control the external I O ports and can be used in direct mode and in stand alone mode Mnemonic Command number Meaning SIO 14 Set output GIO 15 Get input SAC 29 Access to external SPI device 6 4 4 Control commands These commands are used to control the...

Page 17: ...ulator to a global parameter For calculating purposes there is an accumulator or accu or A register and an X register When executed in a TMCL program in stand alone mode all TMCL commands that read a value store the result in the accumulator The X register can be used as an additional memory when doing calculations It can be loaded from the accumulator When a command that reads a value is executed...

Page 18: ...eter module specific settings e g communication settings or TMCL user variables GGP 10 parameter bank number Get global parameter read out module specific settings e g communication settings or TMCL user variables STGP 11 parameter bank number Store global parameter TMCL user variables only RSGP 12 parameter bank Restore global parameter TMCL user variables only RFS 13 START STOP STATUS motor numb...

Page 19: ...lication 133 quit download mode target command execution is resumed don t care don t care don t care 134 read TMCL memory the specified program memory location is read don t care don t care memory address 135 get application status one of these values is returned 0 stop 1 run 2 step 3 reset don t care don t care don t care 136 get firmware version return the module type and firmware revision eithe...

Page 20: ...le sends back a reply in ASCII format This reply consists of the address character of the host host address that can be set in the module the address character of the module the status code as a decimal number the return value of the command as a decimal number a CR character So after sending AGAP 0 1 the reply would be BA 100 5000 if the actual position of axis 1 is 5000 the host address is set t...

Page 21: ...space character press the backspace key in a terminal program When bit 4 is set and bit 5 is clear the characters that are entered are not echoed back immediately but the entire line will be echoed back after the CR character has been sent When bit 5 is set and bit 4 is clear there will be no echo only the reply will be sent ...

Page 22: ... transferred to axis parameter 0 target velocity The module is based on the TMC428 I stepper motor controller and the TMC236 TMC246 power driver This makes possible choosing a velocity between 0 and 2047 Related commands ROL MST SAP GAP Mnemonic ROR motor number velocity Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 1 don t care motor number velocity 0 2047 Reply in direct mode STATUS V...

Page 23: ...sed on the TMC428 I stepper motor controller and the TMC236 TMC246 power driver This makes possible choosing a velocity between 0 and 2047 Related commands ROR MST SAP GAP Mnemonic ROL motor number velocity Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 2 don t care motor number velocity 0 2047 Reply in direct mode STATUS VALUE 100 OK don t care Example Rotate left motor 1 velocity 1200 ...

Page 24: ...unction The axis parameter target velocity is set to zero Related commands ROL ROR SAP GAP Mnemonic MST motor number Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 3 don t care motor number don t care Reply in direct mode STATUS VALUE 100 OK don t care Example Stop motor 1 Mnemonic MST 1 Binary Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Instruction Number Type Motor Bank Operan...

Page 25: ...tors reach their target positions at the same time It is important that the maximum accelerations axis parameter 5 and the ramp and pulse dividers axis parameters 153 and 154 of all axes are set to the same values as otherwise interpolation will not work correctly Please note that the distance between the actual position and the new one should not be more than 8388607 microsteps Otherwise the moto...

Page 26: ... Byte1 Operand Byte0 Checksum Value hex 01 04 01 00 ff ff fc 18 18 Examples MVP COORD Move motor 2 to previously stored coordinate 8 Mnemonic MVP COORD 2 8 Binary Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Instruction Number Type Motor Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 Checksum Value hex 01 04 02 02 00 00 00 08 11 It is possible to use stall detection Please se...

Page 27: ...ge Number Axis Parameter Description Range Unit 0 target next position The desired position in position mode see ramp mode no 138 223 µsteps 1 actual position The current position of the motor Should only be overwritten for reference point setting 223 µsteps 2 target next speed The desired speed in velocity mode see ramp mode no 138 In position mode this parameter is set by hardware to the maximum...

Page 28: ...140 microstep resolution 0 full step 1 half step 2 4 microsteps 3 8 microsteps 4 16 microsteps 5 32 microsteps 6 64 microsteps Note that modifying this parameter will affect the rotation speed in the same relation The full step setting and the half step setting are not optimized for use without an adapted microstepping table These settings just step through the microstep table in steps of 64 respe...

Page 29: ...he microstep wave This can be used to fix microstep errors 0 2048 or 1 204 freewheeling Time after which the power to the motor will be cut when its velocity has reached zero 0 65535 0 never msec 205 stall detection threshold Stall detection threshold Set it to 0 for no stall detection or to a value between 1 low threshold and 7 high threshold The motor will be stopped if the load value exceeds th...

Page 30: ... 11 30 Copyright 2011 TRINAMIC Motion Control GmbH Co KG Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Instruction Number Type Motor Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 Checksum Value hex 01 05 06 01 00 00 00 c8 d5 ...

Page 31: ... no 138 223 µsteps 1 actual position The current position of the motor Should only be overwritten for reference point setting 223 µsteps 2 target next speed The desired speed in velocity mode see ramp mode no 138 In position mode this parameter is set by hardware to the maximum speed during acceleration and to zero during deceleration and rest 2047 3 actual speed The current rotation speed 2047 4 ...

Page 32: ... and MVP 0 position mode Steps are generated when the parameters actual position and target position differ Trapezoidal speed ramps are provided 2 velocity mode The motor will run continuously and the speed will be changed with constant maximum acceleration if the parameter target speed is changed For special purposes the soft mode value 1 with exponential decrease of speed can be selected 0 1 2 1...

Page 33: ...mum velocity 0 full speed 1 half of the maximum speed 2 a quarter of the maximum speed 3 1 8 of the maximum speed etc 0 8 195 referencing switch speed Similar to parameter no 194 the speed for the switching point calibration can be selected 0 8 196 distance end switches This parameter provides the distance between the end switches after executing the RFS command mode 2 or 3 0 8388307 203 mixed dec...

Page 34: ...to be able to reach a higher motor velocity 0 2048 214 power down delay Standstill period before the current is changed down to standby current The standard value is 200 value equates 2000msec 1 65535 10msec Unit of acceleration Example Get the actual position of motor 2 Mnemonic GAP 2 1 Binary Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Instruction Number Type Motor Bank Operand Byte3 Op...

Page 35: ...an be used for STAP Number Axis Parameter Description 4 maximum positioning speed Should not exceed the physically highest possible value Adjust the pulse divisor no 154 if the speed value is very low 50 or above the upper limit See TMC 428 datasheet for calculation of physical units 5 maximum acceleration The limit for acceleration and deceleration Changing this parameter requires re calculation ...

Page 36: ...through the microstep table in steps of 64 respectively 32 To get real full stepping use axis parameter 211 or load an adapted microstepping table If the module is specified for 16 microsteps only switching to 32 or 64 microsteps brings an enhancement in resolution and smoothness The position counter will use the full resolution but however the motor will resolve a maximum of 24 different microste...

Page 37: ...hold and 7 high threshold The motor will be stopped if the load value exceeds the stall detection threshold Switch off mixed decay to get usable results 211 fullstep threshold When exceeding this speed the driver will switch to real full step mode To disable this feature set this parameter to zero or to a value greater than 2047 Setting a full step threshold allows higher motor torque of the motor...

Page 38: ... 4 maximum positioning speed Should not exceed the physically highest possible value Adjust the pulse divisor no 154 if the speed value is very low 50 or above the upper limit See TMC 428 datasheet for calculation of physical units 5 maximum acceleration The limit for acceleration and deceleration Changing this parameter requires re calculation of the acceleration factor no 146 and the acceleratio...

Page 39: ...through the microstep table in steps of 64 respectively 32 To get real full stepping use axis parameter 211 or load an adapted microstepping table If the module is specified for 16 microsteps only switching to 32 or 64 microsteps brings an enhancement in resolution and smoothness The position counter will use the full resolution but however the motor will resolve a maximum of 24 different microste...

Page 40: ...threshold Stall detection threshold Set it to 0 for no stall detection or to a value between 1 low threshold and 7 high threshold The motor will be stopped if the load value exceeds the stall detection threshold Switch off mixed decay to get usable results 211 fullstep threshold When exceeding this speed the driver will switch to real full step mode To disable this feature set this parameter to ze...

Page 41: ...ve values The parameter is transferred to the correct position in the appropriate on board device Related commands GGP STGP RSGP AGP Mnemonic SGP parameter number bank number value Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 9 parameter number bank number value Reply in direct mode STATUS VALUE 100 OK don t care Global parameters of bank 0 which can be used for SGP Number Global param...

Page 42: ...r power up 0 1 80 shutdown pin functionality Select the functionality of the SHUTDOWN pin 0 no function 1 high active 2 low active 0 2 81 TMCLTM code protection Protect a TMCLTM program against disassembling or overwriting 0 no protection 1 protection against disassembling 2 protection against overwriting 3 protection against disassembling and overwriting If you switch off the protection against d...

Page 43: ...ications 231 231 9 general purpose variable 9 for use in TMCL applications 231 231 10 general purpose variable 10 for use in TMCL applications 231 231 11 general purpose variable 11 for use in TMCL applications 231 231 12 general purpose variable 12 for use in TMCL applications 231 231 13 general purpose variable 13 for use in TMCL applications 231 231 14 general purpose variable 14 for use in TMC...

Page 44: ...de STATUS VALUE 100 OK don t care Global parameters of bank 0 which can be used for GGP Number Global parameter Description Range 64 EEPROM magic Setting this parameter to a different value as E4 will cause re initialization of the axis and global parameters to factory defaults after the next power up This is useful in case of miss configuration 0 255 65 RS232 baud rate 0 9600 baud Default 1 14400...

Page 45: ...st disassembling 2 protection against overwriting 3 protection against disassembling and overwriting If you switch off the protection against disassembling the program will be erased first Changing this value from 1 or 3 to 0 or 2 the TMCLTM program will be wiped off 0 1 2 3 83 CAN secondary address Second CAN ID for the module Switched off when set to zero 0 7ff 128 TMCLTM application status 0 st...

Page 46: ...able 10 for use in TMCL applications 231 231 11 general purpose variable 11 for use in TMCL applications 231 231 12 general purpose variable 12 for use in TMCL applications 231 231 13 general purpose variable 13 for use in TMCL applications 231 231 14 general purpose variable 14 for use in TMCL applications 231 231 15 general purpose variable 15 for use in TMCL applications 231 231 16 general purp...

Page 47: ...ains general purpose 32 bit variables for the use in TMCL applications They are located in RAM and can be stored to EEPROM After booting their values are automatically restored to the RAM Number Global parameter Description 0 general purpose variable 0 for use in TMCL applications 1 general purpose variable 1 for use in TMCL applications 2 general purpose variable 2 for use in TMCL applications 3 ...

Page 48: ...Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Instruction Number Type Motor Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 Checksum Value hex 01 0b 2a 02 00 00 00 00 38 Note The STAP command will not have any effect when the configuration EEPROM is locked refer to 8 1 In direct mode the error code 5 configuration EEPROM locked see also section 6 2 1 will be returned in this ca...

Page 49: ...er specific extensions of the firmware Global parameters of bank 2 which can be used for RSGP Bank 2 contains general purpose 32 bit variables for the use in TMCL applications They are located in RAM and can be stored to EEPROM After booting their values are automatically restored to the RAM Number Global parameter Description 0 general purpose variable 0 for use in TMCL applications 1 general pur...

Page 50: ...9 for use in TMCL applications 20 55 general purpose variables 20 55 for use in TMCL applications Example Restore the serial address of the device Mnemonic RSGP 66 0 Binary Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Instruction Number Type Motor Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 Checksum Value hex 01 08 06 00 00 00 00 00 10 Please refer to chapter 8 for more in...

Page 51: ...ch can be checked Internal function The reference search is implemented as a state machine so interaction is possible during execution Related commands WAIT Mnemonic RFS START STOP STATUS motor number Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 13 0 START start ref search 1 STOP abort ref search 2 STATUS get status motor number don t care Reply in direct mode When using type 0 START o...

Page 52: ...te0 Checksum Value hex 01 0e 07 02 00 00 00 01 19 Available I O ports 20 19 1 2 Addressing all eight output lines with one SIO command Set the type parameter to 255 and the bank parameter to 2 The value parameter must then be set to a value between 0 255 where every bit represents one output line Furthermore the value can also be set to 1 In this special case the contents of the lower 8 bits of th...

Page 53: ... bank number Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 15 port number bank number don t care Reply in direct mode STATUS VALUE 100 OK status of the port Example Get the analogue value of ADC channel 3 Mnemonic GIO 3 1 Binary Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Instruction Number Type Motor Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 Checksum Value h...

Page 54: ... inputs The ADIN lines can be read back as digital or analogue inputs at the same time The digital states can be accessed in bank 0 6 7 15 3 I O bank 2 the states of digital outputs The states of the OUT lines that have been set by SIO commands can be read back using bank 2 Pin I O port Command Range 11 IN_0 GIO 0 1 0 1023 12 IN_1 GIO 1 1 0 1023 13 IN_2 GIO 2 1 0 1023 14 IN_3 GIO 1 1 0 1023 15 IN_...

Page 55: ... COMP JC AAP AGP GAP GGP GIO Mnemonic CALC op value where op is ADD SUB MUL DIV MOD AND OR XOR NOT or LOAD Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 19 0 ADD add to accu 1 SUB subtract from accu 2 MUL multiply accu by 3 DIV divide accu by 4 MOD modulo divide by 5 AND logical and accu with 6 OR logical or accu with 7 XOR logical exor accu with 8 NOT logical invert accu 9 LOAD load op...

Page 56: ...calculate instruction see GAP GGP GIO CALC CALCX The internal arithmetic status flags are set according to the comparison result Related commands JC jump conditional GAP GGP GIO CALC CALCX Mnemonic COMP value Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 20 don t care don t care comparison value Example Jump to the address given by the label when the position of motor 2 is greater than ...

Page 57: ...ate state s Related commands JA COMP WAIT CLE Mnemonic JC condition label where condition ZE NZ EQ NE GT GE LT LE ETO EAL EDV EPO Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 21 0 ZE zero 1 NZ not zero 2 EQ equal 3 NE not equal 4 GT greater 5 GE greater equal 6 LT lower 7 LE lower equal 8 ETO time out error 9 EAL external alarm 12 ESD shutdown error don t care jump address Example Jump...

Page 58: ...ode Internal function The TMCL program counter is set to the passed value Related commands JC WAIT CSUB Mnemonic JA Label Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 22 don t care don t care jump address Example An infinite loop in TMCL Loop MVP ABS 0 10000 WAIT POS 0 0 MVP ABS 0 0 WAIT POS 0 0 JA Loop Jump to the label Loop Binary format of JA Loop assuming that the label Loop is at ...

Page 59: ...al stack is limited to 8 This also limits nesting of subroutine calls to 8 The command will be ignored if there is no more stack space left Related commands RSUB JA Mnemonic CSUB Label Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 23 don t care don t care subroutine address Example Call a subroutine Loop MVP ABS 0 10000 CSUB SubW Save program counter and jump to label SubW MVP ABS 0 0 J...

Page 60: ...loads down This command cannot be used in direct mode Internal function The TMCL program counter is set to the last value of the stack The command will be ignored if the stack is empty Related command CSUB Mnemonic RSUB Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 24 don t care don t care don t care Example Please have a look at the CSUB example below Binary format of RSUB Byte Index 0...

Page 61: ...by the ticks parameter RFS Wait until the reference search of the motor specified by the motor field has been reached An optional timeout value 0 for no timeout must be specified by the ticks parameter The timeout flag ETO will be set after a timeout limit has been reached You can then use a JC ETO command to check for such errors or clear the error using the CLE command Internal function The TMCL...

Page 62: ...and alone TMCL program needs the STOP command at its end It is not to be used in direct mode Internal function TMCL instruction fetching is stopped Related commands none Mnemonic STOP Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 28 don t care don t care don t care Example Mnemonic STOP Binary Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Instruction Number Type Motor Bank Operan...

Page 63: ...be sent When bit 7 of the bus number is set this value is ignored and the contents of the accumulator are sent instead Please note that in the TMCL IDE always all three values have to be specified when sending the contents of the accumulator the value parameter is a dummy parameter Related commands SIO GIO Mnemonic SAC bus number number of bytes send data Binary representation INSTRUCTION NO TYPE ...

Page 64: ...OM Internal function The passed value is stored in the internal position array Related commands GCO CCO MVP Mnemonic SCO coordinate number motor number position Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 30 coordinate number 0 20 motor number position 223 223 Reply in direct mode STATUS VALUE 100 OK don t care Example Set coordinate 1 of motor 2 to 1000 Mnemonic SCO 1 2 1000 Binary B...

Page 65: ...ternal coordinate array copied to the accumulator register and in direct mode returned in the value field of the reply Related commands SCO CCO MVP Mnemonic GCO coordinate number motor number Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 31 coordinate number 0 20 motor number don t care Reply in direct mode STATUS VALUE 100 OK don t care Example Get value coordinate 1 of motor 2 Mnemoni...

Page 66: ...c CCO coordinate number motor number Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 32 coordinate number 0 20 motor number 0 2 7 don t care Choose 7 if you want to save the positions of all connected axes Now the bits 0 2 of the motor number parameter define the motors you want to work with Each of these bits stands for one motor Reply in direct mode STATUS VALUE 100 OK don t care Exampl...

Page 67: ...OT LOAD SWAP Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 33 0 ADD add X register to accu 1 SUB subtract X register from accu 2 MUL multiply accu by X register 3 DIV divide accu by X register 4 MOD modulo divide accu by x register 5 AND logical and accu with X register 6 OR logical or accu with X register 7 XOR logical exor accu with X register 8 NOT logical invert X register 9 LOAD lo...

Page 68: ... this parameter is set by hardware to the maximum speed during acceleration and to zero during deceleration and rest 3 actual speed The current rotation speed 4 maximum positioning speed Should not exceed the physically highest possible value Adjust the pulse divisor no 154 if the speed value is very low 50 or above the upper limit See TMC 428 datasheet for calculation of physical units 5 maximum ...

Page 69: ...through the microstep table in steps of 64 respectively 32 To get real full stepping use axis parameter 211 or load an adapted microstepping table If the module is specified for 16 microsteps only switching to 32 or 64 microsteps brings an enhancement in resolution and smoothness The position counter will use the full resolution but however the motor will resolve a maximum of 24 different microste...

Page 70: ...reshold and 7 high threshold The motor will be stopped if the load value exceeds the stall detection threshold Switch off mixed decay to get usable results 211 fullstep threshold When exceeding this speed the driver will switch to real full step mode To disable this feature set this parameter to zero or to a value greater than 2047 Setting a full step threshold allows higher motor torque of the mo...

Page 71: ...e used for AGP Number Global parameter Description 64 EEPROM magic Setting this parameter to a different value as E4 will cause re initialization of the axis and global parameters to factory defaults after the next power up This is useful in case of miss configuration 65 RS232 baud rate 0 9600 baud Default 1 14400 baud 2 19200 baud 3 28800 baud 4 38400 baud 5 57600 baud 6 76800 baud Not supported ...

Page 72: ...igh active 2 low active 81 TMCLTM code protection Protect a TMCLTM program against disassembling or overwriting 0 no protection 1 protection against disassembling 2 protection against overwriting 3 protection against disassembling and overwriting If you switch off the protection against disassembling the program will be erased first Changing this value from 1 or 3 to 0 or 2 the TMCLTM program will...

Page 73: ...rs of bank 1 which can be used for SGP The global parameter bank 1 is normally not available It may be used for customer specific extensions of the firmware Together with user definable commands see section 7 3 these variables form the interface between extensions of the firmware written in C and TMCLTM applications ...

Page 74: ... applications 231 231 9 general purpose variable 9 for use in TMCL applications 231 231 10 general purpose variable 10 for use in TMCL applications 231 231 11 general purpose variable 11 for use in TMCL applications 231 231 12 general purpose variable 12 for use in TMCL applications 231 231 13 general purpose variable 13 for use in TMCL applications 231 231 14 general purpose variable 14 for use i...

Page 75: ...DV clear the deviation flag modules with encoder feedback only EPO clear the position error flag modules with encoder feedback only Related commands JC Mnemonic CLE flags where flags ALL ETO EDV EPO Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 36 0 ALL all flags 1 ETO timeout flag 2 EAL alarm flag 3 EDV deviation flag 4 EPO position flag 5 ESD shutdown flag don t care don t care Exampl...

Page 76: ...rogramming of these functions Internal function Call user specific functions implemented in C by TRINAMIC Related commands none Mnemonic UF0 UF7 Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 64 71 user defined user defined user defined Reply in direct mode Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Target address Status Instruction Operand Byte3 Operand Byte2 Operand Byte1 Ope...

Page 77: ...ntation INSTRUCTION NO TYPE MOT BANK VALUE 138 don t care don t care motor bit mask The value field contains a bit mask where every bit stands for one motor bit 0 motor 0 bit 1 motor 1 bit 2 motor 2 Reply in direct mode right after execution of this command Byte Index 0 1 2 3 4 5 6 7 8 Function Target address Target address Status Instruction Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0...

Page 78: ...trol GmbH Co KG 6 7 34BIN return to binary mode This command can only be used in ASCII mode It quits the ASCII mode and returns to binary mode Related Commands none Mnemonic BIN Binary representation This command does not have a binary representation as it can only be used in ASCII mode ...

Page 79: ...tarted or continued 0 run from current address 1 run from specified address don t care don t care starting address 130 step application only the next command of a TMCL application is executed don t care don t care don t care 131 reset application the program counter is set to zero and the standalone application is stopped when running or stepped don t care don t care don t care 132 start download ...

Page 80: ...ing the CAN bus interface just send this command in an eight byte frame instead of a seven byte frame Then eight bytes will be sent back so you will get all characters of the version string Type set to 1 version number in binary format Please use the normal reply format The version number is output in the value field of the reply in the following way Byte index in value field Contents 1 Version nu...

Page 81: ...e divisor no 154 if the speed value is very low 50 or above the upper limit See TMC 428 datasheet for calculation of physical units 0 2047 RWE 5 maximum acceleration The limit for acceleration and deceleration Changing this parameter requires re calculation of the acceleration factor no 146 and the acceleration divisor no 137 which is done automatically See TMC 428 datasheet for calculation of phy...

Page 82: ...rostep resolution 0 full step 1 half step 2 4 microsteps 3 8 microsteps 4 16 microsteps 5 32 microsteps 6 64 microsteps Note that modifying this parameter will affect the rotation speed in the same relation The full step setting and the half step setting are not optimized for use without an adapted microstepping table These settings just step through the microstep table in steps of 64 respectively...

Page 83: ...be set to 1 which turns on mixed decay permanently also in the rising part of the microstep wave This can be used to fix microstep errors 0 2048 or 1 RWE 204 freewheeling Time after which the power to the motor will be cut when its velocity has reached zero 0 65535 0 never msec RWE 205 stall detection threshold Stall detection threshold Set it to 0 for no stall detection or to a value between 1 lo...

Page 84: ...TMCM 310 TMCL Firmware Manual V1 02 2011 JAN 11 84 Copyright 2011 TRINAMIC Motion Control GmbH Co KG Please use the TMCL IDE axis parameter calculation tool for getting best values ...

Page 85: ...ber Parameter 0 datagram low word read only 1 datagram high word read only 2 cover datagram position 3 cover datagram length 4 cover datagram contents 5 reference switch states read only 6 TMC428 SMGP register 7 22 driver chain configuration long words 0 15 23 38 microstep table long word 0 15 Parameters 64 132 Parameters with numbers from 64 on configure stuff like the serial address of the modul...

Page 86: ...nlocked 0 1 RWE 75 telegram pause time Pause time before the reply via RS232 is sent For RS232 set to 0 For CAN interface this parameter has no effect 0 255 RWE 76 serial host address Host address used in the reply telegrams sent back via RS232 0 255 RWE 77 auto start mode 0 Do not start TMCLTM application after power up default 1 Start TMCLTM application automatically after power up 0 1 RWE 80 sh...

Page 87: ...ion status 0 stop 1 run 2 step 3 reset 0 3 R 129 download mode 0 normal mode 1 download mode 0 1 R 130 TMCLTM program counter The index of the currently executed TMCLTM instruction R 132 tick timer A 32 bit counter that gets incremented by one every millisecond It can also be reset to any start value RW 133 random number Choose a random number Read only 0 21474 83647 R ...

Page 88: ... Co KG 8 2 Bank 1 The global parameter bank 1 is normally not available It may be used for customer specific extensions of the firmware Together with user definable commands see section 7 3 these variables form the interface between extensions of the firmware written in C and TMCLTM applications ...

Page 89: ...use in TMCL applications 231 231 RWE 6 general purpose variable 6 for use in TMCL applications 231 231 RWE 7 general purpose variable 7 for use in TMCL applications 231 231 RWE 8 general purpose variable 8 for use in TMCL applications 231 231 RWE 9 general purpose variable 9 for use in TMCL applications 231 231 RWE 10 general purpose variable 10 for use in TMCL applications 231 231 RWE 11 general ...

Page 90: ...ch share the same electrical function Until the reference switch is found for the first time the searching speed is identical to the maximum positioning speed axis parameter 4 unless reduced by axis parameter 194 After hitting the reference switch the motor slowly moves right until the switch is released Finally the switch is re entered in left direction setting the reference point to the center o...

Page 91: ...hold if needed ROL 0 500 Let the motor run or use ROR or other velocity Loop GAP 3 0 COMP 0 JC NE Loop Wait until the motor has stopped SAP 1 0 0 Set this position as the zero position Do not use RFS in this case Mixed decay should be switched off when stallGuard is operational in order to get usable results 9 3 Fixing microstep errors Due to the zero crossing problem of the TMC236 TMC246 stepper ...

Page 92: ...n history 10 1Firmware revision Version Date Author Description 3 37 2008 OKT 11 OK Most recent version 10 2Document revision Version Date Author Description 1 00 2009 OKT 15 SD Initial version 1 01 2009 OKT 27 SD Axis parameters 194 and 195 corrected 1 02 2011 JAN 11 SD Value range of axis parameter 6 corrected ...

Page 93: ...e Manual V1 02 2011 JAN 11 93 Copyright 2011 TRINAMIC Motion Control GmbH Co KG 11 References TMCL TMCL reference and programming manual see http www trinamic com TMCM 310 TMCM 310 Hardware Manual see http www trinamic com ...

Reviews: