You are on page 1of 76

COSIMIR Robotics

Training

Datum

17. Mai 2007

Ersteller

Andreas Zabka Georg Kinder

Version

1.0

Festo Didactic GmbH & Co. KG Rechbergstr. 3 73770 Denkendorf Germany www.festo.com/didactic Telefon Telefax E-Mail 0711/3467-1424 0711/34754-1424 gkin@de.festo.com

1 2

Symbols ......................................................................................................................... - 3 Introduction ................................................................................................................... - 4 2. 1 2. 2 Robot hardware .................................................................................................................. - 4 Robot Software ................................................................................................................... - 8 -

Programing .................................................................................................................. - 10 3. 1 3. 2 3. 3 Project management ........................................................................................................ - 10 Teching positions ............................................................................................................. - 14 Exercises ........................................................................................................................... - 18 Exercise 1 Simple pick and place application ...................................................................... - 18 Exercise 2 Pick and place application with defined speeds ................................................ - 21 Exercise 3 Pick and place application with relative positions............................................. - 23 Exercise 4 Pick and place application with hindrance......................................................... - 25 Exercise 5 - Pick and place application with Inputs/Outputs ................................................ - 27 Exercise 6 - Pick and place application with sensor definition .............................................. - 32 Exercise 7 - Pick and place application with different cases ................................................. - 35 -

3. 3. 1 3. 3. 2 3. 3. 3 3. 3. 4 3. 3. 5 3. 3. 6 3. 3. 7

Testing ......................................................................................................................... - 38 4. 1 4. 2 Introduction ...................................................................................................................... - 38 Tests .................................................................................................................................. - 39 Test 1 - Simulation with COSIMIR Robotics ............................................................................ - 39 Test 2 - Testing with COSIMIR Industrial on the real robot .................................................... - 41 Test 3 - Interaction of programs on the target hardware ....................................................... - 46 Test 4 - Testing with COSIMIR Control .................................................................................... - 53 -

4. 2. 1 4. 2. 2 4. 2. 3 4. 2. 4

Appendix ...................................................................................................................... - 55 5. 1 Solutions ........................................................................................................................... - 55 Solution 1 Simple pick and place application ..................................................................... - 55 Solution 2 Pick and place application with defined speeds................................................ - 57 Solution 3 Pick and place application with relative positions ............................................ - 59 Solution 4 Pick and place application with hindrance ........................................................ - 63 Solution 5 Pick and place application with Inputs-Outputs ................................................ - 65 Solution 6 - Pick and place application with sensor definition .............................................. - 67 5. 1. 1 5. 1. 2 5. 1. 3 5. 1. 4 5. 1. 5 5. 1. 6

5. 2 5. 3

Changing the batteries .................................................................................................... - 69 Teaching positions with the TeachBox ........................................................................... - 73 -

Festo Didactic GmbH & Co. KG

-2-

Symbols

left click right click double click [Button] [Button] Hint Warning hardware button, turn- or toggle switch software button hint to avoid mistakes a warning which should be followed filename, path or user input program name command block accentuation

Italic
Bold Blue

Red

Festo Didactic GmbH & Co. KG

-3-

2 2. 1

Introduction
Robot hardware

You can find different Mitsubishi robots in Festo Didactic systemsRobot RV-2AJ

Degrees of freedom: Maximum workload: Range gripper hand: Repeat accuracy: Maximum speed: Controller-type: Robot weight: Path measurement: Drive:

5 2 kg 482 mm 0.02 mm 2.1 m/s CR1 17 kg absolute encoder AC-Servo motors with HarmonicDrive gears pneumatic / electric

Gripper:

Robot RV-1A

Degrees of freedom: Maximum workload: Range gripper hand: Repeat accuracy: Maximum speed: Controller-type: Robot weight:

6 1 kg 490 mm 0.02 mm 2.2 m/s CR1 19 kg

Festo Didactic GmbH & Co. KG

-4-

Path measurement: Drive: Gripper: Robot RV-3SJB

absolute-encoder AC-Servo motors with HarmonicDrive gears pneumatic / electric

Degrees of freedom: Maximum workload: Range gripper hand: Repeat accuracy: Maximum speed: Controller-type: Robot weight: Path measurement: Drive: Gripper:

5 3 kg 641 mm 0.02 mm 5.3 m/s CR2B 33 kg absolute-encoder AC-Servo motors with HarmonicDrive gears pneumatic / electric

Robot RV-3SB

Degrees of freedom: Maximum workload: Range gripper hand: Repeat accuracy: Maximum speed: Controller-type: Robot weight: Path measurement:

6 3 kg 642 mm 0.02 mm 5.5 m/s CR2B 37 kg absolute-encoder

Festo Didactic GmbH & Co. KG

-5-

Drive: Gripper:

AC-Servo motors with HarmonicDrive gears pneumatic / electric

Robot RH-5AH55

Degrees of freedom: Maximum workload: Range gripper hand: Repeat accuracy: Maximum speed: Controller-type: Robot weight: Path measurement: Drive: HarmonicDrive gears Gripper:

4 5 kg 198-550 mm 0.02 mm 5.5 m/s CR2A 19 kg absolute-encoder AC-Servo motors with

pneumatic / electric

In Festo Didactic systems usually an articulated robot with 5 or 6 axis is used. The robots workload is not important since only the customers wish decides which robot is used.

Festo Didactic GmbH & Co. KG

-6-

Controller CR1 / CR2A / CR2B

Controller-type: Processor: Controller functions:

CR1, CR2A, CR2B 64-Bit RISC axial, linear and 3D circle interpolation, lineare, palletizing, functions, interrupt control, multitasking CR1: CR2: CR1: CR2: 16 I/O, 32 I/O 240 I/O, 256 I/O

Internal Inputs/Outputs:

Maximum Inputs/Outputs:

Security functions:

Emergency-Stop and door jamb switch 207 253V AC

Power supply:

Depending on the demand the controller can be equipped with different interface cards. An extension of the binary inputs and outputs is possible, too.

Festo Didactic GmbH & Co. KG

-7-

2. 2

Robot Software

