Robot Programs

RoboDK is a simulator focused on industrial robot applications. This means that robot programs can be created, simulated and generated offline for a specific robot arm and robot controller. In other words, RoboDK is software for Offline Programming.

To create robot programs, it is required to select a robot, load the robot tools and use one or more CAD to path features to create programs by adding targets or using specific tools (such as converting CNC programs to robot programs).

An extensive library of industrial robots is available. Industrial robots are modelled in RoboDK the same way they behave using vendor-specific controllers, including axis limits, sense of motion and axis linking.

Robot Programs - Image 1

This section shows how robot programs can be created, simulated and generated for a specific robot controller using the RoboDK Graphical User Interface (GUI).

Offline Programming

Offline Programming (or Off-Line Programming) means programming robots outside the production environment. Offline Programming eliminates production downtime caused by shop floor programming (programming using the teach pendant).

Simulation and Offline Programming allows studying multiple scenarios of a robot cell before setting up the production cell. Mistakes commonly made in designing a work cell can be predicted in time.

Offline Programming is the best way to maximize return on investment for robot systems and it requires appropriate simulation tools. The time for the adoption of new programs can be cut from weeks to a single day, enabling the robotization of short-run production.

Create a Program

A simulation can be accomplished by adding a sequence of instructions in a program. Each instruction represents specific code for a specific controller, however, RoboDK offers a Graphical User Interface (GUI) to easily build robot programs, in a generic way, without the need to write code.

The code specific to a robot controller will be generated automatically when the program is generated. To create a new empty program using the RoboDK Graphical User Interface:

1.Select ProgramRobot Programs - Image 2 Add Program
Alternatively, select the corresponding button in the toolbar.

2.Select ToolsRename item… (F2) to rename the program

This action will create an empty program and will allow adding new instructions by right clicking the program or selecting an instruction from the Program menu. The next section Program Instructions provides more information about adding instructions.

Robot Programs - Image 3

Program Instructions

It is possible to add new instructions by right clicking a program or from the Program menu, as shown in the previous section.

This section describes the instructions supported by the RoboDK graphical user interface for robot offline programming.

Joint Move

Select ProgramRobot Programs - Image 4 Move Joint Instruction to add a new joint movement instruction. Alternatively, select the corresponding button in the toolbar.

Unless a target is selected before adding the instruction, the movement instruction will create a new target and they will be linked. If the target is moved the movement is also modified.

If this is the first instruction that is added to the program, two more instructions will be added before the movement instruction: a Reference Frame selection and a Tool Frame selection. This will make sure that when the program reaches the movement instruction the robot is using the same reference and tool frames used to create this new target.

Robot Programs - Image 5

Linear Move

Select ProgramRobot Programs - Image 6Move Linear Instruction to add a new linear movement instruction. Alternatively, select the corresponding button in the toolbar.

Unless a target is selected before adding the instruction, the movement instruction will create a new target and they will be linked. If the target is moved the movement is also modified.

Joint Moves and Linear Moves behave the same way and can be easily switched from one type to the other.

Same as with the Joint Move Instruction, if this is the first instruction that is added to a program, two more instructions will be added before the movement instruction: a Reference Frame selection and a Tool Frame selection.

Contrary to Joint Movements, Linear Movements are sensible to robot singularities and axis limits. For example, 6-axis robots can’t cross a singularity following a linear move. The following image shows an example saying Joint 5 is too close to a singularity (0 degrees). […] Consider a Joint move instead. As shown in the following image.

Robot Programs - Image 7

If a linear move is not strictly necessary, right click the movement instruction and change it to a Joint Instruction.

Robot Programs - Image 8

Alternatively, the target, the TCP or the position of the reference frame must be modified to avoid the singularity.

Set Reference Frame

Select Program Robot Programs - Image 9 Set Reference Frame Instruction to use a specific reference frame. This will update the given reference frame on the controller for the following movement instructions and will change the Active reference frame of the robot in RoboDK for simulation purposes. That means that movement instructions to specific targets (Cartesian targets) will be made with respect to the last reference frame set.

The reference frame is a variable also known as Work Object (ABB robots), UFRAME (Fanuc robots), FRAME (for Motoman robots) or $BASE (for KUKA robots).

Robot Programs - Image 10

Set Tool Frame

Select Program Robot Programs - Image 11Set Tool Frame Instruction to use a specific tool frame (TCP). This will update the given tool frame on the program for the following movement instructions and will change the Active tool frame of the robot in RoboDK for simulation purposes. That means that movement instructions to specific target (Cartesian targets) will be made with respect to the last tool frame set.

The reference frame is a variable also known as ToolData (ABB robots), UTOOL (Fanuc robots), TOOL (for Motoman robots) or $TOOL (for KUKA robots).

Robot Programs - Image 12

Circular Move

Select ProgramRobot Programs - Image 13Move Circular Instruction to add a new circular movement instruction. Alternatively, select the corresponding button in the toolbar.

