Table of Contents

Advertisement

Quick Links

TMCM-142
TM
TMCL
Firmware Manual
Version: 1.06
2014-JUN-24
Trinamic Motion Control GmbH & Co KG
Waterloohain 5
D - 22769 Hamburg, Germany
http://www.trinamic.com

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TMCL TMCM-142 and is the answer not in the manual?

Questions and answers

Summary of Contents for Trinamic TMCL TMCM-142

  • Page 1 TMCM-142 TMCL Firmware Manual Version: 1.06 2014-JUN-24 Trinamic Motion Control GmbH & Co KG Waterloohain 5 D - 22769 Hamburg, Germany http://www.trinamic.com...
  • Page 2: Table Of Contents

    6.7.25 GCO (get coordinate) ..........................75 6.7.26 CCO (capture coordinate) ........................... 76 6.7.27 ACO (accu to coordinate)........................... 77 6.7.28 CALCX (calculate using the X register) ....................78 6.7.29 AAP (accumulator to axis parameter) ....................79 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 3 Reference search .............................. 104 Fixing microstep errors ..........................105 Using the RS485 interface ..........................106 10 Revision history ................................ 107 10.1 Firmware revision ............................107 10.2 Document Revision ............................107 11 References................................... 108 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 4: Life Support Policy

    Specifications are subject to change without notice. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 5: Features

     Integrated protection: overtemperature/undervoltage Software  Stand-alone operation using TMCL or remote controlled operation  Memory for 2048 TMCL commands  PC-based application development software TMCL-IDE included  CANopen ready Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 6: Order Codes

    60mm/NEMA24, 1.8˚ step angle 60.5 x 60.5 x 45/56/ 65/86 mm Table 3.1: Order codes Versions without the standard adapter/interface board TMCM-IF (just the baseboard) or custom interface boards are available on request. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 7: Overview

    Whereas the boot loader is installed during production and testing at TRINAMIC and remains – normally – 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).
  • Page 8: Putting The Tmcm-142 Into Operation

    Avoid bounding I/O wires with motor power wires as this may cause noise picked up from the motor supply.  Do not exceed the maximum power supply of 78.5V DC.  Start with power supply OFF! Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 9: Starting Up

    Firmware Manual (V1.06 / 2014-JUN-24) 5.1 Starting up Connect the TMCM-142 and the TMCM-IF Usually TRINAMIC delivers the base board and the add-on board connected. If not for any reason, this figure will show you how to do this. Connector 3...
  • Page 10 Figure 5.2: Overview of DIP switches For selecting the USB interface, configure the DIP switches 101 and 102 as shown below: Switch 102 Switch 101 Figure 5.3: Configuration of DIP switches for USB Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 11 Single ended: Channel N input No internal resistors. (TTL) Differential: Channel N+ input Active for one clock pulse at Digital user controlled input #4. each on-pole fullstep position. No internal resistors. (TTL) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 12 If this does not occur, switch power OFF and check your connections as well as the power supply. Start the TMCL-IDE software development environment The TMCL-IDE is on hand on the TechLibCD and on www.trinamic.com. Installing the TMCL-IDE:  Make sure the COM port you intend to use is not blocked by another program.
  • Page 13: Testing With A Simple Tmcl

    Click on Icon Assemble to convert the TMCL™ into machine code. Then download the program to the TMCM-142 module via the icon Download. Press icon Run. The desired program will be executed. Click Stop button to stop the program. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 14: Operating The Module In Direct Mode

    -> Click Execute. The first motor is rotating now.  MST motor stop, motor 0 -> Click Execute. The first motor stops now. You will find a description of all TMCL commands in the following chapters. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 15: Tmcl Tm And Tmcl-Ide

    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). Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 16: Reply Format

    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! Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 17: Status Codes

    These commands control the motion of the motor. They are the most important commands and can be used in direct mode or in stand-alone mode. Command Mnemonic Meaning number Rotate left Rotate right Move to position Motor stop Reference search Store coordinate Capture coordinate Get coordinate Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 18: Parameter Commands

    Jump conditional COMP Compare accumulator with constant value Clear error flags CSUB Call subroutine RSUB Return from subroutine WAIT Wait for a specified event STOP End of a TMCL program Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 19: Calculation Commands

    GAP, GGP or GIO 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. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 20: Tmcl Tm Commands

    CSUB <subroutine address> Call subroutine RSUB Return from subroutine WAIT <condition>, <motor number>, Wait with further program execution <ticks> STOP Stop program execution <coordinate number>, <motor Set coordinate number>, <position> Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 21 137 – restore factory reset all settings stored in the (don’t care) (don’t care) must be 1234 settings EEPROM to their factory defaults This command does not send back a reply. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 22: The Ascii Interface

    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 back when the module is addressed. A Character can also Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 23 <CR> character has been sent. When bit 5 is set and bit 4 is clear there will be no echo, only the reply will be sent. This may be useful in RS485 systems. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 24: Commands

    Rotate right, motor #0, velocity = 350 Mnemonic: ROR 0, 350 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 25: Rol (Rotate Left)

    Rotate left, motor #0, velocity = 1200 Mnemonic: ROL 0, 1200 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 26: Mst (Motor Stop)

    (don't care) Example: Stop motor Mnemonic: MST 0 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 27: Mvp (Move To Position)

    Move motor from current position 1000 steps backward (move relative –1000) Mnemonic: MVP REL, 0, -1000 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 28 Byte2 Byte1 Byte0 Value (hex)  When moving to a coordinate, the coordinate has to be set properly in advance with the help of the SCO, CCO or ACO command. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 29: Sap (Set Axis Parameter)

    Right limit switch disable Deactivates the function of the right limit switch when set to 1. Left limit switch disable Deactivates the function of the left limit switch when set to 1. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 30 0: no mixed decay when standing 1: use mixed decay when standing Chopper clock divider Chopper clock frequency divider. Do 96…818 not change! Chopper clock = 16MHz/value Default = 444 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 31 Clipping parameter for pid_isum 0…32640 Clipping of (pid_isum*2^16*pid_iclip) PID d clock divider Clock divider for D part calculation 0…255 D-part is calculated with a frequency of: / (pid_d_clkdiv*128) (attention: pid_d_clkdiv=0 results in 256) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 32 1. Microstep table position Position of the microstep table 0…8191 pointer. Step pulse length Length of the step pulses on the 0…255 step/direction output. [1/16 MHz] Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 33 0: use TMC457 units 1: use PPS units Please use the TMC457 calculations data file (www.trinamic.com) for getting best values. Please refer to 7.1 for information about real world units vs. units of the TMC457. Example: Set the absolute maximum current of motor to 200mA...
  • Page 34: Gap (Get Axis Parameter)

    Current when motor is standing. 0 0…15 means 0%, 15 means 100% of the maximum possible current. Position reached 1 when the target position and the actual position are equal. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 35 Shaft Reverses the motor direction when set to 1. Standby delay Time after the motor has stopped 0…4095 until the current is changed to [1/f standby current. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 36 PID p factor P parameter (unsigned) 0…1677215 update frequency f /128; Result: pid_e*pid_p/256 (becomes clipped to +/-2^31) PID i factor I parameter (unsigned) 0…1677215 Result: (pid_isum/256)*pid_i/256 (becomes clipped to +/-2^31) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 37 0… 32767 [µsteps] 1/65536 when bit 13 in param. 43 is Bits 15-0: not set or in 1/10000 when bit 13 0… 9999 in param. 43 is set. [1/1000 µsteps] Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 38 0…255 step/direction output. [1/16 MHz] Ramp mode Normally set automatically by the 0...3 ROL, ROR, MVP and MST commands. 0: positioning mode 1: reserved 2: velocity mode 3: hold mode Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 39 Get the actual position of motor Mnemonic: GAP 0, 1 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Reply: Byte Index Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 40 TMCM-142 TMCL Firmware Manual (V1.06 / 2014-JUN-24) Function Host- Target- Status Instruction Operand Operand Operand Operand Checksum address address Byte3 Byte2 Byte1 Byte0 Value (hex)  status=no error, position=711 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 41: Stap (Store Axis Parameter)

    Right limit switch disable Deactivates the function of the right limit switch when set to 1. Left limit switch disable Deactivates the function of the left limit switch when set to 1. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 42 Mixed decay standby 0: no mixed decay when standing 1: use mixed decay when standing Chopper clock divider Chopper clock frequency divider. Do not change! Chopper clock = 16MHz/value Default = 444 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 43 PID i clipping Clipping parameter for pid_isum Clipping of (pid_isum*2^16*pid_iclip) PID d clock divider Clock divider for D part calculation D-part calculated with frequency of: / (pid_d_clkdiv*128) (attention: pid_d_clkdiv=0 results in 256) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 44 Length of the step pulses on the step/direction output. Ramp mode Normally set automatically by the ROL, ROR, MVP and MST commands. 0: positioning mode 1: reserved 2: velocity mode 3: hold mode Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 45 Note: The STAP command will not have any effect when the configuration EEPROM is locked (refer to 8.1). In direct mode, the error code 5 (configuration EEPROM locked, see also section 6.2.1) will be returned in this case. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 46: Rsap (Restore Axis Parameter)

    Right limit switch disable Deactivates the function of the right limit switch when set to 1. Left limit switch disable Deactivates the function of the left limit switch when set to 1. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 47 Mixed decay standby 0: no mixed decay when standing 1: use mixed decay when standing Chopper clock divider Chopper clock frequency divider. Do not change! Chopper clock = 16MHz/value Default = 444 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 48 PID i clipping Clipping parameter for pid_isum Clipping of (pid_isum*2^16*pid_iclip) PID d clock divider Clock divider for D part calculation D-part calculated with frequency of: / (pid_d_clkdiv*128) (attention: pid_d_clkdiv=0 results in 256) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 49 Length of the step pulses on the step/direction output. Ramp mode Normally set automatically by the ROL, ROR, MVP and MST commands. 0: positioning mode 1: reserved 2: velocity mode 3: hold mode Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 50 Restore the maximum current of motor #0 Mnemonic: RSAP 6, 0 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 51: Sgp (Set Global Parameter)

    1 – start up in ASCII mode Bits 4 and 5: 00 – Echo back each character 01 – Echo back complete command 10 – Do not send echo, only send command reply Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 52 Together with user definable commands these variables form the interface between extensions of the firmware (written in C) and TMCL applications. Please contact TRINAMIC if you are interested in this. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 53 Set the serial address of the target device to 3 Mnemonic: SGP 66, 0, 3 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 54: Ggp (Get Global Parameter)

    1 – start up in ASCII mode Bits 4 and 5: 00 – Echo back each character 01 – Echo back complete command 10 – Do not send echo, only send command reply Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 55 A 32 bit counter that gets incremented by one every millisecond. It can also be reset to any start value. random number Choose a random number. Read only! 0…21474 83647 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 56 Byte2 Byte1 Byte0 Value (hex) Reply: Byte Index Function Host- Target- Status Instruction Operand Operand Operand Operand Checksum address address Byte3 Byte2 Byte1 Byte0 Value (hex)  Status=no error, Value=1 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 57: Stgp (Store Global Parameter)

    TMCL™ applications general purpose variable #11 for use in TMCL™ applications general purpose variable #12 for use in TMCL™ applications general purpose variable #13 for use in TMCL™ applications Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 58 8.1). In direct mode, the error code 5 (configuration EEPROM locked, see also section 6.2.1) will be returned in this case. Please refer to chapter 7 for more information about bank 0 to 2. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 59: Rsgp (Restore Global Parameter)

    #10 for use in TMCL™ applications …+2 general purpose variable #11 for use in TMCL™ applications …+2 general purpose variable #12 for use in TMCL™ applications …+2 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 60 Restore the maximum current of motor #0 Mnemonic: RSAP 6, 0 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 61: Rfs (Reference Search)

    Start reference search of motor #0 Mnemonic: RFS START, 0 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 62: Sio (Set Output)

    Pin (connector 3) I/O port Command Range OUT_0 SIO 0, 2, <n>, (n=0/1) OUT_1 SIO 1, 2, <n>, (n=0/1) OUT_2 SIO 2, 2, <n>, (n=0/1) OUT_7 SIO 7, 2, <n>, (n=0/1) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 63 Set all output pins high. Mnemonic: SIO 255, 2, 255 The following program will show the states of the input lines on the output lines: Loop: GIO 255, 0 SIO 255, 2,-1 JA Loop Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 64: Gio (Get Input/Output)

    Operand Checksum address address Byte3 Byte2 Byte1 Byte0 Value (hex)  value: 506 Connector 3 3 Pin 1 Connector 2 2 Pin 1 TMCM-142 Terminal 1 1 Connector 1 1 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 65 The states of the OUT lines (that have been set by SIO commands) can be read back using bank 2. Pin (connector 3) I/O port Command Range OUT_0 GIO 0, 2, <n> OUT_1 GIO 1, 2, <n> OUT_2 GIO 2, 2, <n> OUT_7 GIO 7, 2, <n> Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 66: Calc (Calculate)

    Multiply accu by –5000 Mnemonic: CALC MUL, -5000 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 67: Comp (Compare)

    //jump, type: 5 greater/equal, the label must be defined somewhere else in the program Binary format of the COMP 1000 command: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 68: Jc (Jump Conditional)

    Binary format of “JC GE, Label” when Label is at address 10: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 69: Ja (Jump Always)

    Binary format of “JA Loop” assuming that the label “Loop” is at address 20: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 70: Csub (Call Subroutine)

    Binary format of the “CSUB SubW” command assuming that the label “SubW” is at address 100: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 71: Rsub (Return From Subroutine)

    Example: please see the CSUB example (section 6.7.20). Binary format of RSUB: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 72: Wait (Wait For An Event To Occur)

    #0 to reach its target position, without timeout Mnemonic: WAIT POS, 0, 0 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 73: Stop

    (don't care) (don't care) (don't care) Example: Mnemonic: STOP Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 74: Sco (Set Coordinate)

    Set coordinate #1 of motor to 1000 Mnemonic: SCO 1, 0, 1000 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 75: Gco (Get Coordinate)

    Byte3 Byte2 Byte1 Byte0 Value (hex) Reply: Byte Index Function Target- Target- Status Instruction Operand Operand Operand Operand Checksum address address Byte3 Byte2 Byte1 Byte0 Value (hex)  Value: 0 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 76: Cco (Capture Coordinate)

    Store current position of the axe to coordinate 3 Mnemonic: CCO 3, 0 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 77: Aco (Accu To Coordinate)

    Copy the actual value of the accumulator to coordinate 1 of motor #0 Mnemonic: ACO 1, 0 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 78: Calcx (Calculate Using The X Register)

    Example: Multiply accu by X-register Mnemonic: CALCX MUL Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 79: Aap (Accumulator To Axis Parameter)

    Right limit switch disable Deactivates the function of the right limit switch when set to 1. Left limit switch disable Deactivates the function of the left limit switch when set to 1. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 80 Mixed decay standby 0: no mixed decay when standing 1: use mixed decay when standing Chopper clock divider Chopper clock frequency divider. Do not change! Chopper clock = 16MHz/value Default = 444 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 81 PID i clipping Clipping parameter for pid_isum Clipping of (pid_isum*2^16*pid_iclip) PID d clock divider Clock divider for D part calculation D-part calculated with frequency of: / (pid_d_clkdiv*128) (attention: pid_d_clkdiv=0 results in 256) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 82 Length of the step pulses on the step/direction output. Ramp mode Normally set automatically by the ROL, ROR, MVP and MST commands. 0: positioning mode 1: reserved 2: velocity mode 3: hold mode Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 83 // jump back to start Binary format of the AAP 0,0 command: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 84: Agp (Accumulator To Global Parameter)

    00 – Echo back each character 01 – Echo back complete command 10 – Do not send echo, only send command reply CAN bit rate 10kBit/s 1…7 20kBit/s 50kBit/s 100kBit/s 125kBit/s 250kBit/s 500kBit/s 1000kBit/s Default Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 85 Together with user definable commands these variables form the interface between extensions of the firmware (written in C) and TMCL applications. Please contact TRINAMIC if you are interested in this. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 86 Copy accumulator to TMCL user variable #3 Mnemonic: AGP 3, 2 Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 87: Cle (Clear Error Flags)

    Example: Reset the timeout flag Mnemonic: CLE ETO Binary: Byte Index Function Target- Instruction Type Motor/ Operand Operand Operand Operand Checksum address Number Bank Byte3 Byte2 Byte1 Byte0 Value (hex) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 88: Customer Specific Tmcl Tm Command Extension (Uf0

    The user definable functions UF0 through UF7 are predefined, empty functions for user specific purposes. Contact TRINAMIC for customer specific programming of these functions. Internal function: Call user specific functions implemented in C by TRINAMIC. Related commands: none Mnemonic: UF0 ... UF7 Binary representation: INSTRUCTION NO.
  • Page 89: Request Target Position Reached Event

    Motor number is always O as only one motor is involved. Reasonable values for the motor bit mask (of modules with one axis like the TMCM-142) are 0 and 1. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 90: 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. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 91: Tmcl™ Control Functions

    EEPROM their factory defaults This command does not send back a reply. 139 – enter ASCII Enter ASCII command line (see (don’t care) (don’t care) (don’t care) mode chapter 6.6) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 92 The version number is output in the value field of the reply in the following way: Byte index in value field Contents Version number, low byte Version number, high byte Type number, low byte (currently not used) Type number, high byte (currently not used) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 93: Axis Parameters

    Right limit switch disable Deactivates the function of the right limit switch when set to 1. Left limit switch disable Deactivates the function of the left limit switch when set to 1. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 94 Default = 444 Actual load value The actual load value. 0…7 7 = low load 0 = high load Driver status Bit 0: driver error Bit 1: over temperature pre-warning Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 95 +/- 127) PID i clipping Clipping parameter for pid_isum 0…32640 Clipping of (pid_isum*2^16*pid_iclip) PID i sum PID integrator sum (signed) Updated with f [Hz]/128 Cleared to zero upon write access Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 96 Bit 13: Encoder divisor selection (0=encoder constant/65535, 1=encoder constant/10000). Encoder status 1 when an encoder null channel event has been detected. Cleared after reading. Encoder latch Encoder position latched on N [µsteps] channel event. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 97 Specifies the speed for the exact 0…2147483647 reference switch calibration. End switch distance Provides the distance between the 0…2147483647 two end switches after executing a [µsteps] reference search in mode 2 or 3. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 98: Real World Units Vs. Units Of The Tmc457

    = rs [457] micro steps during linear acceleration ramp (if v_max is really reached during acceleration) Please refer to the TMC457 datasheet (www.trinamic.com) for more information about the units and examples. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 99: Global Parameters

    1 – start up in ASCII mode Bits 4 and 5: 00 – Echo back each character 01 – Echo back complete command 10 – Do not send echo, only send command reply Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 100 A 32 bit counter that gets incremented by one every millisecond. It can also be reset to any start value. random number Choose a random number. Read only! 0…21474 83647 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 101: Bank 1

    The global parameter bank 1 is normally not available. It may be used for customer specific extensions of the firmware. Together with user definable commands (see section 7.3) these variables form the interface between extensions of the firmware (written in C) and TMCL applications. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 102: Bank 2

    #18 for use in TMCL™ applications …+2 general purpose variable #19 for use in TMCL™ applications …+2 20..55 general purpose variables for use in TMCL™ applications …+2 #20..#55 Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 103: Hints And Tips

    PID controller. Additionally, a special control register allows software interaction for additional feedback control algorithms that can be implemented within the micro controller used to parameterize the TMC457. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 104: Reference Search

    Figure 9.1: Two limit switches Figure 9.2: Limit switch with extra Figure 9.3: Circular reference switch system Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 105: Fixing Microstep Errors

    2) Using mixed decay: This can be switched on by setting parameter21 to the value 1. Then, the motor will run with mixed decay turned on. The minimum reachable motor current then is always near zero which also leads to better microstepping results. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 106: Using The Rs485 Interface

    SGP 75, 0, 15 command in direct mode. The parameter will automatically be stored in the configuration EEPROM. For RS232 set the telegram pause time to zero for maximum data throughput. Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 107: Revision History

    Minor corrections 1.03 2009-JUL-17 MVP COORD command corrected 1.04 2009-JUL-31 GIO and SIO commands corrected, minor changes 1.05 2009-NOV-17 SD Minor corrections 1.06 2014-JUN-24 USB stack changed, no functional changes Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...
  • Page 108: References

    TMCM-142 TMCL Firmware Manual (V1.06 / 2014-JUN-24) 11 References [TMCL TMCL reference and programming manual (see http://www.trinamic.com) [TMCM-142-IF] TMCM-142-IF hardware manual (see http://www.trinamic.com) [TMCM-IF) TMCM-IF hardware manual (see http://www.trinamic.com) Copyright © 2009, TRINAMIC Motion Control GmbH & Co. KG...

Table of Contents