There are different COSIMIR software products which can be used for starting or programming robot stations. The COSIMIR software products: COSIROP COSIMIR Robotcis COSIMIR Industrial

COSIROP COSIROP has the programming core of all COSIMIR robot software. It offers the opportunity to program the used robot in a specific programming language, e.g.: Mitsubishi ABB KUKA Stubli Adept programming language: MELFA III, IV; Movemaster Command programming language: Rapid programming language: KRL programming language: V+ programming language: V+

Because of its programming functions is COSIROP part of the other COSIMIR robot software.

COSIMIR Robotics COSIMIR Robotics extends COSIROP with a multitasking capable real-time simulation of the robot cell. In this contect. real-time simulation means an exact reproduction of all running process in reality. Programs which run on the robot controller in the background, like handshake-processes, run in the simulation on a virtual controller as well. There the simulation is not just a simple animation of the process sequences!

COSIMIR Industrial COSIMIR Industrial contains the necessary download function (only for Mitsubishi robots!). The user program as well as its the associated position list can be loaded on the controller. However consider that user program (XYZ.MB4) and position list (XYZ.POS) need to have the same name since the controller connects them after the download. You can do the following with COSIMIR Industrial: 3D simulation (no sensor and several robots simulations) 3D modeling with Mitsubishi robot systems

Festo Didactic GmbH & Co. KG

-8-

Mitsubishi robot programming as well as down-/uploading to/from the controller No SPS functionality In conclusion you can program a robot with the following means: The TeachBox COSIROP COSIMIR Industrial COSIMIR Robotics

Hint

The robot programming is explained with COSIMIR Robotics. Programming with the Teachbox is exhausting and therefore not recommended.

Festo Didactic GmbH & Co. KG

-9-

3 3. 1

Programing
Project management

Copying a robot model COSIMIR Robotics has up to 35 predefined robot cells. These are embedded in a library and can be used as a basis for new projects.

Tipp

You should always make copy of a predefined robot cell and use the copy for your own project. This way changes will be applied only to the user project and not in the robot cell in the library.

1. 2. 3.

Open Windows Explorer Create the folder RoboticsModel on the desktop Copy the files of the folder C:\...\didactic\cosimir robotics.en\Models in RoboticsModel on your desktop on

4. Open COSIMIR Robotics by 5. 6. 7. 8. 9.

The help is opened automatically, if not: Choose in the menu Help on [Browse] Search in Cosimir Educational GB\Bin for the file Cosimir.CHM and open it Open in the menu File Open the model FirstSteps RV-2AJ.MOD in the folder RoboticsModel\Models\FirstSteps\Model\... Startup Info

Festo Didactic GmbH & Co. KG

- 10 -

Robotics user interface

The project window contains 3 windows: work cell position list robot program The work cell can be modeled by the user. It is used for real-time simulations of robot movements therefore cricitcal situations can be recognized in time and collisions in real robot applications can be avoided. In the educational version you can only add abstract, in the libraries defined, objects to the cell. The robots movements are created with commands and position calls in a robot program as with the real robot. Positions of a robot program are inserted in the position list via a Teach-In-Tool. The following compiling and linking replace virtually the controller, whose kernel merges position list and robot program to an executable program. To run the predefined program in COSIMIR Robotics: 1. 2. on the robot program on [Compile+Link]

3.

on [Start]

Festo Didactic GmbH & Co. KG

- 11 -

Reset of the work cell After a one-time run reset the robot program as well as the work cell: 1. 2. Select in the menu Execute Select in the menu Edit Reset Program

Reset Workcell

Now close the existing robot program and position list, to create an own program for the predefined robot model.

Creating of new files Create a new robot program file as well as a new position list file: 1. 2. 3. Choose in the menu File New

on MELFA BASIC IV-Program A new file opens Save As

4. Select in the menu File 5. 6. 7. 8.

Save the new file as: RoboticsModel\Models\FirstSteps\Programs\1.MB4 Select in the menu File New

on MRL Position List Save the new file as: RoboticsModel\Models\FirstSteps\Position Lists\1.POS

Project management In the project management you can define which robot program is run as Main Program. Furthermore, here you can specify all further position lists and robot programs, which are needed in the project.

Festo Didactic GmbH & Co. KG

- 12 -

Compiler settings 1. 2. 3. Select in the menu Execute Select the tab Files Select the file FirstSteps RV-2AJ.MB4 and remove it by on Project Management

4. Repeat that step for the file FirstSteps RV-2AJ.POS 5. 6. 7. 8. Add your file 1.MB4 by on and selecting 1.MB4 in the root directory

Repeat that for the file 1.POS on the file 1.MB4 Choose the Compile Mode: Main

Program
9. Confirm by on [OK]

Opening and closing the project 1. 2. 3. Close the project by on in the robot model window FirstSteps RV-2AJ.MOD

Robot program and position list are closed automatically Choose in the menu File Open

4. Select the file FirstSteps RV-2AJ.MOD in the root directory 5. 6. Confirm by on [OK]

Robot program and position list are opened automatically

Festo Didactic GmbH & Co. KG

- 13 -

3. 2

Teching positions

Perspectives To teach robot positions exactly in COSIMIR Robotics another window with a different perspective is reasonable:

1. 2. 3. 4. 5.

Select in the menu View on the first window Select in the menu View on the second window Select in the menu View

New

Standard

Front View

Standard

Right Side View

Festo Didactic GmbH & Co. KG

- 14 -

Rotating/Moving/Zooming The chosen perspectives can be changed at will. For that purpose then: [Ctrl] + [Shift] + : : : rotates the image moves the image zooms the image on one perspective window. Press

[Ctrl] + [Shift] +

If you in a perspective window the robot will move to the selected point. If the point is not reachable an error message will be displayed.

Collision detection Activate the collision detection with the button Confirm the question if all objects should be checked with Yes. If a collision is detected the colliding objects change their color to magenta. .

Festo Didactic GmbH & Co. KG

- 15 -

Teach-In-Box Now use the Teach-In-Box to move to the required position: 1. 2. Select in the menu Extras A new window opens Teach-In

