ADI Trinamic Blog

We transform digital information into physical motion.

 
  • Newsletter
  • Blog Ethics
  • Legal/Impressum
  • Main Website
Menu
  • Newsletter
  • Blog Ethics
  • Legal/Impressum
  • Main Website
  • TMCL: Use of X-Register

    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 demonstates the usage of the X-register. The motor 0 is performing 10 rotations with velocity 1000 then the program will be stopped.

    Before use: Restore Factory Defaults

    //This program demonstates the usage of the X-register. The motor 0 is performing 10 rotations with
    //velocity 1000 then the program will be stopped.
    //For more details look at TMCL_reference.pdf -
    //http://www.trinamic.com/software-tools/tmcl-ide
    //
    //Before use: Restore Factory Defaults
    //(MN 19.05.2015)
    
    // *** Values that have to be adapted *** //
    vmax = 2000					//max. speed (0 ... 2047)
    amax = 1000					//max. acceleration (0 ... 2047)
    cmax = 100					//max. current (0 ... 255)
    
    // *** Interrupt initialization *** //
    SAP 4, 0, vmax   			//set max. positioning speed
    SAP 5, 0, amax				//set max. acceleration
    SAP 6, 0, cmax    			//set max. current
    
    CALC LOAD, 1				//load 1 to accu
    CALCX LOAD					//load accu to X-register
    CALC LOAD, 0				//load 0 to accu
    
    
    // *** Main Loop *** //
    loop:
    	MVP REL, 0, 51200		//perform 1 rotation: 51200 = 200 * 256
    	WAIT POS, 0, 0			//wait until postion reached
    	WAIT TICKS, 0, 100		//wait 1 second. 100 * 10ms
    	CALCX ADD				//add X-register to accu
    	COMP 10					//compare accu with 10
    	JC LT, loop				//if greater or equal 10 end program
    	STOP					//end of program

    For more details look at TMCL_reference.pdf  at http://www.trinamic.com/software-tools/tmcl-ide

    This sample is tested with TMCM-1140, TMCM-1161, TMCM-6110.

    Share this:

    • Twitter
    • Facebook
    • LinkedIn
    • Pinterest
    • Print
    • Email

    Related

    November 19, 2015 / Jonas P. Proeger / 3

    Categories: Code Snippet, Tutorial

    Tags: TMCL

    TRINAMIC reveals progress on AutoR Heliostat Program How to make a stepper motor turn in minutes with Trinamic TMC5130-EVAL-KIT

    Comments are currently closed.

    3 thoughts on “TMCL: Use of X-Register”

    • Mownika says:
      January 19, 2018 at 1:10 am

      Hi…How is 1 roation caluculated as 51200?? is it constant for all or what is the logic behind it??

      Thank you

    • Lars Jaskulski says:
      January 22, 2018 at 3:55 pm

      Hi Mownika,

      This number is calculated by the full steps per revolution of the used stepper motor and the micro step resolution set in the controller. In this example a 200 full step motor is used with a micro step resolution of 256.
      200 multiplied by 256 equals 51200.

      I hope that help.

      Best regards,
      Lars

    • Mownika says:
      January 22, 2018 at 4:43 pm

      Thankyou

Recent Posts

  • Guest Blog: UBC Thunderbots
  • Guest Blog: TURAG
  • Guest Blog: School of Engineering Telecom Physics University of Strasbourg
  • Guest Blog: STAR Dresden
  • Pushing the Limits of Stepper Motor Control in 3D Printing

Social

  • View trinamic.mc’s profile on Facebook
  • View Trinamic_MC’s profile on Twitter
  • View trinamic’s profile on GitHub
  • View UC4SHA5_GAw1Wbm2T2NWpWbA’s profile on YouTube

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Newsletter

 

Info

Waterloohain 5
22769 Hamburg
+49 40 514 806 40

Tags

3D printer 3d printing arduino BLDC cDriver code code snippet coolStep drive Driver ease of use ethercat eval kit evaluation kit Field Oriented Control FOC GUI guide heliostat How-To IC linear stage motion controller motor driver open source hardware programming rtmi servo servo controller IC setup silentstepstick stealthChop stepper stepper motor stepper motor driver stepper motor driver ic stepper motors technology TMC4671 tmc5130 TMCL TMCL-IDE TRINAMIC TRINAMIC Motion Control tuning

Tag Cloud

    3D printer 3d printing arduino BLDC cDriver code code snippet coolStep drive Driver ease of use ethercat eval kit evaluation kit Field Oriented Control FOC GUI guide heliostat How-To IC linear stage motion controller motor driver open source hardware programming rtmi servo servo controller IC setup silentstepstick stealthChop stepper stepper motor stepper motor driver stepper motor driver ic stepper motors technology TMC4671 tmc5130 TMCL TMCL-IDE TRINAMIC TRINAMIC Motion Control tuning

Pages

  • Blog Ethics
  • Newsletter
  • Player Embed
  • Search Videos
  • User Videos
  • Video Category
  • Video Tag

Categories

  • Competition
  • Guest blog
  • Industry News
  • Jobs
  • Myths about Motors
  • Open Source Hardware
  • Products
  • Projects
    • DIY
    • University Projects
  • Research
  • Social
  • Software
  • technology
  • Trade Shows
  • Tutorial
    • Code Snippet
  • Uncategorized

Copyright © 2015 TRINAMIC BlogTheme created by PWT. Powered by WordPress.org

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.