开始

This getting started guide will help you create a simple project in RoboDK for robot simulation and offline programming. This example shows how you can simulate and program a robot arm for a robot painting application.

This example also provides an overview of basic robot concepts, such as how to use reference frames, tools and targets.

The examples section provides more examples for many different applications. For example:robot machining,polishingorwelding.

New project

All robots, objects and tools used in a RoboDK project are saved as a RoboDK station (RDK file). A RoboDK station contains all settings related to robots, tools, reference frames, targets, objects and other parameters. The RoboDK station is stored in one file (RDK extension).

It is not required to keep a separate copy of the robot files, tools and objects as they are saved as one RDK file.

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

1.Download and install RoboDK from the website://www.jasonament.com/download

2.Double click the shortcut on the Desktop开始- Image 1

3.If other stations are open:
selectFile
开始- Image 2New Station (Ctrl+N)to start a new project

开始- Image 3开始- Image 4

Multiple RoboDK projects can be open at the same time. Double clicking the Station icon开始- Image 5in the tree will activate and display that project.

Select a robot

New robots can be added to your project from your PC or from RoboDK’s online library.

Follow these steps to choose a robot from the online library:

1.SelectFile开始- Image 6Open online library(Ctrl+Shift+O). A new nested window will appear showing the online library
It is also possible to select the corresponding button in the toolbar.开始- Image 7

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 m reach).

3.SelectDownload.The robot should automatically appear in the station in a few seconds.

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

开始- Image 8

Add a Reference Frame

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

To add a new reference frame:

1.SelectProgram开始- Image 9Add Reference Frame
Alternatively, select the equivalent button in the toolbar

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

X coordinateRed

Y coordinateGreen

Z coordinateBlue

1st Euler rotationCyan

2nd Euler rotationMagenta

3rd Euler rotationYellow

3.SelectViewMake reference frames bigger (+)to increase the size of the reference frames

4.SelectViewMake reference frames smaller (-)to decrease the size of the reference frames

5.SelectViewShow/Hide text on screen (/)to show or hide the text on the screen

6.Optionally, rename any reference frame or object in the tree by selectingF2

开始- Image 10

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

开始- Image 11

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

开始- Image 12

参考frames can also be moved in the main screen by holding theAltkey, or selecting the corresponding button in the toolbar开始- Image 13. Then, drag the reference with the mouse on the screen. As the reference is being moved, the corresponding coordinate values will be updated.

开始- Image 14

Import 3D objects

RoboDK supports most standard 3D formats such as STL, STEP (or STP) and IGES (or IGS) formats. Other formats such as VRML, 3DS or OBJ are also supported (STEP and IGES are not supported on Mac and Linux versions).

Follow these steps to load a new 3D file:

1.SelectFile开始- Image 15Open

2.Select the objectObject Inspectionavailable in RoboDK’s default library:
C:/RoboDK/Library/Object Inspection.

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

4.Drag & drop the object to the reference frameFrame 2(inside the station tree)

开始- Image 16

开始- Image 17开始- Image 18

Create a Tool

New robot tools (TCPs) can be loaded or created in RoboDK from previously loaded 3D geometry.

Follow these steps to load an object and set it up as a robot tool:

1.SelectFile开始- Image 19Open(as described in theprevioussection)

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

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

New tools can be loaded or saved as a .tool format.

开始- Image 20开始- Image 21

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

1.HoldALT+Shiftor select the highlighted button from the toolbar

2.Select the light blue plane (XZ plane of the TCP) and drag the TCP approximately 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 the Z axis point outwards

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

开始- Image 22

At this point, the station can be saved:

1.SelectFile开始- Image 23Save Station(Ctrl+S)

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

Set a relative TCP

You can reference a tool (TCP) with respect to another one, for example, to define a given standoff or to place a cutter with respect to a reference or tool holder.

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

1.Right click the robot

2.Select开始- Image 24Add Tool (TCP). A new item called Tool 2 will appear.

3.Double click this new TCP

4.SelectTool Center Point with respect toPaint gun

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

开始- Image 25

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

Move the Tool geometry