You can choose from three coordinate systems in the Teach-In-Box. The choice of the coordinate system affects the robots movement. XYZ Jog XYZ Jog is used to move the Tool Center Point (TCP) in the Cartesian world coordinate system. Depending on the positioning of the world coordinate reference point moving linear or parallel along the coordinate axis is limited mechanically by the robot. If a mechanical limit is reached an error will sound and be displayed.

TOOL Jog TOOL Jog is used for the movement in the Tool coordinate system. At this the Cartesian coordinate system is put in the reference point of the Tool coordinates. Movement in this mode is also limited by the robots mechanic.

Festo Didactic GmbH & Co. KG

- 16 -

JOINT Jog JOINT Jog is used for turning single axis. Since in this mode only single axis are moved movement is much faster than in the other modes. Still movement is limited by the robots mechanic.

Tipp

First move in mode JOINT Jog, to reach the desired position fast. For teaching the exact position use then TOOL Jog-mode. While teaching reduce moving speed with the Jog Override scroll bar.

Adding positions to the position list If you reach the definite position add it to the position list with the button [Current Position Pos. List] in the Teach-In-Box. To edit the added position: 1. 2. 3. on the position in the position list you want to edit Select Properties Enter the name P1 and the comment box1 for the taught position

4. You can also change the global data (X,Y,Z) of the position in this menu If you already know the global data for a teach position you can use [Set XYZ Position] in the Teach-In-Box.

Practice

Teach the gripper position for all three cubes in the initial position of the robot work cell. Teach the storage positions in the first workpiece receiver for all three cubes. Teach the storage positions in the second workpiece receiver for all three cubes. Use the Teach-In-Box and the collision detection!

Festo Didactic GmbH & Co. KG

- 17 -

3. 3 3. 3. 1

Exercises
Exercise 1 Simple pick and place application

Task

Program the following Pick and Place-Application: The robot moves in any way from the initial position P10 to the position P1HELP. + 3 The robot moves from position P1HELP directly to position P1 and picks the red cube after a delay of 0,5s. After another delay of 0,5s the robot moves directly to position P1HELP. Starting from position P1HELP the robot moves in any way to position P7HELP. + 6 From position P7HELP the robot moves directly to position P7 and puts down the red cube there after a delay of 0,5s. After another delay of 0,5s the robot moves directly to position P7HELP.
7 5 4 2 1

The robot moves from P7HELP in any way to the initial position P10.

If needed positions are not saved in the position list yet teach them with the Teach-In-Box.

Festo Didactic GmbH & Co. KG

- 18 -

Move commands With these commands you can initiate a Point-To-Point or a linear movement of the robot. MOV The command MOV is used for Joint interpolation movement from position X to position Y. With this command the path of the robot is not predictable, e.g. MOV P1HELP MVS move robot to position P1HELP with Joint interpolation

The command MVS is used for Linear interpolation from position X to position Y. The path of the robot is linear and therefore predictable, e.g.: MVS P1 move robot to position P1 with Linear interpolation Use the MOV command for the critical movements Use the MVS command for the movements interpolation in order to aviad collisions.
2 1

Hint

,
5

and
6

and

to use linear

Time commands DLY To avoid an early gripping of work pieces delays should be included in the program sequence. One possibility is the command DLY. The command is followed by the waiting time with a point separator, e.g. DLY 0.5 Hint delay time of 0,5s Consider that there is always a space between command and value.

Gripper commands The gripper tool of the robot can be opened or closed with the following commands: HOPEN The command HOPEN is used to open the gripper tool. Since a robot can have severe gripper tools the index of the gripper tool has to be specified additionally. The index count starts with 1, e.g. HOPEN 1 HCLOSE open gripper tool 1

The command HCLOSE is used to close the gripper tool. The index count starts here with 1 as well, e.g.: HCLOSE 1 close gripper tool 1

Festo Didactic GmbH & Co. KG

- 19 -

Hint

If the sequence of the robot program is not given create first the task steps in a text editor. To insert commands in your program use on the program window. This way tipping errors decrease and error search is easier. Of course you can also type the commands in the program window directly. Comment your commands. For this use the apostrophe. All characters right hand to the apostrophe to the end of line are ignored by the compiler. Therefore pay attention that there is no apostrophe before a command accidentally.

Programming 1. 2. 3. on the file 1.MB4 on the program window Select the desired command

4. Add parameters to the command optionally, like position, delay time, etc. When you entered the last command do the following: 1. 2. 3. 4. 5. 6. 7. 8. 9. Highlight the complete program Select in the menu Edit Renumber

A dialog opens in which you can set a start line and a step size. on the program window 1.MB4 and Repeat step 4 for the position list 1.POS on the file 1.MB4 on [Compile+Link] Use the help for any compile errors If there are not any errors on [Stepwise] to run the program step-by-step on [Save]

10. After a successful run of the robot program reset the work cell and the robot program.

Festo Didactic GmbH & Co. KG

- 20 -

3. 3. 2

Exercise 2 Pick and place application with defined speeds

Task

Program the following Pick and Place-Application: The robot moves with maximum speed in any way from the initial position P10 to the position P1HELP. + 3 The robot moves from position P1HELP directly to position P1 with 100mm/s. There it picks the red cube after a delay of 0,5s. After another delay of 0,5s the robot moves directly to position P1HELP with 100mm/s. Starting from position P1HELP the robot moves in any way to position P7HELP with 10% of maximum speed. + 6 From position P7HELP the robot moves directly to position P7 with 10mm/s. There it puts down the red cube after a delay of 0,5s. After another delay of 0,5s the robot moves directly to position P7HELP with 10mm/s. The robot moves from P7HELP in any way to the initial position P10 with maximum speed. If needed positions are not saved in the position list yet teach them with the Teach-In-Box.
7 5 4 2 1

Festo Didactic GmbH & Co. KG

- 21 -

