motionCookie™ SYSTEM IN A PACKAGE motionCookie™ TMCC160 TMCL™ FIRMWARE MANUAL TMCC160 TMCL Firmware Version 2.11 • 2018-Feb-08 | Document Revision 1.01 • 2018-Feb-08 The TMCL™ Firmware is used in combination with the integrated TMCC160 motionCookie™ microsystem with 3-Phase BLDC/PMSM gate driver for up to 24V and 1A gate current. Features The TMCL Firmware can operate in stand-alone or in remote control mode.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 2/57 TABLE OF CONTENTS TMCC160 TMCL™ Firmware Manual ..............................................................2 Features.......................................................................................................................... 2 TABLE OF CONTENTS .....................................................................................2 TMCL Overview ....................................................
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 ESD DEVICE INSTRUCTIONS ........................................................................................ 51 Producer Information ................................................................................................... 51 Copyright ...................................................................................................................... 51 Target User .......................................
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 4/57 TMCL Overview The software that runs on the microprocessor of the TMCC160 motionCookie™ consists of two parts: 1. Boot loader: The boot loader is installed by TRINAMIC during production. It remains untouched throughout its entire product lifetime. 2. Firmware: The firmware can be updated by the user. The firmware is related to the standard TMCL firmware [TMCL] with regard to protocol and commands.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Checksum Calculation 5/57 The checksum is calculated by adding up all bytes (including the module address byte) using 8-bit addition.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 1.1.2 6/57 Reply Format RS232 and RS485 Reply Format Whenever a command is sent to a module, the module sends a reply. The reply format for RS232 and RS485 is structured as follows: RS253 and RS485 TMCL Reply Format Bytes Description 1 Reply address 1 Module address 1 Status (e.g.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 1.1.3 7/57 Motion Commands These commands control the motion of the motor. They are the most important commands and can be used in direct mode or in standalone mode. TMCL Motion Commands Mnemonic Command Number Description ROR 1 Rotate right. ROL 2 Rotate left. MST 3 Motor stop. MVP 4 Move to position. Table 4: TMCL Motion Commands 1.1.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 8/57 1.2 Detailed TMCL Commands The module-specific commands are explained in more detail on the following pages. They are listed according to their command number. 1.2.1 ROR (Rotate Right) Process Description The motor is instructed to rotate with a specified velocity in right direction (increasing the position counter). First, velocity mode is selected.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 1.2.2 9/57 ROL (Rotate Left) The motor is instructed to rotate with a specified velocity (opposite direction compared to ROR, decreasing the position counter). Process Description First, velocity mode is selected. Then, the velocity value is transferred to axis parameter #2 ( target velocity). Related commands: ROR, MST, SAP, GAP Mnemonic: ROL 0, NOTE: An example for ROL is provided in Table 11.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 1.2.3 10/57 MST (Motor Stop) The motor is instructed to stop with the MST function. The axis parameter target velocity is set to zero. Process Description Related commands: ROL, ROR, SAP, GAP Mnemonic: MST 0 NOTE: An example for MST is provided Table 14.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 1.2.4 11/57 MVP (Move to Position) Two available Operation Types The motor is instructed to move to a specified relative or absolute position. The motor uses the predefined acceleration/deceleration ramp and the positioning speed. This setting can be changed by the user. The command is non-blocking (like all commands). A reply is sent immediately after command interpretation.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 13/57 SAP Example: Absolute Maximum Current 2000mA: Mnemonic: SAP6, 0, 2000 Byte Index Function 0 1 2 3 4 5 6 7 Targetaddress Instruction Number Type Motor/ Bank Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 $01 $05 $06 $00 $00 $00 $07 $D0 Value (hex) Table 21: SAP Example: Absolute Max. Current 2000MA: 1.2.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 14/57 GAP Reply Example Byte Index Function 0 1 2 3 4 5 6 7 Hostaddress Targetaddress Status Instruction Operand Byte3 Operand Byte2 Operand Byte1 Operand Byte0 $00 $01 $64 $06 $00 $00 $02 $c7 Value (hex) Table 25: GAP Reply Example 1.2.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 1.2.8 15/57 RSAP (Restore Axis Parameter) Non-Volatile Memory Locations For all configuration-related axis parameters non-volatile memory locations are provided. By default, most parameters are automatically restored after power-up. Process Description The specified parameter is copied from the configuration EEPROM memory to its RAM location.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 1.2.9 16/57 SGP (Set Global Parameter) Global parameters are related to the host interface, peripherals or other application specific variables. The different groups of these parameters are organized in banks to allow a larger total number for future products. Organization of Parameters in Banks Currently, bank 0 is used for global parameters and bank 2 is intended for user variables.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 17/57 1.2.10 GGP (Get Global Parameter) All global parameters can be read with this function.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 18/57 1.2.11 STGP (Store Global Parameter) Some global parameters are located in RAM memory. Consequently, modifications are lost at power-down. STGP Configuration The instruction copies a value from its RAM location to the configuration EEPROM and enables permanent storing. Most parameters are automatically restored after powerup.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 19/57 1.2.12 RSGP (Restore Global Parameter) This instruction copies a value from the EEPROM configuration to its RAM location. Thereby, the permanently stored value of a RAM-located parameter is recovered. Most parameters are automatically restored after power-up. Process Description Related commands: SGP, GGP, STGP Mnemonic: RSGP , NOTE: An example for RSGP is provided below.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 20/57 1.2.13 SIO (Set Output) and GIO (Get Input / Output) SIO und GIO Command Settings The TMCC160-EVAL provides two commands for dealing with inputs and outputs: SIO: Sets the status of the general digital output either to low (0) or to high (1). GIO: Reads out the status of the two available general purpose inputs of the module. NOTE: The command reads out a digital or analogue input port.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 21/57 1.2.13.1SIO (Set Output) Bank 2 is used for setting the status of the general digital output either to low (0) or to high (1). Setup of General Output Status The passed value is transferred to the specified output line. Related commands: GIO, WAIT Mnemonic: SIO , , NOTE: Am SIO reply example is provided below. Request in Direct Mode INSTRUCTION NO.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 22/57 1.2.13.2GIO (Get Input / Output) GIO can be used in direct mode or in standalone mode. The specified line is read. Process Description: Direct Mode or Standalone Mode Related commands: SIO Mnemonic: GIO , OPTION 1: IN STANDALONE MODE The requested value is copied to the accumulator (accu) for further processing purposes; such as conditioned jumps.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Command 136 – Reply in Direct Mode Type set to 1. Version Number in Binary Format: Byte Index in Value Field 1 2 3 4 Contents Version number, low byte Version number, high byte Type number, low byte Type number, high byte Table 55: TMCL Command 136, Reply in Direct Mode, Type Set to 1 i The version number is output in the value field. © 2015 TRINAMIC Motion Control GmbH & Co.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 25/57 Axis Parameter Overview (SAP, GAP, STAP, RSAP) The following section describes all axis parameters that can be used with the SAP, GAP, STAP and RSAP commands. Access Type Description Access Type Related Command(s) Description R GAP Parameter readable. W SAP Parameter writable. Parameter automatically restored from EEPROM after reset or power-on.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 27/57 Axis Parameter Description (Numbers 1- …254) Number 161 163 165 172 173 175 176 Axis Parameter Encoder set NULL Encoder clear set NULL Actual encoder commutation offset P parameter for current PID I parameter for current PID Single-shunt offset single-shunt vref Description Range [Unit] 1: set position counter to zero at next N channel event.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 29/57 Axis Parameter Description (Numbers 1- …254) Number 254 Axis Parameter Hall sensor invert Description Range [Unit] 1: Invert the hall scheme 0/1 Table 57: Axis Parameter Description (Numbers 1 …254) © 2015 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany — Terms of delivery and rights to technical change reserved. Download newest version at: www.trinamic.com .
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 30/57 2.1 Axis Parameters Sorted by Functionality The following section describes all axis parameters that can be used with the SAP, GAP, STAP, RSAP and AAP commands. Functional Access Type Description Access Type R W Related Command(s) GAP SAP, AAP E STAP, RSAP Description Parameter readable. Parameter writable. Parameter automatically restored from EEPROM after reset or power-on.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 31/57 Axis Parameter Encoder / Initialization Settings Number Axis Parameter 249 250 251 252 254 Description 0: Initialization in controlled sine commutation (determines the encoder offset) 1: Initialization in block commutation using hall Encoder init mode sensors 2: Initialization in controlled sine commutation (use the previous set encoder offset) Encoder steps Encoder steps per rotation.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 32/57 Velocity Regulation Mode Number Axis Parameter Description Range [Unit] Motor halted velocity PID regulation loop delay P parameter for velocity PID I parameter for velocity PID If the actual speed is below this value the 0 +200000 [rpm] motor halted flag is set.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 33/57 Velocity Ramp Parameter Velocity Ramp Mode Number 4 Axis Parameter Max. absolute ramp velocity 11 Acceleration 13 Ramp generator speed Activate ramp 146 Description Range [Unit] Access The maximum velocity used for velocity ramp in velocity mode and positioning mode. Set this value to a realistic velocity which the motor can reach! Acceleration parameter for ROL, ROR, and the velocity ramp of MVP.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 34/57 Axis Parameter Status Information Axis Parameter Status Information Number 151 152 156 Axis Parameter Actual voltage Actual driver temperature Error/Status flags Description Range [Unit] Actual supply voltage. 0… +4294967295 R Actual temperature of the motor driver. 0… +4294967295 R Bit 0: Overcurrent flag. This flag is set if the max. current limit is exceeded. Bit 1: Undervoltage flag.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 35/57 Driver Information Driver Information Number Axis Parameter Description Range [Unit] Access 214 Driver diagnostic Driver diagnostic value 0..1000 [0,1%] R 215 Driver acknowledge W 216 Enable driver SPI Acknowledge driver status. (ignored) Disable the driver and initialize the driver SPI (ignored) access.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 36/57 Single-Shunt Current Measurement Number Axis Parameter 209 Single shunt factor 175 Single-shunt offset Description Range [Unit] Manually adjust the single shunt current measurement factor. The actual ADC offset of the single-shunt 0..4095 current measurement. Access RWEX RWE 176?? 205 Enable single-shunt measurement Use single-shunt measurement for block 0..1 commutation.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 37/57 Global Parameter Overview (SGP, GGP, STGP, RSGP) The following section describes all global parameters that can be used with the SGP, GGP, STGP and RSGP commands. Two banks are used for global parameters Bank 0 for global configuration of the module (chapter 4.1). Bank 2 for user TMCL variables (chapter 4.2) 3.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 38/57 Bank 0 Global Parameters Bank 0 Global Parameters Number 64 65 66 69 70 71 73 75 76 77 81 85 Global Parameter Description Setting this parameter to a different value as $D0 will cause re-initialization of the axis and global EEPROM magic parameters (to factory defaults) after the next power -up. This is useful in case of missconfiguration.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 39/57 Bank 0 Global Parameters Number 128 129 Global Parameter TMCL application status Download mode Description Range 0 1 2 3 0 1 0… 3 R 0/1 R 0… 2047 R –stop – run – step – reset – normal mode – download mode i 130 132 TMCL program counter Tick timer 255 Suppress reply Access Download mode can only be used if the motor has been stopped first. Otherwise the download mode setting will be disallowed.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 40/57 3.2 Bank 2 General Purpose Bit Variables in Bank 2 Bank 2 contains general purpose 32 bit variables for use in TMCL applications. They are located in RAM and can be stored to EEPROM. After booting, their values are automatically restored to RAM. Up to 56 user variables are available.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 41/57 Motor Regulation 4.1 Structure of Cascaded Motor Regulation Modes The TMCC160-EVAL supports a current, velocity, and position PID regulation mode for motor control in different application areas. These regulation modes are cascaded as shown in Figure 1 below. Individual modes are explained in the following sections.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Timing Control Value Calculation Example 42/57 The timing control value (current regulation loop multiplier, axis parameter 134) determines how often the current regulation is invoked.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Current Regulation Parameters Parameter Description IACTUAL Actual motor current (GAP 150) ITARGET Target motor current (SAP 155) IMax Max. motor current (SAP 6) eSUM Error sum for integral calculation (GAP 201) PPARAM Current P parameter (SAP 172) IPARAM Current I parameter (SAP 173) Table 74: Current Regulation Set Parameters © 2015 TRINAMIC Motion Control GmbH & Co.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 44/57 4.3 Velocity Regulation Timing Control Value Based on the current regulation the motor velocity can be controlled by the velocity PID regulator. Also, the velocity PID regulator uses a timing control value (PID regulation loop delay, axis parameter 133) that determines how often the PID regulator is invoked.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Parameter Description of Velocity Regulator Set Parameter Description vACTUAL Actual motor velocity (GAP 3) vRAMPGEN Target velocity of ramp generator (SAP 2, GAP 13) vMax Max. target velocity (SAP 4) eSUM Error sum for integral calculation (GAP 229) PPARAM Velocity P parameter (SAP 234) IPARAM Velocity I parameter (SAP 235) IMax Max.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 46/57 4.4 Velocity Ramp Generator Axis Parameter 146 For a controlled startup of the motor's velocity a velocity ramp generator can be activated or deactivated by axis parameter 146.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Parameterizing the Position Regulation 47/57 Only the P parameter of the position regulator must to be parameterized because the regulator is based on the velocity regulator. In order to configure the position regular, do as follows: Action: Disable the velocity ramp generator and set position P parameter to zero.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 48/57 Correlation of Axis Parameters 10 and 7, the Target Position, and the Position End Flag MVP target reached distance Slow-down-distance |Velocity| Max.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 49/57 I2T-Monitoring The I²t monitor determines the sum of the square of the motor current over a given time. Thermal Winding Time Constant of the Motor The integrating time is motor-specific. In the datasheet of the motor this time is described as thermal winding time constant and can be set for each module using axis parameter 25.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Example: Configuration of the I²t Limits 50/57 I²t limits for an average current of a) 1A, b) 2A, c) 3A and d) 4A over a thermal winding time of 10,0s.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 51/57 APPENDICES Supplemental Directives ESD DEVICE INSTRUCTIONS TMCC160 is an ESD-sensitive CMOS device. It is sensitive to electrostatic discharge. Provide effective grounding to protect personnel and machines. Ensure work is performed in a non-static environment. Use personal ESD control footwear and ESD wrist straps, if necessary. Failure to do so can result in defects, damages and decreased reliability.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Disclaimer: Life Support Systems 52/57 TRINAMIC Motion Control GmbH & 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 & Co. KG.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 53/57 Safety Alerts In this chapter we provide an overview of all Safety Alerts that are provided in this documentation. Please refer to the appropriate chapters and/or sections for detailed information about the nature of the Safety Alerts. Thank you. List of Safety Alerts in this Documentation Type Page ESD Device Instructions 51 Table 77: List of Safety Alerts in this Documentation References 8.
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 54/57 8.3 Table Index Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table 1: RS232 and RS485 TMCL Request Format ................................................
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table Table 53: 54: 55: 56: 57: 58: 59: 60: 61: 62: 63: 64: 65: 66: 67: 68: 69: 70: 71: 72: 73: 74: 75: 76: 77: 78: 79: 80: 55/57 TMCL Command 136 Request in Direct Mode ...........................................................................
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 56/57 8.4 Figure Index Figure Figure Figure Figure Figure 1: 2: 3: 4: 5: Cascaded Regulation ............................................................................................................... 41 Current Regulation .................................................................................................................. 42 Velocity Regulation .......................................................
TMCC160 TMCL Firmware Version 2.11 • 2018-FEB-08 | Document Revision 1.01 • 2018-FEB-08 57/57 8.5 Keyword Index 5.5 Position Regulation .............................................. 47 Overview TMCL ........................................................................ 4 Axis Parameter Overview (SAP, GAP, STAP, RSAP) .... 25 Checksum Calculation .................................................. 5 Copyright ................................................................... 52 Current Regulation ...