RefFrame Class and Objects

The Objects of the RefFrame Class define robot and part reference frames. As previously described, one or more Cartesian Locations can be defined relative to a RefFrame. If the position or orientation of the RefFrame is subsequently modified, the absolute (or “total) position and orientation of all associated Cartesian Locations are automatically adjusted and will move with the reference frame.

For example, a RefFrame Object, tray_ref, can be created that defines the position and orientation of a tray of parts. The Location of each part on the tray can then be defined with respect to tray_ref. If the tray and its parts move in unison, the position and orientation of tray_ref can be updated and the total position of all of the part Locations will be automatically adjusted and move with the reference frame.

In addition to defining a Location with respect to a RefFrame, a RefFrame can be defined with respect to another RefFrame. In the example above, if an array of trays is organized into a two dimensional grid, a second “pallet” RefFrame, pallet_ref, can be defined to represent the grid of trays. tray_ref can then be defined with respect to pallet_ref. Each time the pallet_ref is advanced to the next tray, the tray_ref position will be modified as well as all of the part Locations that are defined with respect to tray_ref.

To define a Location with respect to a reference frame, you simply refer to the reference frame via the RefFrame property of a Cartesian Location. For example,

Dim part1 As New Location   ' part1 defaults to Cartesian Loc
Dim tray_ref As New RefFrame
part1.RefFrame = tray_ref   ' part1 defined wrt tray_ref

To simplify the use of reference frames, several different types of RefFrames exist and more will be added in the future. The common members of all RefFrame Objects are summarized in Table 19-19. For detailed information on these members and those of the specific types of reference frames, please consult the GPL Dictionary Pages.

Table 19-17: RefFrame Objects

Member Type Description

 refframe_obj.Type

Property

Sets and gets the type of the reference frame.

 refframe_obj.Loc

Property

Sets and gets the Location Object that is an integral part of the reference frame. The use of Loc varies for different types of reference frames although Loc.RefFrame always defines the next reference frame if RefFrame_obj is itself relative to another reference frame.

 refframe_obj.Pos

Method

Returns the absolute (“total”) position and orientation for any type of reference frame object.

 refframe_obj.PosWrtRef

Method

Returns the position for any type of reference frame while ignoring any further reference frames.

 refframe_obj.Text

Property

Sets and gets a String value not used by GPL. Available for general use by applications.

 

Basic Reference Frame

The basic type of RefFrame simply stores the position and orientation of the reference frame in the Loc Location. The Loc.Pos property defines the position and orientation of the reference frame. The GPL project is responsible for defining and updating the Loc.Pos value to reflect the current reference frame value.

Dim loc1 As New Location       ' loc1 set to Cartesian Loc
Dim ref1 As New RefFrame
loc1.RefFrame = ref1             ' loc1 with respect to ref1
ref1.Loc.XYZ(10,20,30,0,180,20)  ' Set ref1 Pos

In order to define a basic reference frame with respect to another reference frame, the Loc.RefFrame value must reference the next reference frame.

For a basic reference frame, it is possible to use Loc.Pos and Loc.PosWrtRef to read the total position and relative position of the reference frame. However, it is generally a better practice to read the Pos and PosWrtRef of the RefFrame instead. RefFrame_obj.Pos and RefFrame_obj.PosWrtRef will return the current values for any type of RefFrame.

The RefFrame members that have special meaning for the basic type of reference frame are briefly described in Table 19-18.

Table 19-18: RefFrame, Special Meaning for Basic Reference Frame Type

Member Type Description

 refframe_obj.Type

Property

Set to 0 to indicate a basic reference frame.

 refframe_obj.Loc

Property

 Loc.Pos is set equal to the position and orientation of the reference frame by a GPL procedure.

 

Pallet Reference Frame

A pallet reference frame defines a one, two, or three-dimensional rectangular grid of positions that are sequentially indexed. For example, this type of reference frame can be utilized to represent a row of parts being fed, an array of test samples organized into a two dimensional grid or a three dimension pallet of shipping boxes. Once a pallet RefFrame has been defined, you can advance to the next position in the pallet by simply invoking the pallet’s “PalletNextPos” method.