Speed commands The resulting speed of the robot is made up like that: Movement with Joint interpolation: controller panel override * program override * Joint override Movement with Linear-interpolation: controller panel override * program override * Linear-override There are commands for program, Joint and Linear override which change the current speed in the robot program. Fr Programm-, Joint- und Linear-Override gibt es jeweils Befehle, durch die die aktuelle Geschwindigkeit im Roboterprogramm beeinflut werden kann. OVRD The command OVRD is used to change the program override. The program override is independent of the interpolation mode and is stated in percent (%), e.g. OVRD 50 decreases resulting speed to 50%

Factory default is 100%, therefore it is not necessary to set the program override on 100% at program start. If you want to reset the program override use the variable M_NOVRD: OVRD M_NOVRD ACCEL resets OVRD to 100%

The command ACCEL is used to set the maximum acceleration for upward and downward moving of the robot. The first parameter is for upward moving and second parameter is for downward moving, e.g. ACCEL 100,50 maximum acceleration for upward moving half acceleration for downward moving

The value range for both parameters is from 1 to 100 and depends on the robot specific thresholds. SPD The command SPD is used to change the Linear override. Linear override only influences movements with Linear interpolation, like the command MVS. The dimension is mm/s. SPD 100 set the Linear override on 100mm/s

If you want to reset the Linear override use the variable M_NSPD: SPD M_NSPD JOVRD reset SPD on the prior value

The command JOVRD is used to change the Joint override. Joint override only influences movements with Joint interpolation, like the command MOV. The dimension is in %. JOVRD 50 set the Joint override on 50 %

If you want to reset the Joint override use the variable M_NJOVRD: JOVRD M_NJOVRD reset JOVRD back on 100% - 22 -

Festo Didactic GmbH & Co. KG

3. 3. 3

Exercise 3 Pick and place application with relative positions

Task

Program the following Pick and Place-Application: The robot moves with maximum speed relative from the initial position P10 to the relative position. This position is 40mm above P1 in +-Z-Direction of the world coordinate system. + 3 Starting from the relative position above P1 the robot moves directly to position P1 with 100mm/s. There it picks the red cube after a delay of 0,5s. After another delay time of 0,5s the robot moves to the relative position above P1 directly with 100mm/s. The robot moves with a relative movement from the relative position above P1 with 10% of maximum speed to the relative position above P7. This position is 30mm above P7 in +-Z-Direction of the world coordinate system. + 6 Starting from the relative position above P7 the robot moves directly to position P7 with 10mm/s. There it puts down the red cube after a delay of 0,5s. After another delay time of 0,5s the robot moves directly to the relative position above P7with 10mm/s. Then the robot moves from the relative position above P7 in any way to the initial position P10 with maximum speed.
7 5 4 2 1

Festo Didactic GmbH & Co. KG

- 23 -

Relative movements If you do not want to teach every single position you can use so called relative movements. Though there are two commands to differ: MOV P1,-100 MOV P1+PHELP MOV P1,-100 This MOV command executes a relative movement in --Z-Direction of the Tool coordinate system. Starting position is P1 and the distance is 100mm. This MOV command initiate a relative movement whose target position results from the addition of the positions P1 and PHELP. In order that PHELP can be used as relative position it first hast to be declared and defined: DEF POS PHELP declaration of position PHELP definition of position PHELP

MOV P1+PHELP

PHELP=(0,0,+100.00,0,0,0)

Hint

For movements parallel to the Z-Axis in the World coordinate system always use the additive command MOV P1+PHELP. Because if you use the command MOV P1,-100 and the Z-Axis in the Tool coordinate system is not parallel to the Z-Axis in the World coordinate system the robot moves along the Z-Axis in the Tool coordinate system which has an angular offset to the Z-Axis in the World coordinate system.

Festo Didactic GmbH & Co. KG

- 24 -

3. 3. 4

Exercise 4 Pick and place application with hindrance

Task

Take over the task from Exercise 3. Add the hindrance wall to the model file. Change your program so that there is no collision between the hindrance wall and the robot. If needed positions are not saved in the position list yet teach them with the Teach-In-Box.

Festo Didactic GmbH & Co. KG

- 25 -

Importing MOD-file 1. Open in the menu File Import the model

wall.MOD in the folder RoboticsModel\Models\ FirstSteps\Model\...


2. 3. Confirm by on [Open] Settings Collision

Select in the menu Extras Detection

4. Select the tab Selection 5. 6. 7. on [Select all] Choose Selected objects against each other Confirm with on [OK]

Hint

Use the collision detection during simulation.

Festo Didactic GmbH & Co. KG

- 26 -

3. 3. 5

Exercise 5 - Pick and place application with Inputs/Outputs

Task

Take over the positions PINIT, PPAL(1), PPAL(3) and PPAL(4) from the file MP.POS in your position list and rename them to PINIT, P1, P3, P4. Program and simulate the following pick and place application with COSIMIR Robotics: The robot moves with maximum speed from the initial Position PINIT to the relative position. This position is 70mm above P1 in +-ZDirection in the World coordinate system. + 3 As soon as the sensor monitoring identifies a carrier on Sensor 1 (Input 5) the robot moves directly to position P1 with 100mm/s. There it picks a carrier after a delay of 0,5s. After another delay of 0,5s the robot moves directly to the relative position above P1 with 100mm/s. Starting from the relative position P1 the robot moves with 10% of maximum speed to the relative position above P3. This position is 70mm above P3 in +-Z-Direction in the World coordinate system.
4 2 1

Festo Didactic GmbH & Co. KG

- 27 -

+ 6 The robot moves from the relative position above P3 directly to position P3 with 10mm/s. There the robot puts down the carrier after a delay of 0,5s if Sensor 3 (Input 7) doesnt detect a carrier. After another delay time of 0,5s the robot moves directly to the relative position above P3 with 10mm/s. Afterwards the robot moves from the relative position above P3 in any way with maximum speed to the initial position PINIT.
7

Festo Didactic GmbH & Co. KG

- 28 -

RobotAssembly RV1A 1. 2. 3. Open COSIMIR Robotics by Select in the menu File Open on

on StationAssemblyRV1A.MOD in the folder

RoboticsModel\Models\StationAssembly RV1A\Model\...
4. Close all .MB4 and .POS files 5. 6. 7. 8. 9. Select in the menu File New

