Creating XY Grid Inspection Applications with the Motion Control Module
Overview
Grid inspection typically involves moving across an area in a back and forth pattern and taking measurements at predefined intervals. You might mount the sensor and move the object being inspected on a stage under the sensor. Or, you might attach the sensor to an arm that moves over the stationary object to inspect it. This document describes how you can use the Motion Control Module for Measurement Studio to perform XY Grid inspection.
Table of Contents
Defining the Grid Dimensions and Scanning Pattern
Imagine that you laid a piece of graph paper over the area to be scanned. Place a dot at each location where a measurement must be taken. You have just defined the dimensions of the grid. The grid can be composed of squares (like a checkerboard) or rectangles. Suppose the application involves inspecting a semiconductor wafer that is 10 cm by 20 cm. An image of the wafer must be taken every centimeter. The x axis is divided into 10 columns or segments; each segment is 1 cm long. The y axis is divided into 20 rows or segments, each segment is 1 cm. Each block in the grid is a square centimeter. The measurements are taken at the corners of each block. The scanning pattern is defined by how you connect the dots in the grid.One method of grid inspection is to scan row by row. The first row of the grid is scanned along the x axis from left to right. Every centimeter a measurement is taken. When the edge of the wafer is reached, the sensor is moved to the next row by moving along the y axis. The second row of the grid is scanned from right to left. This process continues until the entire grid surface has been scanned, as shown in Figure 1.

Figure 1. Row-by-row scanning of the grid surface
A second method is to first scan the outside grid segments forming a square pattern. The sensor moves inward in a spiral pattern, scanning smaller and smaller squares until the center of the grid is reached, as shown in Figure 2.
The move sequence is defined to execute the scanning pattern. If the sensor can take the measurement while the move is executing, you can define a single contour move. The coordinates for each grid segment compose the contour data array. Use a contour move if the grid covers a nonrectangular area or must be scanned in an irregular pattern. A second option is performing a single move to scan a row of the grid. A second move then advances to the next row. You can repeat this basic sequence for each row in the grid. Configure the NIMotion control with the number of moves needed to complete the row-by-row scan . It takes a total of 39 moves to scan the 10 by 20 wafer (20 rows plus 19 moves between rows). There is repetition in the move sequence. The only difference between row1 and row2 is a different target position.
Alternately, you can define a move sequence of just two moves—a "RowScan" move and a "RowAdvance" move. The target position for the "RowScan" move must be updated while the sequence is executing. If the sensor's original position is (0,0) and it takes 10,000 encoder counts to move the sensor the length of the row, the target position of the first "RowScan" move is 10,000. The "RowAdvance" move moves the sensor 1000 counts in the y direction. Repeat the move sequence. The second time the "RowScan" move executes, the target position should be 0 to scan the second row in the opposite direction to the first row. Repeat the move sequence 20 times.
You can trigger the sensor at predefined positions using buffered breakpoints. Use modulo breakpoints if the sensor must be triggered at a constant repeating interval. If the system must be at rest while the measurement is performed (for example, the measurement takes time to complete or the system must settle before the measurement is taken) , the controller needs to move, then measure, and then execute the next move. Each measurement requires a separate move. Instead of creating a move sequence of 200 moves (10 by 20), it is simpler to create a move sequence with a single move that is repeated 200 times. The target position is updated as a move completes so that the next iteration of the sequence uses the updated position information. This technique is used in the XY Grid Inspection (Template) example. The example uses a task with the Type property set to complete moves. After each move is completed, the appropriate measurement is made. The next move in the sequence is executed when the sensor has completed the measurement at the current location.
See Also:
X-Y Grid Inspection (Template)
Executing the Move Sequence
For a move sequence with a single, repeated move, load the first target position before the Start method is called. The XY Grid Inspection (Template) example uses a function to calculate the target position for the next move. The NextXYPosition function keeps track of the current position and direction of motion. The function also knows the size of each segment. The function returns the target coordinates for the next move. The MoveCompleted event is generated when the move has completed. The MoveCompleted event handler is used to update the move position to the next target position. You can add custom code depending on your application.
Private Sub NIMotion1_MoveCompleted(ByVal Move As NIMotionControlLib.NIMotionMove, ByVal Task As NIMotionControlLib.NIMotionTask)
- 'Perform the desired task at each grid position
'ExecuteTask
'Load the next position into the returned Move reference
'Because there is only one move in the task, the move is repeated for each grid position.
'Each time the move completes, it is assigned a new target position
Move.Position = NextXYPosition
When the MoveCompleted event handler finishes, the NIMotion control continues executing the move sequence. The new target position stored in the move is sent to the motion controller.
Updating the Display
The XYGrid Inspection (Template) example displays the scanning pattern in a Measurement Studio Graph control as it is executed. When you click the Start button, the graph axes are resized to fit the specified range of the scan. The PlotXYGridPositions function calculates the position of each measurement. These positions are plotted as green squares on the graph. While the move sequence is executing, the GetCurrentPosition method is called as each move completes. The current position is plotted as a white line, which connects the dots to show the scanning pattern.
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/).

