2 Life support policy ....................................................................................................................................................... 5
3 Electrical and Mechanical Interfacing ..................................................................................................................... 6
5.1 System Architecture ........................................................................................................................................... 9
5.1.4 Interface to the external drivers .......................................................................................................... 9
5.2 Power Supply ....................................................................................................................................................... 9
5.3 Host Communication ....................................................................................................................................... 10
5.3.1 CAN 2.0b .................................................................................................................................................... 10
6 Putting the TMCM-342 into Operation .................................................................................................................. 22
7 Migrating from the TMCM-302 to the TMCM-342 ............................................................................................... 23
11 Revision History .......................................................................................................................................................... 26
Figure 3.2: Pin order of the connector ........................................................................................................................... 7
Figure 5.1: Main parts of the TMCM-342 ......................................................................................................................... 8
Figure 5.2: Connecting CAN ............................................................................................................................................. 10
Figure 5.6: Application Environment using the Step/Direction-Interface ........................................................... 13
Figure 5.7: Application with power module Monopack 2 with a Step/Direction-Interface .......................... 13
Figure 5.8: Application with TMCM-023 with 3 Step/Direction-Interfaces (5V inputs required, please see
latest TMCM-023 documentation for modifications) ........................................................................................ 14
Figure 5.9: Application with TMCM-013 with a Step/Direction-Interface ............................................................ 14
Figure 5.10: Application Environment using the SPI-Interface ............................................................................. 15
Figure 5.11: Application with an SPI-stepper motor driver ................................................................................... 16
Figure 5.12: Power supply requirements for TMCM-342 with additional driver ............................................... 16
Figure 5.13: Power supply requirements for TMC-Modules in a bus system .................................................... 17
Figure 5.14: Velocity profile in ramp mode ................................................................................................................ 18
Figure 5.15: Velocity profile in velocity mode ............................................................................................................ 18
Figure 5.16: Left and right limit switches .................................................................................................................... 19
Figure 5.17: Limit switch and reference switch ......................................................................................................... 19
Figure 5.18: One reference switch ................................................................................................................................. 20
List of Tables
Table 1.1: Order codes ......................................................................................................................................................... 4
Table 3.1: Pinout of the 68-Pin Connector .................................................................................................................... 7
Table 5.1: Pinning of Power supply ................................................................................................................................ 9
Table 5.2: Pinout for CAN Connection .......................................................................................................................... 10
Table 5.3: Pinout for RS-232 Connection ...................................................................................................................... 10
Table 5.4: Pinout for RS-485 Connection ...................................................................................................................... 11
Table 5.5: Pinout for using the Step/Direction-Interface ......................................................................................... 12
Table 5.6: Pinout for the connections using the SPI-Interface ............................................................................. 15
Table 5.7: Pinout of the reference switch inputs ...................................................................................................... 19
Table 5.8: Pinout Serial Peripheral Interface .............................................................................................................. 20
The TMCM-342 is a triple axis stepper motor controller module for external power drivers with step /
direction interface. With its very small size it is dedicated to embedded applications, where centralized
or de-centralized high power drivers are desired. The board can be connected to a baseboard or
customized electronics with a pin connector. The TMCM-342 comes with the PC based software
development environment TMCL-IDE. Using predefined TMCL (Trinamic Motion Control Language) high
level commands like “move to position” or “constant rotation” rapid and fast development of motion
control applications is guaranteed. The TMCM-342 can be controlled via the serial UART interface (e.g.
using a RS-232 or RS-485 level shifter) or via CAN. Communication traffic is kept very low since all
time critical operations, e.g. ramp calculation, are performed on board. The TMCL operations can be
stored in the onboard EEPROM for stand-alone operation. The firmware of the module can be updated
via the serial interface as well as via the CAN interface.
Applications
Controller board for control of up to 3 Step / Direction drivers e.g. TMCM-035, TMCM-023 (triple
driver), IDX or PD-013-42 mechatronic module or TMCM-078 step/direction driver
Versatile possibilities of applications in stand alone or host controlled mode
Electrical Data
5V DC logic power supply TTL / CMOS step / direction outputs
Interface
RS-232, RS-485 (max. 115200bps) or CAN 2.0b (max. 1MBit/s) host interface Inputs for reference and stop switches, general purpose analog and digital I/Os
Highlights
Three motion controllers for high step frequency Automatic ramp generation in Hardware On the fly alteration of motion parameters (e.g. position, velocity, acceleration) High dynamics: step frequencies up to 300kHz
1.8µs step pulse length and step to direction delay
Software
Stand-alone operation using TMCL or remote controlled operation TMCL program storage: 16 KByte EEPROM (2048 TMCL commands) PC-based application development software TMCL-IDE included Special firmware for CANopen protocol support also available
Other
68 pin connector carries all signals RoHS compliant Size: 80x50mm²
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.
Life support systems are equipment intended to
support or sustain life, and whose failure to perform,
when properly used in accordance with instructions
provided, can be reasonably expected to result in
personal injury or death.
Information given in this data sheet is believed to be
accurate and reliable. However no responsibility is
assumed for the consequences of its use nor for any
infringement of patents or other rights of third
parties, which may result from its use.
Specifications are subject to change without notice.
The size of the module (80x50mm) is the same as of many other Trinamic motion control modules. It
also uses the same connector.
The 68 pin connector has a 2.0mm pitch.
The 68-pin connector provides communication to a host, configuration of the EEPROM and connection
of step / direction drivers as well as connection of reference switches. Pin 1 of this connector is
located in the lower left corner on the top site, while the connector is pointing towards the user.
Input voltage for StopL, StopR, GPI0
(internal protection diodes)
-0.5
0 … 5
V
+5V
+0.5
V
V
ANA
INx analog measurement range
0 ... 5
V
V
INLO
INx, StopL, StopR low level input
0 0.9
V
V
INHI
INx, StopL, StopR high level input
2 5
V
I
OUTI
OUTx max +/- output current (CMOS
output) (sum for all outputs max. 50mA)
0..10
+/-20
mA
T
ENV
Environment temperature at rated current
(no cooling)
-40 +70
°C
RS-232
or
RS-485
3x
programmable
Motion
Controller
with TMC428
TMCM-342
TMCL
Memory
step/dir
Driver
e.g. TMCM-035
Step
Motor
5V DC
REF-Switches
I/Os
16
6
step/dir
Driver
e.g. TMCM-035
Step
Motor
step/dir
Driver
e.g. TMCM-035
Step
Motor
UART
CAN
4 Operational Ratings
The operational ratings show the intended / the characteristic range for the values and should be
used as design values. In no case shall the maximum values be exceeded.
5 Functional Description
In Figure 5.1 the main parts oft the TMCM-342 module are shown. The module mainly consists of
three TMC428 motion controllers, the TMCL program memory (EEPROM) and the host interfaces (RS232, RS-485 and CAN).
=50mA power supply (plus current required for outputs)
2, 4, 6, 8, 10
Ground
5.1 System Architecture
The TMCM-342 integrates a microcontroller with the TMCL (Trinamic Motion Control Language)
operating system. The motion control real-time tasks are realized by three TMC428 chips.
5.1.1 Microcontroller
On this module, the Atmel AT91SAM7X256 microcontroller is used to communicate with the host and
the EEPROM and to control the TMC428. The CPU has 256KB flash memory and a 64KB RAM. The
microcontroller runs the TMCL (Trinamic Motion Control Language) operating system which makes it
possible to execute TMCL commands that are sent to the module from the host via the RS232, RS-485
and CAN interface. These commands are interpreted by the microcontroller and then converted into
SPI-datagrams which are then sent to the TMC428.
The flash ROM of the microcontroller holds the TMCL operating system. The TMCL operating system
can be updated via the RS232 interface or via the CAN interface. Use the TMCL IDE to do this.
5.1.2 TMCL EEPROM
To store TMCL programs for stand-alone operation and for storing configuration data the TMCM-342
module is equipped with a 16kByte EEPROM attached to the microcontroller. The EEPROM can store
TMCL programs consisting of up to 2048 TMCL commands.
5.1.3 TMC428 Motion Controller
The TMC428 is a high-performance stepper motor control IC and can control up to three 2-phasestepper-motors. On the TMCM-342 three TMC428 are used to get fastest calculation of ramps and
highest step frequencies. Motion parameters like speed or acceleration are sent to the TMC428 via SPI
by the microcontroller. Calculation of ramps and speed profiles are done internally by hardware based
on the target motion parameters.
5.1.4 Interface to the external drivers
Drivers are not included on the module. To drive stepper motors with this module, stepper motor
drivers have to be added externally. To drive a stepper motor with the Step/Direction-Interface, a
power driver module has to be added, which can evaluate the Step/Direction-signals. Also stepper
motor drivers with an SPI-Interface can be added, but this module is mainly intended for use with
Step/Direction drivers.
5.2 Power Supply
The power supply for the TMCM-342 is +5VDC for module functionality. Please use all listed pins for
the power supply inputs and ground parallel. Refer to 6.
Communication to a host takes place via one or more of the onboard interfaces. The module provides
a wide range of different interfaces, like CAN, RS-232 and RS-485. The following chapters explain how
the interfaces are connected with the 68-pin connector.
5.3.1 CAN 2.0b
Table 5.2: Pinout for CAN Connection
Figure 5.2: Connecting CAN
5.3.2 RS-232
Table 5.3: Pinout for RS-232 Connection
Note: The module only provides serial signals with TTL level. For using RS232, a suitable RS232 level
shifter (like MAX202) has to be added by the user.
The TMCM-342 generates step- and direction output signals, which are pre-conditioned in order to be
directly connected to microstep driver units with 5V inputs. See Figure 5.5 for the output timing.
Some driver units might require inverters / level shifters in order to adapt step polarity and voltage.
You can use standard open collector level shifters like the SN7407 or inverters like SN7406. These
devices allow level translation to 12V or 24V, or inversion of the step signal, if the device timing
requires this. One 7406 or 7407 can shift all six output signals. In order not to loose any steps, please
make sure that your driver unit can work with the step-to-direction delay and with the step impulse
length.
Figure 5.5: Step-/Direction output signals
5.5 Connecting the drivers
Because there are no stepper motor drivers included on the TMCM-342, an Add-On-Board has to be
developed to drive the stepper motors. Some examples of Trinamic´s own driver modules are added
below. Please refer to www.trinamic.com for more information. Normally, a step/direction interface is
used to connect the driver. Using the SPI interface would also be possible, but is normally not used
with this module (compare TMCM-301 for SPI applications).
5.5.1 Connecting the TMCM-342 to a power driver module with
5.5.2 Connecting the TMCM-342 to drivers with an SPI-Interface
The pins connecting the TMCM-342 with the Add-On-Board using the SPI-Interface are listed in Table
5.6. This is only listed here for the sake of completeness. It is not directly supported by the firmware
of the TMCM-342. Please use the TMCM-341 for using SPI motor drivers.
Table 5.6: Pinout for the connections using the SPI-Interface
Figure 5.10: Application Environment using the SPI-Interface
Example : Using the TMC236 stepper motor driver with an SPI-interface
Figure 5.11: Application with an SPI-stepper motor driver
5.6 Power supply requirements with drivers
The TMCM-342 is supplied with +5VDC, the drivers need an additional power supply for the motor
supply. Please connect all listed pins for the power supply inputs and ground in parallel. It is
recommended to use capacitors of some 1000µF and a choke close to the drivers. This ensures a
stable power supply and minimizes noise injected into the power supply cables. The choke especially
becomes necessary with larger distributed systems using a common power supply.
Especially with bus controlled systems (e.g. CAN or RS485) it is important to ensure a stable ground
potential of all modules. The stepper driver modules draw peak currents of some Ampere from the
power supply. It has to be made sure, that this current does not cause a substantial voltage
difference on the interface lines between the module and the master, as disturbed transmissions
could result.
Figure 5.12: Power supply requirements for TMCM-342 with additional driver
Page 17
TMCM-342 Manual V1.01 17/26
TMCM-342
with driver
V_Motor
(14...50V)
GND
+
C
L
+
Power Supply
keep distance short
TMCM-342
with driver
V_Motor
(14...50V)
GND
+
C
L
keep distance short
keep distance below a few meters with a single power supply
CAN high
CAN low
CAN high
CAN low
Do not supply modules with the
same power supply which are
mounted in a distance of more
than a few meters.
For modules working on the
same power supply (especially
the same power supply as the
master) use a straight and thick,
low-resistive GND connection.
other devices
on CAN bus
(incl. Master)
CAN high
CAN low
V_Motor
GND
+
C
L
CAN_GND
CAN_GND
CAN_GND
The following hints help avoiding transmission problems in larger systems. Not all hints have to be
followed:
Use power supply filter capacitors of some 1000µF on the base board for each module in order to
take over current spikes. A choke in the positive power supply line will prevent current spikes
from changing the GND potential of the base board, especially when a central power supply is
used.
Optionally use an isolated power supply for the TMCM-Modules (no earth connection on the
power supply, in case the CAN master is not optically decoupled)
Do not supply modules with the same power supply which are mounted in a distance of more
than a few meters.
For modules working on the same power supply (especially the same power supply as the
master) use a straight and thick, low-resistive GND connection.
Use a local +5V regulator on each base-board.
Figure 5.13: Power supply requirements for TMC-Modules in a bus system
For large systems, an optically decoupled CAN bus for each number of nodes, e.g. for each base board
with a number of TMCM-34X modules with drivers may make sense, especially when a centralized
power supply is to be used. Be aware that different ground potentials of the CAN sender (e.g. a PC)
and the power supply may damage the modules. Please make sure that the GND lines of the CAN
sender and the module(s) and power supplies are connected by a cable.
The speed profile is automatically worked out by the TMCM-342 from the values for the minimum
speed, maximum speed and acceleration specified by the user with the TMCL. Two modes of
operation for the course of velocity are available for selection.
In the Ramp-Mode the maximum acceleration (a_max), maximum (v_max) and minimum (v_min)
speed and the target position (x_target) are specified to calculate the actual velocity. By giving the
target position, the TMCM-342 calculates the speed profile of each stepper motor from the current
position and the specified parameters and immediately converts it into a motion sequence.
In Figure 5.14, an example of the motion sequence is shown. Here the motor accelerates from t0
onwards with a_max till it reaches v_max in t1, then it moves itself with v_max up to t2, it then
slows down with a_max till it reaches v_min in t3 and then it travels with v_min till it reaches its
target (x_target) in t4.
On the right side of the Figure it can be seen that v_max cannot be reached if a_max is too small
or the target (x_target) is too close.
Figure 5.14: Velocity profile in ramp mode
In Velocity-Mode the acceleration and the maximum speed is specified in the TMCM-342. Then the
motor accelerates immediately with the specified value to the maximum speed and continues to
run at constant speed till new values are sent to the TMCM-342.
In Figure 5.15 the motion sequence for the velocity mode is shown as an example. Here the
motor accelerates with a_max till it reaches the maximum velocity and then continues to run at
constant speed with v_max till new a_max and v_max is specified. On the right side and at t5 the
v_max is not distinctly reached if a new parameter is prematurely given.
Figure 5.15: Velocity profile in velocity mode
A detailed explanation of the parameters and its calculation is given in the software description.
With reference switches, an interval for the movement of the motor or the zero point can be defined.
Also a step loss of the system can be detected, e.g. due to overloading or manual interaction, by
using a travel-switch. All reference switch inputs are equipped with pull-up resistors.
Table 5.7: Pinout of the reference switch inputs
5.8.1 Left and right limit switches
The TMCM-342 can be configured so that a motor has a left and a right limit switch (Figure 5.16). The
motor stops when the traveler has reached one of the limit switches.
Figure 5.16: Left and right limit switches
5.8.2 Triple Switch Configuration
It is possible to program a tolerance range around the reference switch position. This is useful for a
triple switch configuration, as outlined in Figure 5.17. In that configuration two switches are used as
automatic stop switches, and one additional switch is used as the reference switch between the left
stop switch and the right stop switch. The left stop switch and the reference switch are wired
together. The center switch (travel switch) allows for a monitoring of the axis in order to detect a
step loss.
If a circular system is used (Figure 5.18), only one reference switch is necessary, because there are no
end-points in such a system.
Figure 5.18: One reference switch
Note: In the actual TMCL, a function is available, which turns the motor left until the reference switch
has been detected. Then the actual and target position are set to zero. In the future, two and three
limit switches will also be supported.
5.9 Serial Peripheral Interface (SPI)
On-board communication is performed via the Serial Peripheral Interface (SPI), where the
microcontroller acts as master. For adaptation to user requirements, the user has access to this
interface via the 68-pin connector. Furthermore three chip select lines can be used for addressing of
external devices.
The module is equipped with eight TTL input pins and eight TTL output pins, which are accessible via
the 68-pin connector. The input pins can also be used as analog inputs.
Table 5.9: Additional I/O pins
5.11 Miscellaneous Connections
Table 5.10: Miscellaneous Connections
The functionality of the shutdown pin is configurable using in TMCL with global parameter 80 (please
see the TMCL reference manual for information on this).
ROL 0, 500 //Rotate motor 0 with speed 500
WAIT TICKS, 0, 500
MST 0
ROR 1, 250 //Rotate motor 1 with 250
WAIT TICKS, 0, 500
MST 1
SAP 4, 2, 500 //Set max. Velocity
SAP 5, 2, 50 //Set max. Acceleration
Loop: MVP ABS, 2, 10000 //Move to Position 10000
WAIT POS, 2, 0 //Wait until position reached
MVP ABS, 2, -10000 //Move to Position -10000
WAIT POS, 2, 0 //Wait until position reached
JA Loop //Infinite Loop
6 Putting the TMCM-342 into Operation
On the basis of a small example it is shown step by step how the TMCM-342 is set into operation.
Experienced users could skip this chapter and proceed to chapter 6.
Example: The following application is to implement with the TMCL-IDE Software development
environment in the TMCM-342 module. For data transfer between the host PC and the module the RS232 interface is employed.
A formula how “speed” is converted into a physical unit like rotations per seconds can be found in
chapter 8.1.
Turn Motor 0 left with speed 500 Turn Motor 1 right with speed 500 Turn Motor 2 with speed 500, acceleration 5 and move between position +10000 and –10000.
Step 1: Connect the RS-232 Interface as specified in 5.3.2.
Step 2: Connect the motor drivers as specified in 5.4
Step 3: Connect the power supply.
+5 VDC to pins 1 or 3
Ground to pins 2, 4, 6, 8 or 10
Step 4: Connect the motor supply voltage to your driver module
Step 5: Switch on the power supply and the motor supply. An on-board LED should starting
to flash. This indicates the correct configuration of the microcontroller.
Step 6: Start the TMCL-IDE Software development environment. Open file test2.tmc. The
following source code appears on the screen:
A description for the TMCL commands can be found in Appendix A.
Step 7: Click on Icon “Assemble” to convert the TMCL into machine code.Then download the program to the TMCM-342 module via the Icon “Download”.
Step 8: Press Icon “Run”. The desired program will be executed.
A documentation about the TMCL operations can be found in “TMCL Reference and Programming
Manual”. The next chapter discusses additional operations to turn the TMCM-342 into a high
Migrating TMCM-302 applications to the TMCM-342 module is easy, as the TMCM-342 can replace a
TMCM-302 without problems. The connector of the TMCM-342 is identical to the connector of the
TMCM-302, so that a TMCM-342 can just be plugged into a slot that has originally been designed for a
TMCM-302 (it can also use the same base boards as the TMCM-302). Also the TMCL firmware of the
TMCM-342 module is highly compatible with the TMCM-302. However there are some slight differences
that have to be observed (due to the fact that the TMCM-342 has many enhancements compared to
the TMCM-302):
Speed of TMCL program execution: TMCL programs run up twenty times faster than on the
TMCM-302 module. In general, the developer of a TMCL program should not make
assumptions about command execution times.
Axis parameters 194 and 195: The reference search speeds are now specified directly (1..2047)
and no longer as fractions of the maximum positioning speed. These settings have to be
adapted.
MVP COORD: The parameter of the MVP COORD command is different (to make it compatible
with the six axis modules). Please see [TMCL] for details. The usage of this command also has
to be adapted.
Default CAN bit rate: the default CAN bit rate of the TMCM-342 module (e.g. after resetting it to
factory default settings) is 1000kBit/s (in contrast to 250kBit/s on the TMCM-302.
All other TMCL commands and parameters are the same as with the TMCM-302 module.
divider for the velocity. The higher the value is, the
less is the maximum velocity
default value = 0
0..13
ramp_div
divider for the acceleration. The higher the value is,
the less is the maximum acceleration
default value = 0
0..13
Usrs
microstep-resolution (microsteps per fullstep = 2
usrs
)
0..7 (a value of 7 is internally
mapped to 6 by the TMC428)
3220482
velocity]Hz[f
]Hz[usf
div_pulse
CLK
usrs
2
]Hz[usf
]Hz[fsf
29div_rampdiv_pulse
max
2
CLK
2
af
a
usrs
2
a
af
8 TMCM-342 Operational Description
8.1 Calculation: Velocity and Acceleration vs. Microstep- and
Fullstep-Frequency
The values of the parameters, sent to the TMC428 do not have typical motor values, like rotations per
second as velocity. But these values can be calculated from the TMC428-parameters, as shown in this
document. The parameters for the TMC428 are:
Table 8.1: TMC428 Velocity parameters
The microstep-frequency of the stepper motor is calculated with
where “usf” means microstep-frequency
To calculate the fullstep-frequency from the microstep-frequency, the microstep-frequency must be
multiplied with the number of microsteps per fullstep.
where “fsf” means fullstep-frequency
The change in the pulse rate per time unit (pulse frequency change per second – the acceleration a is
given by
If the stepper motor has e.g. 72 fullsteps per rotation, the number of rotations of the motor is:
9 TMCL
TMCL, the TRINAMIC Motion Control Language, is described in a separate documentation, the TMCL
Reference and Programming Manual. This manual is provided on the TMC TechLib CD and on the web
site of TRINAMIC: www.trinamic.com.
Please refer to these sources for updated data sheets and application notes.
The TMC TechLib CD-ROM including data sheets, application notes, schematics of evaluation boards,
software of evaluation boards, source code examples, parameter calculation spreadsheets, tools, and
more is available from TRINAMIC by request to info@trinamic.com
10 CANopen
The TMCM-342 module can also be used with the CANopen protocol. For this purpose, a special
CANopen firmware has to be installed. To do this, download the latest version of the TMCM-342
CANopen firmware from the Trinamic website or use the version provided on the TechLib CD and
install it using the firmware update function of the TMCL-IDE (Setup/Install OS). The TMCM-342 module
is then ready to be used with CANopen. Please see the CANopen manual provided on the Trinamic
website and on the TechLibCD on how to use the TMCM-342 module with the CANopen protocol.