Post Processors

Post Processors

Post Processors are a key step in Offline Programming because they allow flexibility to support any robot controller. A robot post processor defines how robot programs must be generated for a specific robot controller.

The conversion from the RoboDK simulation to a specific robot program is done by a Post Processor. Each robot has a post processor assigned to it by default. The post processor is used when the program is generated offline, as shown in the Generate Program section (by right clicking a program, then, selecting Generate Robot Program).

RoboDK comes with many post processors supporting many robot controllers, listed in the Available Post Processors section. Alternatively, it is possible to create customized post processor or modify an existing post processor. All available post processors are in the folder:

C:/RoboDK/Posts/

One post processor is a PY file (each post processor is defined by a Python script). It is possible to manually add, modify or delete the files in the Posts folder of RoboDK. If you have been provided a RoboDK post processor (PY file) it should be placed in the Posts folder so that it can be selected from RoboDK.

This section shows how to select, edit or create a post processor and use it with your robots in RoboDK. A quick introduction is available in the following video: https://www.robodk.com/help#PostProcessor

Note: Most robot brands have different controller versions. It is important to select the right post processor to generate appropriate robot programs supported by a specific robot controller.

Important: Each robot has a specific post processor assigned to it by default. The default selection might not generate appropriate programs for a specific robot controller. In that case it is required to select the post processor for the right robot controller.


 

Select a Post Processor

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.

Post Processors - Image 1    Post Processors - Image 2

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

Note: The selection of a Post Processor is linked to a specific robot. Changing the post processor of a program will update the post processor for all programs linked to the same robot.

As an alternative, it is also possible to select the post processor by following these steps:

1.    Open the robot panel (double click a robot)

2.    Select Parameters

3.    Select your post processor in the Robot brand box, as shown in the following image.

Tip: It is possible to quickly preview the output of each post processor by double clicking its PY file in the C:/RoboDK/Posts/ folder. More information available in the next section.

Post Processors - Image 3


 

Modify a Post Processor

It is possible to modify existing post processors or create new post processors. Post processors must be placed in the folder C:/RoboDK/Posts/ so that they can be selected in RoboDK. The previous section describes how to link a specific robot to a post processor.

Each post processor is one PY file. It is possible to rename the file or copy files from/to the C:/RoboDK/Posts/ folder to share different post processors. To delete an existing post processor script, simply delete the corresponding PY file in the Posts folder.

Post processors can be edited using any text editor or a Python editor (Python IDLE). Using the Python editor allows to quickly debug and evaluate a sample program at the end of the file.

Video: Overview of post processors: https://www.youtube.com/watch?v=lbycCDjtOnE.

Python should be installed to test and use the post processors properly (Python is installed by default with RoboDK).

To modify an existing post processor:

1.    Select Program➔Add/Edit Post Processor

2.    Select an existing post processor

3.    Select OK. A text editor will open and the program.

4.    Select Run➔Run module (F5) to preview the result. Make any changes if necessary.

Post Processors - Image 4

Alternatively, it is possible to edit a post processor manually:

1.    Go to the post processors folder: C:/RoboDK/Posts/

2.    Open a PY file with Python IDLE (right click ➔ Edit with IDLE) or other text editor

3.    Make the desired changes

4.    Run the file to test the result: Select Run➔Run module (F5 by default) from Python IDLE.

Alternatively, it is possible to edit this file using a text editor and run it with Python by double clicking it.

Post Processors - Image 5

Tip: It is possible to change the default editor for post processors in RoboDK by selecting ToolsOptionsOther and providing the editor path in the Python editor command.

Important: If a text editor such as Notepad++ is used, it is important to replace tabs by 4 spaces. Otherwise, we will get a TabError saying that there is an inconsistent use of tabs and spaces in indentation.


 

Modification Example

This section shows how to make a small change for an existing post processor.

As an example, the following changes will be made to existing ABB and KUKA post processors:

   Set a joint movement to generate the motion command using joint angles information.

   Override the maximum speed to 500 mm/s. Even if the robot is programmed to move faster, the speed will be limited to 500 mm/s in the post processor.

   Generate each program as a separate file and force programs to have 3000 lines of code per program at most. Large programs will be divided into smaller programs and called sequentially.

The previous section shows how to open an existing post processor for editing:

1.    Select Program➔Add/Edit Post Processor

2.    Select your post processor. For example, for KUKA KRC4 select KUKA_KRC4.

3.    Select OK. The post processor will be shown in the Python IDLE editor.

The following sections show how to make the suggested changes on a text editor (or Python IDLE).

Impose a movement using joint angles

The following steps show how to modify an existing post processor to force an axial movement using joint angles. In this example we show how to apply this change for an ABB IRC5 robot controller.

1.    Find the programming manual of your specific robot controller. In this example we use the ABB IRC5 RAPID programming manual.

2.    Look for the joint movement instructions. In this case, ABB’s absolute joint movement command is called MoveAbsJ. This command requires a jointtarget variable that defines the joint axes.

 

Post Processors - Image 6

3.    Select Program➔Add/Edit Post Processor and select the post processor you are currently using to modify it. If you are currently using a customizable post processor it will be selected by default.

4.    You should look for the MoveJ function inside the post processor. This function defines the way post processors generate the joint motion commands. Alternatively, RoboDK uses MoveL for linear movements. Using Python programming language, modify the line that is added to the program file to provide joint angle information, as shown in the following image.

Post Processors - Image 7

5.    Finally, you may need to modify the way the post processor converts the joint angles or the pose to a string. The functions angles_2_str and pose_2_str define how the joint angles and a pose, respectively, is converted to text.

Post Processors - Image 8

