TMCL: Read Analog Value

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 read an analog value and adjust the velocity of motor 0. The velocity depends on the analog value obtained at Port AIN_0. In the easiest case connect a pontiometer to Port AIN_0.

Before use: Restore Factory Defaults

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

This sample is tested with TMCM-1161 and is compatible with Modules with 12-Bit Analog input. Modules with 10Bit analog input are not compatible.

2 Comments

  • Jess

    This was very helpful but is there any way to do a 0-10v = 0-360 degrees or one full rotation??

  • Lars Jaskulski

    Hi Jess,
    In general this is possible and by adapting the basis of the code you should be able to achieve that. You can read up the TMCL commands with the Firmware manual with the module you are writing the program. You might need a hysteresis as otherwise the motor axis might jitter caused by noise on the analog voltage signal.
    If you need further help and / or support please do not hesitate to use our support system. You will find a blue button on our main webpage on the bottom right corner: http://www.trinamic.com
    Best regards,
    Lars

Leave a Reply

Your email address will not be published. Required fields are marked *