Pandrive PD42-1270 TMCL Firmware User Manual

Single axis controller/driver for 2-phase bipolar stepper motors with separate differential encoder and separate home and stop switch inputs
Table of Contents

Advertisement

Quick Links

PANdrive™ for Stepper Motors
PD42-1270 TMCL
Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02
The PD42-1270 is an easy to use, single axis controller/driver PANdrive™ for 2-phase bipolar step-
per motors with separate differential encoder and separate home and stop switch inputs. Dy-
namic current control, and quiet, smooth and e
dcStep™, stallGuard™and coolStep™features. Three digital inputs can be con gured as home and
endstop switches or incremental encoder inputs. A fourth digital input is available to enable or
disable the motor.
Applications
• Lab-Automation
• Semiconductor Handling
• Manufacturing
Simpli ed Block Diagram
4
Input
CAN
+6V..+28V DC
©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.
Firmware Manual
cient operation are combined with stealthChop™,
• Robotics
• Factory Automation
• CNC
TMCL™
Memory
I2C
ARM
SPI
Cortex-M0+
TM
microcontroller
Features
• Single Axis Stepper motor control
• Supply voltage 24V DC
• TMCL™
• Motion Contoller
• CAN
• dcStep™
• Integrated sixPoint™ ramp motion
controller
• stealthChop™ silent PWM mode
• spreadCycle™ smart mixed decay
• stallGuard2™ load detection
• coolStep™ autom. current scaling
• Laboratory Automation
REFL/REFR
ENC_A/ENC_B
/ENABLE
Stepper
Energy Efficient
motor
Driver
controller +
TMC262
driver
TMCM-1270
PANDRIVE™
Step
Motor
PD42-x-1270

Advertisement

Table of Contents
loading
Need help?

Need help?

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

Questions and answers

