打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
Getting Started

This document shows an example of how to preparea basic offline station in RoboDK for robot offlineprogramming. In this example, a UR robot is simulated and programmed for arobot painting application.

All the settings of a RoboDK project aresaved as a RoboDK station (RDK file). A RoboDK station contains all robots,tools, reference frames, objects and other parameters. The RoboDK station isstored in one file (RDK extension). It is not required to keep a separate copyof the robot files, tools and objects as they are saved as one RDK file.

The videos available in the examplessection of RoboDK website provide an overview on how to use RoboDK fordifferent applications: https://www.robodk.com/examples.

New project

Follow these steps to create a new RoboDKproject (RDK station):

1.    Download and install RoboDK from the website: https://robodk.com/download

2.    Double click the shortcut on the Desktop

3.    If other stations are open:      
select File

 NewStation (Ctrl+N) to start a new project

   

Multiple RoboDK projects can be open at thesame time. Double clicking the Station icon

 in the tree willactivate and display that project.

Select a robot

New robots can be added from a local driveor from the online library:

1.    Select File

Open online library (Ctrl+Shift+O). Anew nested window will appear showing the online library  
It is also possible to select the corresponding button in the toolbar.

2.    Use the filters to find your robot by brand, payload, ...         
In this example, we will use a UR10 robot (10 kg payload robot and 1.3 mreach).

3.    Select Download. The robot should automatically appear in thestation in a few seconds.

4.    The online library can be closed once the robot is loaded

Tip:Selecting reset filter in the online library will remove any filter thatwas used.

Tip: Alternatively,it is also possible to download the robot files (.robot extension) separately,from the website: http://robodk.com/libraryand open them in RoboDK by drag & dropping the file to the main window orby selecting FileOpen.

Note: Everytime a new robot is loaded in RoboDK, a new reference frame is addedrepresenting the robot base frame.

Note: Loadingrobots from the online library will store them in the local library. Thedefault location of this folder is: C:/RoboDK/Library/.


Add a Reference Frame

A Reference frame allows placing objectswith respect to a robot or with respect to other objects in the 3D space(including position and orientation).

Note: Moreinformation about reference frames in RoboDK in the reference frames section.

To add a new reference frame:

1.   Select Program

Add Reference Frame         
Alternatively, select the equivalent button in the toolbar

2.   Double click the reference frame (on the tree or on the 3D geometry onthe main screen) to enter the coordinates shown in the image (X,Y,Z positionand Euler angles for the orientation). The mouse wheel can be used on top ofeach case to quickly update the position of the reference frame on the mainscreen.           
The following colors are used by default:

o   X coordinate Red

o   Y coordinate Green

o   Z coordinate Blue

o   1st Euler rotation Cyan

o   2nd Euler rotation Magenta

o   3rd Euler rotation Yellow

Tip: SelectToolsOptionsDisplayDisplay XYZ axis letters to see the Coordinate system axes.

3.   Select View➔Makereference frames bigger (+) to increase the size of the reference frames

4.   Select View➔Makereference frames smaller (-) to decrease the size of the reference frames

5.   Select View➔Show/Hidetext on screen (/) to show or hide the text on the screen

6.   Optionally, rename any reference frame or object in the tree byselecting F2

If more than one reference frame is used,it is possible to drag and drop them inside the Station Tree to match thedependency that exists in the real setup. For example, the reference Frame 2may be placed with respect to the robot base reference. In this case, if theUR10 Base reference is moved, the Frame 2 is also moved with it. It isimportant to take this into account if other robots or reference frames areused. The next image shows the difference in dependency.

Tip: Dragand drop reference frames (or any other items) in the tree holding the mouseright click to reorder the items in the Station Tree (before other items, afteror as nested items).

Even if the dependency is different, it isstill possible to enter or retrieve the coordinates of any reference frame withrespect to any other reference frame, as shown in the next image. Most robotcontrollers require the coordinates of the reference frame with respect to therobot base frame.

Reference frames can also be moved in themain screen by holding the Alt key, or selecting the corresponding buttonin the toolbar

. Then, drag the reference with themouse on the screen. As the reference is being moved, the correspondingcoordinate values will be updated.

