-
TMCL: Turn One Motor to an Absolute Position
TMCL is the simple way to implement your motion control application. With this series of simple coding examples we want to provide you an easy start.
This program demonstrates how to perform a complete turn assuming you are using a 200 fullstep (1.8°) motor using the move to position command.
Before use: Restore Factory Defaults
// *** Values that have to be adapted *** // vmax = 1000 //max. speed (0 ... 2047) amax = 1000 //max. acceleration (0 ... 2047) cmax = 100 //max. current (0 ... 255) // *** Initialization *** // SAP 1, 0, 25600 //set actual position to 25600 SAP 4, 0, vmax //set max. positioning speed SAP 5, 0, amax //set max. acceleration SAP 6, 0, cmax //set max. current // *** Main Loop *** // loop: MVP ABS, 0, -25600 //turn motor to absolute position -25600 WAIT POS, 0, 0 //wait until position reached WAIT TICKS, 0, 200 //wait 2 seconds. 200 * 10ms MVP ABS, 0, 25600 //turn motor to absolute position 25600 WAIT POS, 0, 0 //wait until position reached WAIT TICKS, 0, 200 //wait 2 seconds. 200 * 10ms JA loop //jump to loop
For more details look at TMCL_reference.pdf at http://www.trinamic.com/software-tools/tmcl-ide
Basic Commands, this sample can be used with any TMCL module with one or multiple axes tested with TMCM-1140, TMCM-1161, TMCM-6110.
Related
September 10, 2015 / Jonas P. Proeger / 2
Categories: Code Snippet, Tutorial
Tags: TMCL
TMCL: Turn one Motor Left and Right TMCL: Different Microstep Resolutions
Comments are currently closed.
2 thoughts on “TMCL: Turn One Motor to an Absolute Position”
Can i change the speed after the mvp command ?
Hi Thomas,
Thanks for your comment. Yes, you are able to change the speed after the MVP command. If the position was not reached the velocity will increase to the new velocity. Are you looking into a particular product?
Best regards,
Lars