on MELFA BASIC IV-Program A new file opens Select in the menu File Save As

Save the new file as : RoboticsModel\Models\ StationAssemblyRV1A\StationAssemblyRV1A\Programs\robot\1.MB4 New

10. Select in the menu File 11.

on MRL Position List

12. Save the new file as: RoboticsModel\Models\

StationAssemblyRV1A\StationAssemblyRV1A\Programs\robot\1.POS
13. Select in the menu File Open

14. Select the file MP.POS in the folder RoboticsModel\Models\StationAssemblyRV1A\

StationAssemblyRV1A\Programs\robot\...
15. Copy the positions PINIT, PPAL(1), PPAL(3) and PPAL(4) in the position list 1.POS 16. Rename the positions: 17. PPAL(1) --> P1 18. PPAL(3) --> P3 19. PPAL(4) --> P4 20. Write a move command with target position PINIT in the program 1.MB4 and number the line

Festo Didactic GmbH & Co. KG

- 29 -

21. Save the files 1.MB4 and 1.POS 22. Add 1.MB4 and 1.POS to the project in the Project Management define 1.MB4 as Main

Program
23. Test the configuration with a on [Compile+Link]

Sensor simulation COSIMIR Robotics has a sensor simulation. That means sensors can be scanned and analyzed just as on a real system. To find out which input bit belongs to a sensor do the following: 1. Open the Model Explorer in the menu Execute Model Explorer Open Inputs in the project tree on the left side, you find it under: StationAssemblyRV1A Objects AssemblyRV1A AssemblyRV1ARobot

2.

Inputs

3.

On the right you can see now all connected inputs with name and bit number, e.g. Input P1AV with bit number 5

M_IN()

If you want to query a sensor state use M_IN() with the command WAIT. Enter the bit number you want to scan n the brackets of M_IN, e.g. WAIT M_IN(5)=0 That means the robot program halts until the sensor assigned to bit number 5 changes its state to 0. The sensor changes its state to: 1, when the sensor is activated 0, when the sensor is deactivated

M_OUT()

If you want assign a state to an Output, use M_OUT(). Write the bit number of the output you want to set in the brackets of M_OUT, e.g. M_OUT(0)=1 This means that the start lamp HSTART is set to 1 so it is switched on. The state of the robot gripper tool can also be read by sensors: Bit-No. 900: Bit-No. 901: gripper tool open gripper tool closed

Festo Didactic GmbH & Co. KG

- 30 -

Hint

The robots gripper tool opens and closes only during moving of the robot. Therefore while teaching first click on the Button Close Hand or Open Hand in the Teach-In-Box. Afterwards move the robot until the gripper tool is closed or open.

Festo Didactic GmbH & Co. KG

- 31 -

3. 3. 6

Exercise 6 - Pick and place application with sensor definition

Task

Define the sensor 1 and 3. Name sensor 1 P1AV and sensor 3 P3AV. Program and simulate the following pick and place application with COSIMIR Robotics: The robot moves with maximum speed from the initial Position PINIT to the relative position. This position is 70mm above P1 in +-ZDirection in the World coordinate system. + 3 As soon as the sensor monitoring identifies a carrier on Sensor P1AV the robot moves directly to position P1 with 100mm/s. There it picks a carrier after a delay of 0,5s. After another delay of 0,5s the robot moves directly to the relative position above P1 with 100mm/s. Starting from the relative position P1 the robot moves with 10% of maximum speed to the relative position above P3. This position is 70mm above P3 in +-Z-Direction in the World coordinate system.
4 2 1

Festo Didactic GmbH & Co. KG

- 32 -

+ 6 The robot moves from the relative position above P3 directly to position P3 with 10mm/s. There the robot puts down the carrier after a delay of 0,5s if Sensor P3AV doesnt detect a carrier. After another delay time of 0,5s the robot moves directly to the relative position above P3 with 10mm/s. Afterwards the robot moves from the relative position above P3 in any way with maximum speed to the initial position PINIT.
7

Festo Didactic GmbH & Co. KG

- 33 -

Definitions of Inputs and Outputs To define inputs and outputs use the command DEF IO, e.g.: DEF IO P1AV=Bit,5 This means that bit number 5 is assigned to the variable P1AV. If P1AV is used as an input or output depends on the context in which the variable is used. Example: DEF IO P1AV=Bit,5 DEF IO Output=Bit,5 WAIT P1AV=0 Output=1 Here P1AV is used as input because of the WAIT command. The variable Output is set to 1 so it is used as output. Definitions of inputs and outputs dont differ in the definition but it depends on their use.

Festo Didactic GmbH & Co. KG

- 34 -

3. 3. 7

Exercise 7 - Pick and place application with different cases

Task

Define sensor 4 and name it P4AV. Program and simulate the following pick and place application with COSIMIR Robotics: The robot moves with maximum speed from the initial Position PINIT to the relative position. This position is 70mm above P1 in +-ZDirection in the World coordinate system. + 3 As soon as the sensor monitoring identifies a carrier on Sensor P1AV the robot moves directly to position P1 with 100mm/s. There it picks a carrier after a delay of 0,5s. After another delay of 0,5s the robot moves directly to the relative position above P1 with 100mm/s.
2 1

Festo Didactic GmbH & Co. KG

- 35 -

Case 1: M_00# = 3 o Starting from the relative position P1 the robot moves with 10% of maximum speed to the relative position above P3. This position is 70mm above P3 in +-Z-Direction in the World coordinate system. Fall 2: M_00# = 4 o Starting from the relative position P1 the robot moves with 10% of maximum speed to the relative position above P4. This position is 70mm above P4 in +-Z-Direction in the World coordinate system. + 6 The robot moves from the relative position above P3 directly to position P3 with 50mm/s. There the robot puts down the carrier after a delay of 0,5s if Sensor P3AV doesnt detect a carrier. After another delay time of 0,5s the robot moves directly to the relative position above P3 with 50mm/s. + 6' The robot moves from the relative position above P4 directly to position P4 with 50mm/s. There the robot puts down the carrier after a delay of 0,5s if Sensor P4AV doesnt detect a carrier. After another delay time of 0,5s the robot moves directly to the relative position above P4 with 50mm/s. Afterwards the robot moves from the relative position above P3 or P4 in any way with maximum speed to the initial position PINIT.
7 5' 5