Import 3D objects

RoboDK supports most standard 3D formatssuch as STL, STEP (or STP) and IGES (or IGS) formats. Other formats such asWRML, 3DS or OBJ are also supported (STEP and IGES are not supported on Mac andLinux versions). To load a new 3D file:

1.   Select File

Open

2.   Select the object Object Inspection available in RoboDK’s defaultlibrary:
C:/RoboDK/Library/Object Inspection.

3.   Alternatively, drag & drop files into RoboDK’s main window to importthem automatically

4.   Drag & drop the object to the reference frame Frame 2 (insidethe station tree)

Tip: Drag& drop the object by holding the right click to reorder items inside thetree.

Important: Itis important to place the object nested in the reference frame to teach thetargets with respect to the object. Then, if the reference frame is moved thetargets are moved together with the object.

Tip: Forlarge STEP or IGES files it is possible to accelerate import speed byselecting:  
Tools
OptionsCADFast import settings. More information available in the STEP/IGES section.

Tip:Although objects can be moved with respect to the reference frame they areattached to (by double clicking the object and entering the coordinates), it isrecommended to maintain them always with respect to the given reference frameand move the reference frame instead. This allows matching the object referenceproperly by just updating the reference frame from/to the robot controller.

 

Create a TCP

New tools can be created in RoboDK frompreviously loaded 3D geometry:

1.   Select File

Open (as described in the previous section)

2.   Select the Paint gun.stl file to add it as an object (it will be addedat the robot base frame)

3.   Drag & drop the object to the robot item inside the station tree asshown in the next image

New tools can be loaded or saved as a .toolformat.

 

By default, RoboDK will define the TCP atthe position [X,Y,Z]=[0,0,200] mm. This can be changed by entering thecoordinates manually and/or by moving the TCP holding the ALT+Shift key asshown in the next image:

1.   Hold ALT+Shift or select the highlighted button from the toolbar

2.   Select the light blue plane (XZ plane of the TCP) and drag the TCPapproximately towards the surface of the spray gun, as shown in the next image

3.   Select the Green rounded arrow (rotation around the Y axis) to make theZ axis point outwards

4.   Once an estimate of the coordinates is obtained it is possible to touchup these values manually by double clicking the Paint gun object. The mousewheel can be used on top of each case to quickly update the position on themain screen.

Note: Theseare estimate values according to the 3D drawings. If the definition of the TCPis calibrated on the robot it is possible to import it by pasting thecoordinates in that box.

At this point, the station can be saved:

1.   Select File

Save Station (Ctrl+S)

2.   Save the file as Paint Test.rdk. The Window title and the Station namewill be updated

Note: Thefollowing 2 subsections are optional and show hypothetical situations thatrequire defining the TCP in different ways. The modifications in thesesubsections will not be used in the following steps of this example. To continuewith this example, continue with the section showing how to create targets.

Set a relative TCP

It is possible to place a second TCP withrespect to the first one, for example, to define a given standoff or to place acutter with respect to a spindle TCP.

These steps assume that a second TCP mustbe added with respect to the first one at 150 mm along the Z axis:

1.   Right click the robot

2.   Select

 Add Tool (TCP). A new itemcalled Tool 2 will appear.

3.   Double click this new TCP

4.   Select Tool Center Point with respect to ➔Paint gun

5.   Enter the coordinate Z to 150 mm and set the other translations androtations to 0.

This new TCP relative to the previouslydefined TCP will be removed in the next sections of this demonstration.

Move the Tool geometry

The geometry of the tool might not bealigned properly with respect to the robot flange (adaptor reference frame)when it is loaded in RoboDK. The following steps assume that a mistake was madeand the tool was mounted 180 degrees around the Z axis, so the followingcorrection should be applied:

1.   Select More options in the Tool details window

2.   Enter 180 in the yellow case (Z rotation) of the paint gun geometry, asshown in the following image. The mouse wheel can be used on top of each caseto quickly update the position on the main screen.

