MODULE Module for Stepper Motors TMCM-1270 TMCL™ Firmware Manual Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 The TMCM-1270 is an easy to use, single axis controller/driver module for 2-phase bipolar stepper motors with separate differential encoder and separate home and stop switch inputs. Dynamic current control, and quiet, smooth and efficient operation are combined with stealthChop™, dcStep™, stallGuard™and coolStep™features.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 2 / 87 Contents 1 Features 1.1 stallGuard2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.2 coolStep . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4 5 5 2 First Steps with TMCL 2.1 Basic Setup . . . . . . . . . . . . . . . . 2.2 Using the TMCL Direct Mode . . . . . 2.3 Changing Axis Parameters . . . . .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3 / 87 3.6.29 TMCL Control Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54 4 Axis Parameters 56 5 Global Parameters 66 5.1 Bank 0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66 5.2 Bank 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 1 4 / 87 Features The TMCM-1270 is a single axis controller/driver module for 2-phase bipolar stepper motors with state of the art feature set. It is highly integrated, offers a convenient handling and can be used in many decentralized applications. The module has been designed for coil currents up to 1A RMS and 24V DC supply voltage.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 1.1 5 / 87 stallGuard2 stallGuard2 is a high-precision sensorless load measurement using the back EMF of 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 reaches zero or is near zero.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 2 6 / 87 First Steps with TMCL In this chapter you can find some hints for your first steps with the TMCM-1270 and TMCL. You may skip this chapter if you are already familiar with TMCL and the TMCL-IDE. Things that you will need • Your TMCM-1270 Module. • A CAN adapter. • A power supply (24V DC) for your TMCM-1270 module. • The TMCL-IDE 3.x already installed on your PC • A two-phase bipolar stepper motor. 2.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7 / 87 Number Axis Parameter Description Range [Units] Default Access 5 Maximum acceleration Maximum acceleration in positioning ramps. Acceleration and deceleration value in velocity mode. 0 . . . 7629278 [pps/s] 1000 RWE 6 Maximum current Motor current used when motor is running. The maximum value is 31 which means 100% of the maximum current of the module. 0 . . .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 11 13 15 Loop : MVP ABS , 0 , 512000 WAIT POS , 0 , 0 MVP ABS , 0 , -512000 WAIT POS , 0 , 0 JA Loop 8 / 87 // Move to Position 512000 // Wait until position reached // Move to Position -512000 // Wait until position reached // Infinite Loop After you have done that, take the following steps: 1. Click the Assemble icon (or choose Assemble from the TMCL menu) in the TMCL creator to assemble the program. 2.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3 9 / 87 TMCL and the TMCL-IDE — An Introduction As with most TRINAMIC modules the software running on the microprocessor of the TMCM-1270 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 10 / 87 TMCL Command Format Bytes Meaning 1 Module address 1 Command number 1 Type number 1 Motor or Bank number 4 Value (MSB first!) 1 Checksum Table 2: TMCL Command Format Info Note 3.1.1 The checksum is calculated by accumulating all the other bytes using an 8-bit addition. When using the CAN interface, leave out the address byte and the checksum byte.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.2 11 / 87 Reply Format Every time a command has been sent to a module, the module sends a reply. The reply format with RS-232, RS-485, RS-422 and USB is as follows: TMCL Reply Format Bytes Meaning 1 Reply address 1 Module address 1 Status (e.g.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.3 12 / 87 Standalone Applications The module is equipped with a TMCL memory for storing TMCL applications. You can use the TMCL-IDE for developing standalone TMCL applications. You can download a program into the EEPROM and afterwards 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.4 13 / 87 TMCL Command Overview This sections gives a short overview of all TMCL commands. 3.4.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 15 / 87 Branch Commands 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 event STOP 28 End of a TMCL program Table 7: Branch Commands 3.5.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 16 / 87 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 actual position of the motor) without affecting the flow of the TMCL program running on the module. ©2017 TRINAMIC Motion Control GmbH & Co.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6 17 / 87 Detailed TMCL Command Descriptions The module specific commands are explained in more detail on the following pages. They are listed according to their command number. 3.6.1 SAP (Set Axis Parameter) With this command most of the motion control parameters of the module can be specified. The settings will be stored in SRAM and therefore are volatile.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.2 18 / 87 GAP (Get Axis Parameter) Most motion / driver related parameters of the TMCM-1270 can be adjusted using e.g. the SAP command. With the GAP parameter they can be read out. In standalone mode the requested value is also transferred to the accumulator register for further processing purposes (such as conditional jumps).
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.3 19 / 87 STAP (Store Axis Parameter) This command is used to store TMCL axis parameters permanently in the EEPROM of the module. This command is mainly needed to store the default configuration of the module. The contents of the user variables can either be automatically or manually restored at power on.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.4 20 / 87 RSAP (Restore Axis Parameter) With this command the contents of an axis parameter can be restored from the EEPROM. By default, all axis parameters are automatically restored after power up. An axis parameter that has been changed before can be reset to the stored value by this instruction.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.5 21 / 87 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, peripherals or application specific variables. The different groups of these parameters are organized in banks to allow a larger total number for future products.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.6 22 / 87 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, bank 0 is used for global parameters, and bank 2 is used for user variables.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.7 23 / 87 STGP (Store Global Parameter) This command is used to store TMCL global parameters permanently in the EEPROM of the module. This command is mainly needed to store the TMCL user variables (located in bank 2) in the EEPROM of the module, as most other global parameters (located in bank 0) are stored automatically when being modified.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.8 24 / 87 RSGP (Restore Global Parameter) With this command the contents of a TMCL user variable can be restored from the EEPROM. By default, all user variables are automatically restored after power up. A user variable that has been changed before can be reset to the stored value by this instruction.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.9 25 / 87 RFS (Reference Search) The TMCM-1270 has a built-in reference search algorithm. The reference search algorithm provides different refrence search modes. This command starts or stops the built-in reference search algorithm. The status of the reference search can also be queried to see if it already has finished.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary Form of RFS START Field Value Target address 01h Instruction number 0Dh Type 00h Motor/Bank 00h Value (Byte 3) 00h Value (Byte 2) 00h Value (Byte 1) 00h Value (Byte 0) 00h Checksum 0Eh ©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany Terms of delivery and rights to technical change reserved. Download newest version at www.trinamic.com Read entire documentation.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.10 27 / 87 GIO (Get Input) With this command the status of the available general purpose outputs of the module can be read. The function reads a digital or an analog input port. Digital lines will read as 0 or 1, while the ADC channels deliver their 12 bit result in the range of 0. . . 4095.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 28 / 87 Reply (Status=no error, Value=302) Field Value Host address 02h Target address 01h Status 64h Instruction 0Fh Value (Byte 3) 00h Value (Byte 2) 00h Value (Byte 1) 01h Value (Byte 0) 2Eh Checksum A5h Bank 0 – Digital Inputs The analog input lines can be read as digital or analog inputs at the same time. The digital input states can be accessed in bank 0.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.11 29 / 87 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.12 31 / 87 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 (JC) instruction. This command is intended for use in standalone operation only. Internal function: The accumulator register is compared with the sepcified value.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.13 32 / 87 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 command is intended for standalone operation only.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary form of JC GE, Label assuming Label at address 10 Field Value Target address 01h Instruction number 15h Type 05h Motor/Bank 00h Value (Byte 3) 00h Value (Byte 2) 00h Value (Byte 1) 00h Value (Byte 0) 0Ah Checksum 25h ©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany Terms of delivery and rights to technical change reserved. Download newest version at www.trinamic.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.14 34 / 87 JA (Jump always) Jump to a fixed address in the TMCL program memory. This command is intended for standalone operation only. Internal function: The TMCL program counter is set to the value passed to this command. Related commands: JC, WAIT, CSUB.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.15 35 / 87 CSUB (Call Subroutine) This function calls a subroutine in the TMCL program memory. It is intended for standalone operation only. 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.16 36 / 87 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. Internal function: the TMCL program counter is set to the last value saved on the stack. The command will be ignored if the stack is empty. Related commands: CSUB.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.17 37 / 87 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. There are five different wait conditions that can be used: • TICKS: Wait until the number of timer ticks specified by the parameter has been reached.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Wait for motor 0 to reach its target position, without timeout. Mnemonic: WAIT POS, 0, 0 Binary Form of WAIT POS, 0, 0 Field Value Target address 01h Instruction number 1Bh Type 01h Motor/Bank 00h Value (Byte 3) 00h Value (Byte 2) 00h Value (Byte 1) 00h Value (Byte 0) 00h Checksum 1Dh ©2017 TRINAMIC Motion Control GmbH & Co.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.18 39 / 87 STOP (Stop TMCL Program Execution – End of TMCL Program) This command stops the execution of a TMCL program. It is intended for use in standalone operation only. Internal function: Execution of a TMCL program in standalone mode will be stopped. Related commands: none.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.19 40 / 87 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).
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.20 41 / 87 GCO (Get Coordinate) Using this command previously stored coordinate can be read back. In standalone mode the requested value is copied to the accumulator register for further processing purposes such as conditional jumps. In direct mode, the value is only output in the value field of the reply, without affecting the accumulator.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 42 / 87 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.21 43 / 87 CCO (Capture Coordinate) This command copies the actual position of the axis 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).
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.22 44 / 87 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). Note Coordinate #0 is always stored in RAM only.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.23 45 / 87 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. This command is mainly intended for use in standalone mode.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary Form of CALCX MUL Field Value Target address 01h Instruction number 21h Type 02h Motor/Bank 00h Value (Byte 3) 00h Value (Byte 2) 00h Value (Byte 1) 00h Value (Byte 0) 00h Checksum 24h ©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany Terms of delivery and rights to technical change reserved. Download newest version at www.trinamic.com Read entire documentation.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.24 47 / 87 AAP (Accu 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. This command is mainly intended for use in standalone mode.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.25 48 / 87 AGP (Accu 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. This command is mainly intended for use in standalone mode.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.26 CLE (Clear Error Flags) This command clears the internal error flags. It is mainly intended for use in standalone mode. The following error flags can be cleared by this command (determined by the <flag> 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, WAIT.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary Form of CLE ETO Field Value Target address 01h Instruction number 24h Type 01h Motor/Bank 00h Value (Byte 3) 00h Value (Byte 2) 00h Value (Byte 1) 00h Value (Byte 0) 00h Checksum 26h ©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany Terms of delivery and rights to technical change reserved. Download newest version at www.trinamic.com Read entire documentation.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.27 51 / 87 Customer specific Command Extensions (UF0. . . UF7 – User Functions) These commands are used for customer specific extensions of TMCL. They will be implemented in C by Trinamic. Please contact the sales department of Trinamic Motion Control GmbH & Co KG if you need a customized TMCL firmware. Related commands: none. Mnemonic: UF0. . .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.28 52 / 87 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.29 54 / 87 TMCL Control Commands There is a set of TMCL commands which are called TMCL control commands. These commands can only be used in direct mode and not in a standalone program. For this reason they only have opcodes, but no mnemonics. Most of these commands are only used by the TMCL-IDE (in order to implement e.g. the debugging functions in the TMCL creator).
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Instruction Description Type Value 135 – get application status Return information about the current status, depending on the type field. 0 - return mode, wait flag, memory pointer 1 - return mode, wait flag, program counter 2 - return accumulator 3 - return X register 0 (don’t care) 136 – get firmware version Return firmware version in string format (special reply) or binary format).
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 4 56 / 87 Axis Parameters Most motor controller features of the TMCM-1270 module are controlled by axis parameters. Axis parameters can be modified or read using SAP, GAP, AAP, STAP and RSAP commands. This chapter describes all axis parameters that can be used on the TMCM-1270 module.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 57 / 87 Number Axis Parameter Description Range [Units] Default Access 10 Right Endstop Reference switch right status. 0 - Inactive 1 - Active 0 ...1 0 R 11 Left Endstop Reference switch left status. 0 - Inactive 1 - Active 0 ...1 0 R 12 Automatic Right Stop Enables automatic motor stop during active right reference switch input. 0 - Inactive 1 - Active 0 ...
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 58 / 87 Number Axis Parameter Description Range [Units] Default Access 22 Speed threshold for high speed mode Speed threshold for de-activating coolStep or switching to fullstep mode. 0 . . . 4999999 [pps] 0 RW 23 Minimum speed for switching to dcStep Minimum speed for switching to dcStep. 0 . . .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 59 / 87 Number Axis Parameter Description Range [Units] Default Access 40 Supply voltage The actual supply voltage. 0 . . . 1000 [100mV] 240 R 127 Relative Positioning Option Code The command MoveToRelativePosition uses as referene the following position: 0 - the target position 1 - the actual position 2 - the encoder position 0 ...
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 60 / 87 Number Axis Parameter Description Range [Units] Default Access 163 Constant TOff Mode Selection of the chopper mode. 0 - spread cycle 1 - classic constant off time 0 ...1 0 RW 164 Disable fast decay comparator See parameter 163. For "classic const. off time", setting this parameter to "1" will disable current comparator usage for termination of fast decay cycle.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 61 / 87 Number Axis Parameter Description Range [Units] Default Access 170 smartEnergy hysteresis Sets the distance between the lower and the upper threshold for stallGuard2 reading. Above the upper threshold the motor current becomes decreased. Hysteresis: ([AP172] + 1) * 32. Upper stallGuard threshold: ([AP172] + [AP170] + 1) * 32 0 . . .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 62 / 87 Number Axis Parameter Description Range [Units] Default Access 180 smartEnergy actual current This status value provides the actual motor 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 0 . . .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 63 / 87 Number Axis Parameter Description Range [Units] Default Access 191 PWM frequency PWM frequency selection fro StealthChop. 0 - fP W M = 1/1024fCLK 1 - fP W M = 1/683fCLK 2 - fP W M = 1/512fCLK 3 - fP W M = 1/410fCLK 0 ...3 0 RW 192 PWM autoscale PWM automatic amplitude scaling for StealthChop. 0 - User defined PWM amplitude.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 64 / 87 Number Axis Parameter Description Range [Units] Default Access 201 Encoder mode Encoder mode configuration. See bits 0-9 of TMC5130 ENCMODE register. 0 . . . 1023 0 RW 202 Motor Fullstep Resolution Number of fullsteps of the motor. 0 . . . 4294967295 [fullsteps] 200 RWE 203 PWM symmetric Force symmetric PWM for StealthChop.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 65 / 87 Number Axis Parameter Description Range [Units] Default Access 255 Unit mode Units of velocity and acceleration/deceleration settings 0 - internal units of TMC5130 1 - pps for velocity and pps/s for acceleration 0 ...1 1 RW Table 11: All TMCM-1270 Axis 0 Parameters ©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany Terms of delivery and rights to technical change reserved.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 5 66 / 87 Global Parameters The following sections describe all global parameters that can be used with the SGP, GGP, AGP, STGP and RSGP commands. Global parameters are grouped into banks: • Bank 0: Global configuration of the module. • Bank 2: TMCL user variables. 5.1 Bank 0 Parameters with numbers from 64 on configure stuff like the serial address of the module RS485 baud rate or the CAN bit rate.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 67 / 87 Number Global Parameter Description Range [Units] Default Access 72 CAN Secondary Id CAN Messages with this target Id will also be received and interpreted. If the value is 0, this functionality will not be used. 0 . . . 255 0 RWA 77 Auto start mode Use automatic TMCL application start after power up.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 68 / 87 Meaning of the letters in the Access column Access type Command Description R GGP Parameter readable W SGP, AGP Parameter writable E STGP, RSGP Parameter can be stored in the EEPROM Table 14: Meaning of the Letters in the Access Column User Variables in Bank 2 Number Global Parameter Description Range [Units] Access 0. . . 55 user variables #0. . .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 6 69 / 87 Module Specific Modes This section explains how the three availabe inputs can be configured. The TMCM-1270 implements three different predefined modes, each one with a different set of functions for these three pins. Axis Parameter number 254 “Module Specific Mode” (see Section 4) contains the current mode. In Table 16, the functionalities for all three pins in each configuration are shown.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7 70 / 87 Hints and Tips This chapter gives some hints and tips on using the functionality of TMCL, for example how to use and parameterize the built-in reference search algorithm or using an incremental encoder. You will also find basic information about stallGuard2™ and coolStep™ in this chapter. 7.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7.1.1 71 / 87 Mode 1 Reference search mode 1 only searches the left end switch. Select this mode by setting axis parameter #193 to 1. Figure 3 illustrates this. Add 64 to the mode number (i.e. set axis parameter #193 to 65) to search the right end switch instead of the left end switch.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 L 72 / 87 R start stop left limit / end / stop switch right limit / end / stop switch : reference search speed (axis parameter 194) : reference switch speed (axis parameter 195) Figure 5: Reference search Mode 3 7.1.4 Mode 4 Reference search mode 4 searches the left end switch only, but from both sides so that the middle of the switch will be found and used as the zero point. This is shown in figure 6.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 73 / 87 Home L R start stop left limit / end / stop switch home switch : reference search speed (axis parameter 194) : reference switch speed (axis parameter 195) Figure 7: Reference search Mode 5 7.1.6 Mode 6 Reference search mode 6 searches the home switch in positive direction. The search direction will be reversed if the left limit switch is reached. This is shown in figure 8.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 L 74 / 87 R start stop home switch : reference search speed (axis parameter 194) : reference switch speed (axis parameter 195) Figure 9: Reference search Mode 7 7.1.8 Mode 8 Reference search mode 8 searches the home switch in positive direction, ignoring the limit switch inputs. It is recommende mainly for use with a circular axis. The exact middle of the switch will be found and used as the zero point.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7.2 75 / 87 stallGuard2 The module is equipped with motor driver chips that feature load measurement. This load measurement 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7.3 76 / 87 coolStep This section gives an overview of the coolStep related parameters. Please bear in mind that the figure only shows one example for a drive. There are parameters which concern the configuration of the current. Other parameters are there for velocity regulation and for time adjustment. Figure 11 shows all the adjustment points for coolStep.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description I6 Absolute maximum current 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. . . 255 divided by eight; e.g. step 0 = 0. . . 7, step 1 = 8. . . 15 and so on).
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7.4 78 / 87 Velocity and Acceleration Calculation When the unit mode (axis parameter #255) is set to 1 (which is also the default value), all velocity parameters on the TMCM-1270 are given in microsteps per second (also called pulse per second or pps). Acceleration and deceleration units are given in pps2 . When axis parameter #255 is set to 0 the internal units of the ramp generators are directly used.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 8 79 / 87 TMCL Programming Techniques and Structure 8.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. 8.2 Main Loop Embedded systems normally use a main loop that runs infinitely.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 17 80 / 87 WAIT POS , Motor0 , 0 JA MainLoop 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 in a program. You can change the definition of the constant and do not have to change all occurrences of it in your program. 8.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 8.5 81 / 87 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 82 / 87 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.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 9 83 / 87 Figures Index 1 2 3 4 5 6 stallGuard2 Load Measurement as a Function of Load . . . . . . . . . . . . Energy Efficiency Example with coolStep Reference search Mode 1 . . . . . . . Reference search Mode 2 . . . . . . . Reference search Mode 3 . . . . . . . Reference search Mode 4 . . . . . . . 5 5 71 71 72 72 ©2017 TRINAMIC Motion Control GmbH & Co.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 10 1 2 3 4 5 6 7 8 9 10 11 12 84 / 87 Tables Index Most important Axis Parameters . . . TMCL Command Format . . . . . . . . TMCL Reply Format . . . . . . . . . . . TMCL Status Codes . . . . . . . . . . . Overview of all TMCL Commands . . . Parameter Commands . . . . . . . . . Branch Commands . . . . . . . . . . . I/O Port Commands . . . . . . . . . . Calculation Commands . . . . . . . . TMCL Control Commands .
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 11 85 / 87 Supplemental Directives 11.1 Producer Information 11.2 Copyright TRINAMIC owns the content of this user manual in its entirety, including but not limited to pictures, logos, trademarks, and resources. © Copyright 2017 TRINAMIC. All rights reserved. Electronically published by TRINAMIC, Germany.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 86 / 87 or of any other nature are made hereunder with respect to information/specification or the products to which information refers and no guarantee with respect to compliance to the intended use is given. In particular, this also applies to the stated possible applications or areas of applications of the product.
TMCM-1270 TMCL™ Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 12 Revision History 12.1 Document Revision Version Date Author Description V0.8 2016-JUL-12 BS Exported from xml. V0.9 2016-SEP-26 BS First complete version. V1.00 2016-NOV-18 BS Final version with changes from Fw V1.0. Table 19: Document Revision ©2017 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany Terms of delivery and rights to technical change reserved.