Unless two targets are selected before adding the instruction, the movement instruction will create no new targets. It is required to add two more targets separately and link them from the circular move instruction, as shown in the next image.

Robot Programs - Image 14

The circular path is an arc created from the point where the robot is located, passing through the first circular point (Target Linked 1) and ending at the end point (Target Linked 2).

Set Speed

Select ProgramRobot Programs - Image 15 Set Speed Instruction to add a new instruction that changes the speed and/or the acceleration. It is possible to specify speed and accelerations in the joint space and in the cartesian space.

Activate the corresponding cases to impose a specific speed and/or acceleration in the program. The robot speed is applied from the moment this instruction is executed.

The robot speed can also be changed in the robot parameters menu: Double click the robot, then, select parameters.

Robot Programs - Image 16

Show Message

Select ProgramRobot Programs - Image 17 Show Message Instruction to add a new instruction that will display a message on the teach pendant.

Robot Programs - Image 18

Pause

Select ProgramRobot Programs - Image 19 Pause Instruction to add a new instruction that will pause the program execution for some time or stop the program until the operator desires to resume the program.

Robot Programs - Image 20

Program call

Select ProgramRobot Programs - Image 21 Program Call Instruction to add a call to a sub program from the current program.

By default, this is a blocking call to a specific program. However, it is possible to switch to Insert Code to enter code specific at the location of this instruction. This might be useful for a specific application and a specific controller.

Robot Programs - Image 22Robot Programs - Image 23

Switch from Program Call to Start Thread to provoke a non-blocking call to a sub program. In this case, the controller will start a new thread. This option is only available for certain controllers and only works for specific operations.

Set/Wait IO

Select ProgramRobot Programs - Image 24 Set or Wait I/O Instruction to change the state of Digital Outputs (DO). By default, this instruction is set to Set Digital Output. This instruction also allows waiting for a specific Digital Input (DI) to switch to a specific state.

The IO Name can be a number or a text value if it is a named variable. The IO Value can be a number (0 for False and 1 for True) or a text value if it is a named state.

Robot Programs - Image 25

Set to Wait for Digital Input to stop the program execution until a specific input changes to a specific value. Furthermore, most robot controllers support a timeout delay to raise an error if the waiting time exceeds a specific value. Check the Timeout (ms) option to activate this feature.

Robot Programs - Image 26

Altering simulated Digital Inputs and Digital Outputs will create new station variables. To check the state of these variables you can right click the station and select Station Parameters. It is also possible to read or modify these variables through the API.

Set Rounding value

Select ProgramRobot Programs - Image 27 Set Rounding Instruction to alter the rounding accuracy. The rounding accuracy used to smooth the edges between consecutive movements. This change takes effect from the moment it is executed inside a program (same as with all the other instructions), so it is typical to set this value at the beginning of a program.

Without a rounding instruction, the robot will reach the speed of 0 at the end of each movement (unless the next movement is tangent with the previous movement). This will provoke high accelerations and quick speed changes to ensure the best accuracy for each movement.

This value is also known as Blending radius (Universal Robots), ZoneData (ABB robots), CNT/FINE (Fanuc robots), Cornering (Mecademic robots) or $APO.CDIS/$APO.CPTP/Advance (KUKA robots).

Robot Programs - Image 28

Some controllers require setting this value as a percentage, for example on a Fanuc controller, if you want to provide the command CNT5 you should enter the value 5.

You can also specify the rounding parameter in the Program Events window if you are generating your programs for robot machining, 3D printing or curve/point following.

Robot Programs - Image 29

RoboDK’s path accuracy tests may allow to have a better understanding of the effects of different rounding strategies.

Simulation event

Select ProgramRobot Programs - Image 30 Simulation Event Instruction to provoke a specific simulation event. Simulation events have no impact on generated code and are used only to provoke a specific event for simulation purposes.

Simulation events using the graphical user interface allow you to:

   attach or detach objects to robot tools

   show or hide objects or tools

   change the position of objects and reference frames

Robot Programs - Image 31

For example, if the robot moves to a specific location to grab an object we can set up an Attach object event to move that object together with the robot. Then, after the robot has moved and it is ready to leave the objects we can set up a Detach object event to leave any objects the tool has grabbed.

Robot Programs - Image 32

Simulate Program

Double click the program Robot Programs - Image 33 to start the program simulation.

Alternatively:

1.Right click the program

2.Select Run

A simulation bar will appear at the bottom if the program is double clicked. It is possible to slide the simulation to move the simulation forward or backwards using the simulation bar.

Robot Programs - Image 34

RoboDK simulates 5 times faster than real time by default. That means that if a program takes 30 seconds to execute it will be simulated in 30/5=6 seconds. Speeding up the simulation increases this ratio to 100. Normal and fast simulation speeds can be changed in the ToolsOptionsMotion menu.

Robot Programs - Image 37