Tip: If theTCP was defined before this operation, the TCP won’t match the geometryanymore. To update the position of TCP to the right location we could followthe steps described at the beginning of thissection (by holding the Alt key or entering the values manually).Alternatively, we could rotate the TCP around the robot flange by selecting theCustom Pose representation method (as shown in the next image) andinsert the Z rotation pre-multiplying the TCP definition (at the beginning ofthe TCP line definition).

Note: Moreinformation about how to provide transformations and poses available in the reference frames section.

Create Targets

Robot positions are recorded as Targets.Follow these steps to create two targets as a new home target and approachtarget respectively:

1.   Double click the robot to show the robot panel

2.   Select Paint gun as the Tool Frame. Once a tool or a reference framebecomes active it will show a green dot.

3.   Select Frame 2 as the Reference Frame

4.   Hold the Alt key and move the robot by dragging it through theTCP or the robot flange to a safe position, free of collisions with any objects.Alternatively, move the coordinates of the Tool Frame (TCP) with respect to thereference Frame.

5.   Use the Other configurations section to switch between differentrobot configurations and make sure that none of the robot axes are close to theaxis limits.

Tip: Ingeneral, it is better if the first target of a program has the joint axes ascentered as possible (the joint sliders are as centered as possible, as shownin the following image). This makes sure that the robot won’t reach the axislimits as it follows linear moves along the program. This is possible bychanging the robot configuration.

6.   Select Program

Teach Target (Ctrl+T), or the correspondingbutton in the toolbar (as shown in the image). The target will be placed as adependency of the active reference frame and will automatically remember thecurrent robot position (cartesian and joints axes).      
In this example, the robot joint coordinates used for the first target are:[-150, -75, -90, -60, 70, 110] deg. These values can be copied from this textand
 pasted in the Joint axis jog ofthe robot panel using the corresponding button.

Note: Selectinganother reference frame will place the new target in that reference frameinstead.

7.   Rename the first target as Home by pressing F2.Alternatively, select Tools➔Renameitem.

8.   Move the robot closer to one edge of the part (by dragging the toolusing the Alt key, entering coordinates or jogging the axis manually)    
In this example we used the following robot joint coordinates[0,0,200,180,0,180] deg.

9.   Select Program

Teach Target (Ctrl+T) or theappropriate button in the toolbar to create a new target

10. Rename the target to Approach as shown in step 7

11. Select the Home target and the Approach target alternatively to see therobot moving between the two targets

12. Right click the target and select Teach Current Position (Alt+doubleclick) if a different position needs to be recorded for one of the targets

13.  Rightclick the target and select

 Target Options… (F3) to openthe target options window shown in the next image

If required, provide different values todefine the targets.

Add an Approach Program

Follow these steps to create a program thatmoves from the Home target to the Approach target:

1.   Select Program

Add Program from the menu or thecorresponding button in the toolbar (as shown in the next image)

2.   Rename the program to ApproachMove

3.   Select the Home target

4.   Select Program

Move Joint Instruction (or thecorresponding button in the toolbar)         
Two instructions will be added automatically to tell the robot what tool frameand reference frames we are using

Note: If notarget is selected, a new target will be created at the same location of therobot.

5.   Select the Approach target

6.   Select Program

Move Joint Instruction again

Double click the ApproachMoveprogram and it will execute the program simulation. The simulation bar and anestimated cycle time will be displayed.

Note: Moreinformation about how to add robotprograms and instructionsis available in the robot programsection.

Create Targets on Surface

The Create Targets on Surface feature, isuseful for applications such as painting or inspection:

1.   Select Program

Teach Target(s) on Surface (Ctrl+Shift+T)

2.   Move the mouse cursor over the part to see a preview of what the robotlooks like when it reaches the part

3.   Select a few points on the object (left click). Each mouse left clickwill define a new target keeping the Z axis of the TCP normal to the surface(perpendicular to the surface).

4.   If necessary, adjust the orientation around the Z axis by moving thewheel on the left panel or pressing the left/right keys.

5.   Hold Alt to move an existing target

6.   Hold Alt+Shift to move an existing target while keeping it on thesurface

7.   Select Esc key or right click on the screen and select Done toexit the Create Targets on Surface mode

Once the targets have been created,generate a program following these steps:

1.   Select all the targets created on the surface and right click

Tip: Holdthe Ctrl key to select multiple targets. Alternatively, select the Target 3, holdshift, then select Target 10 to select all targets between Target 3 and Target10.

2.   Select Rename group from the pop up menu

3.   Enter Top Paint. All selected targets will be renamed andnumbered.

4.   Right click on the targets again and select Create Program. A newprogram will be generated. The first movement will be a joint move andfollowing movements will be linear.

5.   Select F2 to rename the program to PaintTop

6.   Double click the PaintTop program to see the simulation movingalong the targets

7.   If required, reorder the movements by dragging the move instructionsinside the program

Add a Retract Program

Similar to the previous operations:

1.   With the robot placed at the last target, move the robot upwards byincreasing the Z coordinate of the TCP with respect to the reference frame inthe robot panel (highlighted case in the next image)

2.   Select Program

Add Program, or the appropriatebutton in the toolbar.

3.   Select Program

Move Linear Instruction, orthe appropriate button in the toolbar
. Rename it to Retractby pressing F2 key.

4.   Select the Home target

5.   Select Program

Move Joint Instruction. A new moveinstruction will be added, linked to the Home target.

Simulate each program individually by doubleclicking it. The simulation can be accelerated by holding the Spacebar key orselecting the Fast Simulation button

/
.

Main Program

A main robot program can execute theapproach, paint and retract programs sequentially:

1.   Select Program

Add Program

2.   Select Program

Program Call Instruction

3.   Enter the name ApproachMove or select Select program toautomatically select it

4.   Select OK

5.   Repeat the previous steps for PaintTop and Retract asshown in the next image

Double clicking the Main Program will runthe complete simulation. Right click the Main Program and select Loop tomake it simulate in a loop.

Tip:Multiple lines can be typed when providing the program name as a program call.Each line will be converted to a new program call instruction.

If the reference frame Frame 2 ismoved (for example, by holding Alt key and dragging the X/red axis of thereference frame), the object and targets will follow. If the targets become notreachable, a small warning sign will be displayed on the target icon

 as shown in the next image.

Tip: Select ViewShow/hiderobot workspaces (*) to display the robotworkspace.

Export simulation

It is possible to export simulations as a3D HTML or 3D PDF as well as distribute your station as a simplified version ofRoboDK (RoboDK Viewer).

Note: Exportingas 3D PDF is not available on Mac and Linux versions,

3D HTML and 3D PDF documents can begenerated following these steps:

1.   Right click the Main Program

2.   Select

 Export Simulation…

3.   Select Start. The program will start and the simulation willrecord until the program is completed.

4.   Save the file. After the file is saved it will be automatically openedto preview it.

HTML and PDF simulations are saved as onesingle file. Compressing an HTML file will remarkably reduce its size. PDFsimulations must be opened with Acrobat Reader. Exporting PDF format isavailable for Windows platforms only.

The following links are examples of 3D HTMLsimulations:

o  https://robodk.com/simulations/UR-Paint.html

o  https://robodk.com/simulations/Welding-3-Fanuc-Robots.html

o   https://robodk.com/simulations/Robot-Drawing.html

And the following links are examples of 3DPDF simulations:

o   https://robodk.com/simulations/UR-Paint.pdf

o   https://robodk.com/simulations/Welding-3-Fanuc-Robots.pdf

o   https://robodk.com/simulations/Milling-with-External-Axes.pdf

Another way of exporting 3D simulations isby generating a self-extracting EXE file or a ZIP file with a reduced versionof RoboDK (available for Windows version only), as shown in the next image.

Note: Thisoption is not available for Mac and Linux versions,

To generate this file:

1.   Select File

Make a demo station

2.   Select the preferred output (ZIP or EXE format)

3.   Select Generate file

After a few seconds, it will generate thedesired file (20 MB) which is a simplified version of RoboDK. The station willautomatically be loaded on start.

Generate Robot Program

It is possible to export any programindividually or the main program including the subprograms:

1.   Right click a program (MainProg for example)

2.   Select Generate robot program (F6)          
Alternatively, select Generate robot program… to specify the location tosave the file

