• No results found

Creating and Altering Location Variables

Creating Location Variables

The most straightforward method of creating a location variable is to place the robot or motion device at a location and enter the monitor command:

HERE loc_name

If you have the optional Adept manual control pendant, you can use the pendant and the TEACH instruction to create location variables. See the V+ Operating System User’s Guide for details on using this command.

Transformations vs. Precision Points

A location can be specified using either the six components described in the previous section, or by specifying the state the robot joints would be in when a location is reached. The former method results in a transformation variable.

Transformations are the most flexible and efficient location variables.

Precision points record the joint values of each joint in the motion device.

Precision points may be more accurate, and they are the only way of extracting joint information that will allow you to move an individual joint. Precision points are identified by a leading pound sign (#). The command:

HERE #pick

will create the precision point #pick equal to the current robot joint values.

Modifying Location Variables

The individual components of an existing transformation or precision point can be edited with the POINT monitor command:

POINT loc_name

will display the transformation components of loc_name and allow you to edit them. If loc_name is not defined, a null transformation will be displayed for editing.

Chapter 8 Creating and Altering Location Variables A location variable can be duplicated using the POINT monitor command or SET program instruction. The monitor command:

POINT loc_name = loc_value and the program instruction:

SET loc_name = loc_value

will both result in the variable loc_name being given the value of loc_value. The POINT monitor command also allows you to edit loc_name after it had been assigned the value of loc_value.

The following functions return transformation values:

TRANS Create a location by specifying individual components of a transfor-mation. A value can be specified for each component.

SHIFT Alter the Cartesian components of an existing transformation.

The POINT and SET operations can be used in conjunction with the

transformation functions SHIFT and TRANS to create location variables based on specific modifications of existing variables.

SET loc_name = SHIFT(loc_value BY 5, 5, 5)

will create the location variable loc_name. The location of loc_name will be shifted 5 mm in the positive X, Y, and Z directions from loc_value.

Relative Transformations

Relative transformations allow you to make one location relative to another and to build local reference frames that transformations can be relative to. For

example, you may be building an assembly whose location in the workcell

changes periodically. If all the locations on the assembly are taught relative to the world coordinate frame, each time the assembly is located differently in the workcell, all the locations must be retaught. If, however, you create a frame based on identifiable features of the assembly, you will have to reteach only the points that define the frame.

Examples of Modifying Location Variables

Figure 8-6 on page 192 shows how relative transformations work. The magnitude and direction elements (x, y, z), but not the orientation elements (y, p, r), of an Adept transformation can be represented as a 3-D vector, as shown by the dashed lines and arrows in Figure 8-6. The following code generates the locations shown in that figure.

Chapter 8 Creating and Altering Location Variables

; Define "loc_b" to be the current location relative

; to "loc_a"

HERE loc_a:loc_b;loc_b = −50, 20, 30, 0, 0, 0 BREAK

; Define "loc_c" as the vector sum of "loc_a" and "loc_b"

SET loc_c = loc_a:loc_b;loc_c = 350, 70, 320, 0, 180, 0 Once this code has run, loc_b exists as a transformation that is completely independent of loc_a. The following instruction will move the robot another

−50mm in the x, 20mm in the y, and 30mm in the z direction (relative to loc_c):

MOVE loc_c:loc_b

Multiple relative transformations can be chained together. If we define loc_d to have the value 0, 50, 0, 0, 0, 0:

In Figure 8-6 on page 192, the transformation loc_b defines the transformation needed to get from the local reference frame defined by loc_a to the local reference frame defined by loc_c.

Chapter 8 Creating and Altering Location Variables The transformation needed to go in the opposite direction (from loc_c to loc_a) can be calculated by:

INVERSE(loc_b) Thus, the instruction:

MOVE loc_c:INVERSE(loc_b)

will effectively move the robot back to loc_a.

Figure 8-6. Relative Transformation

Figure 8-6 shows the first three locations from the code examples on page 190.

loc_a =

300, 50, 350, 0, 180, 0

loc_b =

-50, 20, 30, 0, 0, 0 loc_c = loc_a:loc_b =

350, 70, 320, 0, 180, 0

X

Y Z

Chapter 8 Creating and Altering Location Variables

Defining a Reference Frame

In the example shown in Figure 8-7, a pallet is brought into the workcell on a conveyor. The program that follows will teach three locations that define the pallet reference frame (pallet.frame) and then remove the parts from the pallet.

The program that follows will run regardless of where the pallet is placed in the workcell as long as it is within the robot working envelope.

Figure 8-7. Relative Locations

; Get the locations to define the pallet

DETACH () ;Release robot for use by the MCP PROMPT "Place robot at pallet origin. ", $ans

HERE loc.origin ;Record the frame origin

PROMPT "Place robot at point on the pallet x-axis. ", $ans HERE loc.x.axis ;Record point on x-axis

PROMPT "Place robot at point in positive y direction. ", $ans HERE loc.pos.y ;Record positive y direction

+Z

+X

+Y

loc.origin loc.pos.y

pallet.frame

loc.x.axis

Chapter 8 Creating and Altering Location Variables

In the above example, the code that teaches the pallet frame will need to be run only when the pallet location changes.

If you are building an assembly that does not have regularly spaced locations like the above example, the following code will teach individual locations relative to the frame:

; Get the locations to define the pallet frame

DETACH ();Release robot for use by the MCP PROMPT "Place robot at assembly origin. ", $ans HERE loc.origin;Record the frame origin

PROMPT "Place robot at point on the assm. x-axis. ", $ans HERE loc.x.axis;Record point on x-axis

PROMPT "Place robot at point in positive y direction. ", $ans HERE loc.pos.y;Record positive y direction

; Create the local reference frame "assm.frame"

SET assm.frame = FRAME(loc.origin, loc.x.axis, loc.pos.y, loc.origin)

; Teach the locations on the assembly

PROMPT "Place the robot in the first location. ", $ans HERE assm.frame:loc.1;Record the first location

PROMPT "Place the robot in the second location. ", $ans HERE assm.frame:loc.2;Record the second location

Chapter 8 Creating and Altering Location Variables

; etc.

; Move to the locations on the assembly ATTACH ();Reattach the robot

APPRO assm.frame:loc.1, 25 MOVE assm.frame:loc.1

;Activate gripper DEPART 25

APPRO assm.frame:loc.1, 25 MOVE assm.frame:loc.2

;Activate gripper DEPART 25

; etc.

In the above example, the frame will need to be taught each time the assembly moves—the locations on the assembly need to be taught only once.

The instruction HERE assm.frame:loc.1 tells the system to record the location loc.1 relative to assm.frame rather than relative to the world coordinate frame. If a subassembly is being built relative to loc.1, the instruction:

HERE assm.frame:loc.1:sub.loc.1

will create a compound transformation where sub.loc.1 is relative to the transformation assm.frame:loc.1.

Chapter 8 Creating and Altering Location Variables

Miscellaneous Location Operations

The instruction:

DECOMPOSE array_name[] = #loc_name

will place the joint values of #loc_name in the array array_name. DECOMPOSE works with transformations and precision points.

The command:

WHERE

will display the current robot location.

The BASE operation can be used to realign the world reference frame relative to the robot.

Chapter 8 Motion Control Instructions