Generate Program

When you have a program ready to be exported to the robot you can generate the program file required by your robot controller.

Follow these steps to generate a robot program:

1.Right click a program.

2.Select Generate Robot Program (F6).

You should then see the robot program displayed in a text editor.

Robot Programs - Image 38

Robot programs are saved in the Documents folder by default (C:/Users/Your Name/Documents/RoboDK/Programs/). You can change this folder by selecting ToolsOptions, select the Program tab and click on Set right beside the Robot programs folder.

Alternatively, you can also right click a program and select Generate Robot Program as … (Shift+F6) to generate the program specifying the location where you would like to save it.

Transfer Program

It is possible to transfer a program from the computer directly to the robot. This option usually sends the program to the robot through FTP protocol or other specific protocols, such as using socket messaging or serial connection. First, it is required to enter the robot IP and FTP settings in the robot connection menu:

1.Right click a robot.

2.Select Connect to robot… A window will appear on the left.

3.Enter the robot IP.

4.Select More options to enter the FTP settings and FTP credentials (if required)

Robot Programs - Image 39

Once the network settings have been provided and the robot is properly connected, follow these steps to transfer the program to the robot directly from RoboDK:

1.Right click a program.

2.Select Send program to robot (Ctrl+F6).

A popup window will display the status (success or failed).

Select Post Processor

The conversion from the RoboDK simulation to a specific robot program is done by a Post Processor. The Post Processor defines how robot programs should be generated for a specific robot. Each robot has a specific/default post processor by default in RoboDK.

To select a specific post processor for a robot:

1.Right click a robot or a program.

2.Select Select Post Processor.

3.Choose a post processor from the list.

4.Select OK.

Robot Programs - Image 40    Robot Programs - Image 41

The change is now applied, and you can program can be generated again to see the result.

Post Processors in RoboDK provide complete flexibility to generate the robot programs for specific requirements. RoboDK provides Post Processors for most robot brands. Post processors can be easily created or modified. More information about post processors in a dedicated section for post processors.

Program generation settings

You can customize the way you generate programs for your robot.

Follow these steps to see the program generation settings:

1.Select ToolsOptions.

2.Select the Program tab.

Robot Programs - Image 42

This menu allows you to customize program generation, such as:

1.Split joint movements into smaller steps.

2.Split linear movements into smaller steps.

3.Convert circular movements to small linear movements.

4.Split large robot programs into subprograms.

5.Specify the default location to save your robot programs.

6.Specify the default text editor for robot programs.

Convert circular to linear movements

You can easily convert circular moments into small linear movements when you generate programs for your robot. This is useful if your controller does not support arc movements.

Follow these steps to generate arcs as small linear movements:

1.Select ToolsOptions.

2.Select the Program tab.

3.Select Avoid arcs.

4.Specify the Maximum arc size (mm) which defines the size of the linear movements along the arc.

Robot Programs - Image 43

Split large robot Programs

Large robot programs can exceed your robot controller limitations. The controller limitations can be the file size or the number of lines per program. For example, a robot program made for robot machining or 3D printing can thousands of lines of code.

In this case it is better to split such a long program in smaller sub programs, including one main program that runs the subprograms.

Follow these steps to automatically split a long program:

1.Select ToolsOptionsProgram.

2.Check Limit the maximum number of lines per program and provide the desired maximum of lines per program to generate per file.

Robot Programs - Image 44

Inline subprograms

When you generate a program that calls a subprogram, RoboDK will automatically create an instruction to call  that subprogram. On the other hand, you can customize program output to inline subprograms directly on your main program and prevent program calls.

Follow these steps to inline sub-programs to avoid calling offline programs by following these steps:

1.Select ToolsOptions.

2.Select the Program tab.

3.Check the option Inline subprograms.

From now on, when you generate programs that contain subprograms you will obtain the contents of these subprograms directly in the first/main program.

Robot Programs - Image 45

Post processors vs Drivers

Post processors and robot drivers use different methods to move robots. While a post processor allows you to generate programs offline, a driver allows you to have real time communication with your robot.

A post processor is used for offline programming and is responsible for converting the RoboDK robot program into the native programming language of the associated robot controller. For instance, the ABB post processor generates .mod files for IRC5 controllers. The post processor also includes program uploading to the robot controller, often by FTP. The following functionalities of a program are handled by the post processor:

1.Generate Robot Program

2.Generate Robot Program as…

3.Send Program to Robot

4.Start on Robot (in combination with the driver)

Robot Programs - Image 46

A robot driver enables remote control of your robot from your computer using RoboDK. This allows you to execute program instructions from RoboDK on the robot controller in real time. This includes the ability to call remote programs on the controller. For example, the ABB driver sends motion commands through socket communication. The following functionalities are handled by the driver:

1.Activate the option Run on Robot, then double click to run the program on the robot using the driver.

2.Start on Robot (in combination with the post processor)

Robot Programs - Image 47