Sunteți pe pagina 1din 107

RO BO TICS

YuMiLib
ABB Add-in
User and Reference Guide

YuMiLib

Document-ID: 3HDA000059A1554-001
Revision: 1.04
The information in this manual is subject to change without notice and should not be construed
as a commitment by ABB. ABB assumes no responsibility for any errors that may appear in this
manual.

Except as may be expressly stated anywhere in this manual, nothing herein shall be construed
as any kind of guarantee or warranty by ABB for losses, damages to persons or property, fitness
for a specific purpose or the like.

In no event shall ABB be liable for incidental or consequential damages arising from use of this
manual and products described herein.

This manual and parts thereof must not be reproduced or copied without ABB's written
permission.

Additional copies of this manual may be obtained from ABB.

The original language for this publication is English. Any other languages that are supplied have
been translated from English.

© Copyright 2019 ABB, All rights reserved.

ABB AB

Robotics Products

Se-721 68 Västerås

Sweden

3HDA000059A1554-001 Revision: 1.04 5


YuMiLib

Table of Contents

1 OVERVIEW OF THIS MANUAL .......................................................................8


2 WHAT IS THE YUMILIB? ............................................................................... 10
2.1 OVERVIEW ............................................................................................................ 10
2.2 FLEXPENDANT PROGRAMMABLE BUTTONS ............................................................. 11
2.3 FLEXPENDANT APP ............................................................................................... 11
Calibrate .............................................................................................................. 12
Train .................................................................................................................... 14
Clear .................................................................................................................... 19
Run ...................................................................................................................... 19
View ..................................................................................................................... 20
2.4 RAPID CODE ........................................................................................................ 20
3 SYSTEM REQUIREMENTS ............................................................................. 21
4 INSTALLATION AND USER-DEFINED SETTINGS ..................................... 21
5 RAPID REFERENCE BASE ............................................................................. 25
5.1 DATA TYPE ........................................................................................................... 25
pickdata – Pick/Place information ................................................................ 25
locatedata – Store information about located parts...................................... 27
traydata – Store information about a tray setup ............................................ 30
5.2 INSTRUCTIONS ...................................................................................................... 32
MoveY – Compact and fast movement to a robtarget ............................................ 32
MoveToHome – Movement to the home position .................................................. 35
HandInit – Hand initialization and calibration ................................................. 36
MoveFingersTo – Move fingers to desired position .......................................... 37
Calib_HandCamera – Camera calibration ...................................................... 38
InitCamera – Initialize camera job ................................................................. 40
ShowABBLogo – Present the ABB Logo to the other arm .................................... 41
Locate – Locate parts using the hand camera .................................................... 42
WaitForTap – Continue execution after tap ....................................................... 51
PickInward – Robot motion to pick an object inward ........................................ 53
PickOutward – Robot motion to pick an object outward ................................... 57
PickSuction1 – Robot motion to pick an object with suction cup 1 .................. 61
PickSuction2 – Robot motion to pick an object with suction cup 2 .................. 66
PickPlunge – Robot motion to pick an object without gripper motions .............. 70
Place – Robot motion to place an object ............................................................. 73
PlaceSuction1 – Robot motion to place an object with suction cup 1 .............. 77
PlaceSuction2 – Robot motion to place an object with suction cup 2 .............. 81
PlacePlunge – Robot motion to place an object without gripper motions.......... 85
Drop – Robot motion to release an object ............................................................ 88
IndexedPick – Indexed pick ............................................................................ 90
IndexedPlace – Indexed place ........................................................................ 95
CalControl – Evaluate the curent Arm Calibartion ......................................... 99
SetVisionTool – Set the active tool in the spreadsheet.................................. 102
DelayedCall – Make a delayed call to a proc ................................................ 103
5.3 FUNCTIONS ......................................................................................................... 104
LocatePart – Locate single part using the hand camera ................................. 104
Taskno – Get the task number .......................................................................... 106
5.4 YUMILIB PARAMETERS ....................................................................................... 107

3HDA000059A1554-001 Revision: 1.04 7


YuMiLib

1 Overview of this manual

About this Manual

This manual contains an installation guide, RAPID reference and user guide for
the YuMiLib Add-In buiavaliable for YuMi IRB14000

YuMiLib-1.00.0200.38 or higher

RobotWare 6.06 or higher.

Usage

This manual is intended as a user guide for the YuMiLib Flexpendant App and
RAPID reference. It contains documentation of the RAPID syntax and
parameters for the YuMiLib instructions. Additional manuals including a general
RAPID reference, SmartGripper and FlexPendant guides are listed under
References.

Who should read this manual?

This manual is primarily designed for YuMi (IRB14000) application


programmers already familiar with the RAPID language.

Prerequisites

The reader should …

• be familiar with industrial robots and terminology.


• be familiar with the RAPID programming language.
• be familiar with the ABB FlexPendant.
• be familiar with the safety regulations of the ABB IRB14000 robot YuMi.
• be familiar with YuMi and Smartgripper programming.

References

Nr. Reference Document ID

[1] RAPID Reference 3HAC16580-3


Guide - RAPID
Overview
[2] RAPID Reference 3HAC16581-3
Manual - Instructions,
Functions, and Data
Types
[3] User Manual - IRC5 3HAC16590-3
with FlexPendant
[4] Technical Reference 3HAC17076-3
Manual - System
Parameters
[5] Operating Instructions 3HAC032104-001
Robotstudio 6.05
[6] Product manual IRB 3HAC052983-001
14000

3HDA000059A1554-001 Revision: 1.04 8


YuMiLib

[7] Product manual 3HAC054949-001


Grippers for IRB
14000
[8] Application manual 3HAC044251-001
Integrated Vision

Revisions

Revisions Description
0.1 Sandra Collin
0.2 Sandra Collin
0.3 Sandra Collin
1.0 Sandra Collin, Maj Stenmark
1.01 Sandra Collin
1.02 New features in YuMiLib V1.00.02, Sandra Collin
1.03 Changes of YuMiLib V1.00.0200.38
new parameter \KeepOrientation in Locate,
user defined settings adapted, C. Goy
1.04 Changes of YuMiLib V1.00.0200.48
New user-defined settings
Improved MoveY description, C. Goy

Safety regulations

Before beginning to work with the robot, you must be familiar with the safety
information in Product manual - IRB 14000.

License agreement

1. ABB is the sole owner of the copyright and exploitation rights of the
software supplied with YuMiLib.

2. ABB grants the Licensee a simple, non-exclusive, but unlimited right to


use the YuMiLib option.

3. The license only entitles the user to use the software option YuMiLib on
a robot control. Licensee may not duplicate the YuMiLib or any part
thereof and make it available to third parties or use the software or parts
thereof on further robot controls. With the exception of creating a
security scanner solely for their own use in the original hardware.

4. It is not permitted to modify, translate, reverse engineer, decompile or


disassemble the YuMiLib software option.

3HDA000059A1554-001 Revision: 1.04 9


YuMiLib

2 What is the YuMiLib?

2.1 Overview
Usage

YuMiLib is a software option that provides additional programming support and


RAPID modules with instructions and functions for the IRB14000 robot YuMi
equipped with standard servo Smartgrippers (optionally suction and/or vision
enabled).

The library provides automatic setup and calibration routines for robot system
and grippers, and step-by-step configuration guides and user support for
creating vision applications, and efficient pick-and-place and palettizing
applications that use the Smartgripper cameras, fingers and suction cups. It is
integrated into the Flexpendant, the RAPID editors and Robotstudio Integrated
Vision.

YuMiLib includes the following features:


• Automatic setup and calibration of the robot and grippers, including
cameras and tooldata.
• User support for quick configuration of vision jobs for the Smartgripper
cameras.
• User support for training fast optimized motions for the 7-joint arm and
pick and place operations using vision, fingers and/or suction cups.
• User support for generating RAPID code for palettizing applications with
indexed trays.
• Extensive RAPID code example collection.

After installation, the functionality can be accessed through the YuMiLib menu
on the Flexpendant, in RobotStudio, the Program Editor window and Program
Data window on the Flexpendant or by calling the the routines directly from
RAPID programs.

The instructions and functions can be summarized as:

Scope Content

Base Frequently needed instructions and


functions:

• Camera Calibration
• MoveY – optimized YuMi motions
• Pick/Place operations
• Localization
• Indexed Pick/Place operations in a
tray
• Camera guided Pick/Place and tray
localization

3HDA000059A1554-001 Revision: 1.04 10


YuMiLib

2.2 FlexPendant programmable buttons

In YuMiLib the

- 1st Flexpendant Progkey is programmed to toggle the right-hand gripping


commands.
- The 2nd Flexpendant Progkey is programmed to toggle Manual/Auto.
- The 3rd Flexpendant Progkey is programmed to toggle the left-hand
gripping commands.
- The 4th Flexpendant Progkey is programmed to enable leadthrough on both
arms. To disable leadthrough on both arms the button should be double-
tapped.

2.3 FlexPendant App


The features can be accessed through the YuMiLib app which can be found
under the start menu on the FlexPendant.

3HDA000059A1554-001 Revision: 1.04 11


YuMiLib

The welcome screen lets the user select actions for calibration, instruction
traning, task execution or program modification.

Basic/advanced mode:
In basic mode, the dialogues in the initialization guides will minimize the user-
specified input, using default values when possible. In advanced mode, the
dialogues provide all adaptable settings during initialization, for example for
creating fast pick and place motions that measures the pick and grip time.

Calibrate
The calibrate option displays shortcuts for executing calibration routines for the
camera(s) and TCP(s).

The TCP calibration will execute a series of motions where the robot touches
known points on its base and updates the tooldata for the fingers and suction
cups.

3HDA000059A1554-001 Revision: 1.04 12


YuMiLib

The camera focus is adjusted manually by rotating the focus ring after removing
the caps as described in the wizard on the Flexpendant. To calibrate the
camera(s) relative to the robot base, the robot executes a series of movements
while measuring the distance to the ABB logo of the other arm.

3HDA000059A1554-001 Revision: 1.04 13


YuMiLib

Train
When selecting the Train item from the YuMiLib welcome screen, the user will
be guided through configuration steps for teaching instruction parameters. The
idea of the App is to train instruction parameters and then transfer the code to
the user’s own RAPID program that contain the task level logic. The instructions
can be altered or removed and new instructions, declarations and routines can
be added as long as BeginnerProgramMain is the first routine in the module.

When the user selects which arm to instruct, leadthrough is automatically


enabled and the available instruction list is displayed. There are different types
of instuctions, for example Pick and Place using suction cups or cameras.

Each instruction has an initialization guide where the user trains the parameter
values to the routine.

3HDA000059A1554-001 Revision: 1.04 14


YuMiLib

Auto align

All instruction in the instruction list have the option to Auto align. Auto align
automatically aligns the gripper, suction cup or camera z-axis to the appropriate
axis of the base coordinate system when continuing by pressing OK.

Vision

Vision-related instructions such as Locate and VisionPick, have options to show


Live Video. The Live Video window contains controls for jogging the robot
linearly in the camera coordinate system. The possible navigations are rotating
left/right, move up/down, move left/right, move forward/backward and align the
camera’s z-axis with the robot’s z-axis. It is also possible to set the increment
with which the movement is performed.

3HDA000059A1554-001 Revision: 1.04 15


YuMiLib

The configuration guide can be used to identify up to four different objects and
will automatically calculate the ImagePlaneOffset (the distance in z-direction to
the parts).

The step-by-step configuration guide assists the user to train the object model
in the Integrated Vision tab in RobotStudio (32-bit). See more under Program
Execution for the Locate instruction.

Datatypes and Workobjects

The library declares three datatypes:


• pickdata, which is used to specify finger positions, forces and the mass
of the part, which is used to detect errors during pick and place
operations,
• locatedata, which stores the configuration data for the vision tasks,
• traydata which is used to define a multidimensional array of parts for
picking and placing in palettizing applications.

Every time the hand cameras are used, the location of the located part is stored
in a temporary workobject called WObj_vision. This workobject is used to
specify relative motions in subsequent motions relative to the part. The vision
workobject is declared TASK PERS within the scope of the current task,
however, the user can share data between tasks by declaring persistent
variables in both tasks and assign/use it in both tasks:

PERS wobjdata sharedVariable := […]

3HDA000059A1554-001 Revision: 1.04 16


YuMiLib

Each robot arm has its own workobject WObj_FollowR and WObj_FollowL that
can be referenced by the other arm. This can be used while the reference arm
stands still, for example while holding a part. For programming of synchronized
motions, see the RAPID Reference Manual - Instructions, Functions, and Data
Types.

Using vision guided motions

The configuration guides for VisionPick, VisionPlace, VisionIndexedPick and


VisionIndexedPlace generate two RAPID instructions: a Locate which updates
the WObj_vision followed by a Pick (Inward, Outward etc), Place, IndexedPick
or IndexedPlace with WObj_vision as parameter. The user can therefore update
the instructions separately during debugging, for example by selecting the
WObj_vision as a workobject on the Flexpendant and then train a new
instruction.

Image plane parallel to world XY plane

Vision-related instructions have the option to create the image plane (and
thereby also WObj_Vision) parallel to the base coordinate system. If the
checkbox is unchecked, the image plane is parallel to the camera.

Pick and place instructions

YuMiLib provide step-by-step initialization for configuration of the Pick and Place
instructions. For example, the users have the option to automatically weigh the
part using a series of movements to measure the mass. Multiple parts can be
picked and weighed after each other.

For fast pick modes using triggered finger closing, the configuration will measure
grip and pick time. See balanced and fast pick.

3HDA000059A1554-001 Revision: 1.04 17


YuMiLib

During the setup the user moves the robot to the desired grip position, assisted
by for example the Align feature that aligns the gripper z-axis with the axes of
the base coordinate system.

The Pick and Place instructions have an approach position PrePos and retracts
to PostPos after picking the part. Depending on the selection of RelTool or Offs
in the app, the arm is either moved relative to the tool or the workobject. The
default value is 100 mm offset in the z-direction of the current tool or the
instruction workobject (default wobj0). The positions can be edited by specifying
a workobject for the tray as shown in the examples below:

TASK PERS robtarget pTarget:= […];


TASK PERS pickdata gd1 := […];
PERS wobjdata WObj_angled:=[FALSE,TRUE,"",[[450,-
60,100],[0.966,0.2588,0,0]],[[0,0,0],[1,0,0,0]]];