Summary of Contents for Pandrive PD42-1270 TMCL

  • Page 1 Firmware Manual Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 The PD42-1270 is an easy to use, single axis controller/driver PANdrive™ for 2-phase bipolar step- per motors with separate differential encoder and separate home and stop switch inputs. Dy- namic current control, and quiet, smooth and e cient operation are combined with stealthChop™,...
  • Page 2: Table Of Contents

    ™ 2 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Contents 1 Features 1.1 stallGuard2 ..........
  • Page 3 ™ 3 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.29 TMCL Control Commands ........56...
  • Page 4: Features

    It is highly integrated, offers a convenient handling and can be used in many decentralized applications. The PANdrive™ has been designed for coil currents up to 1A RMS and 24V DC supply voltage. Three digital inputs can be con gured as home and endstop switches or incremental encoder inputs.
  • Page 5: Stallguard2

    ™ 5 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 1.1 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.
  • Page 6: First Steps With Tmcl

    In this chapter you can nd some hints for your rst steps with the PD42-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 PD42-1270 PANdrive™. • A CAN adapter. • A power supply (24V DC) for your PD42-1270 module.
  • Page 7: Testing With A Simple Tmcl Program

    ™ 7 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access Maximum Maximum acceleration in positioning 0 . . . 7629278 1000 acceleration ramps. Acceleration and deceleration [pps/s] value in velocity mode.
  • Page 8 ™ 8 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Loop : MVP ABS , 0 , 512000 // Move to Position 512000 WAIT POS , 0 , 0 // Wait until position reached...
  • Page 9: Tmcl And The Tmcl-Ide An Introduction

    ™ 9 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3 TMCL and the TMCL-IDE An Introduction As with most TRINAMIC modules the software running on the microprocessor of the PD42-1270 consists of two parts, a boot loader and the rmware itself.
  • Page 10: Checksum Calculation

    ™ 10 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 TMCL Command Format Bytes Meaning Module address Command number Type number Motor or Bank number Value (MSB rst!) Checksum Table 2: TMCL Command Format The checksum is calculated by accumulating all the other bytes using an 8-bit addition.
  • Page 11: Reply Format

    ™ 11 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.2 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:...
  • Page 12: Standalone Applications

    ™ 12 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.3 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.
  • Page 13: Tmcl Command Overview

    ™ 13 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.4 TMCL Command Overview This sections gives a short overview of all TMCL commands. 3.4.1 TMCL Commands Overview of all TMCL Commands...
  • Page 14: Tmcl Commands By Subject

    ™ 14 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Command Number Parameter Description <coordinate number>, <motor num- Capture coordinate ber> CALCX <operation> Process accumulator and X-register <parameter>, <motor number> Accumulator to axis parameter <parameter>, <bank number>...
  • Page 15: I/O Port Commands

    ™ 15 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Branch Commands Mnemonic Command number Meaning Jump always Jump conditional COMP Compare accumulator with constant value CSUB Call subroutine RSUB Return from subroutine...
  • Page 16 ™ 16 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 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.
  • Page 17: Detailed Tmcl Command Descriptions

    ™ 17 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6 Detailed TMCL Command Descriptions The module speci c commands are explained in more detail on the following pages. They are listed according to their command number.
  • Page 18: Gap (Get Axis Parameter)

    ™ 18 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.2 GAP (Get Axis Parameter) Most motion / driver related parameters of the PD42-1270 can be adjusted using e.g. the SAP command.
  • Page 19: Stap (Store Axis Parameter)

    ™ 19 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.3 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 con guration of the module.
  • Page 20: Rsap (Restore Axis Parameter)

    ™ 20 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.4 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.
  • Page 21: Sgp (Set Global Parameter)

    ™ 21 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.5 SGP (Set Global Parameter) With this command most of the module speci c parameters not directly related to motion control can be speci ed and the TMCL user variables can be changed.
  • Page 22: Ggp (Get Global Parameter)

    ™ 22 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.6 GGP (Get Global Parameter) All global parameters can be read with this function. Global parameters are related to the host interface, peripherals or application speci c variables.
  • Page 23: Stgp (Store Global Parameter)

    ™ 23 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.7 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 modi ed.
  • Page 24: Rsgp (Restore Global Parameter)

    ™ 24 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.8 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.
  • Page 25: Rfs (Reference Search)

    ™ 25 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.9 RFS (Reference Search) The PD42-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 nished.
  • Page 26 ™ 26 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary Form of RFS START Field Value Target address Instruction number Type Motor/Bank Value (Byte 3) Value (Byte 2) Value (Byte 1)
  • Page 27: Gio (Get Input)

    ™ 27 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.10 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.
  • Page 28 ™ 28 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Reply (Status=no error, Value=302) Field Value Host address Target address Status Instruction Value (Byte 3) Value (Byte 2) Value (Byte 1) Value (Byte 0) Checksum Bank 0 –...
  • Page 29: Calc (Calculate)

    ™ 29 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.11 CALC (Calculate) A value in the accumulator variable, previously read by a function such as GAP (get axis parameter) can be modi ed with this instruction. Nine different arithmetic functions can be chosen and one constant operand value must be speci ed.
  • Page 30 ™ 30 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary Form of CALC MUL, -5000 Field Value Target address Instruction number Type Motor/Bank Value (Byte 3) Value (Byte 2) Value (Byte 1)
  • Page 31: Comp (Compare)

    ™ 31 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.12 COMP (Compare) The speci ed 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.
  • Page 32: Jc (Jump Conditional)

    ™ 32 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.13 JC (Jump conditional) The JC instruction enables a conditional jump to a xed address in the TMCL program memory, if the speci ed condition is met.
  • Page 33 ™ 33 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary form of JC GE, Label as- suming Label at address 10 Field Value Target address Instruction number Type Motor/Bank Value (Byte 3)
  • Page 34: Ja (Jump Always)

    ™ 34 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.14 JA (Jump always) Jump to a xed address in the TMCL program memory. This command is intended for standalone operation only.
  • Page 35: Csub (Call Subroutine)

    ™ 35 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.15 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.
  • Page 36: Rsub (Return From Subroutine)

    ™ 36 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.16 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.
  • Page 37: Wait (Wait For An Event To Occur)

    ™ 37 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.17 WAIT (Wait for an Event to occur) This instruction interrupts the execution of the TMCL program until the speci ed condition is met. This command is intended for standalone operation only.
  • Page 38 ™ 38 / 91 PD42-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...
  • Page 39: Stop (Stop Tmcl Program Execution - End Of Tmcl Program)

    ™ 39 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.18 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.
  • Page 40: Sco (Set Coordinate)

    ™ 40 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.19 SCO (Set Coordinate) Up to 20 position values (coordinates) can be stored for every axis for use with the MVP COORD command.
  • Page 41: Gco (Get Coordinate)

    ™ 41 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.20 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.
  • Page 42 ™ 42 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 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.
  • Page 43: Cco (Capture Coordinate)

    ™ 43 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.21 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).
  • Page 44: Aco (Accu To Coordinate)

    ™ 44 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.22 ACO (Accu to Coordinate) With the ACO command the actual value of the accumulator is copied to a selected coordinate of the motor.
  • Page 45: Calcx (Calculate Using The X Register)

    ™ 45 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.23 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.
  • Page 46 ™ 46 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary Form of CALCX MUL Field Value Target address Instruction number Type Motor/Bank Value (Byte 3) Value (Byte 2) Value (Byte 1)
  • Page 47: Aap (Accu To Axis Parameter)

    ™ 47 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.24 AAP (Accu to Axis Parameter) The content of the accumulator register is transferred to the speci ed axis parameter. For practical usage, the accumulator has to be loaded e.g.
  • Page 48: Agp (Accu To Global Parameter)

    ™ 48 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.25 AGP (Accu to Global Parameter) The content of the accumulator register is transferred to the speci ed global parameter. For practical usage, the accumulator has to be loaded e.g.
  • Page 49: Cle (Clear Error Flags)

    ™ 49 / 91 PD42-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 ags. It is mainly intended for use in standalone mode. The following error ags can be cleared by this command (determined by the < ag> parameter): •...
  • Page 50 ™ 50 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Binary Form of CLE ETO Field Value Target address Instruction number Type Motor/Bank Value (Byte 3) Value (Byte 2) Value (Byte 1)
  • Page 51: Customer Speci C Command Extensions (Uf0

    ™ 51 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.27 Customer speci c Command Extensions (UF0. . . UF7 – User Functions) These commands are used for customer speci c extensions of TMCL. They will be implemented in C by Trinamic.
  • Page 52: Request Target Position Reached Event

    ™ 52 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.28 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.
  • Page 53 ™ 53 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Reply in Direct Mode Field Value Target address Host address Status (100) Command (138) Value (Byte 3) Value (Byte 2) Value (Byte 1)
  • Page 54: Tmcl Control Commands

    ™ 54 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 3.6.29 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.
  • Page 55 ™ 55 / 91 PD42-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 0 - return mode, 0 (don’t care) about the current wait ag, memory...
  • Page 56: Axis Parameters

    ™ 56 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 4 Axis Parameters Most motor controller features of the PD42-1270 module are controlled by axis parameters. Axis parame- ters can be modi ed or read using SAP, GAP, AAP, STAP and RSAP commands. This chapter describes all axis parameters that can be used on the PD42-1270 module.
  • Page 57 ™ 57 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access Right Endstop Reference switch right status. 0 . . . 1 0 - Inactive...
  • Page 58 ™ 58 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access Speed Speed threshold for de-activating 0 . . . 4999999 threshold for coolStep or switching to fullstep...
  • Page 59 ™ 59 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access Supply voltage The actual supply voltage. 0 . . . 1000 [100mV] Relative The command MoveToRelativePosi- 0 .
  • Page 60 ™ 60 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access Constant TOff Selection of the chopper mode. 0 . . . 1 Mode 0 - spread cycle 1 - classic constant off...
  • Page 61 ™ 61 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access smartEnergy Sets the distance between the lower 0 . . . 15 hysteresis and the upper threshold for stall- Guard2 reading.
  • Page 62 ™ 62 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access smartEnergy This status value provides the actual 0 . . . 31 actual current motor current setting as controlled by coolStep.
  • Page 63 ™ 63 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access PWM frequency selection fro Stealth- 0 . . . 3 frequency Chop. = 1 1024...
  • Page 64 ™ 64 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access Encoder mode Encoder mode con guration. See bits 0 . . . 1023 0-9 of TMC5130 ENCMODE register.
  • Page 65 ™ 65 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Range [Units] Default Access Unit mode Units of velocity and acceleration/de- 0 . . . 1 celeration settings...
  • Page 66: Global Parameters

    ™ 66 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 5 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: •...
  • Page 67: Bank 2

    ™ 67 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Global Parameter Description Range [Units] Default Access CAN Secondary Id CAN Messages with this target Id will 0 . . . 255 also be received and interpreted.
  • Page 68 ™ 68 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Meaning of the letters in the Access column Access type Command Description Parameter readable SGP, AGP Parameter writable STGP, RSGP Parameter can be stored in the EEPROM...
  • Page 69: Module Speci C Modes

    ™ 69 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 6 Module Speci c Modes This section explains how the three availabe inputs can be con gured. The PD42-1270 implements three different prede ned modes, each one with a different set of functions for these three pins. Axis Parameter number 254 “Module Speci c Mode”...
  • Page 70: Hints And Tips

    ™ 70 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7 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.
  • Page 71: Mode 1

    ™ 71 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7.1.1 Mode 1 Reference search mode 1 only searches the left end switch. Select this mode by setting axis parameter #193 to 1. Figure illustrates this.
  • Page 72: Mode 4

    ™ 72 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 start stop left limit / end / stop switch right limit / end / stop switch : reference search speed (axis parameter 194)
  • Page 73: Mode 6

    ™ 73 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Home 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...
  • Page 74 ™ 74 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 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...
  • Page 75: Stallguard2

    ™ 75 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7.2 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.
  • Page 76: Coolstep

    ™ 76 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7.3 coolStep This section gives an overview of the coolStep related parameters. Please bear in mind that the gure only shows one example for a drive. There are parameters which concern the con guration of the current.
  • Page 77 ™ 77 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 Number Axis Parameter Description Absolute maximum current The maximum value is 255. This value means 100% of the maximum current of the module.
  • Page 78: Velocity And Acceleration Calculation

    ™ 78 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 7.4 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 PD42-1270 are given in microsteps per second (also called pulse per second or pps).
  • Page 79: Tmcl Programming Techniques And Structure

    ™ 79 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 8 TMCL Programming Techniques and Structure 8.1 Initialization The rst task in a TMCL program (like in other programs also) is to initialize all parameters where different values than the default values are necessary.
  • Page 80: Using Variables

    ™ 80 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 WAIT POS , Motor0 , 0 JA MainLoop Have a look at the le TMCLParam.tmc provided with the TMCL-IDE. It contains symbolic constants that de ne all important parameter numbers.
  • Page 81: Using Subroutines

    ™ 81 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 8.5 Using Subroutines The CSUB and RSUB commands provide a mechanism for using subroutines. The CSUB command branches to the given label. When an RSUB command is executed the control goes back to the command that follows the CSUB command that called the subroutine.
  • Page 82 ™ 82 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 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 rst 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.
  • Page 83: Figures Index

    ™ 83 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 9 Figures Index stallGuard2 Load Measurement as a Reference search Mode 5 ..Function of Load .
  • Page 84: Tables Index

    ™ 84 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 10 Tables Index Most important Axis Parameters . . . All Global Parameters of the PD42- TMCL Command Format ..
  • Page 85: Supplemental Directives

    ™ 85 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 11 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.
  • Page 86: Collateral Documents & Tools

    ™ 86 / 91 PD42-1270 TMCL Firmware Manual • Firmware Version V1.00 | Document Revision V1.0 • 2017-Mar-02 or of any other nature are made hereunder with respect to information/speci cation or the products to which information refers and no guarantee with respect to compliance to the intended use is given.
  • Page 87: Revision History

    ™ 87 / 91 PD42-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 Exported from xml. V0.9 2016-SEP-26 First complete version. V1.00 2016-NOV-18 Final version with changes from Fw V1.0.

Table of Contents