Festo Didactic GmbH & Co. KG

- 36 -

IF command To differentiate between cases you habe to use the IF command. The example below shows the syntax of the IF command, alternately you can look it up in the COSIMIR Help: IF M_00#=1 THEN JOVRD 10 MOV P1 ELSE MOV P2 ENDIF The solution to this exercise is not in the chapter Solutions but in the chapter Testing.

Festo Didactic GmbH & Co. KG

- 37 -

4 4. 1

Testing
Introduction

For designing and testing of programs it is reasonable to use the Bottom-Up method. There you first simulate and test the particular program. Is that successful, the interaction of the programs can be tested on the target hardware. Is that also successful, more components can be integrated in the test via communication interfaces if needed. The advantages of this approach: Program enclosure to functional modules Clearness because of defined interfaces Less time is needed for error search

For robot programming this means: Testing phase 1: Simulation the program with COSIMIR Robotics Testing phase 2: Testing the programs on the robot controller with COSIMIR industrial, the TeachBox or the operation panel of the controller Testing phase 3: Testing of interaction between all programs on the target hardware which is started by the MESSystem on the controller Testing phase 4: Testing of communication between controller and MES-System

Festo Didactic GmbH & Co. KG

- 38 -

4. 2 4. 2. 1

Tests
Test 1 - Simulation with COSIMIR Robotics

First test your programs in the COSIMIR Robotics simulation. To test a case differentiation, write this source code at the beginning of your program: M_00#=3 This is necessary because there is no monitoring for user-defined variables in COSIMIR Robotics simulation and therefore the value of M_00# cant be changed online. For simulation with COSIMIR Robotics use position data from the file MP.POS, which is in the folder RoboticsModel\Models\StationAssemblyRV1A\ StationAssemblyRV1A\Programs\robot\.... This is necessary for the simulation since the positions in the Robotics model differ from a real station.

Hint

Program 3a.MB4 for simulation with COSIMIR Robotics:

Festo Didactic GmbH & Co. KG

- 39 -

Position list 3a.POS for simulation withmit COSIMIR Robotics:

Festo Didactic GmbH & Co. KG

- 40 -

4. 2. 2

Test 2 - Testing with COSIMIR Industrial on the real robot

After a successful test with COSIMIR Robotics simulation test your program on a real robot: 1. 2. 3. Open COSIMIR Industrial by on

Open the model copy of StationAssemblyRV1A Load and save your program 3a.MB4 and position list 3a.POS in the project

4. Rename the files to 3.MB4 and 3.POS 5. 6. 7. 8. Delete all positions 3.POS and save the file Add 3.MB4 and 3.POS in the project management Define 3.MB4 as Main Program Open the RCI-Explorer and on the folder AssemblyRV1ARobot programs that are in the controller Load the program MP.MB4 from the controller to the project PC with

Programs to see the

9.

on

10. Open the position list MP.POS by the RCI-Explorers

on MP.MB4 in the folder Workplace

Programs of

11. Copy the positions PINIT, PPAL(1), PPAL(3), PPAL(4) in 3.POS und rename them like this: 12. PPAL(1) --> P1 13. PPAL(3) --> P3 14. PPAL(4) --> P4 15. Save the new position list 3.POS and your program 3.MB4 both under

C:\Documents and Settings\Administrator\Desktop\Cosmir Idustrial Model\FestoTraining\CosimirRoboticsModels\ StationAssemblyRV1A\Model


and under

C:\Documents and Settings\Administrator\Desktop\Cosmir Idustrial Model\FestoTraining\CosimirRoboticsModels\ StationAssemblyRV1A\Programs\robot


16. Select your program 3.MB4 in the folder Workplace 17. Load 3.MB4 from the RCI-Explorer to the controller by

Programs of the RCI-Explorer


on

Festo Didactic GmbH & Co. KG

- 41 -

Hint

Try to use always figures for program names which are saved on the controller. These can be seen better on the controller display.

18. Open the menu Monitors in the RCI-Explorer 19. Open the Debugger with a 20. Load your program in the Debugger

Debugger With the Debugger you can test your program line by line. Here a short list of debugging functions: Program runs until a breakpoint Complete run through of the program Stops the program execution Execution of a program line Reverse execution of a program line Set a breakpoint Delete a breakpoint

Switch to Online/Offline mode

Festo Didactic GmbH & Co. KG

- 42 -

Monitoring variables The global variable M_00 for the case differentiation can be monitored with another monitoring window: 1. Open the menu Monitors in the RCIExplorer Open the Variables Monitor by on it

2. 3.

Select the slot in which your program runs here: Slot-No. 9

4. Enter in the left edit box the name of the variable you want to monitor here: M_00 5. 6. Activate the [ ]-Button After the variable name is taken in the right window, activate the variable monitoring by on [ON]

To change the value of the variable: 1. 2. on [Set Value] Enter the new value in Value and confirm your input by on [Set]

Global variables To use the station RobotAssembly not only as closed Stand-Alone-System a communication interface to other systems is necessary. This is realized by global variables in the controller. The both-way write and read access on those variables is controlled by another global variable, the so called Handshake-Variable M_19#. As semaphore it avoids inconsistent data in the controller. Five parameters are important for communication to the station RobotAssembly: M_00#: process task parameter 1, e.g. target position M_01#: process task parameter 2, e.g. source position M_02#: process task parameter 3, e.g. order number M_19#: semaphore C_00$: program name

Festo Didactic GmbH & Co. KG

- 43 -

The meaning and usage of the parametes M_00# - M_02# depends on the process task which is defined in the program code. This allows a Manufacturing Executing System (MES) to use this interface to send process tasks to the RobotAssembly station and to check the stations state with a return value. Example Exercise 7: The robot of the RobotAssembly station picks the palette from buffer position 1 and places it on buffer position 3. So that the superior MES-System can place that order to the RobotAssembly station a transfer of the following parameters is necessary: M_00#=3: M_01#=0: M_02#=0: C_00$=3: case differentiation, buffer position 3 no meaning no meaning program name (3.MB4)

