Prototyping Your Part Inspection Application using NI Motion Assistant
Table of Contents
- Overview
- Step 1. Reference Move—Moves the XY stage to its initial starting position by using the find home move type
- Step 2. Straight-Line Move—Moves from starting position A to position B
- Step 3. Measurements step—Placeholder for image acquisition action
- Step 4. Straight-Line Move step—Moves from position B to position C
- Step 5. Measurements step—Placeholder for image acquisition action
- Step 6. Straight-Line Move step—Moves from position C to position D
- Step 7. Measurements step—Placeholder for image acquisition action
- Step 8. Straight-Line Move step—Moves from position D back to position A
- Step 9. Measurements step—Placeholder for image acquisition action
- Step 10. Convert to LabVIEW or C code
Overview
This application moves an XY stage under a camera through a specific path comprised of separate moves, pausing at the end of each move to capture an image. The devices being tested are placed at the end of each move segment. The move path is as follows:

The system is comprised of an XY stage with a camera mounted on top.
You can prototype the motion part of this application by creating a script in NI Motion Assistant using the following steps:
Step 1. Reference Move—Moves the XY stage to its initial starting position by using the find home move type
Insert a Reference Move step. This step moves the XY stage to its reference starting position.
1. Click the Add Step button on the far left side of the application window.
2. Click the Reference Move button.
3. Click the Configure tab on the dialog box at the bottom of the new screen.
4. Click the 2D button. You configure this move as a 2D move because this application uses two axes of motion. Enter the following information:
o Device: Choose the motion controller.
o Units: Select counts (steps).
o Coordinate: Select Vector Space 1.
o X Axis: Choose the default, Axis 1.
o Y Axis: Choose the default, Axis 2.
o Profile type: Select S-curve.
o Velocity: Enter 10,000 counts (steps)/sec.
o Acceleration: Enter 100,000 counts (steps)/sec2.
o Deceleration: Enter 100,000 counts (steps)/sec2.
o S-curve (Jerk): Enter 400,000,000 counts (steps)/sec3.
o Reference Type: Home
o Initial Direction: Forward
o Final Direction: Forward
o Edge to stop on: Forward
Check the box next to the Reset Position Counters button to reset the position of the move to zero after the reference move.
Step 2. Straight-Line Move—Moves from starting position A to position B
Insert a Straight-Line Move step. This step moves the stage from point A to point B.
1. Click the Add Step button on the far left side of the application window.
2. Click the Straight-Line Move button. Motion Assistant remembers the Configure and Move Constraints tab settings of the previous step, so it is necessary to change the settings only in the Position tab.
3. Click the Position tab on the dialog box, and set the following parameters:
· X Position: The number of counts (steps) to travel, which equates to distance, varies significantly for each motion system. For this example application, enter 50000.
· Y Position: Enter 0 because the y-axis does not change from position A to position B.
Step 3. Measurements step—Placeholder for image acquisition action
Insert a Measurements step.
1. Click the Add Step button on the far left side of the application window.
2. Click the Measurements step button.
3. Click the Configure Delay tab on the dialog box, and set the following parameters:
o Type of Delay: Wait for specified time
o Delay: 500 ms
This configuration of the Measurements step inserts a half-second delay between two straight-line moves, and adds a comment into the LabVIEW code and code recipe as a placeholder for the image acquisition code.
Step 4. Straight-Line Move step—Moves from position B to position C
Insert a second Straight-Line Move step. This step prototypes the move from point B to point C.
1. Click the Add Step button on the far left side of the application window.
2. Click the Straight-Line Move button.
3. Click the Position tab on the dialog box, and set the following parameters:
o Operation Mode: Absolute Position
o X Position: For this example, enter 50000 because X does not change from position B to position C.
o Y Position: Enter –50000 because the y-axis changes from point B to point C.
Step 5. Measurements step—Placeholder for image acquisition action
Insert a Measurements step.
1. Click the Add Step button on the far left side of the application window.
2. Click the Measurements step button.
3. Click the Configure Delay tab on the dialog box, and set the following parameters:
o Type of Delay: Wait for specified time
o Delay: 500 ms
This configuration of the Measurements step inserts a half-second delay between two straight-line moves, and adds a comment into the LabVIEW code and code recipe as a placeholder for the image acquisition code.
Step 6. Straight-Line Move step—Moves from position C to position D
Insert the third Straight-Line Move step. This step prototypes the move from point C to point D.
1. Click the Add Step button on the far left side of the application window.
2. Click the Straight-Line Move button.
3. Click the Position tab on the dialog box, and set the following parameters:
o Operation Mode: Absolute Position
o X Position: Enter 0 because the x-axis moves back to its original position of zero.
o Y Position: Enter -50000 because the y-axis does not change from point C to point D.
Step 7. Measurements step—Placeholder for image acquisition action
Insert a Measurements step.
1. Click the Add Step button on the far left side of the application window.
2. Click the Measurements step button.
3. Click the Configure Delay tab on the dialog box, and set the following parameters:
o Type of Delay: Wait for specified time
o Delay: 500 ms
This configuration of the Measurements step inserts a half-second delay between two straight-line moves, and adds a comment into the LabVIEW code and code recipe as a placeholder for the image acquisition code.
Step 8. Straight-Line Move step—Moves from position D back to position A
Insert the fourth and final Straight-Line Move step. This step prototypes the move from point D back to point A to complete the square.
1. Click the Add Step button on the far left side of the application window.
2. Click the Straight-Line Move button.
3. Click the Position tab on the dialog box, and set the following parameters:
o Operation Mode: Absolute Position
o X Position: Enter 0 because the x-axis is already at its original position.
o Y Position: Enter 0 because the y-axis returns to its original position to complete the square.
Step 9. Measurements step—Placeholder for image acquisition action
Insert a Measurements step.
1. Click the Add Step button on the far left side of the application window.
2. Click the Measurements step button.
3. Click the Configure Delay tab on the dialog box, and set the following parameters:
o Type of Delay: Wait for specified time
o Delay: 500 ms
This configuration of the Measurements step inserts a half-second delay between two straight-line moves, and adds a comment into the LabVIEW code and code recipe as a placeholder for the image acquisition code.
Step 10. Convert to LabVIEW or C code
You have finished creating the prototype motion script. To test the script, complete the following steps:
1. Initialize the motion controller in MAX.
2. Click the Run button at the top of the Motion Assistant screen to run the motion script.
Note To run this motion script as written, you must have a complete motion system connected to motors. If you are prototyping a motion script with only a motion controller and no external motion hardware, delete the Reference Move step, configure the motion controller for open-loop steppers, and then run the script.
To save the motion script, select File»Save, or press <Ctrl-S>. You can now convert your project to LabVIEW or C code by clicking on Tools»Generate Code.

Download FREE NI Motion Assistant Evaluation Software
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).
