v+ basics sebastian van delden usc upstate [email protected]

32
V+ Basics Sebastian van Delden USC Upstate [email protected]

Upload: alexandra-ray

Post on 27-Dec-2015

226 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

V+ Basics

Sebastian van Delden

USC Upstate

[email protected]

Page 2: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Teaching Points

Use the teach pendant to move the tool to a desired pose.

Use the here command to store that pose in a location variable.

Two types of location variables: Stored with tool’s X, Y, Z, Yaw, Pitch, Roll

Regular variable name (like Java/C++). Stored with joint angle values.

Variable name starts with a #.

Page 3: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Teaching Points

IMPORTANT: Locations remembered with tool X, Y, Z, Yaw,

Pitch, and Roll values can sometimes be reached using different joints angle sets… CAN BE DANGEROUS.

Some points can be reached as many as 8 different ways with our Staubli’s: Lefty versus Righty Above versus Below Flip versus No-Flip

Page 4: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Teaching Locations Joint-Angle versus Tool-Pose Locations:

Use joint angles locations when the arm has to be moved a large distance to approach this location.

Use tool-pose locations when the arm has to be moved a short distance to approach this location.

The here command stores a location in memory. You will be asked if you would like to change the point. Just

click enter if you are satisfied with the taught location. The move command moves to a point. The do command executes a V+ line of code at the

command prompt. NOTE: Locations are only stored in memory and are

lost when controller is powered down. The zero command blanks out memory.

Page 5: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Changing a Location that was just taught. Example

Modify the Z value of a taught point, but leave all other values alone.

The taught Z value is discarded. If you don’t want to change it, just click enter!

here a

Change?

,,50,,

Page 6: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Viewing/Deleting Locations

listL List all locations in memory

listP List all functions in memory

listS List all string in memory

listR List all reals in memory

deleteL, deleteS, deleteR Delete variables from memory

Page 7: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

MOVE vs MOVES MOVE command finds the best (interpolated

curve) way to go through the path points. MOVES command moves in a straight line

from point to point. Slower because movement depends on the

slowest joint. Straight line created using via points.

Page 8: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

MOVE vs MOVES

PROs MOVE is quicker MOVES is more precise (straight line movement)

CONs MOVE can cause collisions in tight situations,

because the generated could hit a close by object or surface.

MOVES simple will not work at times because it is impossible to move in a straight line between two locations.

Page 9: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Example Activity Manually move the arm to a desired location Type in: here #a

Stores a joint-angle point Manually move the arm to another desired location. Type in: here #b Press CMP/PWR to get out of manual mode Type in do ready to return to the ready position. Okay, first try this: type in: do moves #a

What happened and why? Type in:

do move #a do moves #b do ready The arm should visit the two points.

Page 10: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Basic V+ OS Commands fdir show contents of directory fdir/C X create directory X fdir/D X delete directory X fdel delete a file from the disk execute prog execute program abort abort current program load prog load a program into memory store prog saves everything memory to file prog cd dir change directory into dir cd NFS>XE: change directory to the mounted

USB drive

Page 11: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

.V2 Files

Using store: Everything in memory (locations, functions, etc…)

is stored in the file. Use a .V2 extension.

The .V2 file has different separate parts: .LOCATIONS Locations .REAL Real Variables .STRINGS String Variables .PROGRAMS Functions .DOUBLES Double Variables

Page 12: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

.V2 Files cont…

Page 13: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

.V2 Files cont…

You cannot overwrite an existing file with a store command. Store the new file with a temporary name. Then in V+ or Windows (if using USB drive),

rename the original file and finally rename the new file to the original file.

Function names and locations can be renamed in Windows using Notepad. Must be using NFS mounted USB drive

Page 14: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

File VERSUS function When you perform a store command, a .V2 file is created that

contains a snap shot of everything in memory: functions, locations, variables, etc…

Your function names do not need .V2 extensions and do not

need to be at all related to the file name.

Page 15: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Example Activity Assumes you have trained two points #a and #b already. Type in see fun and hit “i” Type in: ready

move #amove #bready

