Home

TMCL Firmware Manual - TMCM-3110

image

Contents

1. TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 25 2 7 3 MST motor stop The motor will be instructed to stop Internal function the axis parameter target velocity is set to zero Related commands ROL ROR SAP GAP Mnemonic MST lt motor gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 3 don t care lt moror don t care 0 2 Reply in direct mode STATUS VALUE 100 OK don t care Example Stop motor 0 Mnemonic MST 0 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 03 00 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 26 2 7 4 MVP move to position With this command the motor will be instructed to move to a specified relative or absolute position It will use the acceleration deceleration ramp and the positioning speed programmed into the unit This command is non blocking that is a reply will be sent immediately after command interpretation and initialization of the motion controller Further commands may follow without waiting for the motor reaching its end position The maximum velocity and acceleration are defined by axis parameters 4 and 5 The range of the MVP command is 32 bit signed 2 147 483 648 2 147 483 647 Positioning can be i
2. ven af acceleration in fullsteps Example Signal Value lar 16 MHz velocity 1000 a_max 1000 pulse div 1 ramp_div 1 srs 6 16M Az 1000 Af Fo 12207031Hz 2 2048 32 12207031 fsfLHz g 190734Hz 2 SE 16Mhz 1000 MHz a G29 119 21 2 Ss MHz 11921 MHz af g 1 863 2 S 3 4 2 1 Calculation of Number of Rotations A stepper motor has e g 72 fullsteps per rotation SF 1907 34 RPS 26 49 fullstepsper rotation 72 Ssf 60 190734 60 RPM 158946 fullstepsper rotation 72 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 84 3 5 Encoder Prescaler The calculation of the prescaler is based on the encoder resolution and the microstep resolution of the motor Choose a prescaler value before working with encoder feedback For selecting a prescaler the following formula is valid motor resolution usteps rescaler P encoder resolution encoder steps Multiply the prescaler with the factor 10000 decimal mode or the factor 65536 binary mode and set the resulting prescaler value p with command SAP 210 0 lt p gt Note that only integer numbers can be used for p In case the decimal value does not fit try the binary one The encoder mode binary or decimal can be selected with axis parameter 201 The following table shows example values Motor resolution
3. Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 18 00 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 48 2 7 22 WAIT wait for an event to occur This instruction interrupts the execution of the TMCL program until the specified condition is met This command is intended for standalone operation only The host address and the reply are only used to take the instruction to the TMCL program memory while the program loads down This command cannot be used in direct mode THERE ARE FIVE DIFFERENT WAIT CONDITIONS THAT CAN BE USED TICKS Wait until the number of timer ticks specified by the lt ticks gt parameter has been reached POS Wait until the target position of the motor specified by the lt motor gt parameter has been reached An optional timeout value 0 for no timeout must be specified by the lt ticks gt parameter REFSW Wait until the reference switch of the motor specified by the lt motor gt parameter has been triggered An optional timeout value 0 for no timeout must be specified by the lt ticks gt parameter LIMSW Wait until a limit switch of the motor specified by the lt motor gt parameter has been triggered An optional timeout value 0 for no timeout must be specified by the lt ticks gt parameter
4. www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 31 CLE clear error flags This command clears the internal error flags The CLE command is intended for use in standalone mode only and must not be used in direct mode THE FOLLOWING ERROR FLAGS CAN BE CLEARED BY THIS COMMAND DETERMINED BY THE lt FLAG gt PARAMETER ALL clear all error flags ETO clear the timeout flag EAL clear the external alarm flag EDV clear the deviation flag EPO clear the position error flag Related commands JC Mnemonic CLE lt flags gt where lt flags gt ALL ETO EDV EPO Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 0 ALL all flags 1 ETO timeout flag 2 EAL alarm fla 36 3 EDV EE flag don t care don t care 4 EPO position flag 5 ESD shutdown flag Example Reset the timeout flag Mnemonic CLE ETO Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 24 01 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 32 VECT set interrupt vector 58 The VECT command defines an interrupt vector It needs an interrupt number and a label as parameter like in JA JC and CSUB commands
5. STATUS VALUE 100 OK don t care Example Copy the actual value of the accumulator to coordinate 1 of motor 0 Mnemonic ACO 1 0 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 27 01 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 28 CALCX calculate using the X register This instruction is very similar to CALC but the second operand comes from the X register The X register can be loaded with the LOAD or the SWAP type of this instruction The result is written back to the accumulator for further processing like comparisons or data transfer Related commands CALC COMP JC AAP AGP Mnemonic CALCX lt operation gt Binary representation INSTRUCTION NO TYPE lt operation gt MOT BANK VALUE 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 33 5 AND logical and accu with X register don t care don t care 6 OR logical or accu with X register 7 XOR logical exor accu with X register 8 NOT logical invert X register 9 LOAD load accu to X register 10 SWAP swap accu with X register Example Multiply accu by X register Mnemonic
6. Value MSB first Checksum The checksum is also calculated by adding up all the other bytes using an 8 bit addition When using CAN bus the first byte reply address and the last byte checksum are left out Do not send the next command before you have received the reply 2 2 1 Status Codes The reply contains a status code The status code can have one of the following values Code Meaning 100 Successfully executed no error 101 Command loaded into TMCL program EEPROM Wrong checksum Invalid command Wrong type Invalid value Configuration EEPROM locked Command not available HD uBR wl rn Re www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 16 2 3 Standalone Applications The module is equipped with an EEPROM for storing TMCL applications You can use TMCL IDE for developing standalone TMCL applications You can load them down into the EEPROM and then it will run on the module The TMCL IDE contains an editor and the 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 2 4 TMCL Command Overview 2 4 1 TMCL Commands Command Number Pa
7. Byte index in value field Contents 1 DC 2 26 3 Version number low byte 4 Version number high byte www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 68 3 Axis Parameters The following sections describe all axis parameters that can be used with the SAP GAP AAP STAP and RSAP commands MEANING OF THE LETTERS IN COLUMN ACCESS Access Related Description type command s R GAP Parameter readable W SAP AAP Parameter writable E STAP RSAP Parameter automatically restored from EEPROM after reset or power on These parameters can be stored permanently in EEPROM using STAP command and also explicitly restored copied back from EEPROM into RAM using RSAP Basic parameters should be adjusted to motor application for proper module operation Parameters for the more experienced user please do not change unless you are absolutely sure Note smartEnergy is an earlier name for coolStep Number Axis Parameter Description Range Unit Acc 0 Target next The desired position in position mode see 2 RW position ramp mode no 138 usteps 1 Actual position The current position of the motor Should 2 RW only be overwritten for reference point ysteps setting 2 Target next The desired speed in velocity mode see ramp 2047 RW speed mode no 138 In position mode this
8. I O Connector Pin I O port Command Range 0 7 OUT_O GIO 0 2 lt n gt 1 0 0 8 OUT_1 GIO 1 2 lt n gt 1 0 0 9 OUT d GIO 2 2 lt n gt 1 0 0 10 OUT_3 GIO 3 2 lt n gt 1 0 1 7 OUT A GIO 4 2 lt n gt 1 0 1 8 OUT_5 GIO 5 2 lt n gt 1 0 1 9 OUT_6 GIO 6 2 lt n gt 1 0 1 10 OUT_7 GIO 7 2 lt n gt 1 0 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 16 CALC calculate A value in the accumulator variable previously read by a function such as GAP get axis parameter can be modified with this instruction Nine different arithmetic functions can be chosen and one constant operand value must be specified The result is written back to the accumulator for further processing like comparisons or data transfer Related commands CALCX COMP JC AAP AGP GAP GGP GIO Mnemonic CALC lt operation gt lt value gt Binary representation INSTRUCTION NO TYPE lt operation gt MOT BANK VALUE 19 0 ADD add to accu don t care lt operand gt 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 operand to accu Example Multiply accu by 5000 Mnemonic CALC MUL 5000 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Typ
9. TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 36 2 7 13 RFS reference search The TMCM 3110 has a built in reference search algorithm which can be used The reference search algorithm provides switching point calibration and three switch modes The status of the reference search can also be queried to see if it has already finished In a TMCL program it is better to use the WAIT command to wait for the end of a reference search Please see the appropriate parameters in the axis parameter table to configure the reference search algorithm to meet your needs chapter 3 The reference search can be started stopped and the actual status of the reference search 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 lt START STOP STATUS gt lt motor gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE O START start ref search emoter 13 1 STOP abort ref search 0 2 see below 2 STATUS get status z Reply in direct mode When using type 0 START or 1 STOP STATUS VALUE 100 OK don t care When using type 2 STATUS STATUS VALUE 100 OK 0 no ref search active other values ref search active Example Start reference search of motor 0 Mnemonic RFS START 0 Binary Byte Index 0 1 2 3 4 5 6 7 Funct
10. This label must be the entry point of the interrupt handling routine Related commands EI DI RETI Mnemonic VECT lt interrupt number gt lt label gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 37 lt interrupt number gt don t care lt label gt The following table shows all interrupt vectors that can be used Interrupt number Interrupt type 0 Timer 0 1 Timer 1 2 Timer 2 3 Target position reached 0 4 Target position reached 1 5 Target position reached 2 15 stallGuard2 axis 0 16 stallGuard2 axis 1 17 stallGuard2 axis 2 21 Deviation axis 0 22 Deviation axis 1 23 Deviation axis 2 27 Left stop switch 0 28 Right stop switch 0 29 Left stop switch 1 30 Right stop switch 1 31 Left stop switch 2 32 Right stop switch 2 39 Input change 0 40 Input change 1 41 Input change 2 42 Input change 3 43 Input change 4 44 Input change 5 45 Input change 6 46 Input change 7 255 Global interrupts Example Define interrupt vector at target position 500 VECT 3 500 Binary format of VECT Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 25 03 00 00 00 01 SEA www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014
11. 201 Encoder mode Operation mode of the encoder bit 1 bit 2 bit 3 Reversal of rotation direction Clear encoder on null channel event 0 Clear encoder only on next null channel event 1 Clear encoder on every null channel event Null channel polarity active high when set bit 5 0 Binary mode 1 Decimal mode bit 4 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 206 Actual load value Readout of the actual load value used for stall detection stallGuard2 0 1023 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 74 Number Axis Parameter Description Range Unit Acc 207 Extended error 1 Motor stopped because of 1 3 R flags stallGuard2 detection 2 Motor stopped because of encoder deviation 3 Motor stopped because of 1 and 2 Will be reset automatically by the next motion command 208 TMC262 driver Bit 0 stallGuard2 status 0 1 R error flags 1 threshold reached Bit 1 Overtemperature 1 driver is shut down due to overtemperature Bit 2 Pre warning overtemperature 1 Threshold is exceeded Bit 3 Short to ground A 1 Short condition detected driver currently shut down Bit 4 Short to ground B 1 Short condition detected driver currently shut down Bit 5 Open load A 1 no chopp
12. www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 66 2 7 38 BIN 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 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 67 2 7 39 TMCL Control Functions There are several TMCL control functions but for the user are only 136 and 137 interesting Other control functions can be used with axis parameters Instruction number Type Command Description 136 0 string Firmware version Get the module type and firmware revision as a 1 binary string or in binary format Motor Bank and Value are ignored 137 don t care Reset to factory Reset all settings stored in the EEPROM to their defaults factory defaults This command does not send back a reply Value must be 1234 FURTHER INFORMATION ABOUT COMMAND 136 Type set to 0 reply as a string Byte index Contents 1 Host Address d 9 Version string 8 characters e g 3110V106 There is no checksum in this reply format 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
13. RFS Wait until the reference search of the motor specified by the lt motor gt field has been reached An optional timeout value 0 for no timeout must be specified by the lt ticks gt 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 program counter is held until the specified condition is met Related commands JC CLE Mnemonic WAIT lt condition gt lt motor gt lt ticks gt Binary representation INSTRUCTION NO TYPE lt condition gt MOT BANK VALUE O TICKS timer ticks don t care lt no of ticks gt EE 1 POS target position reached KSC De timeout lt motor gt lt no of ticks for timeout gt 27 2 REFSW reference switch 0 2 0 for no timeout 3 LIMSW limit switch lt motor gt lt no of ticks for timeout gt 0 d 0 for no timeout A RES creiren search Gommmletad lt motor gt lt no of ticks for timeout gt 0 d 0 for no timeout 1 one tick is 10 milliseconds Example Wait for motor 0 to reach its target position without timeout Mnemonic WAIT POS 0 0 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 1b 01 00 00 00 00 00
14. Internal function the passed value is stored in the internal position array Related commands GCO CCO MVP Mnemonic SCO lt coordinate number gt lt motor gt lt position gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 30 lt coordinate number gt lt motor gt lt position gt 0 20 0 2 2 EE Reply in direct mode STATUS VALUE 100 OK don t care Example Set coordinate 1 of motor to 1000 Mnemonic SCO 1 0 1000 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 Sie 01 00 00 00 03 e8 Two special functions of this command have been introduced that make it possible to copy all coordinates or one selected coordinate to the EEPROM These functions can be accessed using the following special forms of the SCO command SCO 0 255 0 copies all coordinates except coordinate number 0 from RAM to the EEPROM SCO lt coordinate number gt 255 0 copies the coordinate selected by lt coordinate number gt to the EEPROM The coordinate number must be a value between 1 and 20 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 51 2 7 25 GCO get coordinate This command makes possible to read out a previously stored coordinate In standalone mode th
15. 350 Mnemonic ROR 2 350 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 01 00 02 00 00 01 5e www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 24 2 7 2 ROL rotate left The motor will be instructed to rotate with a specified velocity opposite direction compared to ROR decreasing the position counter Internal function first velocity mode is selected Then the velocity value is transferred to axis parameter 0 target velocity The module is based on the TMC429 stepper motor controller and the TMC262 power driver This makes possible choosing a velocity between 0 and 2047 Related commands ROR MST SAP GAP Mnemonic ROL lt motor gt lt velocity gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE lt motor gt lt velocity gt SE 0 2 0 2047 Reply in direct mode STATUS VALUE 100 OK don t care Example Rotate left motor 0 velocity 1200 Mnemonic ROL 0 1200 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 02 00 00 00 00 04 b0 www trinamic com
16. MODULE FOR STEPPER MOTORS MODULE Firmware Version V1 09 TMCL FIRMWARE MANUAL e i TMCM 3110 3 Axis Stepper Controller Driver 2 8A 48V USB RS485 and CAN Step Dizr Interface Encoder Interface MES SE CERT Ear E as coolStep stallGuard2 A TRINAMIC Motion Control GmbH amp Co KG Hamburg Germany www trinamic com MOTION CONTROL TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 Table of Contents T F abt tegen eet AE ake ia ala ane ee eae 4 1 1 Getting Started How to Run a Motor ENEE 6 1 1 1 Start the TMCL IDE Software Development Environment EE 10 1 12 Using TMCL Durect ModE eteg nsig enee raa a REENEN een 11 1 13 Important Mot r Settings siirsin dade desingen tated cep adadiunndilend i a iendane eaa aasi iii 12 1 2 Testing with a Simple TMCL Program 13 2 TMCkand the TMCL IDE Introduction ssop el bale baa Learn a eai 14 2 1 Binary Command Formatera SEENEN ee 14 2 2 e ME EE 15 22t Status EE 15 2 3 Standalone AppltCa opgerass eege ew kaw shiten etn Md nee CA ees 16 24 ENGL G mmand Eupen eebe ete ee Eee Lele be 16 ZAR TMGE Commands a aneii tha debatable iia ad aa tans hoch ee bid 16 2 4 2 Commands Listed According to Subject Area EE 17 2 5 The KL HR a EL 21 2 6 The ASCH Iitera enie ai aia it dee alae 21 2 6 1 Format of the Command Dne sitinc asseetaeieeatena eer dunlawenaaliedavianianeneaate 21 26 2 Format ofa RED ly tosis e besten eden deele
17. www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 49 2 7 23 STOP stop TMCL program execution This function stops executing a TMCL program The host address and the reply are only used to transfer the instruction to the TMCL program memory The STOP command should be placed at the end of every standalone TMCL program 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 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 1c 00 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 50 2 7 24 SCO set coordinate Up to 20 position values coordinates can be stored for every axis for use with the MVP COORD command This command sets a coordinate to a specified value Depending on the global parameter 84 the coordinates are only stored in RAM or also stored in the EEPROM and copied back on startup with the default setting the coordinates are stored in RAM only Please note that the coordinate number 0 is always stored in RAM only
18. download mode 130 TMCL program The index of the currently executed TMCL R counter instruction 132 Tick timer A 32 bit counter that gets incremented by one RW every millisecond It can also be reset to any start value 133 Random number Choose a random number 0 2147483647 R With most RS485 converters that can be attached to the COM port of a PC the data direction is controlled by the RTS pin of the COM port Please note that this will only work with Windows 2000 Windows XP or Windows NT4 not with Windows 95 Windows 98 or Windows ME due to a bug in these operating systems Another problem is that Windows 2000 XP NT4 switches the direction back to receive too late To overcome this problem set the telegram pause time global parameter 75 of the module to 15 or more if needed by issuing an SGP 75 0 15 command in direct mode The parameter will automatically be stored in the configuration EEPROM www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 4 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 6 3 these variables form the interface between extensions of the firmware written in C and TMCL applications 4 3 Bank 2 Bank 2 contains general purpose 32 bit variables for the use in TMCL applications They are located in RAM and can be stored to
19. gie differential inverting 5 Be Input Encoder channel B input differential non inverting 6 B Input Encoder channel B input differential inverting Input Encoder zero index channel input 7 N l differential non inverting 8 N Input Encoder zero index channel input differential inverting c Connect reference switches For each stepper motor axis a separate reference limit switch input connector is available Pin Label Direction Description 1 GND Power GND Signal and system ground 2 5V Power Supply 5V output for external circuit output Input Input for reference limit switch left integrated pull up 3 REF_L to 5V 4 REF_R Input Input for reference limit switch right integrated pull up to 5V 5 Switch ON the power supply Turn power ON The green LED for power flashes and the motor is powered but in standstill now If this does not occur switch power OFF and check your connections as well as the power supply www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 10 1 1 1 Start the TMCL IDE Software Development Environment The TMCL IDE is available on www trinamic com PROCEED AS FOLLOWS Make sure the COM port you intend to use is not blocked by another program Open TMCL IDE by clicking TMCL exe Choose Setup and Options and thereafter the Connection tab Choose COM port and type with the parameters
20. www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 33 2 7 10 GGP get global parameter All global parameters can be read with this function Global parameters are related to the host interface peripherals or application specific variables The different groups of these parameters are organized in banks to allow a larger total number for future products Currently only bank O and 1 are used for global parameters and bank 2 is used for user variables Bank 3 is used for interrupt configuration For a table with parameters and bank numbers which can be used together with this command please refer to chapter 4 Internal function the parameter is read out of the correct position in the appropriate device The parameter format is converted adding leading zeros or ones for negative values Related commands SGP STGP RSGP AGP Mnemonic GGP lt parameter number gt lt bank number gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 10 lt parameter number gt lt bank number gt don t care Reply in direct mode STATUS VALUE 100 OK don t care Example Get the serial address of the target device Mnemonic GGP 66 0 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 0a 42 00 00 00 00
21. 00 Reply Byte Index 0 1 2 3 4 5 6 7 Function Host Target Status Instruction Operand Operand Operand Operand address address Byte3 Byte2 Byte1 Byte0 Value hex 02 01 64 0a 00 00 00 01 gt Status no error value 1 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 11 STGP store global parameter This command is used to store TMCL user variables permanently in the EEPROM of the module Some global parameters are located in RAM memory so without storing modifications are lost at power down This instruction enables enduring storing Most parameters are automatically restored after power up 34 For a table with parameters and bank numbers which can be used together with this command please refer to chapter 4 Internal function the specified parameter is copied from its RAM location to the configuration EEPROM Related commands SGP GGP RSGP AGP Mnemonic STGP lt parameter number gt lt bank number gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 11 lt parameter number gt lt bank number gt don t care Reply in direct mode STATUS VALUE 100 OK don t care Example Store the user variable 42 Mnemonic STGP 42 2 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Ban
22. A MVP ABS 1 50000 AROL 2 500 A MST 1 ABIN The command lines above address the module with address 1 To address e g module 3 use address character C instead of A The last command line shown above will make the module return to binary mode 2 6 2 Format of a Reply After executing the command the module sends back a reply in ASCII format The 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 lt CR gt character www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 22 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 to 2 and the module address is 1 The value 100 is the status code 100 that means command successfully executed 2 6 3 Configuring the ASCII Interface The module can be configured so that it starts up either in binary mode or in ASCII mode Global parameter 67 is used for this purpose please see also chapter 4 1 Bit O determines the startup mode if this bit is set the module starts up in ASCII mode else it will start up in binary mode default Bit 4 and Bit 5 determine how the characters that are entered are echoed back Normally both bits are set to zero In this case every character that is entered is echoed b
23. Ale 79 3 3 1 Reference Search Modes Axis Parameter 19731 80 3 4 Calculation Velocity and Acceleration vs Microstep and Fullstep Frequenccy c ccscssseeseseseeeees 82 ZAIT Microstep Frequency ennaa r p a a aa eaa aeaa aaa aa AEE Aaaa Eaa Aae aE Aaaa ra ENa aaant 82 342 Fullstep Frequency srania ele 83 3 5 Encoder Prescalei sutien ai teh babe lithe aar eea iaaa ia 84 4 Gl balParimeters oseas iae e e a aeaee aer aa tee tte elles e 85 4 1 Boks A EE 85 4 2 Sa A E T A E T E A ATA 88 4 3 GIE 88 4 4 Baik EE 89 5 MCL Programming Techniques and Structure ENEE 90 5 1 Mita ZAC O EEN 90 5 2 Main LOO o EE kde Naidaa hie Nia A alokad E 90 5 3 Using Symbolic gl EE 90 5 4 Using Variables seess aici ea wines wine dad AER laa 91 5 5 Using S broutines d Eelere Ee EA a oe 91 5 6 Mixing Direct Mode and Standalone Mode EEN 91 6 kife Support Policy 2c eer heave ice tient me ends iat tonearm Ee 93 F Revision HISTO NY EE 94 7 1 Firmware REVISION 2iwsaiciecek icine a Raa aiaiai daia eae 94 7 2 DOCUMENT REVISION EE 94 8 lt Referente Snahy atch tote gedeelter 94 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 4 1 Features The TMCM 3110 is a compact 3 axes stepper motor controller driver module for 2 phase bipolar stepper motors It is highly integrated offers a convenient handling and can be used in many decentralized applications The TMCM 3110 supports up to 3 bipolar stepper motors with up
24. BANK VALUE 32 lt coordinate number gt lt motor gt don t care 0 20 0 2 Reply in direct mode STATUS VALUE 100 OK don t care Example Store current position of the axis 0 to coordinate 3 Mnemonic CCO 3 0 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 20 03 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 53 2 7 27 ACO accu to coordinate With the ACO command the actual value of the accumulator is copied to a selected coordinate of the motor Depending on the global parameter 84 the coordinates are only stored in RAM or also stored in the EEPROM and copied back on startup with the default setting the coordinates are stored in RAM only Please note also that the coordinate number 0 is always stored in RAM only For Information about storing coordinates refer to the SCO command Internal function the actual value of the accumulator is stored in the internal position array Related commands GCO CCO MVP COORD SCO Mnemonic ACO lt coordinate number gt lt motor gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE lt coordinate number gt lt motor gt 2 o 20 0 2 dot cate Reply in direct mode
25. Encoder resolution Encoder Prescaler TMCL command SAP 210 for usteps encoder steps setting prescaler value lt p gt decimal SAP 210 0 500000 See E 20 binary SAP 210 0 3276800 decimal SAP 210 0 250000 ote E 8 binary SAP 210 0 1638400 decimal SAP 210 0 125000 one aye 12 3 binary SAP 210 0 819200 decimal SAP 210 0 15625 31200 Feron EE binary SAP 210 0 102400 decimal 12809 SE Pees binary SAP 210 0 25600 decimal SH E SE binary SAP 210 0 51200 51200 10000 5 12 decimal SAP 210 0 51200 binary 51200 20000 256 decimal SAP 210 0 25600 binary 51200 40000 1 28 decimal SAP 210 0 12800 binary 51200 2000 25 6 decimal SAP 210 0 25600 binary READING OUT AND OR CHANGING THE ENCODER COUNTER The encoder counter can be read out by software in order to control the exact position of the motor This way closed loop operation can be realized To read out or to change the position value of the encoder axis parameter 209 is used TMCL Commands to read out the encoder position of motor 0 1 2 GAP 209 0 GAP 209 1 GAP 209 2 TMCL commands for changing the position values of motor 0 1 2 GAP 209 0 lt n gt with n 0 1 2 GAP 209 1 lt n gt with n 0 1 2 GAP 209 2 lt n gt with n 0 1 2 AUTOMATIC MOTOR STOP ON DEVIATION ERROR Automatic motor stop on deviation error is also usable This function can be set using axis parameter 212 maximum
26. TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 21 2 5 The ASCII Interface 2 6 The ASCII Interface There is also an ASCII interface that can be used to communicate with the module and to send some commands as text strings THE FOLLOWING COMMANDS CAN BE USED IN ASCII MODE ROL ROR MST MVP SAP GAP STAP RSAP SGP GGP STGP RSGP RFS SIO GIO SCO GCO CCO UFO UF1 UF2 UF3 UF4 UF5 UF6 and UEL Note Only direct mode commands can be entered in ASCII mode SPECIAL COMMANDS WHICH ARE ONLY AVAILABLE IN ASCII MODE BIN This command quits ASCII mode and returns to binary TMCL mode RUN This command can be used to start a TMCL program in memory STOP Stops a running TMCL application ENTERING AND LEAVING ASCII MODE 1 The ASCII command line interface is entered by sending the binary command 139 enter ASCII mode 2 Afterwards the commands are entered as in the TMCL IDE 3 For leaving the ASCII mode and re enter the binary mode enter the command BIN 2 6 1 Format of the Command Line As the first character the address character has to be sent The address character is A when the module address is 1 B for modules with address 2 and so on After the address character there may be spaces but this is not necessary Then send the command with its parameters At the end of a command line a lt CR gt character has to be sent EXAMPLES FOR VALID COMMAND LINES AMVP ABS 1 50000
27. an interrupt handling routine using the VECT command If necessary configure the interrupt using an SGP lt type gt 3 lt value gt command Enable the interrupt using an EI lt interrupt gt command Globally enable interrupts using an EI 255 command An interrupt handling routine must always end with a RETI command The following example shows the use of a timer interrupt VECT o TimeroIrg define the interrupt vector SGP o 3 1000 configure the interrupt set its period to 1000ms EI o enable this interrupt EI 255 globally switch on interrupt processing Main program toggles output 3 using a WAIT command for the delay Loop SIO 3 2 1 WAIT TICKS 0 50 SIO 3 2 0 WAIT TICKS 0 50 JA Loop Here 1s the interrupt handling routine Timerolrq GIO o 2 check if OUTo is high JC NZ OutoO fFf jump if not SIO o 2 1 switch OUTo high RETI end of interrupt OutoOff SIO o 2 0 switch OUTo low RETI end of interrupt In the example above the interrupt numbers are used directly To make the program better readable use the provided include file Interrupts inc This file defines symbolic constants for all interrupt numbers which can be used in all interrupt commands The beginning of the program above then looks like the following include Interrupts inc VECT TI_TIMERo TimerolIrq SGP TI_TIMERo 3 1000 EI TI_TIMERo EI TI_GLOBAL Please also take a look at the other example programs www trinamic com
28. dats ee a a ai rea akaa 21 2 6 3 Configuring the ASCII Interface NEEN 22 2 1 eteina 0a no EEP EEE E E E E A O A E R 23 EN E BE Ile E 23 che ROL rotate lett osansa E EEA E E 24 2 123 Ee eet 25 2 7 4 MVP move to position ENEE 26 2 7 5 SAP set axis parameter cccscscsscsssssssssesssssssessessssessesessessssnssessesnssesnssesseenesessessesessssnesesaeenesesateneseeateneseees 28 2 1 6 GAP get axis parameter seess 29 2l STAP Ietore axis B tatnetetk stier dereen ERNEIEREN 20 2 7 8 RSAP restore axis parameter ENEE 31 2 19 SGP set global parameter isane giant BEE AE lle a ata 32 2 7 10 GGP get global parameter EEN 33 2 7 11 STGP store global parameter ENEE 34 2 7 12 RSGP restore global parameter dee r SEENEN 35 LLI RES reference sealihjosrasniantesni tinara EAR 36 2 0 14 SO set input OUTPUT EE 37 2 7 15 GIO get input OUtPUt nenesa E REA E A A Ae AEEA EAEE E AEEA E 39 2 716 CALE calculate niee E EEE T EEEE 42 SET COMP CcOmp are a a A N NAAR AEE A ER EA N RES AEAEE 43 erg JC GUM p CONGITION AD asrsnia enaa A A E e R a a a 44 SH JA Gump always cccovidensussizasceandcsausiicasdtavadsanebibcaacdasnd canutgiststdsusniichadhabesddebsasidhadishs a deen 45 2 7 20 CSUB call subroutnel ou e cesecsesessssessessssessesussessesussessesussesaesncsussesussusuesucsesnesussusnesusaeenesusauenesesateneseeateneenees 46 2 7 21 RSUB return from SUbDrOUTINE cccessessesessessesesessesecssssesessessese
29. deviation The function is turned off if the maximum deviation is set to 0 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 85 4 Global Parameters GLOBAL PARAMETERS ARE GROUPED INTO 4 BANKS bank 0 global configuration of the module bank 1 user C variables bank 2 user TMCL variables bank 3 interrupt configuration Please use SGP and GGP commands to write and read global parameters 4 1 Bank 0 PARAMETERS 0 38 The first parameters 0 38 are only mentioned here for completeness They are used for the internal handling of the TMCL IDE and serve for loading microstep and driver tables Normally these parameters remain untouched If you want to use them for loading your specific values with your PC software please contact TRINAMIC and ask how to do this Otherwise you might cause damage on the motor driver Number Parameter datagram low word read only datagram high word read only cover datagram position cover datagram length cover datagram contents reference switch states read only HD uj wl rms rR o TMC429 SMGP register pee 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 module RS485 baud rate or the CAN bit rate Change these parameters to m
30. interface pin D SUB male CAN 2 0B communication interface 9pin D SUB male USB 2 0 full speed 12Mbit s communication interface mini USB connector Software TMCL remote direct mode and standalone operation Memory for up to 1024 TMCL commands Fully supported by TMCL IDE PC based integrated development environment Electrical data Supply voltage 10V 48V DC Motor current up to 2 8A RMS programmable per axis Safety features Integrated protection overtemperature undervoltage Mechanical data Board size 130mm x 100mm height 30mm max 4 mounting holes for M3 screws Please see separate TMCM 3110 TMCL Hardware Manual for additional information www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 5 TRINAMICs UNIQUE FEATURES EASY TO USE WITH TMCL stallGuard2 stallGuard2 is a high precision sensorless load measurement using the back EMF on the coils It can be used for stall detection as well as other uses at loads below those which stall the motor The stallGuard2 measurement value changes linearly over a wide range of load velocity and current settings At maximum motor load the value goes to zero or near to zero This is the most energy efficient point of operation for the motor Load stallGuard2 Nm Initial stallGuard2 SG value 100 Max load stallGuard2 SG value 0 Maximum load reached aie Motor close to stall K Motor s
31. might cause motor damage 7 Standby current The current limit two seconds after the motor has 0 255 stopped Inoar lt value zm a Irms lt value gt x 29A 255 140 Microstep full step 0 8 resolution half step 4 microsteps 8 microsteps 16 microsteps 32 microsteps 64 microsteps 128 microsteps 256 microsteps OANA UL WNFP OH 16MHz microsteps 1 H i a Unit of acceleration 536870912 2PUuls_divisor ramp_divisor sec2 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 13 1 2 Testing with a Simple TMCL Program Type in the following program Loop Lasel wm ROL 0 500 WAIT TICKS 0 500 MST o ROR 0 500 WAIT TICKS 0 500 MST o SAP 4 0 500 SAP 5 0 50 MVP ABS 0 10000 WAIT POS 0 o MVP ABS 0 10000 WAIT POS 0 o JA Loop www trinamic com Download Rotate motor O with speed 500 Rotate motor O with speed 500 Set max Velocity Set max Acceleration Move to Position 10000 Wait until position reached Move to Position 10000 Wait until position reached Infinite Loop Assemble BS Ek gell Te stop Run Click the Assemble icon to convert the TMCL program into binary code Then download the program to the TMCM 3110 module by clicking the Download icon Click the Run icon The desired program will be executed Click the Stop button to stop the program TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 201
32. quarter of the maximum positioning speed by default axis parameter 195 Set one of the values for axis parameter 193 for selecting the reference search mode PARAMETERS NEEDED FOR REFERENCE SEARCH Number Axis Parameter Description 9 Ref switch The logical state of the reference left switch status See the TMC 429 data sheet for the different switch modes The default has two switch modes the left switch as the reference switch the right switch as a limit stop switch 10 Right limit The logical state of the right limit switch switch status 11 Left limit switch The logical state of the left limit switch in three switch mode status 12 Right limit If set deactivates the stop function of the right switch switch disable 13 Left limit switch Deactivates the stop function of the left switch resp reference switch if set disable 141 Ref switch For three switch mode a position range where an additional switch tolerance connected to the REFL input won t cause motor stop 149 Soft stop flag If cleared the motor will stop immediately disregarding motor limits when the reference or limit switch is hit 193 Ref search mode 1 search left stop switch only 2 search right stop switch then search left stop switch 3 search right stop switch then search left stop switch from both sides A search left stop switch from both sides 5 search home switch in negative direction reverse the direction when lef
33. set with a Set Axis Parameter command SAP will be stored permanent Most parameters are automatically restored after power up Internal function an axis parameter value stored in SRAM will be transferred to EEPROM and loaded from EEPORM after next power up Related commands SAP RSAP GAP AAP Mnemonic STAP lt parameter number gt lt motor gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 7 lt parameter number gt pg don t care the value operand of this function has no effect Instead the currently used value e g selected by SAP is saved Reply in direct mode STATUS VALUE 100 OK don t care For a table with parameters and values which can be used together with this command please refer to chapter 3 The STAP command will not have any effect when the configuration EEPROM is locked refer to 4 1 In direct mode the error code 5 configuration EEPROM locked see also section 2 2 1 will be returned in this case Example Store the maximum speed of motor 0 Mnemonic STAP 4 0 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 07 04 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 8 RSAP restore axis parameter F
34. shown in Figure 1 4 baud rate 9600 Click OK USB interface If the file TMCM 3110 inf is installed correctly the module will be identified automatically lg A Options Assembler Connection Debugger Type RS232 7 R9485 USB COM pot v D H FC dk Options Pott New File 1 Configure Module COM1 S TAE Baud TMCM 3110 fei Search Module E Install OS Addes 1 stallGuard stallGuard2 amp coolStep Parameter Calculation A BLDC Configurataion Tool OK K Figure 1 4 Setup dialogue and connection tab of the TMCL IDE Please refer to the TMCL IDE User Manual for more information see www TRINAMIC com www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 11 1 1 2 Using TMCL Direct Mode PROCEED AS FOLLOWS 1 Start TMCL Direct Mode E Direct Mode 2 If the communication is established the TMCM 3110 is automatically detected If the module is not detected please check all points above cables interface power supply COM port baud rate l3 A TMCL Direct Mode TMCM 3110 TMCL Instruction Selector Instruction Motor Bank Value la ROR rotate right v 0 lt don t care 0 Motor D H 500 Si Copy Copy to editor Manual Instruction Input Address Instruction Type Motor Bank Value Datagram 1 0 0 0 10 01000000 00 00 00 00 01 Execute
35. the magnetic field of the stator and magnets in the rotor This also is the most energy efficient point of operation for the motor Stall detection means that the motor will be stopped when the load gets too high It is configured by axis parameter 174 Stall detection can also be used for finding the reference point Do not use RFS in this case PARAMETERS NEEDED FOR ADJUSTING THE STALLGUARD2 FEATURE Number Axis Parameter Description 6 absolute max The maximum value is 255 This value means 100 of the maximum current current of the module The current adjustment is within the range 0 255 and can CS Current be adjusted in 32 steps Scale 0 7 79 87 160 167 240 247 8 15 88 95 168 175 248 255 16 23 96 103 176 183 24 31 104 111 184 191 The most important motor 32 39 112 119 192 199 setting since too high 40 47 Lan 127 200 207 values might cause motor 48 55 128 135 208 215 damage 56 63 136 143 216 223 64 71 144 151 224 231 72 19 152 159 232 239 173 stallGuard2 filter Enables the stallGuarde filter for more precision of the measurement If set enable reduces the measurement frequency to one measurement per four fullsteps In most cases it is expedient to set the filtered mode before using coolStep Use the standard mode for step loss detection 0 standard mode 1 filtered mode 174 stallGuard2 This si
36. the most important commands and can be used in direct mode or in standalone mode Mnemonic Command number Meaning ROL 2 Rotate left ROR 1 Rotate right MVP 4 Move to position MST 3 Motor stop RFS 13 Reference search SCO 30 Store coordinate cco 32 Capture coordinate GCO 31 Get coordinate 2 4 2 2 Parameter Commands These commands are used to set read and store axis parameters or global parameters Axis parameters can be set independently for the axis whereas global parameters control the behavior of the module itself These commands can also be used in direct mode and in standalone mode Mnemonic Command number Meaning SAP 5 Set axis parameter GAP 6 Get axis parameter STAP 7 Store axis parameter into EEPROM RSAP 8 Restore axis parameter from EEPROM SGP 9 Set global parameter GGP 10 Get global parameter STGP 11 Store global parameter into EEPROM RSGP 12 Restore global parameter from EEPROM 2 4 2 3 Control Commands These commands are used to control the program flow loops conditions jumps etc It does not make sense to use them in direct mode They are intended for standalone mode only Mnemonic Command number Meaning JA 22 Jump always JC 21 Jump conditional COMP 20 Compare accumulator with constant value CSUB 23 Call subroutine RSUB 24 Return from subroutine WAIT 27 Wait for a specified eve
37. threshold see smartEnergy hysteresis start current increment step size Scaling 0 3 1 2 4 8 0 slow increment 3 fast increment fast reaction to rising load 172 smartEnergy The lower threshold for the stallGuard2 value 0 15 RW hysteresis start see smart Energy current up step 173 stallGuard2 filter Enables the stallGuard2 filter for more OI RW enable precision of the measurement If set reduces the measurement frequency to one measurement per four fullsteps In most cases it is expedient to set the filtered mode before using coolStep Use the standard mode for detection 0 standard mode 1 filtered mode step loss www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 72 Number Axis Parameter Description Range Unit Acc 174 stallGuard2 This signed value controls stallGuard2 64 63 RW threshold threshold level for stall output and sets the optimum measurement range for readout A lower value gives a higher sensitivity Zero is the starting value A higher value makes stallGuard2 less sensitive and requires more torque to indicate a stall 0 Indifferent value 1 63 less sensitivity 1 64 higher sensitivity 175 Slope control Determines the slope of the motor driver 0 3 RW high side outputs Set to 2 or 3 for this module or rather use the default value 0 lowest slope 3 fastest slope 176 Slop
38. 00 00 01 Sof 90 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 27 Example Move motor 0 from current position 1000 steps backward move relative 1000 Mnemonic MVP REL 0 1000 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 04 01 00 Sff Sff Sfc 18 Example Move motor 0 to previously stored coordinate 8 Mnemonic MVP COORD 0 8 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 ByteO Value hex 01 04 02 00 00 00 00 08 When moving to a coordinate the coordinate has to be set properly in advance with the help of the SCO CCO or ACO command www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 28 2 7 5 SAP set axis parameter With this command most of the motion control parameters can be specified The settings will be stored in SRAM and therefore are volatile That is information will be lost after power off Please use command STAP store axis parameter in order to store any setting permanently Internal function the parameter format is converted ignoring leading zeros or ones for neg
39. 07 values might cause motor 48 55 9128 135 208 215 damage 56 63 f 136 143 216 223 64 71 144 151 f 224 231 72 79 152 159 f 232 239 7 Standby current The current limit two seconds after the motor has stopped smartEnergy Sets the lower motor current limit for coolStep operation by scaling the CS current Current Scale see axis parameter 6 value Minimum motor current 168 Te minimum 0 1 2 of CS SEIMIN 1 1 4 of CS Sets the number of stallGuard2 readings above the upper threshold necessary for each current decrement of the motor current Number of smartEnergy 169 td stallGuard2 measurements per decrement Sec own Scaling 0 3 32 8 2 1 ST 0 slow decrement 3 fast decrement Sets the current increment step The current becomes incremented for each measured stallGuard2 value below the lower threshold see smartEnergy hysteresis start smartEnergy 171 current increment step size current up step Scaling 0 3 1 2 4 8 0 slow increment 3 fast increment fast reaction to rising load EH Deeg Sets the motor current which is used below the threshold speed Please 183 slow run i l j adjust the threshold speed with axis parameter 182 current ree ee Sets the distance between the lower and the upper threshold for 170 oe stallGuard2 reading Above the upper threshold the motor current hysteresis becomes decreased 181 hina well Below this speed motor will not be stopped Above this speed moto
40. 4 MAY 26 14 2 TMCL and the TMCL IDE Introduction As with most TRINAMIC modules the software running on the microprocessor of the TMCM 3110 consists of two parts a boot loader and the firmware itself Whereas the boot loader is installed during production and testing at TRINAMIC and remains untouched throughout the whole 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 TMCM 3110 supports TMCL direct mode binary commands and standalone TMCL program execution You can store up to 2048 TMCL instructions on it In direct mode and most cases the TMCL communication over RS485 CAN or USB follows a strict master slave relationship That is a host computer e g PC PLO acting as the interface bus master will send a command to the TMCM 3110 The TMCL interpreter on the module will then interpret this command do the initialization of the motion controller read inputs and write outputs or whatever is necessary according to the specified command As soon as this step has been done the module will send a reply back over RS485 CAN USB to the bus master Only then should the master transfer the next command Normally the module will just switch to transmission and occupy the bus for a reply otherwise it will stay in receive mode It will not send any data over the interface without receiving a command first This way any collision on the bus will be a
41. 5 128 135 208 215 56 63 136 143 216 223 64 71 144 151 224 231 72 19 15211159 232 239 The most important motor setting since too high values might cause motor damage 7 Standby current The current limit two seconds after the motor 0 255 RWE has stopped Jeck lt value gt x Ipys lt value gt x gee 255 8 Target pos Indicates that the actual position equals the 0 1 R reached target position 9 Ref switch The logical state of the reference left switch 0 1 R status See the TMC 429 data sheet for the different switch modes The default has two switch modes the left switch as the reference switch the right switch as a limit stop switch 10 Right limit The logical state of the right limit switch 0 1 R switch status 11 Left limit switch The logical state of the left limit switch in 0 1 R status three switch mode 12 Right limit If set deactivates the stop function of the 0 1 RWE switch disable right switch 13 Left limit switch Deactivates the stop function of the left 0 1 RWE disable switch resp reference switch if set 130 Minimum speed Should always be set 1 to ensure exact 0 2047 RWE reaching of the target position Do not 16MHZz_ pp usteps change 65536 sec 135 Actual The current acceleration read only 0 2047 R acceleration 138 Ramp mode Automatically set when using ROR ROL MST 0 1 2 RWE and MVP 0 position mode Steps are generated when the parame
42. 7 37 Request Target Position Reached Event This command is the only exception to the TMCL protocol as it sends two replies One immediately after the command has been executed like all other commands also and one additional reply that will be sent when the motor has reached its target position This instruction can only be used in direct mode in standalone mode it is covered by the WAIT command and hence does not have a mnemonic Internal function send an additional reply when the motor has reached its target position Mnemonic Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 138 don t care don t care lt motor bit mask gt The value field contains a bit mask where every bit stands for one motor bit O 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 Function Target Target Status Instruction Operand Operand Operand Operand address address Byte3 Byte2 Byte1 Byte0 Value hex 02 01 100 138 00 00 00 Motor bit mask Additional reply in direct mode after motors have reached their target positions Byte Index 0 1 2 3 4 5 6 7 Function Target Target Status Instruction Operand Operand Operand Operand address address Byte3 Byte2 Byte1 Byte0 Value hex 02 01 128 138 00 00 00 Motor bit mask
43. AIT CSUB Mnemonic JA lt Label gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 22 don t care don t care lt jump address gt Example An infinite loop in TMCL Loop MVP ABS 0 10000 WATT POS 0 0 MVP ABS 0 0 WATT POS 0 0 JA Loop Jump to the label Loop Binary format of JA Loop assuming that the label Loop is at address 20 Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 16 00 00 00 00 00 14 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 46 2 7 20 CSUB call subroutine This function calls a subroutine in the TMCL program memory It is intended for standalone operation only The host address and the reply are only used to take the instruction to the TMCL program memory while the program loads down This command cannot be used in direct mode Internal function the actual TMCL program counter value is saved to an internal stack afterwards overwritten with the passed value The number of entries in the internal 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 lt Label gt Binary representation INSTRUCTION NO TYPE MOT BANK VA
44. Answer Host Target Status Instr Value Datagram 2 100 l 500 02 01 6401 000001 F45D ie 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 gt Click Execute The motor is rotating now MST motor stop motor 0 gt Click Execute The motor stops now Top right of the TMCL Direct Mode window is the button Copy to editor Click here to copy the chosen command and create your own TMCL program The command will be shown immediately on the editor Note Chapter 3 of this manual axis parameters includes a diagram which points out the coolStep related axis parameters and their functions www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 12 1 1 3 Important Motor Settings There are some axis parameters which have to be adjusted right in the beginning after installing your module Please set the upper limiting values for the speed axis parameter 4 the acceleration axis parameter 5 and the current axis parameter 6 Further set the standby current axis parameter 7 and choose your microstep resolution with axis parameter 140 Please use the SAP Set Axis Parameter command for adjusting these values The SAP command is described in paragraph 2 7 5 You can use the TMCL IDE direct mode for easily configuring your module Attention The most i
45. CALCX MUL Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 21 02 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 55 2 7 29 AAP accumulator to axis parameter The content of the accumulator register is transferred to the specified axis parameter For practical usage the accumulator has to be loaded e g by a preceding GAP instruction The accumulator may have been modified by the CALC or CALCX calculate instruction For a table with parameters and values which can be used together with this command please refer to chapter 3 Related commands AGP SAP GAP SGP GGP GIO GCO CALC CALCX Mnemonic AAP lt parameter number gt lt motor gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 34 lt parameter number gt eg lt don t care gt Reply in direct mode STATUS VALUE 100 OK don t care Example Positioning motor by a potentiometer connected to the analogue input 0 Start GIO 0 1 II get value of analogue input line 0 CALC MUL 4 multiply by 4 AAP 0 0 II transfer result to target position of motor 0 JA Start Il jump back to start Binary format of the AAP 0 0 command Byte Index 0 1 2 3 4 5 6 7 Function Target Instructi
46. EEPROM After booting their values are automatically restored to the RAM Up to 56 user variables are available MEANING OF THE LETTERS IN COLUMN ACCESS Access Related Description type commands R GGP Parameter readable W SGP AGP Parameter writable E STGP RSGP Parameter stored permanently in EEPROM Number Global parameter Description Range Access D 55 general purpose variable 0 55 for use in TMCL applications A7 i RWE S 255 general purpose variables 56 255 for use in TMCL applications 2t i RW www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 4 4 Bank 3 Bank 3 contains interrupt parameters Some interrupts need configuration e g the timer interval of a timer interrupt This can be done using the SGP commands with parameter bank 3 SGP lt type gt 3 lt value gt The priority of an interrupt depends on its number Interrupts with a lower number have a higher priority The following table shows all interrupt parameters that can be set MEANING OF THE LETTERS IN COLUMN ACCESS 89 Access Related Description type command s R GGP Parameter readable W SGP AGP Parameter writable E STGP RSGP Parameter automatically restored from EEPROM after reset or power on These parameters can be stored permanently in EEPROM using STGP com
47. LUE 23 don t care don t care lt subroutine address gt Example Call a subroutine Loop MVP ABS 0 10000 CSUB SubW Save program counter and jump to label SubW MVP ABS 0 0 JA Loop SubW WAIT POS 0 0 WATT TICKS 0 50 RSUB Continue with the command following the CSUB command Binary format of the CSUB SubW command assuming that the label SubW is at address 100 Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 17 00 00 00 00 00 64 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 47 2 7 21 RSUB return from subroutine Return from a subroutine to the command after the CSUB command This command is intended for use in standalone mode only The host address and the reply are only used to take the instruction to the TMCL program memory while the program 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 see the CSUB example section 2 7 20 Binary format of RSUB
48. MAY 26 2 7 33 EI enable interrupt The EI command enables an interrupt It needs the interrupt number as parameter Interrupt number 255 globally enables interrupts Related command DI VECT RETI Mnemonic EI lt interrupt number gt Binary representation 59 INSTRUCTION NO TYPE MOT BANK VALUE 25 lt interrupt number gt don t care don t care The following table shows all interrupt vectors that can be used Interrupt number Interrupt type 0 Timer 0 1 Timer 1 2 Timer 2 3 Target position reached 0 4 Target position reached 1 5 Target position reached 2 15 stallGuard2 axis 0 16 stallGuard2 axis 1 17 stallGuard2 axis 2 21 Deviation axis 0 22 Deviation axis 1 23 Deviation axis 2 27 Left stop switch 0 28 Right stop switch 0 29 Left stop switch 1 30 Right stop switch 1 31 Left stop switch 2 32 Right stop switch 2 39 Input change 0 40 Input change 1 41 Input change 2 42 Input change 3 43 Input change 4 44 Input change 5 45 Input change 6 46 Input change 7 255 Global interrupts www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 60 Examples Enable interrupts globally EL 255 Binary format of EI Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operan
49. MCL routines Funcl JA FuncliStart Func2 JA Func2Start Func3 JA Func3Start FunclStart MVP ABS 0 1000 WAIT POS 0 O MVP ABS 0 O0 WAIT POS 0 O STOP Func2Start ROL 0 500 WAIT TICKS 0 100 MST OU STOP Func3Start ROR 0 1000 WAIT TICKS 0 700 MST OU STOP This example provides three very simple TMCL routines They can be called from a host by issuing a run command with address 0 to call the first function or a run command with address 1 to call the second function or a run command with address 2 to call the third function You can see the addresses of the TMCL labels that are needed for the run commands by using the Generate symbol file function of the TMCL IDE Please refer to the TMCL IDE User Manual for further information about the TMCL IDE www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 6 Life Support Policy TRINAMIC Motion Control GmbH amp 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 amp Co KG Life support systems are equipment intended to support or sustain life and whose failure to perform when properly used in accordance with instructions provided can be reasonably expected to result in personal injury or death TRINAMIC Motion Control GmbH amp Co KG 2013 2014 Information given in this data sheet is believed to be accurate and reli
50. OUT 1 Direction Description 1 GND GND Power GND GND Power 2 VorerraL Vue sunniy opun Connected to Vhora Of power connector Dedicated analog input 3 AIN_O AIN_4 Input input voltage range 0 10V resolution 12bit 0 4095 4 IN 1 IN_5 Input Digital input 24V compatible 5 IN 2 IN_6 Input Digital input 24V compatible 6 IN 3 IN_7 Input Digital input 24V compatible Open drain output max 100mA 7 cod SE output Integrated freewheeling diode Open drain output max 100mA S SS ZE SHIERZ Integrated freewheeling diode to Vaicitat Open drain output max 100mA 3 oume OLP Output Integrated freewheeling diode to Vaicita Open drain output max 1A ee SE Output Integrated freewheeling diode to Vgigitat Bank 2 is used for setting the status of the general digital output either to low 0 or to high 1 OUTPUTS USED FOR SIO AND COMMAND I O Connector Pin I O port Command Range 0 7 OUT_O SIO 0 2 lt n gt 1 0 0 8 OUT_1 SIO 1 2 lt n gt 1 0 0 9 OUT_2 SIO 2 2 lt n gt 1 0 0 10 OUT 3 SIO 3 2 lt n gt 1 0 1 7 OUT_4 SIO 4 2 lt n gt 1 0 1 8 OUT_5 SIO 5 2 lt n gt 1 0 1 9 OUT_6 SIO 6 2 lt n gt 1 0 1 10 OUT_7 SIO 7 2 lt n gt 1 0 ADDRESSING ALL 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 li
51. able However neither responsibility is assumed for the consequences of its use nor for any infringement of patents or other rights of third parties which may result from its use Specifications are subject to change without notice All trademarks used are property of their respective owners www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 94 7 Revision History 7 1 Firmware Revision Version Date Author Description 1 07 2013 JUN 25 OK First version 1 08 2014 JAN 20 OK Not deployed 1 09 2014 FEB 28 OK USB interface can also be used with Windows 8 1 Command request target position reached improved Step Dir interface supported axis parameter 254 Reference search modes 7 and 8 corrected 7 2 Document Revision Version Date Author Description 1 00 2013 JUN 26 SD First complete version 1 01 2014 MAY 16 SD Firmware revision updated 1 02 2014 MAY 26 SD Information about selecting an encoder prescaler corrected 8 References TMCM 3110 TMC262 TMC429 TMCL IDE TMCM 3110 Hardware Manual TMC262 Datasheet TMC429 Datasheet TMCL IDE User Manual Please refer to www trinamic com www trinamic com
52. ack when the module is addressed Character can also be erased using the backspace 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 lt CR gt 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 This may be useful in RS485 systems www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 23 2 7 Commands The module specific commands are explained in more detail on the following pages They are listed according to their command number 2 7 1 ROR rotate right The motor will be instructed to rotate with a specified velocity in right direction increasing the position counter Internal function first velocity mode is selected Then the velocity value is transferred to axis parameter 0 target velocity The module is based on the TMC429 stepper motor controller and the TMC262 power driver This makes possible choosing a velocity between 0 and 2047 Related commands ROL MST SAP GAP Mnemonic ROR lt motor gt lt velocity gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE lt motor gt lt velocity gt i don t care 0 2 o 2047 Reply in direct mode STATUS VALUE 100 OK don t care Example Rotate right motor 2 velocity
53. ain output max 100mA 2 Ou AR Output Integrated freewheeling diode to Vgigitat Open drain output max 1A S UU 7 Our Output Integrated freewheeling diode to Nitt 2 7 15 1 I O bank 0 digital inputs The ADIN lines can be read as digital or analogue inputs at the same time The analogue values can be accessed in bank 1 HO Connector Pin I O port Command Range 0 4 IN 1 GIO 1 0 0 1 0 5 IN 2 GIO 2 0 0 1 0 6 IN 3 GIO 3 0 0 1 1 4 IN_5 GIO 5 0 0 1 1 5 IN_6 GIO 6 0 0 1 1 6 IN GIO 7 0 0 1 READING ALL DIGITAL INPUTS WITH ONE GIO COMMAND Set the type parameter to 255 and the bank parameter to 0 In this case the status of all digital input lines will be read to the lower eight bits of the accumulator www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 41 USE FOLLOWING PROGRAM TO REPRESENT THE STATES OF THE INPUT LINES ON THE OUTPUT LINES Loop GIO 255 0 SIO Zb ch JA Loop 2 7 15 2 I O bank 1 analogue 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 I O Connector Pin I O port Command Range 0 3 AIN 0 GIO 0 1 0 4095 1 3 AIN A GIO 4 1 0 4095 2 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
54. ative values The parameter is transferred to the correct position in the appropriate device Related commands GAP STAP RSAP AAP Mnemonic SAP lt parameter number gt lt motor gt lt value gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 5 lt parameter number gt KH lt value gt Reply in direct mode STATUS VALUE 100 OK don t care For a table with parameters and values which can be used together with this command please refer to chapter 3 Example Set the absolute maximum current of motor 0 to 1 4 A Because of the current unit Ipys lt value gt x the 200mA setting has the lt value gt 128 value range for current setting D 255 The value for current setting has to be calculated before using this special SAP command Mnemonic SAP 6 0 128 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 05 06 00 00 00 00 12 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 6 GAP get axis parameter 29 Most parameters of the TMCM 3110 can be adjusted individually for the axis With this parameter they can be read out In standalone mode the requested value is also transferred to the accumulator register for further processing purpose
55. d Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 19 SFF 00 00 00 00 00 Enable interrupt when target position reached EI 3 Binary format of EI Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 19 03 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 61 2 7 34 DI disable interrupt The DI command disables an interrupt It needs the interrupt number as parameter Interrupt number 255 globally disables interrupts Related command EI VECT RETI Mnemonic DI lt interrupt number gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 26 lt interrupt number gt don t care don t care The following table shows all interrupt vectors that can be used Interrupt number Interrupt type 0 Timer 0 1 Timer 1 2 Timer 2 3 Target position reached 0 4 Target position reached 1 5 Target position reached 2 15 stallGuard2 axis 0 16 stallGuard2 axis 1 17 stallGuard2 axis 2 21 Deviation axis 0 22 Deviation axis 1 23 Deviation axis 2 27 Left stop switch 0 28 Right stop switch 0 29 Left stop switch 1 30 Right stop switch 1 31 Left stop switch 2 32 Right stop switch 2 39 Inp
56. d and the execution of the normal program will be continued www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 19 2 4 2 6 3 Interrupt Vectors The following table shows all interrupt vectors that can be used Interrupt number Interrupt type 0 Timer 0 1 Timer 1 2 Timer 2 3 Target position reached 0 4 Target position reached 1 5 Target position reached 2 15 stallGuard2 axis 0 16 stallGuard2 axis 1 17 stallGuard2 axis 2 21 Deviation axis 0 22 Deviation axis 1 23 Deviation axis 2 27 Left stop switch 0 28 Right stop switch 0 29 Left stop switch 1 30 Right stop switch 1 31 Left stop switch 2 32 Right stop switch 2 39 Input change 0 40 Input change 1 41 Input change 2 42 Input change 3 43 Input change 4 44 Input change 5 45 Input change 6 46 Input change 7 255 Global interrupts 2 4 2 6 4 Further Configuration of Interrupts Some interrupts need further configuration e g the timer interval of a timer interrupt This can be done using SGP commands with parameter bank 3 SGP lt type gt 3 lt value gt Please refer to the SGP command paragraph 2 7 9 for further information about that www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 20 2 4 2 6 5 Using Interrupts in TMCL To use an interrupt the following things have to be done Define
57. d therefore any motor connected will not be energized 3 Muer Power Supply voltage for everything else apart from the stepper supply input motor driver ICs An on board voltage regulator will generate the necessary voltages for the digital circuits from this supply This pin can be left unconnected In this case a diode between Vasen and Vorerra Will ensure the supply of the digital parts Note It is expected that Vprera and Vprwer are connected to the same power supply output when both pins are used Otherwise ensure that Vpy r74 is always equal or higher than Maenes When connected due to the diode 4 Connect encoder reference switches and I Os Using these features of the module is optional For a first start up with the TMCM 3110 there is no need to connect an encoder I Os or reference switches a Connect inputs and outputs I O CONNECTOR 0 Pin Label Direction Description 1 GND Power GND GND 2 VorerraL Power Connected to Vase Of Power connector supply output 3 AIN 0 Input Dedicated analog input input voltage range 0 10V resolution 12bit 0 4095 4 IN 1 Input Digital input 24V compatible 5 IN 2 Input Digital input 24V compatible 6 IN Input Digital input 24V compatible 7 OUT_O Output Open drain output max 100mA Integrated freewheeling diode 8 OUT_1 Output Open drain output max 100mA Integrated freewheel
58. digital input CALC 19 lt operation gt lt value gt Process accumulator amp value COMP 20 lt value gt Compare accumulator lt gt value JC 21 lt condition gt lt jump address gt Jump conditional JA 22 lt jump address gt Jump absolute CSUB 23 lt subroutine address gt Call subroutine RSUB 24 Return from subroutine EI 25 lt interrupt number gt Enable interrupt DI 26 lt interrupt number gt Disable interrupt WAIT 27 lt condition gt lt motor number lt ticks gt Wait with further program execution STOP 28 Stop program execution SCO 30 lt coordinate number gt lt motor number gt Set coordinate lt position gt GCO 31 lt coordinate number gt lt motor number gt Get coordinate cco 32 lt coordinate number gt lt motor number gt Capture coordinate CALCX 33 lt operation gt Process accumulator amp X register AAP 34 lt parameter gt lt motor number gt Accumulator to axis parameter AGP 35 lt parameter gt lt bank number gt Accumulator to global parameter CLE 36 lt flags gt Clear error flags VECT 37 lt interrupt number gt lt label gt Set interrupt vector RETI 38 Return from interrupt ACO 39 lt coordinate number gt lt motor number gt Accu to coordinate www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 17 2 4 2 Commands Listed According to Subject Area 2 4 2 1 Motion Commands These commands control the motion of the motor They are
59. e requested value is copied to the accumulator register for further processing purposes such as conditioned jumps In direct mode the value is only output in the value field of the reply without affecting the accumulator Depending on the global parameter 84 the coordinates are only stored in RAM or also stored in the EEPROM and copied back on startup with the default setting the coordinates are stored in RAM only Please note that the coordinate number 0 is always stored in RAM only Internal function the desired value is read out of the internal 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 lt coordinate number gt lt motor gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 31 lt coordinate number gt lt motor gt don t 0 20 0 2 SE Reply in direct mode STATUS VALUE 100 OK don t care Example Get motor 0 value of coordinate 1 Mnemonic GCO 1 0 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 if 01 00 00 00 00 00 Reply Byte Index 0 1 2 3 4 5 6 7 Function Target Target Status Instructio Operand Operand Operand Ope
60. e Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 13 02 00 SFF SFF SEC 78 Reply Byte Index 0 1 2 3 4 5 6 7 Function Host Target Status Instruction Operand Operand Operand Operand address address Byte3 Byte2 Byte1 Byte0 Value hex 02 01 64 13 Sff Sff Sec 78 Status no error value 5000 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 43 2 7 17 COMP compare The specified number is compared to the value in the accumulator register The result of the comparison can for example be used by the conditional jump JQ instruction This command is intended for use in standalone operation only The host address and the reply are only used to take the instruction to the TMCL program memory while the program loads down It does not make sense to use this command in direct mode Internal function the specified value is compared to the internal accumulator which holds the value of a preceding get or 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 lt value gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 20 don t care don t care lt comparison value gt Example Jump to the address gi
61. e control Determines the slope of the motor driver 0 3 RW low side outputs Set identical to slope control high side 177 Short protection 0 Short to GND protection is on 0 1 RW disable 1 Short to GND protection is disabled Use default value 178 Short detection 0 3 2us 0 3 RW timer 1 1 6us 2 1 2us 3 0 8us Use default value 180 smartEnergy This status value provides the actual motor 0 31 RW actual current current setting as controlled by coolStep The value goes up to the CS value and down to the portion of CS as specified by SEIMIN actual motor current scaling factor 0 31 1 32 2 32 32 32 181 Stop on stall Below this speed motor will not be stopped 0 2047 RW Above this speed motor will stop in case 16MHZ_ pp Ges stallGuard2 load value reaches zero 63930 SSe 182 smartEnergy Above this speed coolStep becomes enabled 0 2047 RW threshold speed p PD eg 65536 sec 183 smartEnergy Sets the motor current which is used below 0 255 RW slow run current the threshold speed Ipeak lt value hee 255 Ips lt val ee rms lt value ECH www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 73 Number Axis Parameter Description Range Unit Acc 193 Ref search mode 1 search left stop switch only 2 search right stop switch then search left stop switch 3 search right stop switch then search left stop switch from bo
62. eet your needs The best and easiest way to do this is to use the appropriate functions of the TMCL IDE The parameters with numbers between 64 and 128 are stored in EEPROM only An SGP command on such a parameter will always store it permanently and no extra STGP command is needed Take care when changing these parameters and use the appropriate functions of the TMCL IDE to do it in an interactive way MEANING OF THE LETTERS IN COLUMN ACCESS Access Related type command s Description R GGP Parameter readable W SGP AGP Parameter writable E STGP RSGP Parameter automatically restored from EEPROM after reset or power on These parameters can be stored permanently in EEPROM using STGP command and also explicitly restored copied back from EEPROM into RAM using RSGP www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 86 Number Parameter Description Range Access 64 EEPROM magic Setting this parameter to a different value as 0 255 RWE SE4 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 RS485 baud rate 0 9600 baud Default 0 11 RWE 1 14400 baud 2 19200 baud 3 28800 baud 4 38400 baud 5 57600 baud 6 76800 baud Not supported by Windows 7 115200 baud 8 230400 baud 9 250000 baud Not supported by Wi
63. er event has happened during the last period with constant coil polarity Bit 6 Open load B 1 no chopper event has happened during the last period with constant coil polarity Bit 7 Stand still 1 No step impulse occurred on the step input during the last 2 20 clock cycles 209 Encoder position The value of an encoder register can be read encoder steps RW out or written 210 Encoder Prescaler value p for the encoder decimal t RWE 65536 prescaler Refer to paragraph 3 5 too Setting of AP201 Prescaler value binary 1 Bit5 0 p 65536 prescaler 10000 Bit5 1 p 10000 prescaler 212 Maximum When the actual position parameter 1 and 0 65535 RWE encoder the encoder position parameter 209 differ deviation more than set here the motor will be encoder steps stopped This function is switched off when the maximum deviation is set to zero 213 Group index All motors on the module which have the 0 255 RW same group index will get the same commands when a ROL ROR MST MVP or RFS is issued for one of these motors 214 Power down Standstill period before the current is changed 1 65535 RWE delay down to standby current The standard value 10msec is 200 value equates 2000msec www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 75 Number Axis Parameter Description Range Unit Acc 254 Step Dir mode 1 Use of the ENABLE inputs on
64. g and a checksum byte at the end In this case it consists of nine bytes This is different when communicating is via the CAN bus Address and checksum are included in the CAN standard and do not have to be supplied by the user The binary command format for RS485 USB is as follows Bytes Meaning Module address Command number Type number Motor or Bank number Value MSB first Checksum PIB PI P P P The checksum is calculated by adding up all the other bytes using an 8 bit addition When using CAN bus just leave out the first byte module address and the last byte checksum www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 15 CHECKSUM CALCULATION As mentioned above the checksum is calculated by adding up all bytes including the module address byte using 8 bit addition Here are two examples to show how to do this in C unsigned char i Checksum unsigned char Command 9 Set the Command array to the desired command Checksum Command 0 for i l i lt 8 i Checksum Command i Command 8 Checksum insert checksum as last byte of the command Now send it to the module 2 2 Reply Format Every time a command has been sent to a module the module sends a reply The reply format for RS485 USB is as follows Bytes Meaning 1 Reply address 1 Module address 1 Status e g 100 means no error 1 Command number 4 1
65. gister to a user variable e g to store the result of a calculation EXAMPLE MyVariable 42 Use a symbolic name for the user variable This makes the program better readable and understandable SGP MyVariable 2 1234 Initialize the variable with the value 1234 GGP MyVariable 2 Copy the contents of the variable to the accumulator register CALC MUL 2 Multiply accumulator register with two AAP MyVariable 2 Store contents of the accumulator register to the variable Furthermore these variables can provide a powerful way of communication between a TMCL program running on a module and a host The host can change a variable by issuing a direct mode SGP command remember that while a TMCL program is running direct mode commands can still be executed without interfering with the running program If the TMCL program polls this variable regularly it can react on such changes of its contents The host can also poll a variable using GGP in direct mode and see if it has been changed by the TMCL program 5 5 Using Subroutines The CSUB and RSUB commands provide a mechanism for using subroutines The CSUB command branches to the given label When an RSUB command is executed the control goes back to the command that follows the CSUB command that called the subroutine This mechanism can also be nested From a subroutine called by a CSUB command other subroutines can be called In the current version of TMCL eight le
66. gned value controls stallGuard2 threshold level for stall output and threshold sets the optimum measurement range for readout A lower value gives a higher sensitivity Zero is the starting value A higher value makes stallGuard2 less sensitive and requires more torque to indicate a stall 0 Indifferent value 1 63 less sensitivity 1 64 higher sensitivity 181 stop on stall Below this speed motor will not be stopped Above this speed motor will stop in case stallGuard2 load value reaches zero 206 actual load value Readout of the actual load value used for stall detection stallGuard2 In this chapter only basic axis parameters are mentioned which concern stallGuard2 The complete list of axis parameters in chapter 3 contains further parameters which offer more configuration possibilities www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 77 3 2 coolStep Related Parameters The figure below gives an overview of the coolStep related parameters Please have in mind that the figure shows only one example for a drive There are parameters which concern the configuration of the current Other parameters are for velocity regulation and for time adjustment It is necessary to identify and configure the thresholds for current I6 I7 and 1183 and velocity V182 Furthermore the stallGuard2 feature has to be adjusted and enabled SG170 and SG181 The reduction or increasing of the current in
67. gt Binary representation INSTRUCTION NO TYPE lt condition gt MOT BANK VALUE 21 0 ZE zero don t care lt jump address gt 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 Example Jump to address given by the label when the position of motor is greater than or equal to 1000 GAP 1 0 0 COMP 1000 JC GE Label Label ROL 0 1000 Binary format of JC GE Label when Label is at address 10 Joer axis parameter type no 1 actual position motor 0 value 0 don t care compare actual value to 1000 Jump type 5 greater equal Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 15 05 00 00 00 00 0a www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 45 2 7 19 JA jump always Jump to a fixed address in the TMCL program memory This command is intended only for standalone operation The host address and the reply are only used to take the instruction to the TMCL program memory while the program loads down This command cannot be used in direct mode Internal function the TMCL program counter is set to the passed value Related commands JC W
68. ifferential RS485 bus signal inverting 3 GND Power GND Signal and system ground 4 5 6 7 RS485 Bi directional Differential RS485 bus signal non inverting 8 9 c USB interface Download and install the file TMCM 3110 inf www trinamic com If you connect the USB the first time it is necessary to install a virtual com port configuration file on your PC in advance This file is required for configuration of a virtual com port for your module For Windows systems use the TMCM 3110 inf configuration file available on www trinamic com Pin Label Direction Description 1 VBUS Power 5V input 5V supply from Host 2 D Bi directional USB Data 3 D Bi directional USB Data 4 ID Connected to signal and system ground 5 GND Power GND Signal and System ground 2 Connect 1 2 or 3 motors For each stepper motor a separate connector is used Note the TMCM 3110 hardware manual includes an example how to connect QSH5718 stepper motors Pin Label Description 1 OA1 Motor coil A 2 OA2 Motor coil A 3 OB1 Motor coil B 4 OB2 Motor coil B www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 3 Connect the power supply Pin Label Direction Description 1 GND Power GND Common system supply and signal ground 2 Vorqver Power Stepper driver supply voltage Without this voltage the supply input stepper driver part an
69. ing diode to NA 9 OUT_2 Output Open drain output max 100mA Integrated freewheeling diode to Neie 10 OUT3 Output Open drain output max 1A Integrated freewheeling diode to Vaicita I O CONNECTOR 1 Pin Label Direction Description 1 GND Power GND GND 2 VorerraL Power Connected to Voareu Of Power connector supply output 3 AIN A Input Dedicated analog input input voltage range 0 10V resolution 12bit 0 4095 IN 5 Input Digital input 24V compatible 5 IN e Input Digital input 24V compatible www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 9 Pin Label Direction Description 6 IN_7 Input Digital input 24V compatible 7 OUT_4 Output Open drain output max 100mA Integrated freewheeling diode 8 OUT_5 Output Open drain output max 100mA Integrated freewheeling diode to Vaicita 9 OUT_6 Output Open drain output max 100mA Integrated freewheeling diode to NA 10 OUT_7 Output Open drain output max 1A Integrated freewheeling diode to Neit b Connect 1 2 or 3 encoders For each stepper motor axis a separate encoder input connector is available Pin Label Direction Description 1 GND Power GND Signal and system ground 2 5V Power 5V output for external circuit max 100mA supply output 3 Ae Input Encoder channel A input differential non inverting Input Encoder channel A input 4 A
70. ion Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 0d 00 00 00 00 00 00 With this module it is possible to use stall detection instead of a reference search www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 37 2 7 14 SIO set input output This command sets the status of the general digital output either to low 0 or to high 1 Internal function the passed value is transferred to the specified output line Related commands GIO WAIT Mnemonic SIO lt port number gt lt bank number gt lt value gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE lt bank number gt lt value gt 14 lt port number gt 2 on Reply structure STATUS VALUE 100 OK don t care Example Set OUT_7 to high bank 2 output 7 Mnemonic SIO 7 2 1 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 ByteO Value hex 01 0e 07 02 00 00 00 01 EK oy Laun IN OUT O IN OUT 1 Figure 2 1 I O connectors www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 OVERVIEW CONNECTORS 0 AND 1 Pin IN OUT 0 IN
71. is parameter 195 0 2047 a_max Axis parameter 5 0 2047 maximum acceleration psrs Axis parameter 140 offers the following settings 0 8 microstep resolution 0 full step microsteps per fullstep 2 1 half step 2 4 microsteps 3 8 microsteps 4 16 microsteps 5 32 microsteps 6 64 microsteps 7 128 microsteps 8 256 microsteps ramp_div Axis parameter 153 divider for the acceleration The 0 13 ramp divisor higher the value is the less is the maximum acceleration Default 0 pulse_div Axis parameter 153 divider for the velocity 0 13 pulse divisor Increasing the value by one halves the acceleration decreasing the value by one doubles the acceleration Default 0 fax I clock frequency 16MHz 3 4 1 Microstep Frequency The microstep frequency of the stepper motor is calculated with for lE velocity usfLHz 2 www trinamic com pulse_div psf microstep frequency 2048 32 TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 83 3 4 2 Fullstep Frequency To calculate the fullstep frequency from the microstep frequency the microstep frequency must be divided by the number of microsteps per fullstep H fsfLHz DH fsf fullstep frequency 2 The change in the pulse rate per time unit a pulse frequency change per second is given by 2 CLK fmx a Pulse_divtramp_div 29 This results in acceleration in fullsteps of
72. k Byte3 Byte2 Byte1 Byte Value hex 01 0b 2a 02 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 35 2 7 12 RSGP restore global parameter With this command the contents of a TMCL user variable can be restored from the EEPROM For all configuration related axis parameters non volatile memory locations are provided By default most parameters are automatically restored after power up A single parameter that has been changed before can be reset by this instruction For a table with parameters and bank numbers which can be used together with this command please refer to chapter 4 Internal function The specified parameter is copied from the configuration EEPROM memory to its RAM location Relate commands SGP STGP GGP and AGP Mnemonic RSGP lt parameter number gt lt bank number gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 12 lt parameter number gt lt bank number gt don t care Reply structure in direct mode STATUS VALUE 100 OK don t care Example Restore the user variable 42 Mnemonic RSGP 42 2 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 0c 2a 02 00 00 00 00 www trinamic com
73. mand and also explicitly restored copied back from EEPROM into RAM using RSGP Number Global parameter Description Range Access 0 Timer 0 period ms Time between two interrupts ms 32 bit unsigned ms RWE 1 Timer 1 period ms Time between two interrupts ms 32 bit unsigned ms RWE 2 Timer 2 period ms Time between two interrupts ms 32 bit unsigned ms RWE 27 Stop left O trigger O off 1 low high 2 high low 3 both 0 3 RW transition 28 Stop right O trigger O off 1 low high 2 high low 3 both 0 3 RW transition 29 Stop left 1 trigger O off 1 low high 2 high low 3 both 0 3 RW transition 30 Stop right 1 trigger O off 1 low high 2 high low 3 both 0 3 RW transition 31 Stop left 2 trigger O off 1 low high 2 high low 3 both 0 3 RW transition 32 Stop right 2 trigger O off 1 low high 2 high low 3 both 0 3 RW transition 39 Input D trigger Doft 1 low high 2 high low 3 both 0 3 RWE transition 40 Input 1 trigger Doft 1 low high 2 high low 3 both 0 3 RWE transition 41 Input 2 trigger Doft 1 low high 2 high low 3 both 0 3 RWE transition 42 Input 3 trigger Doft 1 low high 2 high low 3 both 0 3 RWE transition 43 Input 4 trigger Doft 1 low high 2 high low 3 both 0 3 RWE transition 44 Input 5 trigger Doft 1 low high 2 high low 3 both 0 3 RWE transition 45 Input 6 trigger Doft 1 low high 2 high low 3 both 0 3 RWE transi
74. mportant motor setting is the absolute maximum motor current setting since too high values might cause motor damage IMPORTANT AXIS PARAMETERS FOR MOTOR SETTING Number Axis Parameter Description Range Unit 4 Maximum Should not exceed the physically highest possible 0 2047 positioning value Adjust the pulse divisor axis parameter 154 if speed the speed value is very low lt 50 or above the upper sc zie divisor EEBS timit 65536 sec 5 Maximum The limit for acceleration and deceleration Changing 0 2047 acceleration this parameter requires re calculation of the acceleration factor no 146 and the acceleration divisor no 137 which is done automatically See TMC 429 datasheet for calculation of physical units 6 Absolute max The maximum value is 255 This value means 100 of 0 255 current the maximum current of the module The current Ipeak lt value gt x oe CS Current adjustment is within the range 0 255 and can be Scale adjusted in 32 steps lens lt value gt x oe 0 7 79 87 160 167 240 247 8 15 88 95 168 175 248 255 16 23 96 103 176 183 24 31 104 111 184 191 32 39 112 119 192 199 40 47 120 127 200 207 48 55 128 135 208 215 56 63 136 143 216 223 64 71 144 151 224 231 72 19 152 159 232 239 The most important motor setting since too high values
75. n is achieved 0 step interpolation off 1 step interpolation on 161 Double step Every edge of the cycle releases aJ O 1 RW enable step microstep It does not make sense to activate this parameter for internal use Double step enable can be used with Step Dir interface 0 double step off 1 double step on 162 Chopper blank Selects the comparator blank time This time 0 3 RW time needs to safely cover the switching event and the duration of the ringing on the sense resistor For low current drivers a setting of 1 or 2 is good For higher current applications like the TMCM 3110 a setting of 2 or 3 will be required 163 Chopper mode Selection of the chopper mode 0 1 RW 0 spread cycle 1 classic const off time 164 Chopper Hysteresis decrement setting This setting D 3 RW hysteresis determines the slope of the hysteresis during decrement on time and during fast decay time 0 fast decrement 3 very slow decrement 165 Chopper Hysteresis end setting Sets the hysteresis end 3 12 RW hysteresis end www trinamic com value after a number of decrements Decrement interval time is controlled by axis parameter 164 3 1 negative hysteresis end setting 0 zero hysteresis end setting 1 12 positive hysteresis end setting TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 71 Number Axis Parameter Description Range Unit Acc 166 Chopper Hystere
76. ndows 10 500000 baud Not supported by Windows 11 1000000 baud Not supported by Windows 66 Serial address The module target address for RS485 0 255 RWE 67 ASCIT mode Configure the TMCL ASCII interface RWE Bit 0 O start up in binary normal mode 1 start up in ASCIT mode Bits 4 and 5 00 Echo back each character 01 Echo back complete command 10 Do not send echo only send command reply 68 Serial heartbeat Serial heartbeat for the RS485 interface If this ms RWE time limit is up and no further command is noticed the motor will be stopped 0 parameter is disabled 69 CAN bit rate 2 20kBit s d 8 RWE 3 SOkBit s 4 100kBit s 5 125kBit s 6 250kBit s 7 500kBit s 8 1000kBit s Default 70 CAN reply ID The CAN ID for replies from the board 0 7ff RWE default 2 71 CAN ID The module target address for CAN default 0 7ff RWE 1 73 Configuration Write 1234 to lock the EEPROM 4321 to 0 1 RWE EEPROM lock flag unlock it Read 1 EEPROM locked O EEPROM unlocked 75 Telegram pause Pause time before the reply via RS485 is sent 0 255 RWE time For RS485 it is often necessary to set it to 15 for RS485 adapters controlled by the RTS pin For CAN interface this parameter has no effect 76 Serial host Host address used in the reply telegrams sent 0 255 RWE address back via RS485 77 Auto start mode 0 Do not start TMCL application after power 0 1 RWE up default 1 Start TMCL application aut
77. ne 38 Furthermore the value can also be set to 1 In this special case the contents of the lower 8 bits of the accumulator are copied to the output pins Example Set all output pins high Mnemonic SIO 255 2 3 THE FOLLOWING PROGRAM WILL SHOW THE STATES OF THE INPUT LINES ON THE OUTPUT LINES Loop GIO 255 0 StO Zb 2 51 JA Loop www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 39 2 7 15 GIO get input output With this command the status of the two available general purpose inputs of the module can be read out The function reads a digital or analogue input port Digital lines will read 0 and 1 while the ADC channels deliver their 10 bit result in the range of 0 4095 GIO IN STANDALONE MODE In standalone mode the requested value is copied to the accumulator accu for further processing purposes such as conditioned jumps GIO IN DIRECT MODE In direct mode the value is only output in the value field of the reply without affecting the accumulator The actual status of a digital output line can also be read Internal function the specified line is read Related commands SIO WAIT Mnemonic GIO lt port number gt lt bank number gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 15 lt port number gt lt bank number gt don t care Reply in direct mode STATUS VALUE 100 OK lt status of the port gt Exam
78. nt STOP 28 End of a TMCL program 2 4 2 4 I O Port Commands These commands control the external I O ports and can be used in direct mode and in standalone mode Mnemonic Command number Meaning SIO 14 Set output GIO 15 Get input www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 18 2 4 2 5 Calculation Commands These commands are intended to be used for calculations within TMCL applications Although they could also be used in direct mode it does not make much sense to do so Mnemonic Command number Meaning CALC 19 Calculate using the accumulator and a constant value CALCX 33 Calculate using the accumulator and the X register AAP 34 Copy accumulator to an axis parameter AGP 35 Copy accumulator to a global parameter ACO 39 Copy accu to coordinate For calculating purposes there is an accumulator or accu or A register and an X register When executed in a TMCL program in standalone 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 in direct mode the accumulator will not be affected This means that while a TMCL program is running on the module standalone mode a host can still send commands like GAP and GGP to the module e g to query the ac
79. nterrupted using MST ROL or ROR commands THREE OPERATION TYPES ARE AVAILABLE Moving to an absolute position in the range from 2 147 483 648 2 147 483 647 L 27 1 Starting a relative movement by means of an offset to the actual position In this case the new resulting position value must not exceed the above mentioned limits too Moving the motor to a previously stored coordinate refer to SCO for details Please note that the distance between the actual position and the new one should not be more than 2 147 483 647 271 1 microsteps Otherwise the motor will run in the opposite direction in order to take the shorter distance Internal function A new position value is transferred to the axis parameter 2 target position Related commands SAP GAP SCO CCO GCO MST ACO Mnemonic MVP lt ABS REL COORD gt lt motor gt lt position offset coordinate number Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 0 ABS absolute lt position gt 4 1 REL relative lt motor gt lt offset gt 2 COORD coordinate FS SEH asia Reply in direct mode STATUS VALUE 100 OK don t care Example Move motor 0 to absolute position 90000 Mnemonic MVP ABS 0 9000 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 04 00
80. o not connect or disconnect the motor while TMCL IDE software and PC powered Cables for interface motor and power START WITH POWER SUPPLY OFF N N motor 0 motor 1 GU a 9 Motor 0 Motor 1 Motor 2 N motor 2 on D Power supply Pin 1 GND Pin 2 Vprrver Pin 3 Vptarrat gt i E Step Dir IN Pe Power A 1 lt Las WW Ini ur 8 In Out 0 IEA Ref Switch 1 ee 1 Ref Switch 2 Ref Switch 0 can 7 Rs485 se AN rererers ER Zb Sa E t Encoder 0 Encoder 1 Encoder 2 amp USB A j A j lt O J I0 5 8 GS Converter e g USB 2 485 CAN Pin 2 CAN_L Pin 3 GND Pin 7 CAN_H RS485 Pin 2 RS485 Pin 3 GND Pin 7 RS485 Converter e g USB 2 X Serial USB interface Figure 1 3 How to connect the module www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 7 1 Choose your interface The module offer three interfaces CAN RS485 and USB First select one interface and connect it a CAN interface Pin Label Direction Description 1 2 CAN_L Bi directional Differential CAN bus signal inverting 3 GND Power GND Signal and system ground 4 5 6 7 CAN_H Bi directional Differential CAN bus signal non inverting 8 9 b RS485 interface Pin Label Direction Description 1 2 RS485 Bi directional D
81. omatically after power up www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 87 Number Parameter Description Range Access 79 End switch 0 normal polarity 0 1 RWE polarity 1 reverse polarity 81 TMCL code Protect a TMCL program against disassembling 0 1 2 3 RWE protection 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 TMCL program will be wiped off 82 CAN heartbeat Heartbeat for CAN interface If this time limit ms RWE is up and no further command is noticed the motor will be stopped o parameter disabled 83 CAN secondary Second CAN ID for the module Switched off 0 7ff RWE address when set to zero 84 Coordinate 0 coordinates are stored in the RAM only 0or1 RWE storage but can be copied explicitly between RAM and EEPROM 1 coordinates are always stored in the EEPROM only 85 Do not store user o user variables are restored default 0 1 RWE variables 1 user variables are not restored 87 Serial secondary Second module target address for RS485 0 255 RWE address 128 TMCL application 0 stop 0 3 R status 1 run 2 step 3 reset 129 Download mode 0 normal mode 0 1 R 1
82. on Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 22 00 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 56 2 7 30 AGP accumulator to global parameter The content of the accumulator register is transferred to the specified global parameter For practical usage the accumulator has to be loaded e g by a preceding GAP instruction The accumulator may have been modified by the CALC or CALCX calculate instruction Note that the global parameters in bank 0 are EEPROM only and thus should not be modified automatically by a standalone application For a table with parameters and bank numbers which can be used together with this command please refer to chapter 4 Related commands AAP SGP GGP SAP GAP GIO CALC CALCX Mnemonic AGP lt parameter number lt bank number Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 35 lt parameter number gt lt bank number gt don t care Reply in direct mode STATUS VALUE 100 OK don t care Example Copy accumulator to TMCL user variable 3 Mnemonic AGP 3 2 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 23 03 02 00 00 00 00
83. or all configuration related axis parameters non volatile memory locations are provided By default most parameters are automatically restored after power up A single parameter that has been changed before can be reset by this instruction also 31 Internal function the specified parameter is copied from the configuration EEPROM memory to its RAM location Relate commands SAP STAP GAP and AAP Mnemonic RSAP lt parameter number gt lt motor gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 8 lt parameter number gt Kc don t care Reply structure in direct mode STATUS VALUE 100 OK don t care For a table with parameters and values which can be used together with this command please refer to chapter 3 Example Restore the maximum current of motor 3 Mnemonic RSAP 6 0 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction T Motor Operand Operand Operand Operand address Number ype Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 08 06 03 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 32 2 7 9 SGP set global parameter With this command most of the module specific parameters not directly related to motion control can be specified and the TMCL user variables can be changed Global parameters are related to the host interface peri
84. parameter is set by hardware to the ae maximum speed during acceleration and to 65536 BEG zero during deceleration and rest 3 Actual speed The current rotation speed 2047 RW Sc mE 65536 sec 4 Maximum Should not exceed the physically highest 0 2047 RWE positioning possible value Adjust the pulse divisor no speed 154 if the speed value is very low lt 50 or LOMHZ pp EN above the upper limit See TMC 429 datasheet 536 sce for calculation of physical units 5 Maximum The limit for acceleration and deceleration 0 2047 RWE acceleration Changing this parameter requires re calculation of the acceleration factor no 146 and the acceleration divisor no 137 which is done automatically See TMC 429 datasheet for calculation of physical units www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 69 Number Axis Parameter Description Range Unit Acc 6 Absolute max The maximum value is 255 This value means 0 255 RWE current 100 of the maximum current of the module e value SE CS Current The current adjustment is within the range 0 BES Scale 255 and can be adjusted in 32 steps 7 2 8 GE 79 87 160 167 ead cay e Oe x ee ER 88 95 168 175 248 255 16 23 96 103 176 183 24 31 104 111 184 191 EBEN 112 119 192 199 40 47 120 127 200 207 48 5
85. pherals or application specific variables The different groups of these parameters are organized in banks to allow a larger total number for future products Currently only bank O and 1 are used for global parameters and bank 2 is used for user variables All module settings will automatically be stored non volatile internal EEPROM of the processor The TMCL user variables will not be stored in the EEPROM automatically but this can be done by using STGP commands For a table with parameters and bank numbers which can be used together with this command please refer to chapter 4 Internal function the parameter format is converted ignoring leading zeros or ones for negative values The parameter is transferred to the correct position in the appropriate on board device Related commands GGP STGP RSGP AGP Mnemonic SGP lt parameter number gt lt bank number gt lt value gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 9 lt parameter number gt lt bank number gt lt value gt Reply in direct mode STATUS VALUE 100 OK don t care Example Set the serial address of the target device to 3 Mnemonic SGP 66 0 3 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 09 42 00 00 00 00 03
86. ple Get the analogue value of ADC channel 0 Mnemonic GIO 0 1 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 SOf 00 01 00 00 00 00 Reply Byte Index 0 1 2 3 4 5 6 7 Function Host Target Status Instruction Operand Operand Operand Operand address address Byte3 Byte2 Byte1 Byte0 Value hex 02 01 64 SOf 00 00 01 2e www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 40 CES CURLER if gt R i E Ss S LI ie IN OUT O IN OUT 1 Figure 2 2 I O connectors OVERVIEW CONNECTORS D AND 1 Pin IN OUT 0 IN OUT 1 Direction Description 1 GND GND Power GND GND 2 V V ioe Connected to V f Power connector DIGITAL DIGITAL supply output onnecte d IO Vorerra OF FOwer connecto Dedicated analog input 3 AIN_O AIN_4 Input input voltage range 0 10V resolution 12bit 0 4095 4 IN 1 IN k Input Digital input 24V compatible 5 IN 2 IN 6 Input Digital input 24V compatible 6 IN_3 IN_7 Input Digital input 24V compatible Open drain output max 100mA i OUT_0 oles ouput Integrated freewheeling diode Open drain output max 100mA 8 aa oye output Integrated freewheeling diode to Nuit Open dr
87. r will stop in case stallGuard2 load value reaches zero smartEnergy 182 threshold speed Above this speed coolStep becomes enabled 214 power down Standstill period before the current is changed down to standby current The delay standard value is 200 value equates 2000msec www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 79 3 3 Reference Search The built in reference search features switching point calibration and support of one or two reference switches The internal operation is based on a state machine that can be started stopped and monitored instruction RFS no 13 The reference switch is connected in series with the left limit switch The differentiation between the left limit switch and the home switch is made through software Switches with open contacts normally closed are used HINTS FOR REFERENCE SEARCH The settings of the automatic stop functions corresponding to the switches axis parameters 12 and 13 have no influence on the reference search 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 until the switch is released Finally the switch is re entered in the other direction setting the reference point to the center of the two switching points This low calibrating speed is a
88. rameter Description ROR 1 lt motor number gt lt velocity gt Rotate right with specified velocity ROL 2 lt motor number gt lt velocity gt Rotate left with specified velocity MST 3 lt motor number gt Stop motor movement MVP 4 ABS REL COORD lt motor number gt Move to position absolute or relative lt positionloffset gt SAP 5 lt parameter gt lt motor number gt lt value gt Set axis parameter motion control specific settings GAP 6 lt parameter gt lt motor number gt Get axis parameter read out motion control specific settings STAP 7 lt parameter gt lt motor number gt Store axis parameter permanently non volatile RSAP 8 lt parameter gt lt motor number gt Restore axis parameter SGP 9 lt parameter gt lt bank number gt value Set global parameter module specific settings e g communication settings or TMCL user variables GGP 10 lt parameter gt lt bank number gt Get global parameter read out module specific settings e g communication settings or TMCL user variables STGP 11 lt parameter gt lt bank number gt Store global parameter TMCL user variables only RSGP 12 lt parameter gt lt bank number gt Restore global parameter TMCL user variable only RFS 13 START STOP STATUS lt motor number gt Reference search SIO 14 lt port number gt lt bank number lt value gt Set digital output to specified value GIO 15 lt port number gt lt bank number gt Get value of analogue
89. rand address address n Byte3 Byte2 Byte1 Byte0 Value hex 02 01 64 0a 00 00 00 00 gt Value 0 Two special functions of this command have been introduced that make it possible to copy all coordinates or one selected coordinate from the EEPROM to the RAM These functions can be accessed using the following special forms of the GCO command GCO 0 255 0 copies all coordinates except coordinate number 0 from the EEPROM to the RAM GCO lt coordinate number gt 255 0 copies the coordinate selected by lt coordinate number gt from the EEPROM to the RAM The coordinate number must be a value between 1 and 20 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 52 2 7 26 CCO capture coordinate The actual position of the axis is copied to the selected coordinate variable Depending on the global parameter 84 the coordinates are only stored in RAM or also stored in the EEPROM and copied back on startup with the default setting the coordinates are stored in RAM only Please see the SCO and GCO commands on how to copy coordinates between RAM and EEPROM Note that the coordinate number 0 is always stored in RAM only Internal function the selected 24 bit position values are written to the 20 by 3 bytes wide coordinate array Related commands SCO GCO MVP Mnemonic CCO lt coordinate number gt lt motor gt Binary representation INSTRUCTION NO TYPE MOT
90. s such as conditioned jumps In direct mode the value read is only output in the value field of the reply without affecting the accumulator Internal function the parameter is read out of the correct position in the appropriate device The parameter format is converted adding leading zeros or ones for negative values Related commands SAP STAP AAP RSAP Mnemonic GAP lt parameter number gt lt motor gt Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 6 lt parameter number gt yew don t care Reply in direct mode STATUS VALUE 100 OK don t care For a table with parameters and values which can be used together with this command please refer to chapter 3 Example Get the maximum current of motor 1 Mnemonic GAP 6 1 Binary Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 06 06 01 00 00 00 00 Reply Byte Index 0 1 2 3 4 5 6 7 Function Host Target Status Instruction Operand Operand Operand Operand address address Byte3 Byte2 Byte1 Byte0 Value hex 02 01 64 06 00 00 02 80 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 30 2 7 7 STAP store axis parameter An axis parameter previously
91. sis start setting Please remark that 0 8 RW hysteresis start this value is an offset to the hysteresis end value 167 Chopper off time The off time setting controls the minimum O 2 15 RW chopper frequency An off time within the range of Aus to 20us will fit Off time setting for constant to chopper Na 12 32 torp Minimum is 64 clocks Setting this parameter to zero completely disables all driver transistors and the motor can free wheel 168 smartEnergy Sets the lower motor current limit for 0 1 RW current minimum coolStep operation by scaling the CS Current SEIMIN Scale see axis parameter 6 value minimum motor current 0 1 2 of CS 1 1 4 of CS 169 smartEnergy Sets the number of stallGuard2 readings 0 3 RW current down above the upper threshold necessary for each step current decrement of the motor current Number of stallGuard2 measurements per decrement Scaling 0 3 32 8 2 1 0 slow decrement 3 fast decrement 170 smartEnergy Sets the distance between the lower and the 0 15 RW hysteresis upper threshold for stallGuard2 reading Above the upper threshold the motor current becomes decreased Hysteresis smartEnergy hysteresis value 1 32 Upper stallGuard2 threshold smartEnergy hysteresis start smartEnergy hysteresis 1 32 171 smartEnergy Sets the current increment step The current 1 3 RW current up step becomes incremented for each measured stallGuard2 value below the lower
92. ssssneseseenesesaesnesesstsnesesssenesessseneseestenesnees 47 2 7 22 WAIT wait for an event to occul ENEE 48 2 7 23 STOP Stop TMCL program executton ENEE 49 2 70 24 SCO set COOrI Mate EE 50 2 1 25 GCO get coordinate EE 51 2 7 26 CCO capture coordinatel nerenin a n RETA A O EE 52 2 7 27 ACO accu to coordinate sucrose E E EEOAE 53 2 7 28 CALCX calculate using the X register ENEE 54 2 7 29 AAP accumulator to axis ParaMetel c cccsecsecsssessesecsessesessessesessssnesessssneseesssnesessssneseestsnssessseeeseeeteneseess 55 2 7 30 AGP accumulator to global parameter EEN 56 2 31 CLE clear error Tag et eege Arer cen Seu e a Eege E a e Ge 57 2 7 32 VECT set interrupt vectorl ENEE 58 257 33 EL enable interrupt keeten agdeeeg asl sdichiatscns E E a R Ee 59 Sa DE disable interrupt ien ees edd S EEE AE A EEEE 61 2 7 35 RETI Ateturn from interruptesas inaa E A N N EER 63 2 7 36 Customer Specific TMCL Command Extension user funcHon 64 2 7 37 Request Target Position Reached Event EEN 65 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 38 BIN return to binary model ENEE 66 2 7 39 TMCL Control FUnctions csscsccessesessssesesesesesessesesscseseesesesesscsesaesesessesesesacacsesasseseeasseseeasaesesesaeseeasseeeeaeaeees 67 3 Een 68 3 1 stallGuard2 Related Rn 76 3 2 coolStep Related Parameters it it denied eelste 77 3 3 Reference Search wuy usant iiaii ia arlie aiaa Eet
93. stants should be taken for all important numerical values that are used in the program The TMCL IDE provides an include file with symbolic names for all important axis parameters and global parameters EXAMPLE Define some constants include TMCLParam tmc MaxSpeed 500 MaxAcc 100 PositionO 0 Positionl 5000 Initialization SAP APMaxPositioningSpeed Motor0 MaxSpeed SAP APMaxAcceleration Motor MaxAcc MainLoop MVP ABS Motor Positionl WAIT POS Motor0O 0 MVP ABS Motor0 Position WAIT POS Motor0O 0 JA MainLoop Just have a look at the file TMCLParam tmc provided with the TMCL IDE It contains symbolic constants that define all important parameter numbers Using constants for other values makes it easier to change them when they are used more than once ina program You can change the definition of the constant and do not have to change all occurrences of it in your program www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 91 5 4 Using Variables The User Variables can be used if variables are needed in your program They can store temporary values The commands SGP GGP and AGP are used to work with user variables SGP is used to set a variable to a constant value e g during initialization phase GGP is used to read the contents of a user variable and to copy it to the accumulator register for further usage AGP can be used to copy the contents of the accumulator re
94. step dir connector to 1 5 254 switch between hold current and run current no automatic switching d Automatic switching between hold and run current after the first step pulse the module automatically switches over to run current and a configurable time after the last step pulse the module automatically switches back to hold current The ENABLE inputs on the step dir connector do not have any functionality 3 Always use run current never switch to hold current The ENABLE inputs on the step dir connector do not have any functionality 4 Automatic current switching like 2 but the ENABLE inputs are used to switch the driver stages completely off or on 5 Always use run current like 3 but the ENABLE pins are used to switch the driver stages completely off or on z 16MHz microsteps S Unit of acceleration 536870912 2Puls_divisor ramp_divisor sec2 P www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 76 3 1 stallGuard2 Related Parameters The module is equipped with three TMC262 motor driver chips The TMC262 features load measurement that can be used for stall detection stallGuard2 delivers a sensorless load measurement of the motor as well as a stall detection signal The measured value changes linear with the load on the motor in a wide range of load velocity and current settings At maximum motor load the stallGuard2 value goes to zero This corresponds to a load angle of 90 between
95. t care don t care Example Terminate interrupt handling and continue with normal program execution RETI Binary format of RETI Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 26 00 00 00 00 01 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 64 2 7 36 Customer Specific TMCL Command Extension user function The user definable functions UFO UF7 are predefined functions without topic for user specific purposes A user function UF command uses three parameters Please contact TRINAMIC for a customer specific programming Internal function Call user specific functions implemented in C by TRINAMIC Related commands none Mnemonic UFO UF7 lt parameter number gt 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 Function Target Target Status Instruction Operand Operand Operand Operand address address Byte3 Byte2 Byte1 Byte0 Value hex 02 01 user 64 71 user user user user defined defined defined defined defined www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 65 2
96. t stop switch reached 6 search home switch in positive direction reverse the direction when right stop switch reached 7 search home switch in positive direction ignore end switches 8 search home switch in negative direction ignore end switches Additional functions Add 128 to a mode value for inverting the home switch can be used with mode 5 8 Add 64 to a mode for driving the right instead of the left reference switch can be used with mode 1 4 194 Referencing For the reference search this value directly specifies the search speed search speed 195 Referencing Similar to parameter no 194 the speed for the switching point calibration switch speed can be selected 196 Distance end This parameter provides the distance between the end switches after switches executing the RFS command mode 2 or 3 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 80 3 3 1 Reference Search Modes Axis Parameter 193 SAP 193 0 1 M A 3 negative limit switch Search left stop switch only SAP 193 0 2 negative limit switch positive limit switch Search right stop switch then search left stop switch SAP 193 0 3 negative limit switch positive limit switch Search right stop switch then search left stop switch from both sides SAP 193 0 4 negative limit switch Search left stop switch from both sides
97. talls Figure 1 1 stallGuard2 load measurement SG as a function of load coolStep coolStep is a load adaptive automatic current scaling based on the load measurement via stallGuard2 adapting the required current to the load Energy consumption can be reduced by as much as 75 coolStep allows substantial energy savings especially for motors which see varying loads or operate at a high duty cycle Because a stepper motor application needs to work with a torque reserve of 30 to 50 even a constant load application allows significant energy savings because coolStep automatically enables torque reserve when required Reducing power consumption keeps the system cooler increases motor life and allows reducing cost 0 9 Efficiency with coolStep E Efficiency with 50 torque reserve 0 8 0 7 0 6 0 5 Efficiency 0 4 0 3 0 2 0 1 0 T T T T T T 1 0 50 100 150 200 250 300 350 Velocity RPM Figure 1 2 Energy efficiency example with coolStep www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 1 1 Getting Started How to Run a Motor YOU NEED PRECAUTIONS TMCM 3110 with stepper up to three motors Do not mix up connections or short circuit pins Interface RS485 CAN USB suitable to your Avoid bounding I O wires with motor wires module Do not exceed the maximum power supply of Nominal supply voltage 24V DC or 48V DC 10 52 8V DC 52 8V DO D
98. ters 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 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 70 Number Axis Parameter Description Range Unit Acc 140 Microstep O full step 0 8 RWE resolution 1 half step 2 4 microsteps 3 8 microsteps 4 16 microsteps 5 32 microsteps 6 64 microsteps 7 128 microsteps 8 256 microsteps 149 Soft stop flag If cleared the motor will stop immediately 0 1 RWE disregarding motor limits when the reference or limit switch is hit 153 Ramp divisor The exponent of the scaling factor for the 0 13 RWE ramp generator should be de incremented carefully in steps of one 154 Pulse divisor The exponent of the scaling factor for the 0 13 RWE pulse step generator should be de incremented carefully in steps of one 160 Step Step interpolation is supported with a 16 0 1 RW interpolation microstep setting only In this setting each enable step impulse at the input causes the execution of 16 times 1 256 microsteps This way a smooth motor movement like in 256 microstep resolutio
99. th sides search left stop switch from both sides 5 search home switch in negative direction reverse the direction when left stop switch reached 6 search home switch in positive direction reverse the direction when right stop switch reached 7 search home switch in direction ignore end switches positive 8 search home switch in direction ignore end switches negative Additional functions Add 128 to a mode value for inverting the home switch can be used with mode 5 8 Add 64 to a mode for driving the right instead of the left reference switch can be used with mode 1 4 1 8 RWE 194 Referencing search speed For the reference search this value directly specifies the search speed 0 2047 RWE 195 Referencing switch speed Similar to parameter no 194 the speed for the switching point calibration can be selected 0 2047 RWE 196 Distance end switches This parameter provides the distance between the end switches after executing the RFS command mode 2 or 3 0 8388307 197 Last reference position Reference search the last position before setting the counter to zero can be read out A7 244 usteps 200 Boost current Current used for acceleration and deceleration phases If set to 0 the same current as set by axis parameter 6 will be used 0 255 4A Ipeak lt value gt X 255 Ipus lt val see rms lt value EES RWE
100. the coolStep area depending on the load has to be configured with parameters 1169 and 1171 coolStep adjustment points and thresholds Velocity Current Piel See Seen COE DEE The current depends on the load of the motor IK L Time T214 Ei coolStep area area without coolStep 123 Current and parameter Vi23 Velocity and parameter T123 Time parameter SG123 stallGuard2 parameter The lower threshold of the coolStep current can be adjusted up to 16 4 Refer to parameter 168 In this chapter only basic axis parameters are mentioned which concern coolStep and stallGuard2 The complete list of axis parameters in chapter 3 contains further parameters which offer more configuration possibilities www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 78 PARAMETERS NEEDED FOR ADJUSTING THE COOLSTEP FEATURE Number Axis parameter Description The maximum value is 255 This value means 100 of the maximum current of the module The current adjustment is within the range 0 255 and can be adjusted in 32 steps 0 7 79 87 160 167 NH 240 247 Aiea 8 15 88 95 168 175 248 255 solute max 16 23 f 96 103 le 183 6 current aa 31 1104 111 184 191 The most important motor CS Current T high 32 39 112 119 192 199 setting since too hig SECH am Ai 120 127 200 2
101. tion 46 Input 7 trigger Doft 1 low high 2 high low 3 both 0 3 RWE transition www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 90 5 TMCL Programming Techniques and Structure 5 1 Initialization The first task in a TMCL program like in other programs also is to initialize all parameters where different values than the default values are necessary For this purpose SAP and SGP commands are used 5 2 Main Loop Embedded systems normally use a main loop that runs infinitely This is also the case in a TMCL application that is running stand alone Normally the auto start mode of the module should be turned on After power up the module then starts the TMCL program which first does all necessary initializations and then enters the main loop which does all necessary tasks end never ends only when the module is powered off or reset There are exceptions to this e g when TMCL routines are called from a host in direct mode So most but not all standalone TMCL programs look like this Initialization SAP 4 0 500 define max positioning speed SAP 5 0 100 define max acceleration MainLoop do something in this example just running between two positions MVP ABS 0 5000 WAIT POS 0 O0 MVP ABS 0 O WAIT POS 0 O0 JA MainLoop end of the main loop gt run infinitely 5 3 Using Symbolic Constants To make your program better readable and understandable symbolic con
102. to 2 8A RMS coil current and supply voltages up to 48V DC nominal There are separate motor and reference end switch connectors as well as incremental encoder a b n connectors for each motor Communication can take place via RS485 CAN or USB interfaces The module offers 8 general purpose inputs and 8 general purpose outputs for various application possibilities With its high energy efficiency from TRINAMIC s coolStep technology cost for power consumption is kept down The TMCL firmware allows for both standalone operation and direct mode MAIN CHARACTERISTICS Motion controller Motion profile calculation in real time On the fly alteration of motor parameters e g position velocity acceleration High performance microcontroller for overall system control and serial communication protocol handling Bipolar stepper motor driver Up to 256 microsteps per full step High efficient operation low power dissipation Dynamic current control Integrated protection stallGuard2 feature for stall detection coolStep feature for reduced power consumption and heat dissipation Interfaces Up to 8 multi purpose inputs 24V compatible incl 2 dedicated analog inputs Up to 8 multi purpose outputs Open drain incl 2 outputs for currents up to 1A Inputs for 3 incremental encoders differential and TTL open drain S D in for all three axes as alternative to on board motion controller RS485 communication
103. tual position of the motor without affecting the flow of the TMCL program running on the module 2 4 2 6 Interrupt Commands Due to some customer requests interrupt processing has been introduced in the TMCL firmware for ARM based modules Mnemonic Command number Meaning EI 25 Enable interrupt DI 26 Disable interrupt VECT 37 Set interrupt vector RETI 38 Return from interrupt 2 4 2 6 1 Interrupt Types There are many different interrupts in TMCL like timer interrupts stop switch interrupts position reached interrupts and input pin change interrupts Each of these interrupts has its own interrupt vector Each interrupt vector is identified by its interrupt number Please use the TMCL included file Interrupts inc for symbolic constants of the interrupt numbers 2 4 2 6 2 Interrupt Processing When an interrupt occurs and this interrupt is enabled and a valid interrupt vector has been defined for that interrupt the normal TMCL program flow will be interrupted and the interrupt handling routine will be called Before an interrupt handling routine gets called the context of the normal program will be saved automatically i e accumulator register X register TMCL flags There is no interrupt nesting i e all other interrupts are disabled while an interrupt handling routine is being executed On return from an interrupt handling routine the context of the normal program will automatically be restore
104. ut change 0 40 Input change 1 41 Input change 2 42 Input change 3 43 Input change 4 44 Input change 5 45 Input change 6 46 Input change 7 255 Global interrupts www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 62 Examples Disable interrupts globally DI 255 Binary format of DI Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 1A SFF 00 00 00 00 00 Disable interrupt when target position reached DI 3 Binary format of DI Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte0 Value hex 01 1A 03 00 00 00 00 00 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 63 2 7 35 RETI return from interrupt This command terminates the interrupt handling routine and the normal program execution continues At the end of an interrupt handling routine the RETI command must be executed Internal function the saved registers A register X register flags are copied back Normal program execution continues Related commands EI DI VECT Mnemonic RETI Binary representation INSTRUCTION NO TYPE MOT BANK VALUE 38 don t care don
105. vels of nested subroutine calls are allowed 5 6 Mixing Direct Mode and Standalone Mode Direct mode and stand alone mode can also be mixed When a TMCL program is being executed in standalone mode direct mode commands are also processed and they do not disturb the flow of the program running in standalone mode So it is also possible to query e g the actual position of the motor in direct mode while a TMCL program is running Communication between a program running in standalone mode and a host can be done using the TMCL user variables The host can then change the value of a user variable using a direct mode SGP command which is regularly polled by the TMCL program e g in its main loop and so the TMCL program can react on such changes Vice versa a TMCL program can change a user variable that is polled by the host using a direct mode GGP command www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 92 A TMCL program can be started by the host using the run command in direct mode This way also a set of TMCL routines can be defined that are called by a host In this case it is recommended to place JA commands at the beginning of the TMCL program that jump to the specific routines This assures that the entry addresses of the routines will not change even when the TMCL routines are changed so when changing the TMCL routines the host program does not have to be changed EXAMPLE Jump commands to the T
106. ven by the label when the position of motor is greater than or equal to 1000 GAP 1 2 0 Joer axis parameter type no 1 actual position motor 0 value 0 don t care COMP 1000 compare actual value to 1000 JC GE Label Jump type 5 greater equal the label must be defined somewhere else in the program Binary format of the COMP 1000 command Byte Index 0 1 2 3 4 5 6 7 Function Target Instruction Type Motor Operand Operand Operand Operand address Number Bank Byte3 Byte2 Byte1 Byte Value hex 01 14 00 00 00 00 03 e8 www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 2 7 18 JC jump conditional The JC instruction enables a conditional jump to a fixed address in the TMCL program memory if the specified condition is met The conditions refer to the result of a preceding comparison Please refer to COMP instruction for examples This function is for standalone operation only 44 The host address and the reply are only used to take the instruction to the TMCL program memory while the program loads down It does not make sense to use this command in direct mode See the host only control functions for details Internal function the TMCL program counter is set to the passed value if the arithmetic status flags are in the appropriate state s Related commands JA COMP WAIT CLE Mnemonic JC lt condition gt lt label
107. voided when there are more than two nodes connected to a single bus The Trinamic Motion Control Language TMCL provides a set of structured motion control commands Every motion control command can be given by a host computer or can be stored in an EEPROM on the TMCM module to form programs that run standalone on the module For this purpose there are not only motion control commands but 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 whereas the mnemonic format is used for easy usage of the commands when developing standalone TMCL applications using the TMCL IDE IDE means Integrated Development Environment There is also a set of configuration variables for the axis and for global parameters which allow individual configuration of nearly every function of a module This manual gives a detailed description of all TMCL commands and their usage 2 1 Binary Command Format When commands are sent from a host to a module the binary format has to be used Every command consists of a one byte command field a one byte type field a one byte motor bank field and a four byte value field So the binary representation of a command always has seven bytes When a command is to be sent via RS485 or USB interface it has to be enclosed by an address byte at the beginnin
108. www trinamic com TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 SAP 193 0 5 negative limit switch positive limit switch home switch Search home switch in negative direction reverse the direction when left stop switch reached SAP 193 0 6 negative limit switch positive limit switch j home switch Search home switch in positive direction reverse the direction when right stop switch reached SAP 193 0 7 d home switch Search home switch in positive direction ignore end switches SAP 193 0 8 d home switch Search home switch in negative direction ignore end switches www trinamic com 81 TMCM 3110 TMCL Firmware V1 09 Manual Rev 1 02 2014 MAY 26 82 3 4 Calculation Velocity and Acceleration vs Microstep and Fullstep Frequency The values of the axis parameters sent to the TMC429 do not have typical motor values like rotations per second as velocity But these values can be calculated from the TMC429 parameters as shown in this document TMC429 VELOCITY PARAMETERS TMC429 velocity parameters Related TMCM 3110 axis parameters Range TMC429 and TMCM 3110 Velocity target next speed actual speed maximum positioning speed minimum speed referencing search speed referencing switch speed Axis parameter 2 Axis parameter 3 Axis parameter 4 Axis parameter 13 Axis parameter 194 Ax

Download Pdf Manuals

image

Related Search

Related Contents

C - Teuco  BIENVENIDA La Confederación Sudamericana de Bádminton  Owner`s manual  TP-LINK 85Mbps Powerline Ethernet Adapter  Master Calendar User`s Manual  Alimentation des nourrissons au Congo belge (*)  

Copyright © All rights reserved.
Failed to retrieve file