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 Program➔Robot 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 Program➔Robot 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 sensitive to robot singularities and axis limits. For example, most robot arms can’t cross a singularity while performing a linear movement. The following image shows an example saying Joint 5 is too close to a singularity (0 degrees). Consider a Joint move instead.

Robot Programs - Image 7

If a linear move is not strictly necessary, right-click the movement instruction and change it to a Joint Move 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 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 Program➔Robot 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 Program➔Robot 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 Program➔Robot 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 Program➔Robot 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 Program➔Robot 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 Program➔Robot 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 Program➔Robot 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

Simulation event

You can create specific events meant for simulation by using a simulation event instruction. Simulation events have no impact on the real robot or the generated robot program.

Select Program➔Simulation Event Instruction to add a custom simulation event. This type of instruction will provoke a specific event only for simulation purposes, such as attaching one object to a gripper, dropping it to a table or creating objects to simulate a feeder.

You can use the user interface to trigger the actions as simulation events:

1.Attach an object to a tool.

2.Detach an object from a tool and drop it to a coordinate system.

3.Show one or more objects or tools.

4.Hide one or more objects or tools.

5.Set the absolute position of one or more objects or reference frames.

6.Set the relative position of one or more objects or reference frames.

7.Set the robot joints to home.

8.Move conveyor.

9.Create object.

10.Delete objects.

11.Wait for object.

Robot Programs - Image 30

By combining the right simulation events you can create simulations with the user interface for material handling or move objects through conveyors in the simulation as desired.

Robot Programs - Image 31

Attach object

The attach object simulation event allows you to attach one object to a tool to simulate a pick action.

When the action to attach an object to a tool is triggered, the closest object to the selected tool will be attached. A default tolerance of 200 mm is used to ignore any objects farther than this distance.

Robot Programs - Image 32

If you don’t specify a distance tolerance, the global default value will be used (you can change the global default in Tools➔Options➔Maximum distance to attach an object to a robot tool). Also, by default, the distance is checked from the TCP location to the object reference. Alternatively, it is possible to use the distance between the TCP and the object geometry by selecting Check shortest distance between TCP and the object shape.

Detach object

The detach object simulation event allows you to detach an object from a tool to another object or coordinate system.

You should choose the tool where the objects should be detached from and the coordinate system or object where the objects should be attached to afterwards.

The detach object simulation event allows you to simulate a place/drop operation in a plick and place application (performing the opposite action of the attach event).

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 drop the grabbed objects, you can trigger a Detach object event to leave any objects the robot tool has grabbed.

Robot Programs - Image 33

Show objects or tools

The show objects or tools event allows you to make one or more objects, tools or robots visible within the simulation environment.

You can select one or more items by holding the Ctrl key.

Robot Programs - Image 34

Hide objects or tools

The Hide objects or tools event allows you to make one or more objects or tools invisible within the simulation.

You can select one or more items by holding the Ctrl key.

Robot Programs - Image 35

Set the absolute position

The Set object position (absolute) allows you to update the position of every object you selected when this action is triggered. The parent reference that each item is attached to is not modified. Only the position of each object is updated.

You can select one or more items by holding the Ctrl key. The current position of the item is recorded when you press OK.

Robot Programs - Image 36

Set the relative position

The Set object position (relative) allows you to update the position and parent of every object you selected when this action is triggered. The parent reference that each item is attached to is also modified and the position of each object is also updated.

You can select one or more items by holding the Ctrl key. The current position of the item and the parent item it is attached to is recorded when you press OK.

The difference between this instruction and the absolute position instruction is that this instruction also updates the parent item that each object is attached to.

Robot Programs - Image 37

Set the robot to home

The set joints to home event triggers the selected robot or mechanisms to move to its defined "home" joint positions immediately (the movement is not simulated over time).

This is useful when you need to reset a simulation and place the conveyors at the start position.

You can select one or more items by holding the Ctrl key.

Robot Programs - Image 38

Move conveyor event

The move conveyor event simulates moving the conveyor by a specific distance, simulating the effect of the movement over time.

This is useful when you need to simulate a specific increment for processing an object on the conveyor once it moves a specific distance.

Robot Programs - Image 39

Create object

The Create object instruction allows you to simulate a feeder by creating a new object in the simulation environment.

You should select the model object to create and the parent reference where the items should be attached to.

This action is useful to create new objects in a conveyor.

Robot Programs - Image 40

Delete objects

The Delete objects instruction removes objects from the simulation environment.

You should select a model object that you would like to delete. Any object that matches the name and geometry of the same object is deleted when this action is triggered. The model object selected and any locked objects are not removed.

This instruction helps clean up a simulation that has finished and you have many objects that were created by the Create object instruction.

Robot Programs - Image 41

Wait for object

The Wait for object instruction waits for an object to be in contact with another object to trigger a specific action.

This event is useful when you want to trigger. It is common to place this instruction by itself in a program running in a loop that performs a specific action when an object is in contact with a sensor.

Robot Programs - Image 42

The actions you can perform when an object is in contact with the sensor are the following:

1.Stop a robot: you should select the robot or mechanism that should stop.

2.Delete an object: the object should be removed from the station.

3.Wait for the object only (for example, you can trigger a robot to pick an object).

4.Move an object to another coordinate system. For example, to attach an object from one conveyor to another.

Robot Programs - Image 43