User Manual
Table Of Contents
- 1 Features
- 2 First Steps with TMCL
- 3 TMCL and the TMCL-IDE — An Introduction
- 3.1 Binary Command Format
- 3.2 Reply Format
- 3.3 Standalone Applications
- 3.4 The ASCII Interface
- 3.5 TMCL Command Overview
- 3.6 TMCL Commands by Subject
- 3.7 Detailed TMCL Command Descriptions
- 3.7.1 ROR (Rotate Right)
- 3.7.2 ROL (Rotate Left)
- 3.7.3 MST (Motor Stop)
- 3.7.4 MVP (Move to Position)
- 3.7.5 SAP (Set Axis Parameter)
- 3.7.6 GAP (Get Axis Parameter)
- 3.7.7 STAP (Store Axis Parameter)
- 3.7.8 RSAP (Restore Axis Parameter)
- 3.7.9 SGP (Set Global Parameter)
- 3.7.10 GGP (Get Global Parameter)
- 3.7.11 STGP (Store Global Parameter)
- 3.7.12 RSGP (Restore Global Parameter)
- 3.7.13 RFS (Reference Search)
- 3.7.14 SIO (Set Output)
- 3.7.15 GIO (Get Input)
- 3.7.16 CALC (Calculate)
- 3.7.17 COMP (Compare)
- 3.7.18 JC (Jump conditional)
- 3.7.19 JA (Jump always)
- 3.7.20 CSUB (Call Subroutine)
- 3.7.21 RSUB (Return from Subroutine)
- 3.7.22 WAIT (Wait for an Event to occur)
- 3.7.23 STOP (Stop TMCL Program Execution – End of TMCL Program)
- 3.7.24 SCO (Set Coordinate)
- 3.7.25 GCO (Get Coordinate)
- 3.7.26 CCO (Capture Coordinate)
- 3.7.27 ACO (Accu to Coordinate)
- 3.7.28 CALCX (Calculate using the X Register)
- 3.7.29 AAP (Accu to Axis Parameter)
- 3.7.30 AGP (Accu to Global Parameter)
- 3.7.31 CLE (Clear Error Flags)
- 3.7.32 EI (Enable Interrupt)
- 3.7.33 DI (Disable Interrupt)
- 3.7.34 VECT (Define Interrupt Vector)
- 3.7.35 RETI (Return from Interrupt)
- 3.7.36 Customer specific Command Extensions (UF0…UF7 – User Functions)
- 3.7.37 Request Target Position reached Event
- 3.7.38 TMCL Control Commands
- 4 Axis Parameters
- 5 Global Parameters
- 6 Module Specific Hints
- 7 Hints and Tips
- 8 TMCL Programming Techniques and Structure
- 9 Figures Index
- 10 Tables Index
- 11 Supplemental Directives
- 12 Revision History

PD-1160 TMCL
™
Firmware Manual • Firmware Version V1.42 | Document Revision V1.06 • 2018-JAN-09
93 / 113
•
The motor can be stopped automatically if motor position and encoder position differ too much
(deviation error). This can be set using axis parameter #212 (maximum deviation). Setting this
parameter to 0 turns off this feature.
•
As the built-in encoder is a magnetic encoder, the absolute position value can also be read. Use GAP
215, 0 to read the absolute (single-turn) position value. This always is a value between 0 and 1023
(independent of the prescaler setting).
6.2.1 Matching Encoder Resolution and Motor Resolution
When choosing a different microstep resolution than the factory default setting, the encoder prescaler also
has to be adapted so that functions using the built-in encoder still work properly. Table 20 shows which
prescaler settings are to be used with which microstep resolution settings. The factory default setting is
256 microsteps and prescaler 50.
Internal Encoder Settings
Microstep Encoder
Resolution SAP command Prescaler SAP command
256 SAP 140, 0, 8 50 SAP 210, 0, 25600
128 SAP 140, 0, 7 25 SAP 210, 0, 12800
64 SAP 140, 0, 6 12.5 SAP 210, 0, 6400
32 SAP 140, 0, 5 6.25 SAP 210, 0, 3200
16 SAP 140, 0, 4 3.125 SAP 210, 0, 1600
8 SAP 140, 0, 3 1.5625 SAP 210, 0, 800
4 SAP 140, 0, 2 0.78125 SAP 210, 0, 400
2 SAP 140, 0, 1 0.390625 SAP 210, 0, 200
Table 20: Internal Encoder Settings
Other encoder prescalers than those shown in table 20 can also be used, but are mostly not needed for
the internal encoder. The formula for the prescaler setting is
p
=
prescaler ·
512 where <p> is the value
passed to axis parameter #210. Hence, a setting of SAP 210, 0, 512 would for example result in a prescaler
of 1. The lower four bits of the <p> value must not be used for the prescaler setting as they are reserved
for activating special encoder functions.
6.2.2 Special Encoder Functions
The only special function of the internal sensOstep
™
encoder is the clear-on-null function. This will clear
the encoder position each time the encoder passes its absolute zero point. This can be useful for finding a
reference position. To activate this function, add the value of 4 to the value passed to axis parameter #210.
6.3 External Encoders
External encoders with ABN interface can also be attached to the PD-1160 module. Please see the
Hardware Manual on how to connect an external encoder. Consider the following things when using an
external ABN encoder:
•
The encoder counter can be read by software and can be used to monitor the current position of the
motor.
©2018 TRINAMIC Motion Control GmbH & Co. KG, Hamburg, Germany
Terms of delivery and rights to technical change reserved.
Download newest version at www.trinamic.com