The position of the first item (i.e. index 1,1,1) is defined by the X, Y, and Z displacements of Loc. The directions of the X, Y, and Z axes of Loc define the direction for each row, column, and layer of the pallet, respectively.

The distance between each item in a row, column, or layer is defined by the “PalletPitch” in each dimension. The maximum number of elements in each row, column, or layer can also be specified. Setting the maximum index to 1 indicates that this corresponding dimension is not incremented.

The order in which GPL indexes along rows, columns, and layers can also be specified. For example, when PalletNextPos is executed, the default is to step along the row first, then along columns, and finally to the next layer. However, you can change the order to any combination. So, you could step by layers first, rows second, and then columns if you so choose.

In addition to using PalletNextPos to increment to the next pallet element, the pallet element can be directly specified by the PalletIndex property or the PalletRowColLay method. When a pallet indexes beyond the final element, it automatically wraps back to the first element.

The RefFrame members that have special meaning for the pallet type of reference frame are described in Table 19-19.

Table 19-19: Special Meaning for Pallet Type of Reference Frame

Member Type Description

 refframe_obj.Type

Property

Set to 1 to indicate a pallet reference frame.

 refframe_obj.Loc

Property

 Loc.X, Y, and Z define the position of the first row, column and layer. The orientation of the X, Y, and Z axes of Loc define the direction for each row, column, and layer respectively.

 refframe_obj.PalletIndex

Property

Sets and gets the index for the next position along the pallet row, column, or layer (1 to n).

 refframe_obj.PalletMaxIndex

Property

Sets and gets the maximum position index along the pallet row, column, or layer (1 to n).

 refframe_obj.PalletNextPos

Method

Advances to the next pallet position.

 refframe_obj.PalletOrder

Property

Sets and gets the parameter that specifies the order in which PlalletNextPos indexes along the row, column, and layer indices.

 refframe_obj.PalletPitch

Property

Sets and gets the step size for advancing along each row, column, or layer.

 refframe_obj.PalletRowColLay

Method

Sets the next pallet position row, column, and layer indices in a single instruction.

 

Conveyor Reference Frame

Conveyor Tracking is a software option that permits Locations to be defined relative to a conveyor belt.  When the robot moves to such positions, the system automatically adjusts the robot's motions to account for the actual position and speed of the belt.  For example, this option allows an application that picks parts from one conveyor and places them on a second conveyor to be taught when the conveyors are stationary.  Then, during the actual execution, the program will be automatically adjusted by the system to perform the same operation even when the conveyors are moving.

From a programming point of view, conveyor reference frames provide the means for implementing a conveyor tracking program.  For each conveyor belt, one or more conveyor RefFrame objects must be defined.  Each such object specifies the conveyor that is being referenced and provides the data need by the system to evaluate the instantaneous position of the belt. 

The Pos value of a conveyor reference frame always yields the instantaneous position of a conveyor and its X-axis always points along the nominal direction of travel of the belt.  Any Location that is defined with respect to a conveyor RefFrame automatically moves with the conveyor belt.

The RefFrame members that are defined for a conveyor reference frame are described in Table 19-20.  For more information on the Conveyor Tracking option, please see the Controller Software > Introduction to the Software > Motion Control > Conveyor Tracking section of the PreciseFlex Library.

Table 19-20: Conveyor Type of Reference Frame

Member Type Description

 refframe_obj.Type

Property

Set to 2 to indicate a conveyor reference frame.

 refframe_obj.Loc

Property

 Not used.  Conveyor reference frames cannot be defined with respect to any other reference frame.

 refframe_obj.PosWrtRef

Method

Returns the position of the "nominal" transformation for the associated conveyor robot.

 refframe_obj.ConveyorOffset

Property

Sets or gets the property that specifies the zero position of the conveyor belt's encoder.

 refframe_obj.ConveyorRobot

Property

Sets or gets the property that specifies the robot module that is interfaced to the belt encoder and contains the data that defines the conveyor.