Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NI 7334 with Labview for Motion Control

Hi all,

I am using a NI 7334 to control 3 stepper motors ( Y,Z & A axis (rotational)superimposed on Z). While NI motion assistant creates simple straight profiles, I have much more complex requirements at the User Interface level. As I am in the beginning phase of this, I need help/advice in the following areas to move forward:

1. VI that will help home the axis (the feedback being home limit switch on ballscrew slides connected to these motors)and reset that position to (0,0,0)in the software as home position

2. Arising from the above question, What VI's can I use to store the current count positions of the individual axis, and then be able to use those positions as reference, for further profile movements. (basically a way to store 'stepper motor count(ABSOLUTE)' positions and use them)

3. While the NI motion assistant gives me a Labview Diagram for a simple 2D movement profile, I need to modify that movement profile through the User Interface GUI to do the following:

:1: Have whole profile (point A to Point C)split into two seperate profiles, (click button)Point A to point B(stop), and then (click button)for point B to point C(stop))

:2: How to stop motion of the axis using a labview VI
0 Kudos
Message 1 of 7
(4,727 Views)
Please browse the motion examples that ship with LabVIEW which cover most of your questions.

Here are some brief answers:

1. Use Find Reference.flx
2. Use Reset Position.flx (allows you to reset the positions to custom values)
3:1. Please have a look at the attached example which should give you an idea how to accomplish that.
3:2. Use Stop Motion.flx

Best regards,

Jochen Klier
National Instruments Germany
Message 2 of 7
(4,726 Views)
Jochen,

Thank You very very much. I have some more questions.

1. I am trying to run the motion profiles without connecting the stepper motors to the ballscrew slides, and hence I do not have a feedback for the home limit switches for it to find a reference .....and hence when I run the motion profile which looks something like this below

1. Find Reference
2. Straight Line move (3D)
3. Straight Line move (3D)

It keeps rotating the motors ( Iguess because it canoot reference itself, since there are no home limit switches to give it feed back)

How can I overcome this problem? There is some documentation on "Index Referencing", but that hasn't helped much either.


2. What is the "Vector Space" criteria in settings for "Straight Line Move" in the Motion Assistant Software? I have a series of movements which simple straignt line moves, and I dont need two motots to move together to make me reach the end point. Again what is that vector space? The documentation is very brief, and I am unable to clear myself on this issue.

Thank you for your kind help.
0 Kudos
Message 3 of 7
(4,707 Views)
1. When you run the find home sequence your motor will run until it hits the limit or home switches. If there are no switches it simply will keep turning.
As long as you haven't connected the motors to your stage in fact there is no need for homing them. Thus I would suggest to skip this step as long as you use this mechanical setup. Simply reset the position as a first step and you are done.

"Index Referencing" refers to finding the index position on an encoder.

2. This text is from the NI-Motion User Manual and I think it explains very well the idea of vector spaces:

Coordinate Space (Vector Space)

With the exception of the arc move, you can execute all the basic moves on either a single axis or on a coordinate space. A coordinate space is a logical grouping of axes, such as the XYZ axis shown in Figure III-3. Arc moves always execute on a coordinate space.

If you are performing a move that uses more than one axis, you must specify a coordinate space made up of the axes the move will use.
Use the Configure Vector Space function to configure a coordinate space. This function creates a logical mapping of axes and treats them as part of a coordinate space. Then the move generated by the trajectory generator is done on the vector and all the move constraints are treated as vector values.

Multi-Starts versus Coordinate Spaces
Coordinate spaces always start and end the motion of all axes simultaneously. You can use multi-starts to create a similar effect without grouping axes into coordinate spaces. Using a multi-start automatically starts all axes virtually simultaneously. To end the moves of the axes together, you must calculate the appropriate move constraints for each axis that brings it to the end of its travel with the others. In coordinate spaces, this is calculated automatically.

Jochen
0 Kudos
Message 4 of 7
(4,686 Views)
Thank You Jochen,

Creating a complete movement profile with NI motion assistant, generates its own sub VI's. While the profile is being executed in different case structures, NI Labview/Motion assistant does not have a provision to stop the complete process by using a Boolean 'STOP' or any of it's other relative. Each inherent process gets completed and the STOP becomes external to this process, and hence, while a sequence of movement is being executed, and I want to stop it, It won't. I have to stop the complete VI!!!

Does Labview provide a universal stop function, just as similar to the main 'STOP' button for the VI? Is there anyway to tackle this? This is crucial because, if my axis appears to head into a crash with an object (due to the nature of the physical surroundings) even if they are preset before the motion begins, I have no way to stop it then and there, or Kill it so to speak. Or is there?

Thanks Again.
0 Kudos
Message 5 of 7
(4,668 Views)
There are two ways to stop a LabVIEW vi. A clean one and a dirty one.

The dirty way
In a parallel loop the vi can open a reference to itself and use the abort vi method (see attachment). This will abort the vi just like clicking on the abort button.
There are some drawbacks for using this method:
  1. As the motion board is working independently from the LabVIEW vi ongoing moves won't be stopped when the vi is aborted. If you want to stop an ongoing move you would have to make sure that another vi that is started dynamically calls stop motion after every other vi is stopped or aborted.
  2. When the abort method is called at a time when LV calls a hardware driver there is a chance that the complete application hangs.

The clean way
This involves some more programming but it's definitely the recommended way. There is also not only one way to do that. The general idea is to provide in every loop in every subvi a way to leave it when a global stop command occurrs. You also need to make sure that everything is stopped correctly before the application is stopped. Please have a look at the example in my next reply. It works with a global variable but you also could work with control references, notifications, occurrences and so on.

It might look like that the clean way is a bit annoying but in fact there is no good alternative and please note that this issue is immanent in every programming language. The code Motion Assistant generates is just a prototype that you need to adjust for your specific requirements.

Jochen
Message 6 of 7
(4,658 Views)
The clean way
Message 7 of 7
(4,656 Views)