User Manual

TMCM-102 Manual (V1.01 / 7 November 2007) 17
Copyright © 2006, TRINAMIC Motion Control GmbH & Co. KG
6 Putting the TMCM-102 into Operation
with TMCL
On the basis of a small example it is shown step by step how the TMCM-102 is set into operation.
Users who are already familiar with TMCL and other Trinamic modules may skip this chapter.
Example
: The following application is to be implemented on the TMCM-102 module using the TMCL-
IDE Software development environment.
The simple application is:
Move the Motor to position 150000
Wait 2 seconds
Move the Motor back to position 0
Wait 1 second
Start again with the first step
To implement this simple application on theTMCM-102 it is necessary to do the following things:
Step 1:
Connect the host interface to the PC
Step 2:
Connect the motor to the motor connector
Step 3:
Connect the power supply voltage to the module
Step 4:
Switch on the power supply. The activity LED should start to flash. This indicates the
correct configuration of the microcontroller.
Step 5:
Start the TMCL-IDE Software development environment. Enter the program shown in
the following listing. A description of the TMCL commands can be found in the TMCL
Reference and Programming Manual.
Step 6:
Click the “Assemble” icon to convert the TMCL program into byte code.
Then download the program to the TMCM-102 module by clicking the “Download”
icon.
Step 7:
Click the “Run” icon. The downloaded program will now be executed.
A detailed documentation about the TMCL operations and the TMCL IDE can be found in the TMCL
Reference and Programming Manual. The next chapter shows how the velocity and acceleration values
are calculated.
//A simple example for using TMCL and the TMCL-IDE
SAP 4, 0, 100 //Set the maximum speed
Loop: MVP ABS, 0, 150000 //Move to position 150000
WAIT POS, 0, 0
WAIT TICKS, 0, 200
MVP ABS, 0, 0 //Move back to position 0
WAIT POS, 0, 0
WAIT TICKS, 0, 100
JA Loop //Infinite Loop