Most RoboDK post processors use joint data for joint movements and Cartesian coordinates for linear movements. It is recommended to always start the first point in a sequence of linear movements as a joint movement, specifying joint coordinates. This avoids starting a program with the wrong robot configuration and reaching a singularity or axis limits.

Note: All RoboDK post processors link to the robodk.py module by default. This module includes useful tools to convert from poses to Euler angles for many robot controllers. Use the notation corresponding to your robot controller. More information available in the Reference Frames section and the robodk.py module.

Note: More than one robot manufacturer can use the same Euler angle notation. For example, Fanuc and Motoman both use the same XYZ notation, Stäubli and Mecademic use the same XY’Z’’ notation, etc.

Important: If you specify a movement using a pose (for example, using cartesian coordinates and Euler or Quaternion information), the position that the robot will attain will depend on the active tool and reference frames. The poses of the tool and reference frames must be properly specified in the program. This is done through the setTool and setFrame functions respectively.

Force a speed limit

Follow these steps to set a speed limit of 500 mm/s and avoid setting higher speeds using RoboDK. In this example we assume we are using a KUKA KRC2 or KRC4 controller:

1.    Locate the setSpeed function definition (def setSpeed)

2.    Add the following code before generating the $VEL.CP output which will change the speed in m/s:           
speed_mms = min(speed_mms, 500)

Post Processors - Image 9

Note: A default speed of 200 mm/s is defined in the HEADER variable, at the top of the post processor ($VEL.CP=0.2). This default speed can also be changed if the speed is not modified from RoboDK.

Generate one program per file

Add the following changes to avoid adding more than one program per file and to generate programs with 3000 lines of code at most:

1.    Set the variable MAX_LINES_X_PROG to 3000

2.    Set the variable INCLUDE_SUB_PROGRAMS to False

Note: The variable MAX_LINES_X_PROG may be overridden if the maximum lines per program is specified from the RoboDK Program Options menu. Modify the __init__ section of the post processor to avoid changing this variable from the RoboDK settings.

Post Processors - Image 10


 

Available Post Processors

By default, the following post processors are available in RoboDK:

   ABB_RAPID_IRC5: for ABB IRC5 robot controllers

   ABB_RAPID_S4C: for ABB S4C robot controllers

   Adept_Vplus: for Adept V+ programming language

   Allen_Bradley_Logix5000: for Allen Bradley Logix5000 PCL

   CLOOS: for CLOOS robot controllers

   Comau_C5G: for Comau C5G robot controllers

   Denso_PAC: for Denso RC7 (and older) robot controllers (PAC programming language)

   Denso_RC8: for Denso RC8 (and newer) robot controllers (PacScript programming language)

   Dobot: for educational Dobot robots

   Fanuc_R30iA: for Fanuc R30iA and R30iB robot controllers

   Fanuc_R30iA_Arc: for Fanuc Arc welding

   Fanuc_RJ3: for Fanuc RJ3 robot controllers

   GCode_BnR: for B&R robot controllers

   GSK: for GSK robots

   HIWIN_HRSS: for HIWIN robots

   KAIRO: for Keba Kairo robot controllers

   KUKA_IIWA: for KUKA IIWA sunrise programming in Java

   KUKA_KRC2: for KUKA KRC2 robot controllers

   KUKA_KRC2_CamRob: for KUKA CamRob milling option

   KUKA_KRC2_DAT: for KUKA KRC2 robot controllers including DAT data files

   KUKA_KRC4: for KUKA KRC4 robot controllers

   KUKA_KRC4_Config: for KUKA KRC4 robot controllers with configuration data in each line

   KUKA_KRC4_DAT: for KUKA KRC4 robot controllers including DAT data files

   Kawasaki: for Kawasaki AS robot controllers

   Mecademic: for Mecademic Meca500 robot

   Mitsubishi: for Mitsubishi robot controllers

   Motoman/Yaskawa: for different Motoman robot controllers using Inform II and Inform III (JBI)

   Nachi_AX_FD: for Nachi AX and FD robot controllers

   OTC: for Daihen OTC robot controllers

   Panasonic: For Panasonic PRG programs

   Precise: for Precise Scara robots

   Siemens_Sinumerik: for Siemens Sinumerik ROBX robot controller

   Staubli_VAL3: for Staubli VAL3 robot programs (CS8 controllers and later)

   Staubli_VAL3_InlineMove: to generate Staubli VAL3 programs with inline movement data

   Staubli_S6: for Staubli S6 robot controllers

   Toshiba: for Toshiba robots

   Universal_Robots: for UR robots, generates linear movements as pose targets

   Universal_Robots_RobotiQ: for UR robots including support for RobotiQ gripper

   Universal_Robots_joints: for UR robots, generates linear movements as joint targets

   Yamaha: for Yamaha robots


 

Reference

The following video shows an overview of Post Processors in RoboDK:    
https://robodk.com/help#PostProcessor

Reference documentation for each method in the post processor is available online:        
http://robodk.com/doc/en/PythonAPI/postprocessor.html

All post processors use the robodk.py module:      
http://robodk.com/doc/en/PythonAPI/robodk.html#robodk.Mat

The robodk.py module provides tools for pose operations (multiplications, inverse, …) and conversions between poses to Euler angles in different formats, among other things.

Note: By default, Python is installed with RoboDK and the robodk.py module is added to the Python path.

Documentation is available online to learn about Python programming:     
https://docs.python.org/3/

 

When a program is generated, a preprocessed/universal Python program is generated and saved in a local temporary folder. The preprocessed program is linked with the right post processor (selected by the user in RoboDK). The post processor defines a RobotPost class that generates the desired code.

The precompiled programs are executed with Python.

Tip: On Windows, the preprocessed programs are saved in the C:/Users/username/AppData/Local/Temp folder (type %TEMP% in windows file explorer). These programs can also be used for debugging new post processors.