Program 3.MB4 for testing on the real robot with COSIMIR Industrial:

Festo Didactic GmbH & Co. KG

- 44 -

Position list 3.POS for testing on the real robot with COSIMIR Industrial:

Festo Didactic GmbH & Co. KG

- 45 -

4. 2. 3

Test 3 - Interaction of programs on the target hardware

In Test 3 the controller program START.MB4 is used instead of the process task StartPrg of the MESSystem. It is started by the controller program MAIN1.MB4 and contains the order dataset as well as necessary handshake communication of the MES side. START.MB4 itself calls the controller program COMM.MB4f. This is responsible for the handshake communication of the controller side and allows START.MB4 write access on the order dataset. After the program is called by the program name in parameter C_00$, COMM.MB4 provides return values and waits until they are read. Afterwards COMM.MB4 is terminated. Example Exercise 7:

MAIN1.MB4 calls START.MB4 in slot 8 of the controller START.MB4 calls COMM.MB4 in slot 1 of the controller START.MB4 run parallel to COMM.MB4 START.MB4 waits until COMM.MB4 is ready to read the order dataset COMM.MB4 sets the handshake variable M_19#=&H55 and gives START.MB4 the right to write
the order dataset in controllers memory

START.MB4 sets the handshake variable M_19#=&H0 after the order dataset is written tells COMM.MB4 that all data is transferred COMM.MB4 reads variable C_00$=4 from the controller memory and starts the program 4.MB4 in slot 1 After termination of 4.MB4, COMM.MB4 provides the return value and signalizes it by setting of
M_19#=&HAA

START:MB4 reads the return value and acknowledges it for COMM.MB4 by setting of
M_19#=&H0

COMM.MB4 terminates START.MB4 awaits activation of the [Start]-Button for another start or of the [Stop]-Button for its
own termination To start testing phase 3 do the following: 1. 2. Load MAIN1.MB4 in the project management and activate Main program On the left in the RCI-Explorer program MAIN in slot 2 on slots and enter the properties in the context menu of the

3.

In the line Default Program: choose MAIN1 and activate the checkbox [ALWAYS]

4. Switch the controller off and on again to let the changes take effect 5. 6. 7. 8. 9. Remove all pallets from the buffer positions of the RobotAssembly station Switch the complete station RobotAssembly off and on again with the emergency stop switch Press [CONTROLLER ON] immediately afterwards When [Reset] blinks, press it [Reset] lights now permanently

Festo Didactic GmbH & Co. KG

- 46 -

10. When [Start] blinks, press it 11. [Reset] goes off, [Start] blinks 12. Now press again the blinking [Start]-Button to start the program4.MB4. [Start] lights permanently until the program 4.MB4 is terminated 13. Afterwards [Start] blinks again 14. Press [Start] again to start the program one more time

Program 4.MB4 for test on the real robot:

Festo Didactic GmbH & Co. KG

- 47 -

Position list 4.POSfor test on the real robot:

Festo Didactic GmbH & Co. KG

- 48 -

Program START.MB4for test on the real robot:

Festo Didactic GmbH & Co. KG

- 49 -

Program MAIN1.MB4for test on the real robot:

Festo Didactic GmbH & Co. KG

- 50 -

Program COMM.MB4for test on the real robot:

Festo Didactic GmbH & Co. KG

- 51 -

Program INIT.MB4for test on the real robot:

Festo Didactic GmbH & Co. KG

- 52 -

4. 2. 4

Test 4 - Testing with COSIMIR Control

After a successful test of the interaction of programs on the controller it is time to test the superior MESSystem with the programs: 1. 2. Load MAIN.MB4 in the project management and activate Main Program On the left in the RCI-Explorer program MAIN in slot 2 on slots and enter the properties in the context menu of the

3.

In the line Default Program: choose MAIN1 and activate the checkbox [ALWAYS]

4. Switch the controller off and on again to let the changes take effect 5. 6. 7. 8. 9. Remove all pallets from the buffer positions of the RobotAssembly station Switch the complete station RobotAssembly off and on again with the emergency stop switch Press [CONTROLLER ON] immediately afterwards When [Reset] blinks, press it [Reset] lights now permanently

10. When [Start] blinks, press it 11. [Reset] goes off, [Start] blinks 12. Switch on all the other iCIM stations and put them in Automatic mode 13. Open COSIMIR Control by on

14. Open the project FHTE.lpj in the folder C:\Festo iCIM\CosimirControl_D\Projects\FHTE\... 15. Remove all pallets from the buffer stations 16. Activate the production by on

17. Confirm that there no pallets on the buffer stations 18. Open the Task-Tool in the menu View Task-Tool

19. In the left window select the component RobotAssembly 20. In the right window select the task StartPrg 21. Enter the parameter for the task: StartPrg(4,3,0,0):
Festo Didactic GmbH & Co. KG

- 53 -

C_00$=4: M_00#=3: M_01#=0: M_02#=0: 22. Confirm with a

program name case differentiation no meaning no meaning on [Start]

23. The robot will now move according to the program 4.MB4 and the transferred parameters

Program MAIN.MB4 for testing on the real robot with COSIMIR Control:

Festo Didactic GmbH & Co. KG

- 54 -

5 5. 1 5. 1. 1

Appendix
Solutions
Solution 1 Simple pick and place application

Program 1.MB4:

Festo Didactic GmbH & Co. KG

- 55 -

Position list 1.POS:

Festo Didactic GmbH & Co. KG

- 56 -

5. 1. 2

Solution 2 Pick and place application with defined speeds

Program 2a.MB4:

Festo Didactic GmbH & Co. KG

- 57 -

Position list 2a.POS:

Festo Didactic GmbH & Co. KG

- 58 -

5. 1. 3

Solution 3 Pick and place application with relative positions

Program 3a.MB4:

Festo Didactic GmbH & Co. KG

- 59 -

Position list 3a.POS:

Festo Didactic GmbH & Co. KG

- 60 -

Program 3b.MB4:

