TMCM-342 Manual V1.01
22/26
Copyright © 2008, TRINAMIC Motion Control GmbH & Co. KG
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 RS-
232 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 po10000 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
performance motion control system.
//A simple example for using TMCL and TMCL-IDE
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