PROC main()
PickInward pTarget,tGripper\WObj:=WObj_angled,gd1;
ENDPROC

Or, by modifying the x, y,z- offset directly using the optional parameters:

PROC main()
PickInward pTarget, tGripper, gd1\PrePos:=[0,-
50,90]\PostPos:=[0,-50,90];
ENDPROC

Indexed pick and place

The initialization guides for IndexedPick and IndexedPlace provide user


support for specifying traydata to pick and/or place parts in multidimensional
arrays. The trays can have up to three dimensions. A 1D tray or array can be
used to pick parts located in a row or stacked on top of each other, a 2D tray is
used when the parts are located in a grid and, a 3D tray have stacks of parts
located in a grid. The positions can be set relative to a workobject for the tray
specified by the user or WObj_vision located using vision. The latter is
configured step-by-step using the VisionIndexedPick and VisionIndexedPlace

3HDA000059A1554-001 Revision: 1.04 18


YuMiLib

initialization guides which will generate Locate and an IndexedPick RAPID


instructions.

For example, the image below shows a 2-by-2 tray with parts where the corner
of the tray is located using the hand camera. The traydata keeps track of the
index of the current part and updates it in each IndexedPick. Please see the
code example PickPlaceTray provided in the YuMiLibExample modules.

TASK PERS robtarget cTarget:= […];


TASK PERS locatedata ld := […];
TASK PERS robtarget pTarget:= […];
TASK PERS traydata td := […];
TASK PERS pickdata pd := […];

PROC main()
VAR num nStatus;
td.nIndex := 0;
WHILE nStatus<>TRAY_EMPTY DO
Locate cTarget, tHandCamera , ld;
IndexedPick pTarget, tGripper
\WObj:=WObj_Vision,td, pd\nStatus:=nStatus;
! Do something with the objects
ENDWHILE
ENDPROC

Clear
Clears the program in BeginnerModuleMain for both tasks respectively.

Run
Executes the program in BeginnerModuleMain for both tasks.

3HDA000059A1554-001 Revision: 1.04 19


YuMiLib

View
The View tab displays the current instructions in BeginnerModuleMain for each
arm. The instructions can be removed or modified. If pressing Edit, a window
with Align, Modify position as well as settings for present pickdata or locatedata
is shown.

The App generates a BeginnerModuleL.sys and a BeginnerModuleR.sys which


the user can access in RAPID. The BeginnerProgramMain can only hold 50
lines and will be overwritten by Clear (which will ask the user to save the
modules) so the user should save code continuously. When the user has altered
the module the button Refresh must be pressed in order for the code to appear
in the View window.

2.4 RAPID code


The YuMiLib RAPID instructions can be accessed through the instruction list in
the Program Editor window on the FlexPendant. Each instruction comes with its
own configuration editor.

The public data types of the YuMiLib can be accessed in the Program Data
window of the FlexPendant.

During installation, several modules are deployed on the robot. For example,
the RAPID modules YuMiLibExamplesR.sys and YuMiLibExamplesL.sys
provide code examples that demonstrate the usage and functionality of the
YuMiLib instructions. The YuMiLibExamplesR.sys and YuMiLibExamplesL.sys
modules can be deleted without affecting the rest of the library.

In the RAPID editor in RobotStudio, the YuMILib snippets are added to the
Snippet-menu.

3HDA000059A1554-001 Revision: 1.04 20


YuMiLib

3 System requirements

Conditions

• IRB14000 (YuMi)

• ABB Robot Control of the Generation IRC5 and Operation System from
RobotWare 6.07.

4 Installation and user-defined settings

Installation

YuMiLib adds the following RAPID modules:

Module Functionality

YuMiLib_Params_R/L.sys System module containing arm


specific parameters for the
different modules.

YuMiLibExamplesR/L.sys System module containing


examples of the functionality
present in YuMiLib.

YuMiLibStartApp.sys System module which is used by


the YuMiLib app.

YuMiLib Installation
• Install ABB.YuMiLib_1.00.0000.xx.rspak via RobotStudio. Under the
Add-Ins tab, select Install Package and browse to the rspak-file.
• Connect to the controller and install the add-in via the Installation
Manager in RobotStudio.
• Save the YuMiLib license file in the HOME folder on the robot controller.

YuMiLibSnippets Installation
• Run SnippetsInstall.exe. If RobotStudio is open during the installation
RobotStudio must be restarted.
Autoconfiguration at first startup

The first time YuMiLib is started a startup sequence is performed in the


background task to auto configure the hands and cameras. During the
configuration, the present cameras are renamed to HandCameraR and/or
HandCameraL. The initialization takes several minutes and the controller is
restarted when the configurations are finished. Save the license file in the HOME
folder on the robot controller (using file transfer) or load it as a system module
on both tasks.

3HDA000059A1554-001 Revision: 1.04 21


YuMiLib

When the installation and startup are finished, a welcome screen is displayed
asking the user if they want help with the setup. Performing the setup is
advisable. The setup will perform the following:
• Calibration control and update of the revolution counters if needed
• If suction cups are present the tVacuum1 and tVacuum2 TCP will be
identified.
• The tGripper TCP is identified.
• A guide to set up focus depth is shown.
• Camera calibration for present cameras

Restore from Backup

YuMiLib parameters are part of the backup and will be restored together with the rest of
the robot system parameters. YuMiLib sets the camera configuration and if the backup
did not have YuMiLib installed and the cameras were named to something other than
HandCameraR and HandCameraL, the camera configuration must either be removed or
the cameras renamed (to HandCameraR and HandCameraL). To remove the
configuration, edit the camera name(s) in the SIO.cfg file in SYSPAR folder in the backup
folder to set the camera name(s):
COM_APP:

-Name "HandCameraR" -Type "CAMERA" -Trp "TCPIP1" -MAC "00:d0:24:4c:44:3c"


#

Custom Settings

Parameters in module YuMiLibInstalled :

In the internal system module YuMiLibInstalled several settings can be altered


to change the default behavior for YuMiLibPick and YuMiLibLocate. These
settings will be reset after the program pointer is moved, i.e PP to Main or PP to
Routine. The settings may be assigned in the program only, they can not be
reached from the data window.

The different settings are:

Offset to pre-and post-position:

• yl_nOffs: 100 mm. Default distance between pre/post position and


pick/place position.
• yl_nOffsDirection{3}: [0,0,1]. Default direction in which yl_nOffset is
applied.

Speeddata and zonedata:


• yl_vDefault: The default speeddata.
• yl_zDefault: The default zonedata.
• yl_nContactForce: 0.04. The default contact force used in contactL for
collision detection.
• yl_vCollPrecise: v100. Default speed used in ContactL movement for
collision detection in precise mode.
• yl_vCollBalanced: v300. Default speed used in ContactL movement
for collision detection in balanced mode.
• yl_zColl: fine. Default zone used in ContactL movement for collision
detection in precise and balanced mode. Default zone for pick/place
position in fast mode.
• yl_ zIntermediate: z0. Default zone used in intermediate movement in
precise and balanced mode.
• yl_nBalancedAccDist: 30 mm. The default acceleration distance in
balanced mode. The acceleration distance is used to create an

3HDA000059A1554-001 Revision: 1.04 22


YuMiLib

intermediate target between pre-pick/place-position and pick/place-


position to avoid ContactL to trigger in the pre-pick/place zone.
• yl_nPreciseAccDist: 15 mm. The default acceleration distance in
precise mode. The acceleration distance is used to create an
intermediate target between pre-pick/place-position and pick/place-
position to avoid ContactL to trigger in the pre-pick/place zone.

Data used in mass identification:

• yl_vMassIdent: [40,10,40,40] (speeddata). The default speed used in


the mass identification movement.
• yl_vMassOffset: 5 degrees. The default angle to offset the axes to
create a movement where all axes are moved.
• yl_vMaxIter: 10. The default limit of iterations used in mass
identification.

Finger/Suction data used in initialization process:

• yl_nFingerClearance: 2.5. Finger clearance between the finger grip


position and FingerPos (pickdata).
• yl_nFingerLimitHighDiff: 1. Finger difference between gripping
position and LimitHigh (pickdata).
• yl_nFingerLimitLowDiff: 1. Finger difference between LimitLow
(pickdata) and gripping position.
• yl_nSuctionLimitHighDiff: 10. Pressure difference between pressure
when grabbing the object and LimitHigh (pickdata).
• yl_ nReleaseTimeFast: 0.05 s. The default time between reaching the
place position and moving the fingers to release the object.
• yl_ nDelaySuction: 0.05 s. The default time difference between
reaching the pick/place and enable/disable suction.
• yl_BlowOffDelay: 0.3 s. The default wait time between blow on and
blow off when releasing object from the suction cups

Gripper data:

• yl_ nGripperMaxPosition: 25. The maximum grip position.


• yl_ nGripperMinPosition: 0. The minimum grip position.
• yl_ nGripperMaxForce: 20. The maximum grip force.
• yl_ nGripperMinForce: 4. The minimum grip force.
• yl_ nGripperForce: 20. The default gripping force.
• yl_bLimitDriveForce: TRUE. If the gripping in pick/place should be
performed with limited drive force.

Locate data:

• yl_nLocatePreciseCheckDistance: 3 mm. When a precise locate is


executed, the second image processing might return several found
parts. Locate selects the correct part by calculating the distance of the
positon of the first image and the image of the precise locate.
• yl_nFeederProcLimit: 4. Number of times sFeederProc is called in
Locate when no parts are found.

3HDA000059A1554-001 Revision: 1.04 23


YuMiLib

Parameters in module YuMiLibInstalled :

In the internal system module YuMiLibInstalled a couple of settings can be


altered to activate advanced logging features or adjust the CPU load of the YuMi
Lib background tasks.
The settings may be assigned in the program only and can not be modified from
the program data editor.

The settings are persistent and must be changed back to default by assigning
the here documented default values. The actual values are not stored with a
backup.

The different settings are:

Logging functionality of Locate command.

It is possible to log all data of the executed Locate instructions. Additionally, a


special logging in an error case may be activated.

The logger uses two files with a definable maximum size (default 1000 KB).
Each TASK creates separate log files. They are named
TaskName_LOCATE_1.LOG and TaskName_LOCATE_2.LOG and are stored
in HOME: of the system.

Logging of LOCATE data to a file may be enabled or disabled by assigning


TRUE or FALSE to the following Boolean persistent variables in RAPID code
(access via program data is not possible).

By default (after installation of YuMi Lib) the logging is disabled.

• yl_bLogLocateEnabled:=TRUE; !enables logging for LOCATE


• yl_LogLocateErrorEnabled:=TRUE; !enables logging for LOCATE in
error case

The file size may be defined by assigning the value in RAPID. The default value
is 1000 KB.
• yl_nLogLocateFileMaxSizeKB:=1000;

Wait time in YuMi Lib background tasks:

• yl_nWaitTimeBGLoop: 0.001s. Default wait time in program loop of


YuMi Lib background task. Observe: increasing this value may cause
unexpected behavior of YuMi Lib. E.g the gripper performance may be
reduced. Modify carefully and only, if the user application causes
additional high CPU load. Change the value in 0.001 s steps and test
your application.

3HDA000059A1554-001 Revision: 1.04 24


YuMiLib

5 RAPID Reference Base


5.1 Data Type
pickdata – Pick/Place information

Usage

pickdata is used to store information about a pick or a place.

Description

The information about a pick or place is stored in a separate data declaration


and modified when first performing a pick or place to initialize the operation.

Components

Initialized Data Type: bool

Initialization status for the operation. Setting this value to FALSE will force a re-
initialization of the pickdata.

DelayTime Data Type: num

DelayTime for triggering the fingers in advance. Used when performing a


pick/place in balanced or fast mode.

FingerPos Data Type: num

Finger position before a pick or after a place. In the range 0-25.

HoldForce Data Type: num

Force to grip and hold the object. In the range 4-20 N.

LimitLow Data Type: num

Low limit used when evaluating finger position in a pick or place.

LimitHigh Data Type: num

High limit used when evaluating finger position or suction pressure in a pick or
place.

Offset Data Type: num

The distance from the pick/place position to the pre/post pick/place position in
the z-direction specified by the workobject used in a pick/place. If specified to 0,
the offset will be initialized to yl_nOffs mm.

mass Data Type: num

Only used when not using a defined \Load in a pick. If specified to 0, the
initialization will ask the user to specify the mass or let YuMiLib try to identify the
mass. In the range 1-250 g.

3HDA000059A1554-001 Revision: 1.04 25


YuMiLib

Mode Data Type: num

The pick/place has three modes:

• YUMILIB_PRECISE_MODE (1): The pick/place is performed using


collision detection and post pick evaluation. The pre pick position and
the pick position have finezones and the path with collision detection
uses speed yl_vCollPrecise.

• YUMILIB_BALANCED_MODE (0): The pick/place is performed using


collision detection, pretriggering of finger movement/suction and post
pick evaluation. The pick/place position has a finezone and the path
with collision detection uses speed yl_vCollBalanced.

• YUMILIB_FAST_MODE (2): The pick/place is performed without


collision detection and with pretriggering of finger movement/suction
and post pick evaluation. The pick/place position has a finezone.

Hash Data Type: num

When the initialization is finished the sum of all parameters affecting the delay
time (including velocity and acceleration) is stored in a hash. When performing
a pick/place, the hash is controlled to discover changes in pickdata and in that
case, ask user to update the hash, update delaytime or reinitialize.

Basic Example

PERS pickdata pd_default:=[FALSE,0,0,0,0,0,0,0,0,0];

Default pickdata when creating a pick or place.

PERS pickdata
pd_initialized:=[TRUE,0.093,5.5,20,1.3,3.3,100,0.03536,1,0
];

Initialized pick/place where the information is stored in


pd_initialized.

Structure

< Dataobject of pickdata>


< Initialized of bool >
< DelayTime of num >
< FingerPos of num >
< HoldForce of num >
< LimitLow of num >
< LimitHigh of num >
< Offset of num >
< mass of num >
< Mode of num >
< Hash of num >

3HDA000059A1554-001 Revision: 1.04 26


YuMiLib

locatedata – Store information about located parts

Usage

locatedata is used to store information about a locate command and the located
parts.

Description