Click ESC followed by CNTRL+E CD to your NFS folder and type in store practice.v2 Type in execute fun Type in listL, and after that type in listP what do you see? In Windows, navigate to the USB drive, and use Notepad/WordPad to view

practice.v2 Change in the code in notepad/wordpad to move to #b first and then #a. Save the file (CNTRL+S) Go back to Tera-Term and re-execute the program. What happened? Type zero and “y”, and then load practice.v2 (to reload the program) and then try

to re-execute the program. What happened?

Page 16: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Arm Speed

Can be set at prompt or program In a program:

SPEED 50 sets arm speed to 50% of monitor speed.

If no speed is set, 100% of monitor speed is used. At the prompt:

SPEED 50 sets arm speed to 50% of maximum arm speed.

Default when arm is booted up is 10%

Page 17: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Arm Speed cont…

Example: At monitor: speed 50 In program: speed 20 Results in arm speed of 10% of maximum

Changing prompt speed from program: speed 100 monitor

NOTE: the ZERO command does not reset speed!

Page 18: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Arm Speed cont…

For linear movements and prompt speed at 100%, an exact speed can be specified:

speed 150 mmps Sets speed to 150 mm per second

speed 4 ips Sets speed to 4 inches per second

Page 19: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Control Structures

WHILE <boolean-statement> DO….

END

IF <boolean-statement> THEN…

END

FOR <var> = <initial> TO <final> STEP <incr_value>; the STEP part is optional – by default 1 is used.

END

Page 20: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Arrays and for loops

Training array points:here loc[0] or here #loc[0]here loc[0] or here #loc[0]… ...

Get size of the array: n = last(loc[ ])

2D and 3D arrays: here loc[0,0] here loc[0,0,0]

Page 21: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Arrays and for loops cont…

Example:

; loc[ ] is an array of taught locations in memory.

n = last(loc[ ])

for i = 0 to n

move loc[i]

end

Page 22: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

User Interaction

Printing text to the monitor type “text text text…\n”

Comma can be used for concatenation type “Total: “, total

Getting user input: prompt “How many?”, $A ; puts input in string $A n = val($A) ; get numeric value out of $A

Page 23: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Forward Processing

Moves are forward processed so that a smooth trajectory can be generated. V+ looks 1 move ahead VAL3 looks 10 moves ahead

Page 24: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Forward Processing cont…

Example:type “hi 1\n” move #atype “hi 2\n”move #btype “hi 3\n”move #ctype “hi 4\n”move #dtype “hi 5\n”

Page 25: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Forward Processing cont… The BREAK command pauses program until current

motion is completed. Example:

type “hi 1\n” move #atype “hi 2\n”move #bbreaktype “hi 3\n”move #ctype “hi 4\n”move #dtype “hi 5\n”

Page 26: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

ALIGNING…. The align command aligns the tool’s Z axis

with the closest world axis. Type in do align from the command prompt

Page 27: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Approaching points

appro location, mm or appros location, mm Approaches the location from “above” it – mm

distance added to the Z component of the location.

depart mm or departs mm Departs from the location in the positive Z

direction of the location mm distance.

Page 28: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Gripping

Pneumatic gripper use compressed air to push them closed on open.

We have 2 finger gripper from Shunk

Page 29: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Gripping cont… Simply push the tubing into

the holes on the gripper to lock them, they won’t come out.

You need to figure out which holes on the back side of the arm to push the tubing in….

Page 30: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Gripping cont… Remove tubing by pushing down on the little plastic

portion of connector and pulling out the tubing:

Page 31: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

Gripping cont… V+ can control the grippers with using two commands:

openi Opens the grippers instantaneously

closei closes the grippers instantaneously

Recall: you figure out where to plug the tubes in the arm. Hint: do this by removing the stopper plugs from the

holes, and issues “do openi” and “do closei” commands to try to figure out which holes should be used and how…

Page 32: V+ Basics Sebastian van Delden USC Upstate svandelden@uscupstate.edu

More commands…

See the V+ Quick Reference manual for a summary of commonly used V+ commands and control structures. On course website…