Offline Programming

Offline Programming (or Off-Line Programming) means programming robots outside the production environment. Offline Programming eliminates production downtime caused by shopfloor programming. Simulation and Offline Programming allows studying multiple scenarios of a work cell before setting up the production work 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.

Offline Programming with RoboDK

Offline Programming has no limits with RoboDK. RoboDK provides a user friendly Graphical User Interface to simulate industrial robots. Furthermore, with RoboDK's API you can easily program and simulate robots through Python. RoboDK supports many robot controllers and generates the appropriate files for your robot. You can also customize your Post Processor.

Python is a programming language that lets you work faster and integrate your systems more effectively. Python's syntax allows programmers to express concepts in fewer lines of code compared to other languages, making it friendly and easy to learn. The Python 3.4.1 version is automatically installed with the default installer.

Some RoboDK examples with Python are available as well as the RoboDK's API reference for Python. The RoboDK API is also available for C# with a sample project and Matlab.


Offline Programming example:

from robolink import *    # RoboDK's API
from robodk import *      # Math toolbox for robots

# Any interaction with RoboDK must be done through
# Robolink()
RL = Robolink()

# get the robot item:
robot = RL.Item('ABB IRB 1600ID-4/1.5')

# get the home target and the welding targets:
home = RL.Item('Home')
target = RL.Item('Target 1')
# get the pose of the target (4x4 matrix):
ref = target.Pose()

# move the robot to home, then to the center:

# call a robot program to start the weld gun

# make an hexagon around the center:
for i in range(7):
    ang = i*2*pi/6 #ang = 0, 60, 120, ..., 360
    pi = ref*rotz(ang)*transl(200,0,0)*rotz(-ang)

# call a robot program to stop the weld gun

# move back to the center, then home:

Once a simulation works as desired, we can right click the Python program in the main tree ("Hexagonal Path" in this example) and select "Generate robot program". The following program will be generated automatically.

Robot program example output

MODULE MOD_Weld_Hexagon

PERS wobjdata rdkWObj := [FALSE, TRUE, "", [[0,0,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]];
PERS tooldata rdkTool := [TRUE,[[0,0,0],[1,0,0,0]],[3,[0,0,200],[1,0,0,0],0,0,0.005]];
VAR speeddata rdkSpeed := [500,500,500,500];
VAR extjoint rdkExtax := [9E9,9E9,9E9,9E9,9E9,9E9];

PROC Weld_Hexagon()
	!Program generated by RoboDK for ABB IRB 1600ID-4/1.5 on 29/11/2014 17:42:31
	ConfJ \On;
	ConfL \On;
	MoveAbsJ [[-0,-19.143793,-7.978668,0,49.189506,-0]],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveJ [[1010.634,-114.491,662.29],[0,0,1,0],[-1,0,-1,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveL [[810.634,-114.491,662.29],[0,0,1,0],[-1,0,-1,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveL [[910.634,58.715,662.29],[0,0,1,0.00000001],[0,-1,0,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveL [[1110.634,58.715,662.29],[0,0,1,0],[0,-1,0,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveL [[1210.634,-114.491,662.29],[0,0,1,0],[-1,0,-1,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveL [[1110.634,-287.696,662.29],[0,0,1,0],[-1,0,-1,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveL [[910.634,-287.696,662.29],[0,0,1,0],[-1,0,-1,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveL [[810.634,-114.491,662.29],[0,0,1,0],[-1,0,-1,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveL [[1010.634,-114.491,662.29],[0,0,1,0],[-1,0,-1,0],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	MoveAbsJ [[-0,-19.143793,-7.978668,0,49.189506,-0]],rdkExtax], rdkSpeed, rdkZone, rdkTool, \WObj:=rdkWObj;
	ConfJ \On;
	ConfL \On;

Robot Post Processor

The Post Processor defines how the robot programs should be generated. The conversion of the simulator movements to specific robot instructions is done by a Post Processor. Post Processors 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. One Post Processor in RoboDK is simply a Python file that defines how the code should be generated.