The information about the locate command and the located parts is stored in a
separate data declaration and modified when locating parts or training a Locate.

Components

Trained Data Type: bool

Trained status for the locatedata. Setting this value to FALSE will force a re-
initialization of the locatedata.

VisionJobName Data Type: string

The vision job name. If VisionJobName is not specified when training a Locate
the user is prompted to select a job from a list.

nVisionTool Data Type: num

The vision tool number, used to enable correct tool when performing a Locate.
nVisionTool is automatically assigned during training.

VisionToolName Data Type: string

The vision tool name.

VisioResultName Data Type: string

The vision result name found in Output to RAPID in Integrated Vision.

ImagePlane Data Type: pose

When training a Locate with a specified workobject, the ImagePlane is set to the
current position of the camera. If no workobject is specified, the pose of wobj0
is used. The ImagePlane is used to calculate the position of the located object.

ImagePlaneOffset Data Type: num

The z-offset from base coordinate system to the object if no workobject is used
in Locate. If a workobject is specified the ImagePlaneOffset is expressed from
camera to the top of the object in negative direction. During a Locate training
the user is asked to specify the ImagePlaneOffset or to let YuMiLib perform an
identification. The ImagePlaneOffset is used to calculate the position of the
located object.

nPartsFound Data Type: num

Number of parts found when locating multiple parts. If nPartsFound is -1, a new
image is taken.

3HDA000059A1554-001 Revision: 1.04 27


YuMiLib

pTakePicture_tHandCamera Data Type: pose

The pose where the robot takes the image. The pose is calculated using
tHandcamera and wobj0.

part1 Data Type: pos

Position of part1.

part2 Data Type: pos

Position of part2.

part3 Data Type: pos

Position of part3.

part4 Data Type: pos

Position of part4.

part5 Data Type: pos

Position of part5.

part6 Data Type: pos

Position of part6.

part7 Data Type: pos

Position of part7.

part8 Data Type: pos

Position of part8.

part9 Data Type: pos

Position of part9.

part10 Data Type: pos

Position of part10.

nFingerAreaObscured Data Type: num

The number of located parts that does not have enough finger clearance to grip
an object.

nPartsOnFeeder Data Type: num

The number of located parts that are present on a feeder.

3HDA000059A1554-001 Revision: 1.04 28


YuMiLib

Basic Example

TASK PERS locatedata ld:= [FALSE,"",0,"" ,"",0,


[[0,0,0],[0,0,0,0]],0,0,[[0,0,0],[0,0,0,0]],[0,0,0],[0,0,0
],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],
[0,0,0],0,0];

Default locatedata.

Structure

< Dataobject of locatedata>


< Trained of bool >
< VisionJobName of string >
< nVisionTool of num >
< VisionToolName of string >
< VisionResultName of string >
< ImagePlaneOffset of num >
< nPartsFound of num >
< nRestartCtr of num >
< pTakePicture_tHandCamera of pose >
< part1 of pos >
< part2 of pos >
< part3 of pos >
< part4 of pos >
< part5 of pos >
< part6 of pos >
< part7 of pos >
< part8 of pos >
< part9 of pos >
< part10 of pos >
< nFingerAreaObscured of num >
< nPartsOnFeeder of num >

3HDA000059A1554-001 Revision: 1.04 29


YuMiLib

traydata – Store information about a tray setup

Usage

traydata is used to store information about a tray’s setup and is modified when
a IndexedPick or IndexedPlace is performed.

Description

The information about the tray setup and indexation is stored in a separate data
declaration and modified when performing indexed picking or placing of parts.

Components

Initialized Data Type: bool

Initialization status for the operation. Setting this value to FALSE will force a re-
initialization of the traydata.

nIndex Data Type: num

nIndex is increased at every call to IndexedPick or IndexedPlace to keep track


of the next part or the next available place. Set nIndex to 0 to pick/place the first
part in the tray.

psWObj Data Type: pose

The calculated workobject pose for the tray setup. psWObj is initialized
according to the given positions in each direction during leadthrough teaching
of an IndexedPick or IndexedPlace instruction.

nObjects Data Type: pos

The number of objects in each direction.

nDistance Data Type: pos

The distance between two objects in each direction.

nPickMode Data Type: num

The pickmode of the pick or place instruction during IndexedPick or


IndexedPlace. The user is asked to choose mode during initialization. The mode
can be set to:

TRAY_MODE_PICKINWARD;
TRAY_MODE_PICKOUTWARD;
TRAY_MODE_PICKSUCTION1;
TRAY_MODE_PICKSUCTION2;
TRAY_MODE_PICKPLUNGE;
TRAY_MODE_PLACE;
TRAY_MODE_PLACESUCTION1;
TRAY_MODE_PLACESUCTION2;
TRAY_MODE_PLACEPLUNGE;

3HDA000059A1554-001 Revision: 1.04 30


YuMiLib

Basic Example

TASK PERS traydata td:=


[FALSE,0,[[0,0,0],[0,0,0,0]],[0,0,0],[0,0,0],0];

Default traydata.

Structure

< Dataobject of traydata>


< Initialized of bool >
< nIndex of num >
< psWobj of pose >
< nObjects of pos >
< nDistance of pos >
< nPickMode of num >

3HDA000059A1554-001 Revision: 1.04 31


YuMiLib

5.2 Instructions

MoveY – Compact and fast movement to a robtarget

Usage

MoveY is used to make a compact and fast movement on the YuMi robot without
having to choose between linear or joint movement or calculate a suitable elbow
angle.

MoveY compares the last executed position or the current position after a PP to
main (FromPoint) with the given target position (pToPoint).

If FromPoint and pToPoint differ not too much, MoveY moves directly to
pToPoint.

This is the case, if:


- the difference of the tool orientation < 45° and
- the differences of the calculated joint value of axes 1, 4, 6 and 7 < 180° and
- the robot configuration (robconf) values are equal

If this is not the case, MoveY calculates a mid point automatically to reach the
given pToPoint.

Basic Example

CONST robtarget rt1:=[[460,0,202],[0,0,0,0],[-2,1,-


1,5],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];
MoveY rt1,v300,fine,tGripper;
Make a compact movement to rt1 using speed v300, zone fine and tooldata
tGripper.

Arguments

MoveY [\J] | [\L] [\DesiredTorque] | [\SyncProcStart]


[\nSyncProcStartDist] [\CollisionDetected] pToPoint speed zone
tool [\WObj] [\SyncProcEnd] [\nSyncProcEndDist] [\SyncProcEndTime]
[\SignMidPoint] [\NoConc]

[\J] Data Type: switch

The movement will be performed using a joint movement.

If \CollisionDetected or \DesiredTorque is used, \J has no meaning and the


movement will be performed using a linear movement.

If \J, \L,\CollisionDetected and \DesiredTorque are omitted MoveY desides


which movement to make.

3HDA000059A1554-001 Revision: 1.04 32


YuMiLib

[\L] Data Type: switch

The movement should be performed using linear movement.

If \J and \L are omitted MoveY desides which movement to make.

If \CollisionDetected or \DesiredTorque is used, the movement will be performed


using a linear motion.

If \J, \L,\CollisionDetected and \DesiredTorque are omitted, MoveY desides


which movement to make.

[\DesiredTorque] Data Type: num

DesiredTorque for collision detection. Can be logged using signal 7901 to find appropriate
threshold. If DesiredTorque is specified \SyncProcStart and \SyncProcEnd cannot be
used.

If \CollisionDetected or \DesiredTorque is used, the movement will be performed


using a linear motion.

[\SyncProcStart] (Procedure Name) Data Type: string

Name of the RAPID procedure to be executed at the start of the movement. The
procedure call is a late binding call, and therefore inherits its properties. The syntax must
be “ModuleName:ProcName”.

[\nSyncProcStartDist] Data Type: num

The distance (mm) after the beginning of the instruction where SyncProcStart should be
called.

[\CollisionDetected] Data Type: bool

Bool to store status of collision detection. If ContactL without \DesiredTorque is desired


CollisionDetected should be present without DesiredTorque.

If \CollisionDetected is used, the movement will be performed using a linear motion.

pToPoint Data Type: robtarget

The position of the desired destination.

speed Data Type: speeddata

Speed data for the movement.

zone Data Type: zonedata

Zonedata for the movement.

tool Data Type: tooldata

The tooldata used during the movement.

[\WObj] (Work Object) Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

3HDA000059A1554-001 Revision: 1.04 33


YuMiLib

[\SyncProcEnd] (Procedure Name) Data Type: string

Name of the RAPID procedure to be executed at the middle of the corner path in the
destination point. The procedure call is a late binding call, and therefore inherits its
properties. The syntax must be “ModuleName:ProcName”.

[\nSyncProcEndDist] Data Type: num

The distance (mm) before the end of the instruction where SyncProcEnd should be called.

[\nSyncProcEndTime] Data Type: switch

If used, nSyncProcEndDist is expressed in seconds instead of millimeters.

[\SingMidPoint] Data Type: switch

Use to enforce a midpoint between start and end position. The midpoint will be a near
singular configuration of the arm, where axis 5 is close to zero. This can be practical to
enforce very compact movements, typically in a home running procedure in the beginning
of a program.

[\NoConc] Data Type: switch

Use to prevent all movements from using \Conc which executes subsequent instructions
while the robot is moving.

Syntax