Festo Didactic GmbH & Co. KG

- 61 -

Position list 3b.POS:

Festo Didactic GmbH & Co. KG

- 62 -

5. 1. 4

Solution 4 Pick and place application with hindrance

Program 4.MB4:

Festo Didactic GmbH & Co. KG

- 63 -

Position list 4.POS:

Festo Didactic GmbH & Co. KG

- 64 -

5. 1. 5

Solution 5 Pick and place application with Inputs-Outputs

Program 1.MB4:

Festo Didactic GmbH & Co. KG

- 65 -

Position list 1.POS:

Festo Didactic GmbH & Co. KG

- 66 -

5. 1. 6

Solution 6 - Pick and place application with sensor definition

Program 2.MB4:

Festo Didactic GmbH & Co. KG

- 67 -

Position list 2.POS:

Festo Didactic GmbH & Co. KG

- 68 -

5. 2

Changing the batteries

As soon as robot and controller are cut off a power supply a battery buffering takes effect. It ensures the preservation of the original position the so called origin point on which all taught position correspond to. If the batteries buffering drops because of low charging the controller will give an error. If the error isnt considered in time the origin point will get lost. A lost origin point means that all taught positions are invalid. In that case the origin point and the Teach positions have to be adjusted from scratch.

Warning

Check the battery hour meter regularly! Always change the controller and robot batteries at the same time and in time to avoid a loss of the origin point!

The controller battery is used for saving programs and positions. The robot batteries are used for savings encoder position data.

Changing robot batteries Do the following to change the batteries:

Festo Didactic GmbH & Co. KG

- 69 -

1. 2. 3.

Check the cable connection between robot and controller Put the RobotAssembly station in the definite initial position Turn the main switch on [ON]

4. Then press the button [CONTROLLER ON] immediately 5. Switch on the controller so that the robots encoder position data is saved while changing the robot battery.

6.

Move the robot axis in JOG mode like this: J2 = -20 J3 = J5 = 90

7. 8. 9.

For security activate the [Emergency Stop] switch Remove the cover A as well as battery case cover and battery attachment together with the screws Detach the slots of the old batteries and replace them completely with new ones

10. Connect the slots of the new batteries 11. Mount the battery attachment, the battery case cover and the cover A 12. Dispose of the old batteries properly

Festo Didactic GmbH & Co. KG

- 70 -

Hint

It is possible that during demounting of the battery case cover and attachment a screw falls in the open robot basis. It is hard to get it out again. Therefore be careful while removing the screws. Put a paper under the battery case cover.

Changing controller battery 1. 2. Switch on the controller for at least one minute Then switch off the power switch and disconnect the power supply

Warning

Wait at least three minutes after disconnection of the power supply! Only then dangerous residual voltages are reduced.

3.

Remove the case cover together with the screw

4. Disconnect the slot of the old battery and replace the battery with a new one 5. 6. 7. Connect the slot of the new battery Mount the case cover Reset the battery timer

Festo Didactic GmbH & Co. KG

- 71 -

Reseting the battery timer Immediately after changing the batteries reset the battery timer:

1. 2. 3.

Turn the controllers key switch on mode [TEACH] Turn the Teachboxs key switch on [ENABLE] Follow these instructions

Festo Didactic GmbH & Co. KG

- 72 -

5. 3

Teaching positions with the TeachBox

At times it is necessary to teach a new position. You can use the Teachbox for that: 1. 2. 3. Put the RobotAssembly station in the definite initial position Turn the main switch on [ON] Afterwards press the button [CONTROLLER ON] immediately

4. Turn the controllers key switch on mode [TEACH] 5. 6. Turn the key switch of the TeachBox on [ENABLE] Call the main menu

Main menu

7.

Now select the desired program:

Program selection

Festo Didactic GmbH & Co. KG

- 73 -

Hint

If the menu TEACH already shows a program you first have to delete it: With the [HAND/ ] button move the cursor at the end of the programs name Press the buttons [POS/CHAR]- and [DEL/ ] simultaneously The last character of the name is deleted Repeat this until the program name is deleted

8. 9.

Confirm SELECT PROGRAM with the [INP/EXE] button Choose the desired program with the cursor buttons [ADD/ ] or [RPL/ ] and confirm your choice with the button [INP/EXE]

10. The menu for program editing opens 11. Press the button [POS/CHAR] to see the programs taught positions 12. Select the desired positions by browsing with the buttons [+/FORWD] and [-/BACKWD]

Moving toward a position 1. 2. Press the [Deadman-switch] and keep it pressed Now move toward the chosen position:

Festo Didactic GmbH & Co. KG

- 74 -

Teaching a position

To teach the position anew, do the following: 1. 2. 3. Press the [Deadman-switch] and keep it pressed Press the button [STEP/MOVE] and keep it pressed as well A click sound will confirm that the servos are activated

4. Select a coordinate system by pressing either [TOOL/=*], [JOINT/()?] or [XYZ/$:] 5. 6. 7. Select a movement speed by pushing the button [+/FORWD]- or [-/BACKWD] Push a [Movement-Key] to move in the chosen coordinate system If you release either the [Deadman-switch], the [STEP/MOVE] or a [Movement-Key] the robot will stop

Festo Didactic GmbH & Co. KG

- 75 -

Hint

For teaching a position always use another same part for help. Put it on the teaching position contrary. Move the robot with the other part above that position like shown in the picture. Position the gripped part so that the edges of both parts are aligned. Move the robot in +Z-Direction in World coordinate system. Take out the helping part and finally position the gripped part in +Z-Direction in World coordinate system. Now replace the old position with the new one: 1. 2. 3. Push the button [STEP/MOVE] and keep it pushed Push the button [ADD/ ] Confirm the question REPLACING? by pressing [ADD/ ] again

4. This way you can also add new position to the program

Saving a position The program and its positions are automatically saved when you: Press the button [MENU/#%] Turn the key switch of the TeachBox on [DISABLE] If you need more information about using and programming with the Teachbox you can find it in the reference and programming manual of the controller. - 76 -

Festo Didactic GmbH & Co. KG

You might also like