The geometry of the tool might not be aligned properly with respect to the robot flange (adaptor reference frame) when it is loaded in RoboDK.

The following steps assume that a mistake was made, and the tool was mounted 180 degrees around the Z axis, so the following correction 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, as shown in the following image. The mouse wheel can be used on top of each case to quickly update the position on the main screen.

开始- Image 26

开始- Image 27

Create Targets

Robot positions are recorded as Targets. A Cartesian target defines the position of the tool with respect to a coordinate system. A Joint target defines the position of the robot given robot joint values.

Follow these steps to create two targets as a new home target and approach target 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 frame becomes active it will show a green dot in the tree icon.

3.Select Frame 2 as the Reference Frame

4.Hold theAltkey and move the robot by dragging it through the TCP 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 the reference Frame.

5.Use theOther configurations部分不同机器人configur之间切换ations and make sure that none of the robot axes are close to the axis limits.

6.SelectProgram开始- Image 28Teach Target(Ctrl+T), or the corresponding button in the toolbar (as shown in the image). The target will be placed as a dependency of the active reference frame and will automatically remember the current 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. You can copy these joint values from the text and paste开始- Image 29them in theJoint axis jogof the robot panel using the corresponding button.

开始- Image 30

7.Rename the first target asHomeby pressingF2. Alternatively, selectToolsRename item.

8.Move the robot closer to one edge of the part (by dragging the tool using the Alt key, entering coordinates or jogging the axis manually)
在这个示例中,我们使用以下机器人关节coordinates [0,0,200,180,0,180] deg.

9.SelectProgram开始- Image 31Teach Target(Ctrl+T) or the appropriate button in the toolbar to create a new target.

10.Rename the target toApproachas shown in step 7

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

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

13.Right click the target and select开始- Image 32Target Options…(F3) to open the target options window shown in the next image.

开始- Image 33

If required, provide different values to define the targets.

添加一个方法程序

You can easily create a new program that safely approaches the robot to the part.

Follow these steps to create a program that moves from theHometarget to theApproachtarget:

1.SelectProgram开始- Image 34Add Programfrom the menu or the corresponding button in the toolbar (as shown in the next image)

2.Rename the program toApproachMove

3.Select theHometarget

4.SelectProgram开始- Image 35Move Joint Instruction(or the corresponding button in the toolbar)
Two instructions will be added automatically to tell the robot what tool frame and reference frames we are using.

5.Select theApproachtarget

6.SelectProgram开始- Image 36Move Joint Instructionagain

Double click theApproachMoveprogram and it will execute the program simulation. The simulation bar and an estimated cycle time will be displayed.

开始- Image 37

Create Targets on Surface

The Create Targets on Surface feature is useful for applications such as painting or inspection.

Follow these steps to teach targets using the Teach Target(s) on Surface:

1.SelectProgram开始- Image 38Teach Target(s) on Surface(Ctrl+Shift+T)

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

3.Select a few points on the object (left click). Each mouse left click will 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 the wheel on the left panel or pressing the left/right keys.

5.HoldAltto move an existing target.

6.HoldAlt+Shiftto move an existing target while keeping it on the surface.

7.Select Esc key or right click on the screen and selectDoneto exit the Create Targets on Surface mode

开始- Image 39

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

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

2.SelectRename groupfrom the pop-up menu.

3.EnterTop Paint. All selected targets will be renamed and numbered.

4.Right click on the targets again and selectCreate Program. A new program will be generated. The first movement will be a joint move and following movements will be linear.

5.SelectF2to rename the program toPaintTop.

6.Double click thePaintTopprogram to see the simulation moving along the targets.

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

开始- Image 40

Add a Retract Program

You can easily create a new program that safely retracts the robot from the part to a safe position.

Similar to the previous operations:

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

2.SelectProgram开始- Image 41Add Program, or the appropriate button in the toolbar.

3.SelectProgram开始- Image 42Move Linear Instruction, or the appropriate button in the toolbar开始- Image 43. Rename it toRetractby pressingF2key.

4.Select theHometarget

5.SelectProgram开始- Image 44Move Joint Instruction. A new move instruction will be added, linked to the Home target.