MoveY
[ '\' J ',']
[ '\' L ',']
[ '\' DesiredTorque ':=' < expression (IN) of num >]
[ '\' CollisionDetected ':=' < variable (VAR) of bool >]
[ '\' SyncProcStart ':=' < expression (IN) of bool >]
[ '\' nSyncProcStartDist ':=' < expression (IN) of num >]
','
[ pToPoint' :=' ] < expression (IN) of robtarget >','
[ speed ':=' ] < expression (IN) of speeddata >','
[ zone ':=' ] < expression (IN) of zonedata >','
[ tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj' :='< persistent (PERS) of wobjdata >]
[ '\' SyncProcEnd :=' < expression (IN) of string >]
[ '\' nSyncProcEndDist ':=' < expression (IN) of num >]
[ '\' nSyncProcEndTime ]
[ '\' SingMidPoint ]
[ '\' NoConc ]';'

3HDA000059A1554-001 Revision: 1.04 34


YuMiLib

MoveToHome – Movement to the home position

Usage

MoveToHome is used to make movement to the home position. The algorithm


calculates a way to move on the arm’s path to safely go to home position.

The home position is defined at the calibration position of the arms.

Basic Example

MoveToHome;

Arguments

MoveToHome

Syntax

MoveToHome';'

3HDA000059A1554-001 Revision: 1.04 35


YuMiLib

HandInit – Hand initialization and calibration

Usage

HandInit is used to connect and calibrate the hand. The hand is jogged to
minimum position and is calibrated.

Basic Example

HandInit;

Arguments

HandInit [\ReCalibrate]

[\ReCalibrate] Data Type: switch

To force a new calibration, even when the hand has been previously calibrated, the switch
ReCalibrate should be specified.

Syntax

HandInit
[ '\' ReCalibrate ]';'

3HDA000059A1554-001 Revision: 1.04 36


YuMiLib

MoveFingersTo – Move fingers to desired position

Usage

MoveFingersTo is used to move the fingers to a desired position. When the hand
is given the command to move to a position there is a risk for the fingers to
overshoot. MoveFingersTo checks for overshoot when the fingers are still and
corrects them if overshoot is found.

Basic Example

MoveFingersTo 10\Wait
The fingers are moved to 10 and corrected if overshoot is found. The
procedure waits for correct position before returning.

Arguments

MoveFingersTo nGripPos nFingerClearance [\Wait] [\Precise]

nGripPos Data Type: num

The desired finger position expressed in the same manner as the smartgripper on the
FlexPendant.

nFingerClearance Data Type: num

The desired finger clearance expressed in the same manner as the smartgripper on the
FlexPendant. nFingerClearance is used to evaluate if the fingers are close enough to the
desired position, if they are the movement is not performed.

[\Wait] Data Type: switch

Wait for the fingers to reach the correct position before returning.

[\Precise] Data Type: switch

Wait for the fingers to be completely still before returning.

Syntax

MoveFingersTo
[ nGripPos ':=' ] < expression (IN) of num >
[ nFingerClearance ':=' ] < expression (IN) of num >
[ '\' Wait ]
[ '\' Precise ]';'

3HDA000059A1554-001 Revision: 1.04 37


YuMiLib

Calib_HandCamera – Camera calibration

Usage

Calib_HandCamera is used to calibrate the camera. The routine calculates the


camera workobject and robot tool based on a sequence of robtargets and
corresponding camera measurements. To calibrate the camera the other hand
must show the ABB logo by calling ShowABBLogo.

If the default calibration position cannot be reached, it is possible to modify the


position used for camera calibration by modifying the robtargets

pCamera_Calib_Near, pCamera_Calib_Far, pShowABBLogo.

Theese robtargets are located in YuMiLib_Params_L/R.

Basic Example

ShowABBLogo \NoStop;
WaitSyncTask syncShowABB, task_list;
WaitSyncTask syncCalibHandCamera, task_list;
The arm that should not be calibrated should show the ABB Logo to the other
arm and wait for the other arm to finish the calibration.

WaitSyncTask syncShowABB, task_list;


Calib_HandCamera \NoStop tHandCamera;
WaitSyncTask syncCalibHandCamera, task_list;
The arm that should be calibrated waits until the other arm is showing the ABB
logo and then calls Calib_HandCamera.

Arguments

Calib_HandCamera [\NoStop] [\Print] [\MoveToCalibPos]

[\NoStop] Data Type: switch

Used when not wanting the arm to stop when the calibration is finished.

[\Print] Data Type: switch

Used when the status and result of the camera calibration should be logged to file and
printed on the Teach Pendant.

[\MoveToCalibPos] Data Type: switch

Used to only move to the calibration position without performing a calibration.

3HDA000059A1554-001 Revision: 1.04 38


YuMiLib

Syntax

Calib_HandCamera
[ '\' NoStop ]
[ '\' Print ]
[ '\' MoveToCalibPos ]';'

3HDA000059A1554-001 Revision: 1.04 39


YuMiLib

InitCamera – Initialize camera job

Usage

InitCamera is used to initialize a camera job. The camera job is loaded and the
camera is put in run mode.

Basic Example

InitCamera;

Arguments

InitCamera job [\ReloadJob]

job Data Type: string

The name of the job that should be loaded.

[\ReloadJob] Data Type: switch

If the camera job has been previously loaded and should be reloaded.

Syntax

InitCamera
[ job ':=' ] < expression (IN) of string >
[ '\' ReloadJob ]';'

3HDA000059A1554-001 Revision: 1.04 40


YuMiLib

ShowABBLogo – Present the ABB Logo to the other arm

Usage

The robot moves to a position where the hand is presenting the ABB logo to the
other hand so the other arm can perform a Calib_HandCamera.

To change the default position, user can edit the position pShowABBLogo,
located in the YuMiLib_Params_L/R.

Basic Example

ShowABBLogo \NoStop;
WaitSyncTask syncShowABB, task_list;
WaitSyncTask syncCalibHandCamera, task_list;
The arm that should not be calibrated should show the ABB Logo to the other
arm and waits for the other arm to finish the calibration.

WaitSyncTask syncShowABB, task_list;


Calib_HandCamera \NoStop;
WaitSyncTask syncCalibHandCamera, task_list;
The arm that should be calibrated waits until the other arm is showing the ABB
logo and then calls Calib_HandCamera.

Arguments

ShowABBLogo [\NoStop]

[\NoStop] Data Type: switch

Used when not wanting the execution to stop when in correct position.

Syntax

ShowABBLogo
[ '\' NoStop ]';'

3HDA000059A1554-001 Revision: 1.04 41


YuMiLib

Locate – Locate parts using the hand camera

Usage

Locate is used to locate up to 10 parts using the hand camera. When calling the
routine, WObj_Vision is updated to the next part in the locatedata. If there is no
next part in the locatedata a new image is taken.

Basic Example

Example 1:

TASK PERS locatedata lpmd:= [FALSE,"",0,""


,"",0,0,0,[[0,0,0],[0,0,0,0]],[0,0,0],[0,0,0],[0,0,0],[0,0
,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],0,0];

Locate pPicture,tGripper,lpmd;
Locates the parts and stores the information in the locatedata.

Example 2:

TASK PERS locatedata lpmd:= [FALSE,"",0,""


,"",0,0,0,[[0,0,0],[0,0,0,0]],[0,0,0],[0,0,0],[0,0,0],[0,0
,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],0,0];

Locate pPicture,tGripper,lpmd\sFeederProc:=
"MainModule:FeederProc";

PROC FeederProc(PERS locatedata ldExample)


ErrWrite\I,"FeederProc","";
ENDPROC
Locates the parts and stores the information in the locatedata. When there are
no more parts available after a new image, the process FeederProc is called.
Note that the FeederProc must have PERS locatedata as input parameter.

Arguments

Locate [\J] | [\L] pTakePicture [\Speed] tTakePicture


[\wTakePicture] ld [\sFeederProc] [\sWaitFeederReadyProc]
[\WaitForRollingParts] [\LocateOnly] [\nStatus] [\Precise]
[\KeepOrientation] [\NoFingerCollision] [\nSettlingTime]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted Locate desides
which movement to make.

[\L] Data Type: switch

3HDA000059A1554-001 Revision: 1.04 42


YuMiLib

The movement should be performed using linear movement. If omitted Locate desides
which movement to make.

pTakePicture Data Type: robtarget

The position where the robot should take an image and locate the parts.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to yl_vDefault.

tTakePicture Data Type: tooldata

The tooldata used during the movement.

[\wTakePicture] (Work Object) Data Type: wobjdata

The work object (coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

ld Data Type: locatedata

The locatedata containing information about the located parts and the vision job.

[\sFeederProc] Data Type: string

Used, if a feeder procedure should be called when no parts can be found. The feeder
procedure MUST have PERS locatedata as input parameter. The syntax of the called
procuedure must be “ModuleName:ProcName”.

[\sWaitFeederReadyProc] Data Type: string

Used, if a procedure should be called to wait for the feeder to be ready, before the image
is taken. The syntax of the called procedure name must be “ModuleName:ProcName”.

[\WaitForRollingParts] Data Type: switch

If specified Locate checks for rolling parts and waits until all parts are still.

[\LocateOnly] Data Type: switch

If LocateOnly is present, the routine does not update the WObj_Vision but only locates
the parts when there is no longer parts present.

[\nStatus] Data Type: num

If specified, the status is returned. The status codes for Locate are:

CONST num LOCATE_SUCCESS:=0;


CONST num LOCATE_NO_PARTS_FOUND:=-1;
CONST num LOCATE_NO_PARTS_FROM_FEEDER:=-2;

If nStatus is not specified and Locate results in status “no parts found” or “no parts from
feeder”, the information is written to the user screen on the Flexpendant and YuMi is
waiting for a tap to continue.

[\Precise] Data Type: switch

When performing a precise Locate a new image is taken straight over the located part to
improve the image processing accuracy.

3HDA000059A1554-001 Revision: 1.04 43


YuMiLib

The hand will also be rotated according to the rotation of the located part. If the rotation
of the hand causes reachability issues, it may be omitted by using \KeepOrientation.

[\KeepOrientation] Data Type: switch

When performing a Locate with \Precise, a new image is taken straight over the located
part including a rotation of the hand according to the orientation of the located part. If the
rotation of the hand causes reachability issues, it may be omitted by using
\KeepOrientation.

\KeepOrientation has no meaning, if \Precise is not used.

[\NoFingerCollision] Data Type: switch

By specifying NoFingerCollision, Locate will not return any vision result that has finger
collision. The finger collision boxes are present in the vision jobs Fingerpick_template.job
and Fingerpick_template_x4.job. If NoFingerCollision is ommited, the results with finger
collision are returned after all non-collision results have been returned.

[\nSettlingTime] Data Type: num

Used to force a wait time before taking an image. When the arm makes fast movements
to pTakePicture a settling time might be needed to ensure the arm is stable before taking
an image.

Program Execution

During the initialization, the user is guided through the configuration on the
Flexpendant and in the Integrated Vision in RobotStudio (32-bit version)
connected to the controller.

VisionJob:
In basic mode, a new vision job will be created automatically using the
Finger_template.job template which includes a part named Part and two
fingerboxes specifying with which angle and opening the hand will grip the object
as displayed in the screen capture below. In advanced mode, the user can
instead select and modify VisionJobs from a list of current jobs present in the
camera. If the user intends to locate more than one part in the program, the
template Fingerpick_template_x4.job can be used to locate up to 4 different part
types. For example this allows YuMi to find a screw, a nut, a button and a PCB
using the same vision job. Each vision tool will still search for up to 10 parts. i.e.
YuMi could find 6 screws, 8 nuts, 3 buttons and 2 PCBs by taking 4 images
without any delay due to loading of vision jobs. YuMi can only search for 1 part
per locate, so a separate locate call must be made to find each part type.

3HDA000059A1554-001 Revision: 1.04 44


YuMiLib

The latest camera image is shown in the center of the screen. In the top right
corner, the parts from the template are listed. After selecting a part, the user can
train the object model using the menu in the bottom right corner, see the
Integrated Vision Application Manual for more details.

The fingerboxes are used to calculate the angle and width of the fingers when
picking the part and is used when performing visionguided picks. The user can
drag the boxes to desired finger positions to define angle and width. The boxes
are also used to detect if there is free space around the object, showing green
when the fingers are free and red when they are obscured. The object is
detected as either a black or white blob, the Blob Color can be changed in the
RightFinger Settings menu in the lower left corner as shown in the screen
capture above.

During execution, the default template locates up to 10 parts as shown below.


The parts are sorted with free fingers first.

The values nPartsFound and nFingerAreaObscured in the locatedata returns


the number of identified parts and the obscured parts respectively. As an
optimization, the current image will be reused until all parts are picked. To avoid
picking parts that do not have enough finger clearance, the switch
NoFingerCollision can be used.

Fingerpick_template_x4.job has 4 parts, named Part_1 – Part_4, each with


corresponding fingerboxes and a vision tool ID (1 – 4). The template contains
logic for enabling and disabling tools (nVisionTool) when performing a locate.

When performing a Locate, only the vision tool defined in the locatedata
nVisionTool is enabled (as shown in the screen capture above) and all the other
tools are disabled which will significantly decrease the time it takes to take an
image when having multiple tools. The template also contains a table for the
exposure times and lamp status for each tool and is initiated during the training.
This makes it possible for the Locate to switch exposure time and lamp on/off
for each tool in the same job.

VisionResult:
The second question is to choose a VisionResult. An image is taken and
searched for results. If no results are present the user is asked to Create/Modify
a result in Integrated Vision by setting up and training the Model Region for the
tool. Then the fingerboxes should be placed to enable correct picks. The user
can change exposure time (or use the default AutoExposure) and lamp on/off
under Setup. The exposure time and lamp on/off are saved in the spreadsheet
when continuing with Locate. The job should NOT be saved before continuing

3HDA000059A1554-001 Revision: 1.04 45


YuMiLib

since it will overrite the template. When a vision result is defined the robot
searches for a tool matching the result.

ImgagePlaneOffset:
After the vision result is trained the robot tries to identify the offset from the world
coordinate system (height to the object) by taking multiple images in the same
plane. If the z-axis of the camera is not aligned with the z-axis of the robot an
ImagePlane is calculated and the ImagePlaneOffset is calculated relative to the
ImagePlane. It is important that the vision system locates exactly one result. If
that is not the case the user is prompted to ensure there is only one object
present. If the identification fails the user is asked to specify the value.

3HDA000059A1554-001 Revision: 1.04 46


YuMiLib

Edit templates:

The user can edit exposure time and lamp in the spreadsheets of saved
visionjobs in Integrated Vision, for example to modify the exposure time of
different parts in Fingerpick_template_x4:

1. Go to spreadsheet under Advanced

2. In the spreadsheet, locate the cells for exposure time and lamp. The exposure
time is given in milliseconds and 0.0 means auto exposure. For each part, the
lamp can be turned on by setting the value to 2 or turned off by setting the
value to 0.

3. Save the Job (or Save Job As under a new name) on the camera.

3HDA000059A1554-001 Revision: 1.04 47


YuMiLib

Migrate Visionjobs between templates:

The user can migrate saved visionjobs in Integrated Vision. Starting from a job
created using Fingerpick_template.job it can be migrated to
Fingerpick_template_x4 by renaming the part and fingers as described below.

Rename part:
Rename Part, RightFinger and LeftFinger to the corresponding part in
Fingerpick_template_x4 that should be updated.

1. Rename by selecting part under results to the left.

2. Under General, rename Part to Part_1 – Part_4.


3. Repeat for RightFinger and LeftFinger (RightFinger_1 – RightFinger_4)

Export your parts:

4. Go to spreadsheet under Advanced

5. In the spreadsheet, select the cells from Find Blob to End for Find a Pattmax
pattern. It is important to leave out the header with the Loop and LoopCount for
the migration to be successful.

3HDA000059A1554-001 Revision: 1.04 48


YuMiLib

6. Right click on the selection and press Export cells at the bottom of the list.

7. Save the Job on the camera under an appropriate name.

Create new job:


1. Press load job and choose Fingerpick_template_x4.job. Save the job under
another name to prevent overwriting the template.

Import your parts:


1. Mark the cells in Fingerpick_template_x4 for the desired part in the same
manner as described under Export your parts.
2. Right click the mark and choose Clear -> All.
3. Right click the mark and choose Import… and choose the previously saved .cxd-
file.

3HDA000059A1554-001 Revision: 1.04 49


YuMiLib

Syntax

Locate
[ '\' J ',']
[ '\' L ',']
[ pTakePicture ':=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]','
[ Tool ':=' ] < persistent (PERS) of tooldata >','
[ ld ':=' ] < persistent (PERS) of locatedata >
[ '\' sFeederProc ':=' < expression (IN) of string > ]
[ '\' sWatFeederReadyProc ':=' < expression (IN) of string
> ]
[ '\' WaitForRollingParts ]
[ '\' LocateOnly ]
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' Precise ]
[ '\' KeepOrientation ]
[ '\' NoFingerCollision ]
[ '\' nSettlingTime < expression (IN) of num > ] ';'

3HDA000059A1554-001 Revision: 1.04 50


YuMiLib

WaitForTap – Continue execution after tap

Usage

WaitForTap is used after a stop point to wait for the user to interact with the
robot by tapping the arm. The routine recognizes a speed peek on any of the
axes on the arm. Pressing the robot will not be recognized and might lead to a
position error. When the arm is tapped the program pointer returns from the
routine.

Basic Example

Example 1:

All axes of this arm will be supervised.

WaitForTap;

Example 2:

All axes of both arms will be supervised.

WaitForTap\BothArms;

Arguments

WaitForTap [\BothArms] | [\sMessageArray] [\nSensitivity]

[\BothArms] Data Type: switch

Both arms should be supervised to detect a tap.

[\sMessageArray] Data Type: string

A message string array for displaying why the robot stopped and is waiting for tap.

[\nSensitivity] Data Type: num

The sensitivity of the tap expressed in a percentage between 50-300%.

3HDA000059A1554-001 Revision: 1.04 51


YuMiLib

Syntax

WaitForTap
[ '\' BothArms ]
[ '\' sMessageArray ':=' < expression (IN) of string > ]
[ '\' nSensitivity ':=' < expression (IN) of num > ]';'

3HDA000059A1554-001 Revision: 1.04 52


YuMiLib

PickInward – Robot motion to pick an object inward

Usage

PickInward is used to go to a pick position and pick an object by gripping inward.


The robot is moved via a prepick position to a pick position and then to a postpick
position. Depending on the input, the fingers can be triggered in advance to
enable a faster pick, collision detection can be used and post grab evaluation is
performed in the end.

The first time a pick is performed the user is prompted to select which mode the
pick should be performed in and an initialization process is performed. The
process initializes the finger pre-grip position (FingerPos), finger limits for post
grip evaluation (LimitLow, LimitHigh), the offset to the position before and after
the pick (Offset), the mass of the object (mass) and the delaytime for triggering
the fingers (DelayTime) if in YUMILIB_BALANCED_MODE or
YUMILIB_FAST_MODE. If some parameter in the pickdata is specified and not
left as 0 or FALSE the parameter will not be initialized but instead used in the
initialization.

When the fingers are triggered in advance it is important to use the same speed
and settings which is why a hash is used to detect if Speed, AccSet, FingerPos
or Offset has changed. In that case the DelayTime is reinitialized.

If an initialization is wanted using default values there is no need to set all values
to default. Changing the field Initialized of the used pickdata will detect if there
are non-default fields and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPick:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PickInwardErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped.
MoveY pStart,v300,fine,tGripper;
PickInward pPick,tGripper,pd1;
ENDPROC

PROC PickInwardErrorHandler()
!Book errors and catch using error handler.

BookErrNo YUMILIB_PICK_EMPTY;
BookErrNo YUMILIB_PICK_INCORRECT_GRAB;

MoveY pStart,v300,fine,tGripper;

3HDA000059A1554-001 Revision: 1.04 53


YuMiLib

PickInward pPick,tGripper,pd1;
ERROR (YUMILIB_PICK_EMPTY, YUMILIB_PICK_INCORRECT_GRAB)
IF ERRNO=YUMILIB_PICK_EMPTY OR
ERRNO=YUMILIB_PICK_INCORRECT_GRAB THEN
StopMove\Quick;
TPWrite "Pick unsuccessful";
ClearPath;
StartMove;
TRYNEXT;
ENDIF
ENDPROC

PROC PickInwardErrorReturned()
!If pick is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tGripper;
WHILE nStatus <> PICK_SUCCESS DO
PickInward pPick,tGripper,pd1\nStatus:=nStatus;
IF nStatus=PICK_COLLISION THEN
!add code here
ELSEIF nStatus=PICK_TOO_CLOSED THEN
!add code here;
ELSEIF nStatus=PICK_TOO_OPENED THEN
!add code here;
ENDIF
ENDWHILE
ENDPROC

Arguments

PickInward pPick [\J] | [\L] [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\Load] [\PrePos] [\PostPos] [\DontMoveFingers]
[\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted PickInward desides
which movement to make.

3HDA000059A1554-001 Revision: 1.04 54


YuMiLib

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted PickInward


desides which movement to make.

pPick Data Type: robtarget

The pick position where the robot should pick the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

[\Load] Data Type: loaddata

The \Load argument describes the load used in the movement. The load is the payload
of the tool

pd Data Type: pickdata

The pickdata used to store the information about the pick.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the pick instructions are:

CONST num PICK_SUCCESS:=0;


CONST num PICK_COLLISION:=-1;
CONST num PICK_TOO_CLOSED:=-2;
CONST num PICK_TOO_OPENED:=-3;

[\PrePos] Data Type: pos

If PrePos is specified the prepick position is calculated using PrePos instead of pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postpick position is calculated using PostPos instead of


pd.Offset.

[\DontMoveFingers] Data Type: switch

If the fingers should not be moved to FingerPrePos.

3HDA000059A1554-001 Revision: 1.04 55


YuMiLib

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

Limitations

In balanced and fast mode special settings are required for the pick to work properly. The time it
takes for the grippers to grip from a given position (pd.FingerPos) has to take less time than it
takes the robot to move between the PrePick position and the Pick postion. The pick is also
affected by the time it takes to move to PrePick position because the fingers have to reach
pd.FingerPos before continuing to Pick position.

In fast mode the distance between PrePick position and Pick position has to be at least 40 mm.

Syntax

PickInward
[ '\' J ',']
[ '\' L ',']
[ pPick' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' Load' :=' < persistent (PERS) of loaddata > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' DontMoveFingers ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 56


YuMiLib

PickOutward – Robot motion to pick an object outward

Usage

PickOutward is used to go to a pick position and pick and object by gripping


outward. The robot is moved via a prepick position to a pick position and then
to a postpick position. Depending on the input, the fingers can be triggered in
advance to enable a faster pick, collision detection can be used and post grab
evaluation is performed in the end.

The first time a pick is performed the user is prompted to select which mode the
pick should be performed in and an initialization process is performed. The
process initializes the finger pre-grip position (FingerPos), finger limits for post
grip evaluation (LimitLow, LimitHigh), the offset to the position before and after
the pick (Offset), the mass of the object (mass) and the delaytime for triggering
the fingers (DelayTime) if in YUMILIB_BALANCED_MODE or
YUMILIB_FAST_MODE. If some parameter in the pickdata is specified and not
left as 0 or FALSE the parameter will not be initialized but instead used in the
initialization.

When the fingers are triggered in advance it is important to use the same speed
and settings which is why a hash is used to detect if Speed, AccSet, FingerPos
or Offset has changed. In that case, the DelayTime is reinitialized.

If an initialization is wanted with default values there is no need to set all values
to default. Changing the field Initialized of the used pickdata will detect if there
are non-default fields and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPick:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PickOutwardErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped.
MoveY pStart,v300,fine,tGripper;
PickOutward pPick,tGripper,pd1;
ENDPROC

PROC PickOutwardErrorHandler()
!Book errors and catch using error handler. Errors need
to be booked in YUMILIB_FAST_MODE.

BookErrNo YUMILIB_PICK_EMPTY;
BookErrNo YUMILIB_PICK_INCORRECT_GRAB;

MoveY pStart,v300,fine,tGripper;

3HDA000059A1554-001 Revision: 1.04 57


YuMiLib

PickOutward pPick,tGripper,pd1;
ERROR (YUMILIB_PICK_EMPTY, YUMILIB_PICK_INCORRECT_GRAB)
IF ERRNO=YUMILIB_PICK_EMPTY OR
ERRNO=YUMILIB_PICK_INCORRECT_GRAB THEN
StopMove\Quick;
TPWrite "Pick unsuccessful";
ClearPath;
StartMove;
TRYNEXT;
ENDIF
ENDPROC

PROC PickOutwarErrorReturned()
!If pick is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tGripper;
WHILE nStatus <> PICK_SUCCESS DO
PickOutward pPick,tGripper,pd1\nStatus:=nStatus;
IF nStatus=PICK_COLLISION THEN
!add code here
ELSEIF nStatus=PICK_TOO_CLOSED THEN
!add code here;
ELSEIF nStatus=PICK_TOO_OPENED THEN
!add code here;
ENDIF
ENDWHILE
ENDPROC

Arguments

PickOutward [\J] | [\L] pPick [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\Load] [\PrePos] [\PostPos] [\DontMoveFingers]
[\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted PickOutward


desides which movement to make.

[\L] Data Type: switch

3HDA000059A1554-001 Revision: 1.04 58


YuMiLib

The movement should be performed using linear movement. If omitted PickOutward


desides which movement to make.

pPick Data Type: robtarget

The pick position where the robot should pick the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

[\Load] Data Type: loaddata

The \Load argument describes the load used in the movement. The load is the payload
of the tool.

pd Data Type: pickdata

The pickdata used to store the information about the pick.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the pick instructions are:

CONST num PICK_SUCCESS:=0;


CONST num PICK_COLLISION:=-1;
CONST num PICK_TOO_CLOSED:=-2;
CONST num PICK_TOO_OPENED:=-3;

[\PrePos] Data Type: pos

If PrePos is specified the prepick position is calculated using PrePos instead of pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postpick position is calculated using PostPos instead of


pd.Offset.

[\DontMoveFingers] Data Type: switch

If the fingers should not be moved to FingerPrePos.

3HDA000059A1554-001 Revision: 1.04 59


YuMiLib

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

Limitations

In balanced and fast mode special settings are required for the pick to work properly. The time it
takes for the grippers to grip from a given position (pd.FingerPos) has to take less time than it
takes the robot to move between the PrePick position and the Pick postion. The pick is also
affected by the time it takes to move to PrePick position because the fingers have to reach
pd.FingerPos before continuing to Pick position.

In fast mode the distance between PrePick position and Pick position has to be at least 40 mm.

Syntax

PickOutward
[ '\' J ',']
[ '\' L ',']
[ pPick' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' Load' :=' < persistent (PERS) of loaddata > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' DontMoveFingers ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 60


YuMiLib

PickSuction1 – Robot motion to pick an object with suction cup 1

Usage

PickSuction1 is used to go to a pick position and pick an object by using suction


cup 1. The robot is moved via a prepick position to a pick position and then to a
postpick position. Depending on the input, the suction can be triggered in
advance to enable a faster pick, collision detection can be used and post grab
evaluation is performed in the end.

The first time a pick is performed the user is prompted to select which mode the
pick should be performed in and an initialization process is performed. The
process initializes the suction limit for post grab evaluation (LimitHigh), the offset
to the position before and after the pick (Offset), the mass of the object (mass)
and the delaytime for triggering the suction (DelayTime) if in
YUMILIB_BALANCED_MODE or YUMILIB_FAST_MODE. If some parameter
in the pickdata is specified and not left as 0 or FALSE the parameter will not be
initialized but instead used in the initialization.

When the suction is triggered in advance it is important to use the same speed
and settings which is why a hash is used to detect if Speed, AccSet or Offset
has changed. In that case, the DelayTime is reinitialized.

If an initialization is wanted with default values there is no need to set all values
to default. Changing the field Initialized of the used pickdata will detect if there
are non-default fields and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPick:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PickSuction1ErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped.
MoveY pStart,v300,fine,tSuction;
PickSuction1 pPick,tSuction,pd1;
ENDPROC

PROC PickSuction1ErrorHandler()
!Book errors and catch using error handler. Errors need
to be booked in YUMILIB_FAST_MODE.

BookErrNo YUMILIB_PICK_EMPTY;
BookErrNo YUMILIB_PICK_INCORRECT_GRAB;

MoveY pStart,v300,fine,tSuction;

3HDA000059A1554-001 Revision: 1.04 61


YuMiLib

PickSuction1 pPick,tSuction,pd1;
ERROR (YUMILIB_PICK_EMPTY, YUMILIB_PICK_INCORRECT_GRAB)
IF ERRNO=YUMILIB_PICK_EMPTY OR
ERRNO=YUMILIB_PICK_INCORRECT_GRAB THEN
StopMove\Quick;
TPWrite "Pick unsuccessful";
ClearPath;
StartMove;
TRYNEXT;
ENDIF
ENDPROC

PROC PickSuction1ErrorReturned()
!If pick is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tSuction;
WHILE nStatus<>PICK_SUCCESS DO
PickSuction1 pPick,tSuction,pd1\nStatus:=nStatus;
IF nStatus=PICK_COLLISION THEN
!add code here
ELSEIF nStatus=PICK_PRESSURE_TOO_HIGH THEN
!add code here
ENDIF
ENDWHILE
ENDPROC

Arguments

PickSuction1 [\J] | [\L] pPick [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\Load] [\PrePos] [\PostPos] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted PickSuction1


desides which movement to make.

[\L] Data Type: switch

3HDA000059A1554-001 Revision: 1.04 62


YuMiLib

The movement should be performed using linear movement. If omitted PickSuction1


desides which movement to make.

pPick Data Type: robtarget

The pick position where the robot should pick the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

[\Load] Data Type: loaddata

The \Load argument describes the load used in the movement. The load is the payload
of the tool

pd Data Type: pickdata

The pickdata used to store the information about the pick.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the pick instructions are:

CONST num PICK_SUCCESS:=0;


CONST num PICK_COLLISION:=-1;
CONST num PICK_PRESSURE_TOO_HIGH:=-4;

[\PrePos] Data Type: pos

If PrePos is specified the prepick position is calculated using PrePos instead off pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postpick position is calculated using PostPos instead off
pd.Offset.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

3HDA000059A1554-001 Revision: 1.04 63


YuMiLib

3HDA000059A1554-001 Revision: 1.04 64


YuMiLib

Limitations

In balanced and fast mode special settings are required for the pick to work properly. The time it
takes for the grippers to grip from a given position (pd.FingerPos) has to take less time than it
takes the robot to move between PrePick position and Pick postion. The pick is also affected by
the time it takes to move to PrePick position because the fingers have to reach pd.FingerPos
before continuing to Pick position.

In fast mode the distance between PrePick position and Pick position has to be at least 40 mm.

Syntax

PickSuction1
[ '\' J ',']
[ '\' L ',']
[ pPick' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' Load' :=' < persistent (PERS) of loaddata > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 65


YuMiLib

PickSuction2 – Robot motion to pick an object with suction cup 2

Usage

PickSuction2 is used to go to a pick position and pick an object by using suction


cup 2. The robot is moved via a prepick position to a pick position and then to a
postpick position. Depending on the input, the suction can be triggered in
advance to enable a faster pick, collision detection can be used and post grab
evaluation is performed in the end.

The first time a pick is performed the user is prompted to select which mode the
pick should be performed in and an initialization process is performed. The
process initializes the suction limit for post grab evaluation (LimitHigh), the offset
to the position before and after the pick (Offset), the mass of the object (mass)
and the delaytime for triggering the suction (DelayTime) if in
YUMILIB_BALANCED_MODE or YUMILIB_FAST_MODE. If some parameter
in the pickdata is specified and not left as 0 or FALSE the parameter will not be
initialized but instead used in the initialization.

When the suction is triggered in advance it is important to use the same speed
and settings which is why a hash is used to detect if Speed, AccSet or Offset
has changed. In that case, the DelayTime is reinitialized.

If an initialization is wanted with default values there is no need to set all values
to default. Changing the field Initialized of the used pickdata will detect if there
are non-default fields and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPick:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PickSuction2ErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped.
MoveY pStart,v300,fine,tSuction;
PickSuction2 pPick,tSuction,pd1;
ENDPROC

PROC PickSuction2ErrorHandler()
!Book errors and catch using error handler. Errors need
to be booked in YUMILIB_FAST_MODE.

BookErrNo YUMILIB_PICK_EMPTY;
BookErrNo YUMILIB_PICK_INCORRECT_GRAB;

MoveY pStart,v300,fine,tSuction;

3HDA000059A1554-001 Revision: 1.04 66


YuMiLib

PickSuction2 pPick,tSuction,pd1;
ERROR (YUMILIB_PICK_EMPTY, YUMILIB_PICK_INCORRECT_GRAB)
IF ERRNO=YUMILIB_PICK_EMPTY OR
ERRNO=YUMILIB_PICK_INCORRECT_GRAB THEN
StopMove\Quick;
TPWrite "Pick unsuccessful";
ClearPath;
StartMove;
TRYNEXT;
ENDIF
ENDPROC

PROC PickSuction2ErrorReturned()
!If pick is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tSuction;
WHILE nStatus<>PICK_SUCCESS DO
PickSuction2 pPick,tSuction,pd1\nStatus:=nStatus;
IF nStatus=PICK_COLLISION THEN
!add code here
ELSEIF nStatus=PICK_PRESSURE_TOO_HIGH THEN
!add code here
ENDIF
ENDWHILE
ENDPROC

Arguments

PickSuction2 [\J] | [\L] pPick [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\Load] [\PrePos] [\PostPos] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted PickSuction2


desides which movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted PickSuction2


desides which movement to make.

3HDA000059A1554-001 Revision: 1.04 67


YuMiLib

pPick Data Type: robtarget

The pick position where the robot should pick the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

[\Load] Data Type: loaddata

The \Load argument describes the load used in the movement. The load is the payload
of the tool

pd Data Type: pickdata

The pickdata used to store the information about the pick.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the pick instructions are:

CONST num PICK_SUCCESS:=0;


CONST num PICK_COLLISION:=-1;
CONST num PICK_PRESSURE_TOO_HIGH:=-4;

[\PrePos] Data Type: pos

If PrePos is specified the prepick position is calculated using PrePos instead off pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postpick position is calculated using PostPos instead off
pd.Offset.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

3HDA000059A1554-001 Revision: 1.04 68


YuMiLib

Limitations

In balanced and fast mode special settings are required for the pick to work properly. The time it
takes for the grippers to grip from a given position (pd.FingerPos) has to take less time than it
takes the robot to move between PrePick position and Pick postion. The pick is also affected by
the time it takes to move to PrePick position because the fingers have to reach pd.FingerPos
before continuing to Pick position.

In fast mode the distance between PrePick position and Pick position has to be at least 40 mm.

Syntax

PickSuction2
[ '\' J ',']
[ '\' L ',']
[ pPick' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' Load' :=' < persistent (PERS) of loaddata > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 69


YuMiLib

PickPlunge – Robot motion to pick an object without gripper motions

Usage

PickPlunge is used to go to a pick position and pick an object without moving


the fingers. The robot is moved via a prepick position to a pick position and then
to a postpick position.

If an initialization is wanted with default values there is no need to set all values
to default. Changing the field Initialized of the used pickdata will detect if there
are non-default fields and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPick:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PickPlungeErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped.
MoveY pStart,v300,fine, tGripper;
PickPlunge pPick,tGripper,pd1;
ENDPROC

PROC PickPlungeErrorHandler()
!Book errors and catch using error handler. Errors need
to be booked in YUMILIB_FAST_MODE.

BookErrNo YUMILIB_PICK_EMPTY;
BookErrNo YUMILIB_PICK_INCORRECT_GRAB;

MoveY pStart,v300,fine, tGripper;


PickPlunge pPick, tGripper,pd1;
ERROR (YUMILIB_PICK_EMPTY, YUMILIB_PICK_INCORRECT_GRAB)
IF ERRNO=YUMILIB_PICK_EMPTY OR
ERRNO=YUMILIB_PICK_INCORRECT_GRAB THEN
StopMove\Quick;
TPWrite "Pick unsuccessful";
ClearPath;
StartMove;
TRYNEXT;
ENDIF

3HDA000059A1554-001 Revision: 1.04 70


YuMiLib

ENDPROC

PROC PickPlungeErrorReturned()
!If pick is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tGripper;

WHILE nStatus<> PICK_SUCCESS DO


PickPlunge pPick, tGripper,pd1\nStatus:=nStatus;
IF nStatus=PICK_COLLISION THEN
!add code here
ENDIF
ENDWHILE
ENDPROC

Arguments

PickPlunge [\J] | [\L] pPick [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\Load] [\PrePos] [\PostPos] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted PickPlunge desides
which movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted PickPlunge


desides which movement to make.

pPick Data Type: robtarget

The pick position where the robot should pick the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

3HDA000059A1554-001 Revision: 1.04 71


YuMiLib

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

[\Load] Data Type: loaddata

The \Load argument describes the load used in the movement. The load is the payload
of the tool

pd Data Type: pickdata

The pickdata used to store the information about the pick.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the pick instructions are:

CONST num PICK_SUCCESS:=0;


CONST num PICK_COLLISION:=-1;

[\PrePos] Data Type: pos

If PrePos is specified the prepick position is calculated using PrePos instead off pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postpick position is calculated using PostPos instead off
pd.Offset.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

Syntax

PickPlunge
[ '\' J ',']
[ '\' L ',']
[ pPick' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' Load' :=' < persistent (PERS) of loaddata > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 72


YuMiLib

Place – Robot motion to place an object

Usage

Place is used to go to a place position and place an object. The release direction
is decided based on the gripper status. The robot is moved via a preplace
position to a place position and then to a postplace position. Depending on the
input, the fingers can be triggered in advance to enable a faster place and
collision detection can be used.

The first time a place is performed the user is prompted to select which mode
the place should be performed in and an initialization process is performed. The
process initializes the finger post release position (FingerPos), finger limits for
post release evaluation (LimitLow, LimitHigh), the offset to the position before
and after the place (Offset) and the delaytime for triggering the fingers
(DelayTime) if in YUMILIB_FAST_MODE. If some parameter in the pickdata is
specified and not left as 0 or FALSE the parameter will not be initialized but
instead used in the initialization.

If an initialization is wanted with default values there is no need to set all values
to default. Changing the field Initialized will detect if there are non-default fields
and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPlace:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PlaceErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped. There is no
default error handler in YUMILIB_FAST_MODE.
MoveY pStart,v300,fine,tGripper;
Place pPlace,tGripper,pd1;
ENDPROC

PROC PlaceErrorHandler()
!Book errors and catch using error handler. Errors need
to be booked in YUMILIB_FAST_MODE.

BookErrNo YUMILIB_PLACE_COLLISION;
BookErrNo YUMILIB_PLACE_OBJECT_NOT_PRESENT;

MoveY pStart,v300,fine,tGripper;
Place pPlace,tGripper,pd1;
ERROR (YUMILIB_PLACE_COLLISION,
YUMILIB_PLACE_OBJECT_NOT_PRESENT)

3HDA000059A1554-001 Revision: 1.04 73


YuMiLib

IF ERRNO=YUMILIB_PLACE_COLLISION OR ERRNO=
YUMILIB_PLACE_OBJECT_NOT_PRESENT THEN
StopMove\Quick;
TPWrite "Place unsuccessful";
ClearPath;
StartMove;
TRYNEXT;
ENDIF
ENDPROC

PROC PlaceErrorReturned()
!If place is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tGripper;

WHILE nStatus<> PICK_SUCCESS DO


Place pPlace,tGripper,pd1\nStatus:=nStatus;
IF nStatus= PLACE_COLLISION THEN
!add code here
ELSEIF nStatus= PLACE_OBJECT_NOT_PRESENT THEN
!add code here
ENDIF
ENDWHILE

ENDPROC

Arguments

Place [\J] | [\L] pPlace [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\Load] [\PrePos] [\PostPos] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted Place desides which
movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted Place desides
which movement to make.

3HDA000059A1554-001 Revision: 1.04 74


YuMiLib

pPlace Data Type: robtarget

The place position where the robot should place the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

pd Data Type: pickdata

The pickdata used to store the information about the place.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the place instructions are:

CONST num PLACE_SUCCESS:=-6;


CONST num PLACE _COLLISION:=-7;
CONST num PLACE _OBJECT_NOT_PERSENT:=-8;

[\PrePos] Data Type: pos

If PrePos is specified the preplace position is calculated using PrePos instead off
pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postplace position is calculated using PostPos instead off
pd.Offset.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

3HDA000059A1554-001 Revision: 1.04 75


YuMiLib

Syntax

Place
[ '\' J ',']
[ '\' L ',']
[ pPlace' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 76


YuMiLib

PlaceSuction1 – Robot motion to place an object with suction cup 1

Usage

PlaceSuction1 is used to go to a place position and place an object with suction


cup 1. The robot is moved via a preplace position to a place position and then
to a postplace position. Depending on the input, the suction can be triggered in
advance to enable a faster place and collision detection can be used.

The first time a place is performed the user is prompted to select which mode
the place should be performed in and an initialization process is performed. The
process initializes the suction limit for post release evaluation (LimitHigh), the
offset to the position before and after the place (Offset) and the delaytime for
triggering the suction (DelayTime) if in YUMILIB_FAST_MODE. If some
parameter in the pickdata is specified and not left as 0 or FALSE the parameter
will not be initialized but instead used in the initialization.

If an initialization is wanted with default values there is no need to set all values
to default. Changing the field Initialized will detect if there are non-default fields
and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPlace:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PlaceSuction1ErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped.
MoveY pStart,v300,fine,tSuction;
PlaceSuction1 pPlace,tSuction,pd1;
ENDPROC

PROC PlaceSuction1ErrorHandler()
!Book errors and catch using error handler. Errors need
to be booked in YUMILIB_FAST_MODE.

BookErrNo YUMILIB_PICK_EMPTY;
BookErrNo YUMILIB_PICK_INCORRECT_GRAB;

MoveY pStart,v300,fine,tSuction;
PlaceSuction1 pPlace,tSuction,pd1;
ERROR (YUMILIB_PLACE_COLLISION, BookErrNo
YUMILIB_PLACE_COLLISION;
BookErrNo YUMILIB_PLACE_OBJECT_NOT_PRESENT;
BookErrNo YUMILIB_PLACE_COLLISION;

3HDA000059A1554-001 Revision: 1.04 77


YuMiLib

BookErrNo YUMILIB_PLACE_OBJECT_NOT_PRESENT;
PLACE_OBJECT_NOT_PRESENT)
IF ERRNO=YUMILIB_PLACE_COLLISION OR ERRNO=
PLACE_OBJECT_NOT_PRESENT THEN
StopMove\Quick;
TPWrite "Place unsuccessful";
ClearPath;
StartMove;
TRYNEXT;
ENDIF
ENDPROC

PROC PlaceSuction1ErrorReturned()
!If place is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tSuction;
WHILE nStatus<> PICK_SUCCESS DO
PlaceSuction1 pPick,tSuction,pd1\nStatus:=nStatus;
IF nStatus= PLACE_COLLISION THEN
!add code here
ELSEIF nStatus= PLACE_OBJECT_NOT_PRESENT THEN
!add code here
ENDIF
ENDWHILE

ENDPROC

Arguments

PlaceSuction1 [\J] | [\L] pPlace [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\Load] [\PrePos] [\PostPos] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted PlaceSuction1


desides which movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted PlaceSuction1


desides which movement to make.

3HDA000059A1554-001 Revision: 1.04 78


YuMiLib

pPlace Data Type: robtarget

The place position where the robot should place the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

pd Data Type: pickdata

The pickdata used to store the information about the place.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the place instructions are:

CONST num PLACE_SUCCESS:=-6;


CONST num PLACE _COLLISION:=-7;
CONST num PLACE _OBJECT_NOT_PERSENT:=-8;

[\PrePos] Data Type: pos

If PrePos is specified the preplace position is calculated using PrePos instead off
pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postplace position is calculated using PostPos instead off
pd.Offset.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

3HDA000059A1554-001 Revision: 1.04 79


YuMiLib

Syntax

PlaceSuction1
[ '\' J ',']
[ '\' L ',']
[ pPlace' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 80


YuMiLib

PlaceSuction2 – Robot motion to place an object with suction cup 2

Usage

PlaceSuction2 is used to go to a place position and place an object with suction


cup 2. The robot is moved via a preplace position to a place position and then
to a postplace position. Depending on the input, the suction can be triggered in
advance to enable a faster place and collision detection can be used.

The first time a place is performed the user is prompted to select which mode
the place should be performed in and an initialization process is performed. The
process initializes the suction limit for post release evaluation (LimitHigh), the
offset to the position before and after the place (Offset) and the delaytime for
triggering the suction (DelayTime) if in YUMILIB_FAST_MODE. If some
parameter in the pickdata is specified and not left as 0 or FALSE the parameter
will not be initialized but instead used in the initialization.

If an initialization is wanted with default values there is no need to set all values
to default. Changing the field Initialized will detect if there are non-default fields
and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPlace:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PlaceSuction2ErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped. There is no
default error handler in YUMILIB_FAST_MODE.
MoveY pStart,v300,fine,tSuction;
PlaceSuction2 pPlace,tSuction,pd1;
ENDPROC

PROC PlaceSuction2ErrorHandler()
!Book errors and catch using error handler. Errors need
to be booked in YUMILIB_FAST_MODE.

BookErrNo YUMILIB_PICK_EMPTY;
BookErrNo YUMILIB_PICK_INCORRECT_GRAB;

MoveY pStart,v300,fine,tSuction;
PlaceSuction2 pPlace,tSuction,pd1;
ERROR (YUMILIB_PLACE_COLLISION, PLACE_OBJECT_NOT_PRESENT)

3HDA000059A1554-001 Revision: 1.04 81


YuMiLib

IF ERRNO=YUMILIB_PLACE_COLLISION OR ERRNO=
PLACE_OBJECT_NOT_PRESENT THEN
StopMove\Quick;
TPWrite "Place unsuccessful";
ClearPath;
StartMove;
TRYNEXT;
ENDIF
ENDPROC

PROC PlaceSuction2ErrorReturned()
!If place is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tSuction;

WHILE nStatus<> PICK_SUCCESS DO


PlaceSuction2 pPick,tSuction,pd1\nStatus:=nStatus;
IF nStatus= PLACE_COLLISION THEN
!add code here
ELSEIF nStatus= PLACE_OBJECT_NOT_PRESENT THEN
!add code here
ENDIF
ENDWHILE

ENDPROC

Arguments

PlaceSuction2 [\J] | [\L] pPlace [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\Load] [\PrePos] [\PostPos] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted PlaceSuction2


desides which movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted PlaceSuction2


desides which movement to make.

3HDA000059A1554-001 Revision: 1.04 82


YuMiLib

pPlace Data Type: robtarget

The place position where the robot should place the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

pd Data Type: pickdata

The pickdata used to store the information about the place.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the place instructions are:

CONST num PLACE_SUCCESS:=-6;


CONST num PLACE _COLLISION:=-7;
CONST num PLACE _OBJECT_NOT_PERSENT:=-8;

[\PrePos] Data Type: pos

If PrePos is specified the preplace position is calculated using PrePos instead off
pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postplace position is calculated using PostPos instead off
pd.Offset.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

3HDA000059A1554-001 Revision: 1.04 83


YuMiLib

Syntax

PlaceSuction2
[ '\' J ',']
[ '\' L ',']
[ pPlace' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 84


YuMiLib

PlacePlunge – Robot motion to place an object without gripper motions

Usage

PlacePlunge is used to go to a place position and place an object. The robot is


moved via a preplace position to a place position and then to a postplace
position.

If an initialization is wanted with default values there is no need to set all values
to default. Changing the field Initialized will detect if there are non-default fields
and ask the user if they should be set to default.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPlace:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC PlaceErrorDefault()
!If the pick is unsuccessful, the robot will try once
more and then wait until it is tapped. There is no
default error handler in YUMILIB_FAST_MODE.
MoveY pStart,v300,fine,tGripper;
PlacePlunge pPlace,tGripper,pd1;
ENDPROC

PROC PlaceErrorHandler()
!Book errors and catch using error handler. Errors need
to be booked in YUMILIB_FAST_MODE.

BookErrNo YUMILIB_PLACE_COLLISION;
BookErrNo YUMILIB_PLACE_OBJECT_NOT_PRESENT;

MoveY pStart,v300,fine,tGripper;
PlacePlunge pPlace,tGripper,pd1;
ERROR (YUMILIB_PLACE_COLLISION,
YUMILIB_PLACE_OBJECT_NOT_PRESENT)
IF ERRNO=YUMILIB_PLACE_COLLISION OR ERRNO=
YUMILIB_PLACE_OBJECT_NOT_PRESENT THEN
StopMove\Quick;
TPWrite "Place unsuccessful";
ClearPath;
StartMove;
TRYNEXT;

3HDA000059A1554-001 Revision: 1.04 85


YuMiLib

ENDIF
ENDPROC

PROC PlaceErrorReturned()
!If place is unsuccessful, try again. The \nStatus has
higher priority than booking errors. If both are used,
the status will be returned. Not supported in
YUMILIB_FAST_MODE.

VAR num nStatus;

MoveY pStart,v300,fine,tGripper;
WHILE nStatus<> PICK_SUCCESS DO
PlacePlunge pPlace,tGripper,pd1\nStatus:=nStatus;
IF nStatus= PLACE_COLLISION THEN
!add code here
ELSEIF nStatus= PLACE_OBJECT_NOT_PRESENT THEN
!add code here
ENDIF
ENDWHILE
ENDPROC

Arguments

PlacePlunge [\J] | [\L] pPlace [\Speed] [\Zone] Tool [\WObj] pd


[\nStatus] [\PrePos] [\PostPos] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted PickPlunge desides
which movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted PickPlunge


desides which movement to make.

pPlace Data Type: robtarget

The place position where the robot should place the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

3HDA000059A1554-001 Revision: 1.04 86


YuMiLib

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

pd Data Type: pickdata

The pickdata used to store the information about the place.

[\nStatus] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the place instructions are:

CONST num PLACE_SUCCESS:=-6;


CONST num PLACE _COLLISION:=-7;
CONST num PLACE _OBJECT_NOT_PERSENT:=-8;

[\PrePos] Data Type: pos

If PrePos is specified the preplace position is calculated using PrePos instead off
pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postplace position is calculated using PostPos instead off
pd.Offset.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

Syntax

PlacePlunge
[ '\' J ',']
[ '\' L ',']
[ pPlace' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ pd ':=' ] < persistent (PERS) of pickdata >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 87


YuMiLib

Drop – Robot motion to release an object

Usage

Drop is used to go to a place position and release an object. The robot is moved
directly to the place position.

Basic Example

PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


CONST robtarget pPlace:=[[400,20,-20.5],[0,0,1,0],[-2,1,-
1,4],[-170,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pStart:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

PROC DropExample()
MoveY pStart,v300,fine, tGripper;
Drop pPlace,tGripper,pd1;
ENDPROC

Arguments

Drop [\J] | [\L] pPlace [\Speed] Tool [\WObj] [\nFingerPos]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted Drop desides which
movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted Drop desides
which movement to make.

pPlace Data Type: robtarget

The place position where the robot should place the object.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

Tool Data Type: tooldata

The tool used during the movement.

3HDA000059A1554-001 Revision: 1.04 88


YuMiLib

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

[\nFingerPos] Data Type: num

Finger position. In the range 0-25.

Syntax

Drop
[ '\' J ',']
[ '\' L ',']
[ pPlace' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ]
[ '\' nFingerPos ':=' < expression (IN) of num > ]';'

3HDA000059A1554-001 Revision: 1.04 89


YuMiLib

IndexedPick – Indexed pick

Usage

IndexedPick is used to pick from a tray. The tray is defined using traydata to
store the information about the tray and the current index on the tray. In
IndexedPick a pick instruction is wrapped based on the pick mode:

CONST num TRAY_MODE_PICKINWARD:=1;


CONST num TRAY_MODE_PICKOUTWARD:=2;
CONST num TRAY_MODE_PICKSUCTION1:=3;
CONST num TRAY_MODE_PICKSUCTION2:=4;
CONST num TRAY_MODE_PICKPLUNGE:=5;

The first time an IndexedPick is performed the user is prompted to define the
setup for the tray. The setup can be performed in two ways: from numerical input
or by showing the positions using leadthrough.

Numerically:
The distance between two objects and the number of objects in each direction
needs to be stated. Either before calling the instruction (by setting the fields in
the traydata) or by entering the values in the dialogues during initialization. The
positions are relative wobj0 or the WObj if the optional parameter is present.
psWObj (in the traydata) is not used unless defined before calling the instruction.

LeadThrough:
The user is prompted to move the arm using leadthrough to the last position in
each direction. Thereafter, the user is asked to specify how many objects are
present in each direction. With the input from the user a workobject, psWObj, is
calculated relative to either wobj0 or the WObj if the optional parameter is
present.

When running the instruction, the next object will be picked and nIndex in
traydata is increased.

See the YLExample_PickPlaceTray procedure in the YuMiLibExamplesR/L


module for a full code example where objects are moved from one tray to
another.

Basic Example

TASK PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


TASK PERS traydata td1:=
[FALSE,0,[[0,0,0],[0,0,0,0]],[0,0,0],[0,0,0],0]
CONST robtarget pPick:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

Example 1: Simple IndexedPick


IndexedPick pPick,tGripper,td1,pd1;

Example 2: IndexedPick with returned error


VAR num nStatus;
IndexedPick pPick,tGripper,td1,pd1\nStatus:=nStatus;
IF nStatus=TRAY_EMPTY TPWrite "Tray Empty";

3HDA000059A1554-001 Revision: 1.04 90


YuMiLib

Example 3: IndexedPick with returned error for pick and


tray
VAR num nStatus;
VAR num nStatusPick;
IndexedPick
pPick,tGripper,td1,pd1\nStatus:=nStatus\nStatusPick:=nStat
usPick;
IF nStatus=TRAY_EMPTY TPWrite "Tray Empty";
IF nStatusPick<>PICK_SUCCESS TPWrite "Pick unsuccessful";

Arguments

IndexedPick [\J] | [\L] pPick [\Speed] [\Zone] Tool [\WObj] td


[\pd] | [\sPickProc] [\sFeederProc] [\nStatus] [\nStatusPick]
[\Load] [\PrePos] [\PostPos] [\DontMoveFingers] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted Drop desides which
movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted Drop desides
which movement to make.

pPick Data Type: robtarget

The pick position of the "origo" part on the tray.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

td Data Type: pickdata

The traydata used to store the information about the tray setup and the current index.

[\pd] Data Type: pickdata

The pickdata used to store the information about the pick.

3HDA000059A1554-001 Revision: 1.04 91


YuMiLib

[\sPickProc] Data Type: string

If a pick procedure should be used instead of the default pick, it can be given instead of a
pickdata. The procedure must have a robtarget and a (PERS) tooldata and an optional
wobjdata named WObj as parameters, as in

PROC yourProcName(VAR robtarget pTarget, PERS tooldata Tool\PERS wobjdata


WObj);

The syntax must be “ModuleName:ProcName”.

[\sFeederProc] Data Type: string

If a feeder process should be called when no parts can be found. The feeder proc MUST
have VAR locatedata as input parameter. The syntax must be “ModuleName:ProcName”.

[\nStatus] Data Type: num

If specified, the status is returned. The status code for IndexedPick are:

CONST num TRAY_EMPTY:=-10;

[\nStatusPick] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the pick instructions are:

CONST num PICK_SUCCESS:=0;


CONST num PICK_COLLISION:=-1;
CONST num PICK_TOO_CLOSED:=-2;
CONST num PICK_TOO_OPENED:=-3;
CONST num PICK_PRESSURE_TOO_HIGH:=-4;

[\PrePos] Data Type: pos

If PrePos is specified the prepick position is calculated using PrePos instead off pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postpick position is calculated using PostPos instead off
pd.Offset.

[\DontMoveFingers] Data Type: switch

If the fingers should not be moved to FingerPrePos.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

Program Execution

During the initialization, the user is guided through the configuration on the Flexpendant
App. The user specifies the dimensions of the tray by specifying up to four points. The
first position (origo) is the initial gripping position, then the user moves the robot to the
last position in each dimesion. The stacked blocks below illustrate how the user would
specify the positions of a 3D-tray:

3HDA000059A1554-001 Revision: 1.04 92


YuMiLib

Fig 1: The first Fig 2: The last Fig 3: The last Fig 4: The last
position of the items position in the first position in the position in the third
in the tray. dimension. The user second dimension. dimension. The user
will be asked to The user will be will be asked to
specify the number asked to specify the specify the number
of items in that number of items in of items in that
direction. that direction. direction.

The positions of the parts will be calculated with uniform distance linearly between the
corners of the tray. Trays with a single row of items (1D) or a 2D-grid are specified by
omitting the last dimension(s). The directions of the axes of the tray can be tilted or
specified in arbitrary order, for example a stack of items can be an generated using a
1D IndexPick from top to bottom as illustrated by figures 6 and 7.

Fig 5: A stack of parts can be Fig 6: … and the last position in


specified as a 1D-tray. The user the tray.
specifies the first position.

The position of the tray can be updated using the optional workobject parameter WObj
to IndexPick, for example WObj_vision. VisionIndexPick generates code for locating the
tray followed by an IndexPick relative to WObj_vision.

3HDA000059A1554-001 Revision: 1.04 93


YuMiLib

Syntax

IndexedPick
[ '\' J ',']
[ '\' L ',']
[ pPick' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ td ':=' ] < persistent (PERS) of traydata >
[ '\' pd ':=' ] < persistent (PERS) of pickdata >
[ '\' sPickProc ':=' ] < expression (IN) of string >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' nStatusPick ':=' < variable (VAR) of num > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' DontMoveFingers ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 94


YuMiLib

IndexedPlace – Indexed place

Usage

IndexedPlace is used to place on a tray. The tray is defined using traydata to


store the information about the tray and the current index on the tray. In
IndexedPlace a place instruction is wrapped based on the place mode:

CONST num TRAY_MODE_PLACE:=1;


CONST num TRAY_MODE_PLACESUCTION1:=2;
CONST num TRAY_MODE_PLACESUCTION2:=3;
CONST num TRAY_MODE_PLACEPLUNGE:=4;

The first time a IndexedPlace is performed the user is prompted to define the
setup for the tray. The setup can be performed in two ways: from numerical input
or by showing the positions using leadthrough.

Numerically:
The distance between two objects and the number of objects in each direction
needs to be stated. Either before calling the instruction (by setting the fields in
the traydata) or by entering the values in the dialogues during initialization. The
positions are relative wobj0 or the WObj if the optional parameter is present.
psWObj (in traydata) is not used unless defined before calling the instruction.

LeadThrough:
The user is prompted to move the arm using leadthrough to the last position in
each direction. Thereafter, the user is asked to specify how many objects are
present in each direction. With the input from the user a workobject, psWObj, is
calculated relative to either wobj0 or the WObj if the optional parameter is
present.

When running the instruction, the next object will be placed and nIndex in
traydata is increased.

See the YLExample_PickPlaceTray procedure in the YuMiLibExamplesR/L


module for a full code example where objects are moved from one tray to
another.

Basic Example

TASK PERS pickdata pd1:=[FALSE,0,0,0,0,0,0,0,0,0];


TASK PERS traydata td1:=
[FALSE,0,[[0,0,0],[0,0,0,0]],[0,0,0],[0,0,0],0]
CONST robtarget pPlace:=[[300,-200,300],[0,0,1,0],[-2,1,-
1,4],[179,9E+09,9E+09,9E+09,9E+09,9E+09]];

Example 1: Simple IndexedPlace


IndexedPlace pPlace,tGripper,td1,pd1;

Example 2: IndexedPick with returned error


VAR num nStatus;
IndexedPlace pPlace,tGripper,td1,pd1\nStatus:=nStatus;
IF nStatus=TRAY_FULL TPWrite "Tray Full";

3HDA000059A1554-001 Revision: 1.04 95


YuMiLib

Example 3: IndexedPick with returned error for pick and


tray
VAR num nStatus;
VAR num nStatusPlace;
IndexedPlace
pPlace,tGripper,td1,pd1\nStatus:=nStatus\nStatusPlace:=nSt
atusPlace;
IF nStatus=TRAY_FULL TPWrite "Tray Full";
IF nStatusPlace<>PLACE_SUCCESS TPWrite "Place
unsuccessful";

Arguments

IndexedPlace [\J] | [\L] pPlace [\Speed] [\Zone] Tool [\WObj] td


[\pd] | [\sPlaceProc] [\sFeederProc] [\nStatus] [\nStatusPick]
[\Load] [\PrePos] [\PostPos] [\UseOffs]

[\J] Data Type: switch

The movement should be performed using joint movement. If omitted Drop desides which
movement to make.

[\L] Data Type: switch

The movement should be performed using linear movement. If omitted Drop desides
which movement to make.

pPlace Data Type: robtarget

The pick position of the "origo" part on the tray.

[\Speed] Data Type: speeddata

Speed data for the movement. This argument can be omitted. In that case, the speeddata
refers to v1000.

[\Zone] Data Type: zonedata

Zonedata for the movement. This argument can be omitted. In that case, the zonedata
refers to z10.

Tool Data Type: tooldata

The tool used during the movement.

[\Wobj] Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

td Data Type: pickdata

The traydata used to store the information about the tray setup and the current index.

3HDA000059A1554-001 Revision: 1.04 96


YuMiLib

[\pd] Data Type: pickdata

The pickdata used to store the information about the pick.

[\sPlaceProc] Data Type: string

If a palce procedure should be used instead of the default place, it can be given instead
of a pickdata. The procedure must have a robtarget and a (PERS) tooldata and an optional
wobjdata named WObj as parameters, as in

PROC yourProcName(VAR robtarget pTarget, PERS tooldata Tool\PERS wobjdata


Wobj);

The syntax must be “ModuleName:ProcName”.

[\sFeederProc] Data Type: string

If a feeder process should be called when no parts can be found. The feeder proc MUST
have VAR locatedata as input parameter. The syntax must be “ModuleName:ProcName”.

[\nStatus] Data Type: num

If specified, the status is returned. The status code for IndexedPick are:

CONST num TRAY_EMPTY:=-10;

[\nStatusPlace] Data Type: num

If specified, the status is returned in YUMILIB_PRECISE_MODE and


YUMILIB_BALANCED_MODE. The status codes for the place instructions are:

CONST num PLACE_SUCCESS:=-6;


CONST num PLACE _COLLISION:=-7;
CONST num PLACE _OBJECT_NOT_PERSENT:=-8;

[\PrePos] Data Type: pos

If PrePos is specified the preplace position is calculated using PrePos instead off
pd.Offset.

[\PostPos] Data Type: pos

If PostPos is specified the postpick position is calculated using PostPos instead off
pd.Offset.

[\UseOffs] Data Type: switch

If the movements should be performed with Offs instead of with RelTool.

Program Execution

During the configuration, the user is guided through a similar setup as IndexPick.

3HDA000059A1554-001 Revision: 1.04 97


YuMiLib

Syntax

IndexedPlace
[ '\' J ',']
[ '\' L ',']
[ pPlace' :=' ] < expression (IN) of robtarget >
[ '\' Speed ':=' < expression (IN) of speeddata > ]
[ '\' Zone ':=' < expression (IN) of zonedata > ] ','
[ Tool ':=' ] < persistent (PERS) of tooldata >
[ '\' WObj ':=' < persistent (PERS) of wobjdata > ] ','
[ td ':=' ] < persistent (PERS) of traydata >
[ '\' pd ':=' ] < persistent (PERS) of pickdata >
[ '\' sPlaceProc ':=' ] < expression (IN) of string >
[ '\' nStatus ':=' < variable (VAR) of num > ]
[ '\' nStatusPick ':=' < variable (VAR) of num > ]
[ '\' PrePos' :=' < expression (IN) of pos > ]
[ '\' PostPos' :=' < expression (IN) of pos > ]
[ '\' UseOffs ]';'

3HDA000059A1554-001 Revision: 1.04 98


YuMiLib

CalControl – Evaluate the curent Arm Calibartion

Useage

CalControl is used to control the joint calibration of each YuMi Arm. In case of
wrong or missing revolution counters, the arm will recalibrate the revolution
counter automaticly. In case of changet fine calibration value, you will get an
Error log and the operator neets to acknoledge on TPU the next steps.

Basic Example

CalControl;
Make a calibration control of all joints.

CalControl\j5\j6\j7;
Make a calibration control of joint 5, 6 and 7.

CalControl\jReset;
Reset and reseurch the revolution counter and the limits for calibration control
for all joints.

CalControl\j1\jReset;
Reset and reseurch the revolution counter and the limits for calibration control
for joint 1.

Arguments

CalControl [\j1] [\j2] [\j3] [\j4] [\j5] [\j6] [\j7]


[\jReset];

[\j1] Data Type: switch


Switch to enable the calibration control for joint 1.
[\j2] Data Type: switch
Switch to enable the calibration control for joint 2.
[\j3] Data Type: switch
Switch to enable the calibration control for joint 3.
[\j4] Data Type: switch

Switch to enable the calibration control for joint 4.

[\j5] Data Type: switch

Switch to enable the calibration control for joint 5.

[\j6] Data Type: switch

Switch to enable the calibration control for joint 6.

3HDA000059A1554-001 Revision: 1.04 99


YuMiLib

[\j7] Data Type: switch

Switch to enable the calibration control for joint 7.

[\jReset] Data Type: switch

Switch to reset and reseurch the revolution counter and the limits for calibration control
for all joints or selectet joints.

Syntax

CalControl
[ '\' j1 ]
[ '\' j2 ]
[ '\' j3 ]
[ '\' j4 ]
[ '\' j5 ]
[ '\' j6 ]
[ '\' j7 ]
[ '\' jReset ] ';'

Error handling
The following recoverable errors can be generated. The errors can be handled
in an ERROR handler. The system variable ERRNO will be set to:

Name Cause of error

MESSAGE Module missing!


The Module
CAL_CONTROL_MESSAGE_EN.sys is
ERR_CALCONTROL_MESSAGE
missing!
Load minimum the message module for
englisch message of CAL_CONTROL

ERR_CALCONTROL ERROR by executing CalControl

CalControl: Change in fine calib.


ERR_CALCONTROL_FINECALIB Detected!
Arm ? Joint: ?. ?.

3HDA000059A1554-001 Revision: 1.04 100


YuMiLib

Name Cause of error

CalControl: Calib ERROR!


Calibration could not be completed!
Area of Hall sensor could not found,
Signal=1! Or The signal does not
ERR_CALCONTROL_CALIB
change to 1 during the search!
Please check the position and the Hall
sensor!
Arm ? Joint: ?. ?.

3HDA000059A1554-001 Revision: 1.04 101


YuMiLib

SetVisionTool – Set the active tool in the spreadsheet

Usage

SetVisionTool is used to change the enabled vision tool in a


Fingerpick_template_x4.job.

Basic Example

SetVisionTool ld
The vision tool in the locatedata ld is set to the active tool.

Arguments

SetVisionTool ld

ld Data Type: locatedata

The locatedata containing nVisionTool.

Syntax

SetVisionTool
[ ld ':=' ] < persistent (PERS) of locatedata > ';'

3HDA000059A1554-001 Revision: 1.04 102


YuMiLib

DelayedCall – Make a delayed call to a proc

Usage

DelayedCall is used to make a delayed call to a proc.

Basic Example

DelayedCall procName time


procName in executed after time delay.

Arguments

DelayedCall procName time

procName Data Type: string

Name of the RAPID procedure to be executed after a time delay. The procedure call is a
late binding call, and therefore inherits its properties. The syntax must be
“ModuleName:ProcName”.

time Data Type: num

Time delay in seconds before executing procName.

Syntax

DelayedCall
[ procName ':=' ] < expressin (IN) of sting > ','
[ time ':=' ] < expressin (IN) of num > ';'

3HDA000059A1554-001 Revision: 1.04 103


YuMiLib

5.3 Functions
LocatePart – Locate single part using the hand camera

Usage

LocatePart is used to locate a single part using the hand camera.

Basic Example

VAR pos psPixel1;


psPixel1:=LocatePart pPicture,v200,"Part";
Locate the part.

Arguments

LocatePart pLocate vLocate tCamera [\Wobj] sVisionToolName


[\camResult]

pLocate Data Type: robtarget

The position where the robot should take an image and locate the part.

vLocate Data Type: speeddata

The speeddata used during the movement.

tCamera Data Type: tooldata

The tooldata used during the movement.

[\Wobj] (Work object) Data Type: wobjdata

The work object (tool coordinate system) to which the robot position is referenced in the
instruction. This argument can be omitted. In that case, the position refers to the world
coordinate system.

sVisionToolName Data Type: string

The vision tool name.

[\camResult] Data Type: cameratarget

Optional INOUT of located cameratarget.

3HDA000059A1554-001 Revision: 1.04 104


YuMiLib

Syntax

pLocate
[ pLocate ':=' ] < expression (IN) of robtarget >','
[ vLocate ':=' ] < expression (IN) of speeddata >','
[ tCamera ':=' < persistent (PERS) of tooldata > ]
[ '\' Wobj ':=' < expression (INOUT) of workobject > ]','
[ sVisionToolName ':=' ] < expression (IN) of string >','
[ sVisionToolName ':=' < expression (INOUT) of
cameratarget > ]';'

A function with a return value of type pos.

3HDA000059A1554-001 Revision: 1.04 105


YuMiLib

Taskno – Get the task number

Usage

Taskno is used to retrieve the current task’s number.

Basic Example

VAR num nTask;


nTask:=Taskno();
Gets the task number.

Arguments

Taskno

Syntax

Taskno';'

A function with a return value of type num.

3HDA000059A1554-001 Revision: 1.04 106


YuMiLib

5.4 YuMiLib Parameters

The modules YuMiLib_Params_L and YuMiLib_Params_R contain constants for a default YuMi
robot.

The first set of parameters declare the loaddata for the standard configurations of the YuMi
Smartgrippers. The parameter names are suffixed with an S for standard two finger gripper, C
for camera, V1 for one vacuum cup and V2 for two vacuum cups.
CONST loaddata ld_YuMiGripper_S:=[0.230,[8.2,11.7,52.0],[1,0,0,0],0.00021,0.00024,0.00009];
CONST loaddata ld_YuMiGripper_S_V1:=[0.248,[8.6,11.7,52.7],[1,0,0,0],0.00021,0.00024,0.00009];
CONST loaddata ld_YuMiGripper_S_V1_V2:=[0.280,[7.1,11.9,47.3],[1,0,0,0],0.00025,0.00029,0.00012];
CONST loaddata ld_YuMiGripper_S_C:=[0.244,[7.5,11.8,52.7],[1,0,0,0],0.00021,0.00023,0.00008];
CONST loaddata ld_YuMiGripper_S_C_V1:=[0.262,[7.8,11.9,50.7],[1,0,0,0],0.00022,0.00024,0.00009];

The next set of parameters configure the camera calibration and should not be changed:

CONST string markerFinderJob:="PatternABB.job";


TASK PERS num HandCamera_Kinv{3,3}:=[[0,0,0],[0,0,0],[0,0,0]];
TASK PERS num HandCamera_K{3,3}:=[[0,0,0],[0,0,0],[0,0,0]];
TASK PERS tooldata tHandCamera := [...]
CONST pose peDefault_tFrame_HandCamera:=[[-7.3, 28.3, 35.1], [0.5, -0.5, -0.5, -0.5]];
CONST pose peDefault_tFrame_ABBLogo:=[[0, -28.3, 30], [0.5, -0.5, -0.5, -0.5]];

The vision and the tray workobjects are declared as global variables and used in Vision and
Indexed instructions:

TASK PERS wobjdata WObj_Vision := [...]


TASK PERS wobjdata WObj_Tray:= := [...]

The module defines the tooldata for the standard fingers for TCP and vacuum cups respectively:

TASK PERS tooldata


tGripper:=[TRUE,[[0,0,136],[1,0,0,0]],[0.230,[8.2,11.7,52],[1,0,0,0],0.00021,0.00024,0.00009]];
TASK PERS tooldata
tVacuum1:=[TRUE,[[63.5,18.5,37.5],[0.707106781,0,0.707106781,0]],[0.248,[8.6,11.7,52.7],
[1,0,0,0],0.00021,0.00024,0.00009]];
TASK PERS tooldata tVacuum2:=[TRUE,[[-63.5,18.5,37.5],[0.707106781,0,
-0.707106781,0]],[0.280,[7.1,11.9,47.3],[1,0,0,0],0.00025,0.00029,0.00012]];

The module contains task specific parameters. The following parameters in the right task are
used in the camera calibration:

TASK PERS string YuMiLib_CameraName:="HandCameraR";


CONST robtarget pCamera_Calib_Near:=[[413,-50,400],[1,0,0,0],[1,0,2,4],[-
110,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pCamera_Calib_Far:=[[413,-250,400],[1,0,0,0],[1,0,2,4],[-
110,9E+09,9E+09,9E+09,9E+09,9E+09]];
CONST robtarget pShowABBLogo:=[[405+15,-150,405],[0,0,0,1],[1,0,-1,4],[-
110,9E+09,9E+09,9E+09,9E+09,9E+09]]

The left task has an equivalent set of parameters. The string CameraName defines the name of
the right and the left camera respectively. During the camera calibration procedure, the robot
uses the ABB logo on the opposite gripper to calibrate the camera by taking images at different
distances. The robtargets pCamera_Calib_Near and pCamera_Calib_Far are two initial
positions used in the procedure as shown in Fig. 1 and Fig.2. The pShowABBLogo is the position
where the robot shows the ABB logo for the camera on the opposite hand.

3HDA000059A1554-001 Revision: 1.04 107


YuMiLib

Figure 1: pCamera_Calib_Near and pShowABBLogo.

Figure 2: pCamera_Calib_Far and pShowABBLogo.

The x, z and elbow values in these three positions can be changed to adjust the positions of
the calibration procedure, e.g., if the workspace is constrained. In Fig.3, pCamera_Calib_Near
and pCamera_Calib_Far have z value 500 (+100) and elbow angles -170 on the left arm, and
similarly, pShowABBLogo on the right task has been translated +100 mm in z-direction to 505
and the elbow angle is set to 170.

pShowABBLogo:=[[405+15,-150,505],[0,0,0,1],[1,0,-1,4],[170,9E+09,9E+09,9E+09,9E+09,9E+09]];

Figure 3: Calibration positions translated in z-direction.

The flange positions of the arms are named WObj_FollowRobL and WObj_FollowRobR
respectively:

TASK PERS wobjdata WObj_FollowRobL:=[FALSE,FALSE,"ROB_L",[[0, 0, 0],[1, 0, 0, 0]],[[0, 0, 0],[1, 0, 0,


0]]];

3HDA000059A1554-001 Revision: 1.04 108


YuMiLib

These workobjects can be used to define a robtarget relative to the other arm.

The last parameters are common speed values:

CONST speeddata vSlow:=[100,50,5000,1000];


CONST speeddata vMedium:=[300,150,5000,1000];
CONST speeddata vFast:=v1000;

3HDA000059A1554-001 Revision: 1.04 109

S-ar putea să vă placă și