Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

traverse code help

Solved!
Go to solution

I am new to the world of labview and wrote my first code to move a linear stage traverse using the velmex NF90 stepper motor (yes, it's very old).  For my code, I wanted to input the total dist and intervals to stop at.  However when I run it, it doesn't behave how I would like.  If i just run it from the front panel it traveres one interval then stops.  If I use the highlight excution then it runs and won't stop traversing until it the program finishes.  I don't know if the length of run has anything to do with it or just a coincidence but any help would be greatly appreciated.   

0 Kudos
Message 1 of 6
(6,054 Views)

Hi Thordon,

 

That is a very old motor drive. Where in your code is it supposes to stop at intervals? When you increase your distance to traverse does the motor turn more? Can you please explain in more detail what you expect to happen and what is actually happening?

 

Here are some good documents that may help.

 

Model NF90 Controller
http://www.velmex.com/motor_nf90.html

 

Velmex NF90
http://sine.ni.com/apps/utf8/niid_web_display.model_page?p_model_id=2375

 

NI Motion Control
http://www.ni.com/motion/

 

Tim O

Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(6,034 Views)

Tim,

 

Thanks for replying. I was recently working on the code and found a few small mistakes.  I attached the new code that, when I run with the "highlight execution" on, it runs correctly.  However, when I run from the front panel (with highlight execution off) it quits after the first movement, which corresponds to the "collect every" variable.  Run correctly, is defined as, move the traverse _inch (distance to travel) and stop every _in (collect every) and then return to where the motor started or origin when it was turned on.  

 

To try to answer some of the questions about the old code in terms of the one I just attached...The code stops at intervals everytime (after) it initializes the movement based on the "collect every" varible within the stacked sequence (outer stacked sequence #3 and inner stacked sequence #0). 

 

Yes when I increase the distance to traverse it'll continue to move based on the increments set by the user under "collect every."

 

 

0 Kudos
Message 3 of 6
(6,032 Views)

Essentially, the command finishes before the motor finishes moving and therefore the motor will stop when the command stops.  I have been doing some more searching and found this thread, I believe he had the same problem but it appears to be solved without a solution.

 

http://forums.ni.com/t5/LabVIEW/command-executes-before-motor-finish-moving/m-p/1828239#M626157

0 Kudos
Message 4 of 6
(6,029 Views)

@Thordon wrote:

Essentially, the command finishes before the motor finishes moving and therefore the motor will stop when the command stops.  I have been doing some more searching and found this thread, I believe he had the same problem but it appears to be solved without a solution.

 

http://forums.ni.com/t5/LabVIEW/command-executes-before-motor-finish-moving/m-p/1828239#M626157


 

After re-reading, he had a slighly similar problem not the same

0 Kudos
Message 5 of 6
(6,026 Views)
Solution
Accepted by topic author Thordon

Tim,

 

After more hours spent scrutinizing my code, i found the problem.  I was not waiting until the controller was telling me that command was completed to continue.  

 

However, I have ran into a small problem (more of a road bump).  Near the end of the execution, I have to wait for a response from the controller  to indicate the the motor is back at the origin, I receive a time out error from the VISA read function.  This error isn't present until after the command executes so it doesn't effect the command but can get annoying.  Is there an easy way to deal with the error so the user isn't prompted? 

0 Kudos
Message 6 of 6
(6,025 Views)