REFINE_FRAME Statement

The REFINE_FRAME statement is used to create a reference frame for an assembly. The reference frame is based on engineering or CAD data for the assembly. The vision system locates fiducial marks on the assembly and uses the known values of the fiducial offsets from the edges1 of the assembly to create or update an assembly reference frame.

REFINE_FRAME Example shows a typical assembly (a printed circuit board). The exact locations of the two fiducial marks (relative to a corner of the PC board) are known from the board engineering data. MotionWare use this information to create or update the assembly reference frame for the PC board.

All locations on the board are defined relative to this database reference frame. Each time a new board enters the workcell, the vision system locates the fiducials on the board and updates the database reference frame based on the location of the fiducials. The robot places parts at locations that are defined relative to this updated database reference frame.

Figure 9-9. REFINE_FRAME Example

In REFINE_FRAME Example, the fiducials (located 10 x 10 mm and 230 x 170 mm from the frame origin) are used to calculate the frame origin and orientation relative to the robot workspace.

Using REFINE_FRAME

This statement uses vision to determine the precise value of the reference frame associated with an entire assembly (the assembly database reference frame). This statement visually locates 1 to 4 fiducial marks on the assembly and uses them to correct the nominal value of the reference frame.

In order to position a camera to view each fiducial mark, an initial approximate reference frame may be specified. In addition, this statement allows optional paths to be followed while moving to the first fiducial mark and departing from the last fiducial mark.

Statement Syntax and Arguments

The syntax for this statement is as follows (braces ({...}) enclose optional clauses):

REFINE_FRAME --frame-- {DEFAULT--frame--} {APPROACH--path--}
	LOCATE--vision-- {AT--location-- {--location-- {--location--
	{--location--}}}} {DEPART--path} {USING--tool--} 
	{OK_SIGNAL --o_variable--} 

Sequence of Operations

The sequence of operations performed by this statement is as follows. The relevant portion of the statement syntax is shown for each step.

  1. If defined, apply the tool to describe the current robot gripper. {USING--tool--}

  2. If defined, move along the approach path toward the first picture-taking location. {APPROACH--path--}

  3. If defined, set the value of the first frame to the value of the default frame. The default frame value must be sufficiently accurate to ensure that the fiducial marks lie within the vision field-of-view. {DEFAULT--frame--}

  4. Move to each picture-taking location and perform the specified vision operation to visually determine the fiducial mark location. LOCATE vision {AT--location-- {--location-- {--location-- {--location--}}}}

  5. Compute the actual assembly reference frame, based on the visually determined fiducial mark locations, and set the first frame to this computed value.

  6. If defined, depart from the last picture location along the depart path.
    {DEPART--path}

  7. If defined, set the OK_SIGNAL based on the success of creating a reference frame.

Records Required by REFINE_FRAME

The record names in this section are required for the basic refine frame operation.

Fiducial Location Records

The fiducial locations must be locations in the Location database. Creating locations is covered in Locations and Precision Points. REFINE_FRAME requires at least one fiducial mark but can use up to four fiducials to generate the reference frame. To update accurately the reference frame, these locations should specify the actual engineering values of the fiducial marks (see REFINE_FRAME Example).

When creating these locations, remember:

If a default frame is not used, the initial database reference frame values must be close enough to the actual assembly location to enable the vision system to find the fiducial marks. Note that without a default frame, the picture-taking locations for the next REFINE_FRAME statement will be relative to the reference frame updated in the last REFINE_FRAME statement.

If a default frame is used, it must be close enough to the location to enable the vision system to find the fiducials (the database reference frame can be left blank). When the default frame is used, the picture-taking locations will always be the same.

Vision Tool Record

A vision record that returns a frame result2 is required to locate the fiducial in the camera field-of-view. While any vision tool from the frame class can be used, the vision tool records most commonly used to locate fiducials are:

A blob-finder record is the simplest vision record to use. It merely locates a bounded region within the tool search area and returns the orientation and center of the area. If the fiducial marks on an assembly can be uniquely identified using blob finders, they provide the simplest method of locating fiducials.

If only one fiducial mark is used, the orientation of the frame is calculated from the orientation of the found blob. This requires that an ellipse surrounding the blob must have a strong, consistent orientation. The circles used as fiducials in REFINE_FRAME Example would not be adequate since they do not have a strong elliptical orientation. If more than one fiducial is used, the fiducial does not need an identifiable orientation.

If other features on the board make it impossible to identify uniquely a fiducial with a blob finder, you may be able to use prototype models to locate fiducials. To use prototypes you must first create a prototype model of the fiducial using the camera that will eventually locate the fiducial. You then use a prototype finder to locate the fiducial.

A computed frame record requires the use of other vision tools (usually finder or general tools) to generate a frame based on what the vision tools find in the field-of-view. This method can be used effectively with one fiducial. Remember, however, that all located fiducials must use the same vision operation. You cannot define different vision operations for different fiducial locations.

Some general requirements of the vision record used to locate a fiducial are:

The vision tool record requires camera and picture records with the following characteristics:

Camera Record  

Camera records are described in Camera Records. For a REFINE_FRAME statement, the camera used must be an arm-mounted camera, and it must be calibrated. (See Arm-Mounted Camera Calibration for details on calibrating an arm-mounted camera.)

Picture Record

Picture records are described in Picture Records. For a REFINE_FRAME statement, the picture record has the following requirements (to change these options, select Use it from the motion group and click Setup :

Optional Records for REFINE_FRAME

The following records are used by the optional clauses in the REFINE_FRAME statement.

Approach Path This path will be used when the robot moves to the first
picture-taking location.

Default Frame If a default frame is used, the vision target location(s) will be relative to this frame. Based on where the fiducials are found, the database reference frame will be updated and used as the reference frame for the placement locations on the assembly. The default frame is not updated as each assembly is built.

Remember:

If a default frame is used, the vision operations will always be performed in the same place (since this frame is not updated by a REFINE_FRAME statement). The default frame must be close enough to the actual board reference frame for the fiducial marks being located to lie within the vision field-of-view.

If a default frame is not used, the assembly database frame must have an initial value that is close enough for the vision operation to find the fiducial mark. Since the database reference frame is updated each time a REFINE_FRAME statement is executed, the picture-taking locations for the next REFINE_FRAME statement will be based on the updated database reference frame (the
picture-taking locations will not always be in the same place).

Depart Path This path will be used when the robot moves from the last
picture-taking location to its next destination.

Tool Specifies a tool transformation (see Tool Transformations) to be used with this statement. This tool will override the current tool.

Additional Considerations

When you build the records needed for a REFINE_FRAME statement:

  1. Create all locations with the proper tool transformation in place.

  2. The first --frame-- record specified in the REFINE_FRAME statement should also be specified as the "Named Frame" reference frame for all the location parameters in this statement.3

  3. Define the fiducial marks to be relative to the first reference frame specified in the REFINE_FRAME statement. Select Named in the location record and enter the frame name.

  4. If a tool transformation is used, camera calibration must be performed with the proper tool transformation in place. If a prototype finder locates the fiducial, it must use the same camera that created the prototype model.

  5. When debugging the vision operation, observe the database reference frame value before and after the vision operation. If it changes drastically, either the camera calibration is incorrect or parameters on the picture record are set up incorrectly.

1

Or other features or marks that are the zero-basis data for the location values.

2

Vision records "return" classes of information. One class of information is a vision reference frame that is relative to the camera field-of-view. Records that return frame results are said to be in the frame class. See Frame Relative Records in the VisionWare User's Guide.

3

This frame must come from the Frame database (not the Vision database).