Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Trinamic controller - correct commandsin hex-string

Solved!
Go to solution

hi there,

i control a stepper moter with trinamics MCST3601. trinamic provides a labview tool to send commands to the control board.

my problem is, that it is not possible to make a motion (relative to the actual position)  in negative direction with the programm provided by trinamic. that does not work.

the command in TMCL would look like this: MVP 1, 0, -1000.

potitive position values are no problem. my assumption is, that the negative value is not properly translated into hex-code.

I would be very happy for any hints how to fix this.

 

Thanks in advance

 

Here you can find the VIs:

https://www.trinamic.com/support/software/

https://www.trinamic.com/fileadmin/assets/Support/Software/TMCL_with_Labview.zip

 

 

 

 

0 Kudos
Message 1 of 11
(6,872 Views)

Hello hering,

 

in the example you can change rotation from left to right, but what i miss is the feedback part like from an encoder or the postion you are stand. If the drive only accept inputs for driving and you get no information back, then a relative move could not realy done you only can change the direction an move.

Unbenannt.PNG

best regards
Alexander
0 Kudos
Message 2 of 11
(6,814 Views)
Solution
Accepted by topic author hering

Hi Alexander,

thanks for your answer.  I contacted trinamic and got the Vi working now. The Problem was in the conversion from dec- to hex-values.

This is the solution:

conversion.JPG

Cheers

Henning

0 Kudos
Message 3 of 11
(6,804 Views)

Hi Henning,

 

I too am using the sample code that Trinamic provide for their motor control. Was this the only thing you needed to alter in your code to allow your motors to travel in the -ve direction? I tried to change the sub_vi called 'Value into 4 part' to match what you have marked as the solution, only I get an error saying that "The given session or object reference is invalid". 

I'm also curious as to whether you were successful in setting other axis parameters such as max speed and max current using Labview. I'm struggling with that at the moment. 

 

Many Thanks,

Emma

0 Kudos
Message 4 of 11
(6,592 Views)

Hi Emma,

 

if I remember correctly that was the only thing, I needed to change to move in the negative direction.

I send various instructions from labview to the controller, MVT, SAP, ROL. Once I figured out how the instructions worked, it was straigt forward. If you do not allready have the documentation for TMCL, I would recomend it, to see how the instructions work: https://fmcc.faulhaber.com/resources/img/DE_7000_50002.PDF

 

The error, which you describe, sounds like there is a problem with the VISA-Communication. Did you chose the right COM-Port?

 

Cheers

Henning

 

0 Kudos
Message 5 of 11
(6,584 Views)

Thanks for the swift reply to my comment! I've just realised that my error was due to the wrong COM port being selected. However, I made your changes to my code and for some reason the motor still won't move in the -ve direction.

 

I too have also tried implementing TMCL's motion commands. I tried adding instructions to that drop down list so they would correspond with the Trinamic motion controls but that didn't work for me. I tried to limit the current to one of the small motors I'm using but when I checked the operating current in the TMCL-IDE it was still set to it's MAX value. 

I appreciate the help,

Emma

0 Kudos
Message 6 of 11
(6,582 Views)

Hi Emma,

 

without seeing your VI it is hard to guesss where the failure is.

One important thing you need to do is to create an controll for the Instruction Type. The Variable is set in the "DEC to HEX" VI.

If you have the controll try to send the following Instruction:

 

Instruction: MVP

Type: 1 => 1 means Move to relative Position

Value = for example   -1000   => any negative value is ok for testing

 

To send correct commands you need to set the correct Values (see screenshot) in the Instructions Variable. The values ("Werte") for each command can be found in the TMCL documentation.

0 Kudos
Message 7 of 11
(6,579 Views)

Hi Henning,

 

Adding the control for 'Type' means I can now successfully write SAP commands to the motor controller. I still have an issue with moving in the -ve direction though. I've attached a .ZIP of the VI and relevant sub_vis I'm working from. My main program (very rough and not arranged correctly yet) is "New_Module_Control.vi" and the sub_vi I edited to try and solve the -ve direction problem was "Value into 4 part.vi". 

 

Another quick question for you, were you able to write eg. a looping program that allowed the motor to go forward and backwards once you selected that option? What I'd like to do is basically write a small stand-alone program for the motor to run on until the loop terminates. I know this is available in the TMCL-IDE but I was curious to see if it could be implemented in Labview also.

 

Thank you for your help!

 

0 Kudos
Message 8 of 11
(6,576 Views)

Hi Emma,

I will have a look at your programm later tonight.

As to your last question: Yes my programm includes a set of SAP-Instructions to initialize the MC3601 with the motor properties I need. After this I make different automated movements depending on the status of my main programm. I created a stat machine with labview wich sends the instructions I need. This should work for you as well. For example: In one case of the state maschine you can send the movement instruciton and in another you can send the MST Motor Stop instruction, when you want the motor to stop.

 

0 Kudos
Message 9 of 11
(6,573 Views)

Thank you Henning, that would be really helpful. It's interesting to know that this can be done. I don't have a lot of experience with Labview TMCL commands so I'll spend some time figuring out how I can implement something like this. 

 

Emma

0 Kudos
Message 10 of 11
(6,571 Views)