Simulate each program individually by double clicking it. The simulation can be accelerated by holding the Spacebar key or selecting the Fast Simulation button开始- Image 45/开始- Image 46.

开始- Image 47

Main Program

You can easily create a main robot program that executes the approach, paint and retract programs sequentially.

Follow these steps to create the main program:

1.SelectProgram开始- Image 48Add Program.

2.SelectProgram开始- Image 49Program Call Instruction.

3.Enter the nameApproachMoveor select Select program to automatically select it.

4.SelectOK.

5.Repeat the previous steps forPaintTopandRetractas shown in the next image

Double clicking the Main Program will run the complete simulation. Right click the Main Program and selectLoopto make it simulate in a loop.

开始- Image 50

If the reference frameFrame 2is moved (for example, by holding Alt key and dragging the X/red axis of the reference frame), the object and targets will follow. If the targets become not reachable, a small warning sign will be displayed on the target icon开始- Image 51as shown in the next image.

开始- Image 52

Generate Robot Program

Once you have the simulation ready in RoboDK you can easily generate the robot program so you can execute the program on the robot controller without having to write a single line of code.

You can export any program individually or the main program including the subprograms:

1.Right click a program (MainProgfor example).

2.SelectGenerate robot program (F6).
Alternatively, selectGenerate robot program…to specify the location to save the file.

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

The file you obtain is the result of generating the program offline. The file can be sent to the robot controller to run the same movements that were simulated in RoboDK.

SelectSend program to robot (Ctrl+F6)to send the program through FTP (Offline Programming)

Check the optionRun on Robotto run the program step by step each time we run the program (Online Programming). This allows executing the program on the robot as it is simulated at the same time. Robot drivers are required for Online Programming.

开始- Image 53

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

1.Right click a program or a robot.

2.Select开始- Image 54Select Post Processor.

3.SelectUniversal Robots URP.

Generate the program again. In this example, the default post processor uses joint values to define each linear move and the second post processor uses cartesian coordinates to define each linear move.

Using Scripts

You can customize your simulation by using scripts. The RoboDK API allows you to customize the simulation as much as desired. RoboDK integrates with Python and by using a sample script or using the RoboDK API you can improve the result of your simulation.

By default, RoboDK installs Python and a set of sample scripts that allow you to improve simulations. This includes simulating a paint gun, simulating 2D cameras, converting SVG files to robot programs, automatically setting a TCP given a standoff, programming robots using Python, simulating discrete events, etc. Other programming languages can also be used, such as C#, C++ or Matlab. More information is available in theRoboDK API section.

In this example, we will add an existing sample script that will simulate the behavior of the paint gun. You can also change the color of the spray with a transparent color (by selectingToolsChange color tool - Shift+T) or load the existing model with appropriate colors (available from the local library aspaint_gun.toolor the online library, note that the Set Tool instruction might need to be updated to link to the new tool).

1.SelectFile开始- Image 55Opento open a new Python script (py file).

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

3.SelectSprayOn.

4.SelectOpen.A new Python object开始- Image 56will be added. This macro allows simulating particle deposition modeling the spray volume.

5.Double click theSprayOnmacro to test it.

6.SelectOnto activate it.

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

8.Double click the sameSprayOnprogram and selectOffto turn the particle simulation Off.

开始- Image 57

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

1.Right click开始- Image 58SprayOn.

2.SelectEdit Python Script.

A new window (text editor) will appear showing the code that models the spray behavior and how Python is integrated with RoboDK.

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

1.Right click the instructionCall ApproachMove.

2.SelectAdd Instruction开始- Image 59Program call Instruction后,一个新的指令将被添加program call and a new window will pop up.

3.EnterSprayOn(1).

4.Select OK.

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

6.Run theMainProgprogram. After two iterations, the result should look like as shown in the image (simulating at normal speed).

开始- Image 60

It is also possible to create new macros:

1.SelectProgram开始- Image 61Add Python Program.

2.Right click the new program and selectEdit Python Script.

RoboDK supports setting the robot speed within the program, setting digital outputs, waiting for digital inputs, displaying messages, etc. These instructions are available under theProgrammenu.

Baidu
map