3.   The SCRIPT program for UR robot will be displayed in a text editor

This file is the result of generating theprogram offline. The file can be sent to the robot controller to run the samemovements that were simulated in RoboDK.

Tip: If weare properly connected to the robot we can also select one of the followingoptions in the same menu:

o   Select Sendprogram to robot (Ctrl+F6) to send the program through FTP (OfflineProgramming)

o   Select Starton robot (F8): to send the program to the robot and execute it (OfflineProgramming)

o   Check theoption Run on robot to run the program step by step each time we run theprogram (Online Programming). This allows executing the program on the robot asit is simulated at the same time. Robot drivers are required for OnlineProgramming.

Tip: OfflineProgramming with RoboDK involves using a post processor that defines the syntaxused to generate each program. RoboDK provides many post processors to supportdifferent brands. More than one post processors might be available for aspecific robot controller.

It is possible to change the post processorfor UR robots and customize the way a program is generated:

1.   Right click a program or a robot

2.   Select

 Select Post Processor

3.   Select Universal Robots

Note: PostProcessors that have a black icon can be modified by selecting ProgramAdd/Edit PostProcessor.

Generate the program again. In thisexample, the default post processor uses joint values to define each linearmove and the second post processor uses cartesian coordinates to define eachlinear move.

Using Macros

The RoboDK API allows customizing thesimulation as much as desired. By default, RoboDK installs Python and a set ofsample macros that allows a higher level of customization. This includes simulatinga paint gun, programming robots through Python, simulating 2D cameras,converting SVG files to robot programs, automatically setting a TCP given astandoff, simulating discrete events and much more. Other programming languagescan also be used, such as C# or Matlab. For more information visit: https://robodk.com/doc/PythonAPI/intro.html

In this example, we will add an existingsample macro that will simulate the behavior of the paint gun. We will alsorecolor the spray volume with a transparent color (by selecting ToolsChange colortool - Shift+T) or load the existing model withappropriate colors (available from the local library as paint_gun.toolor the online library, note that the Set Tool instruction might need to beupdated to link to the new tool).

1.   Select File

Open to open a new Pythonmacro (py file)

2.   Navigate to C:/RoboDK/Library/Macros/ to see some sample macros

3.   Select SprayOn

4.   Select Open. A new Python object

 will beadded. This macro allows simulating particle deposition modeling the sprayvolume.

5.   Double click the SprayOn macro to test it

6.   Select On to activate it

7.   Hold Alt key, drag the robot flange and move the robot along the surfacewith the Paint gun.       
You should see the trace of the paint gun. The color and transparency shouldchange depending on how close or far the TCP is from the surface.          
Select Esc once to clear the simulated paint.

8.   Double click the same SprayOn program and select Off toturn the particle simulation Off.

To better understand what happens behindthe scenes, it is possible to view or edit the Python code the following way:

1.   Right click

 SprayOn

2.   Select Edit Python Script

A new window (text editor) will appearshowing the code that models the spray behavior and how Python is integratedwith RoboDK.

To take the spray simulation into accountin the main program we can follow these steps:

1.   Select the instruction Call ApproachMove

2.   Select Program

Program call Instruction, a newinstruction will be added after the first program call and a new window willpop up

3.   Enter SprayOn(1)

4.   Select OK

5.   Repeat the same operation after the PaintTop program setting SprayOn(0),as shown in the following image.
If necessary, reorder the instructions by drag & dropping them within theprogram.

6.   Run the MainProg program. After two iterations, the result shouldlook like as shown in the image (simulating at normal speed).

It is also possible to add new macros:

1.   Select Program

Add Python Program

2.   Right click the new program and select Edit Python Script

Next: RoboDKsupports setting the robot speed within the program, setting digital outputs,waiting for digital inputs, displaying messages, etc. These instructions areavailable under the Program menu.

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
TCP Frame
学FANUC机器人视觉功能,不能错过的保姆级教程!
机哥教你,如何编写Fanuc机器人程序!
RobotFramework之关键字
LigerUi中GRID嵌入下拉框(select)示例!
数据包解析(基于wireshark)
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服