How do you program KUKA robots: KRL, smartPAD and WorkVisual, and where to start?

Programming KUKA robots means preparing a program in KRL (KUKA Robot Language), which is executed by a KR C4 or KR C5 robot controller running KUKA System Software (KSS). Points and motions are taught on the smartPAD, and the configuration of the controller, the industrial network and the signals is done in the WorkVisual environment. Anyone who wants to get started should learn all three tools, because each is responsible for a different part of the project.

What does programming KUKA robots involve?

Programming KUKA robots has three layers: the motion and logic program in KRL, teaching points on the robot with the smartPAD, and configuring the whole system in WorkVisual. The robot works correctly only when all three are consistent with one another.

ToolWhat it is forWhen most of the work happens in it
KRLthe program language: motions, logic, signal and error handlingwhen writing the program, offline and on site
smartPADthe operator panel: manual jogging, teaching points, motion forms, diagnosticson the shop floor, during commissioning and in maintenance
WorkVisualconfiguration of the controller, industrial network, signals and safety, project editing and comparisonbefore commissioning and whenever the hardware changes

This division explains why a robot technician who knows only the pendant cannot commission a new cell on their own. They will change a point or a speed, but they will not configure the data exchange with the PLC or carry the changes over to the project archive.

What is KRL, the KUKA robot programming language?

KRL is the text-based programming language of KUKA robots, with procedures, functions, loops, conditional statements and interrupts. Each program consists of two files: SRC contains the code, and DAT holds the program data, including the saved point positions.

Robot motion is described by the instructions PTP (point-to-point: the fastest, but without control of the tool path), LIN (linear) and CIRC (circular). Their spline counterparts SPTP, SLIN and SCIRC make it possible to guide the tool along a smooth path, which matters in gluing, sealing and welding.

Simple motions and commands are programmed on the smartPAD with ready-made forms (inline forms), without writing code. Each form saves a KRL instruction in the SRC file and the point position in DAT. More complex logic, such as selecting the part type, handling errors or communicating with higher-level systems, is written by hand as KRL code.

Many of the hardest faults come from the fact that the controller plans motions ahead (advance run). Thanks to this the robot passes through points smoothly, with approximation, but logic instructions written next to a motion are executed before the arm reaches its destination. A “gripper open” signal sent this way can fire a few millimetres before the target, which is why KRL has TRIGGER instructions for switching at a defined point of the path. The choice of approximations and switching points decides both the cycle time and the repeatability of the process.

Robot languages differ between manufacturers: KUKA has KRL, ABB has RAPID, and Fanuc has TP (Teach Pendant). A program written for one brand will not run on another brand’s controller.

What is the smartPAD used for when programming a KUKA robot?

The smartPAD is the KUKA robot’s operator panel, i.e. a teach pendant: it is used to jog the robot manually, teach points, run programs and diagnose faults. The panel has an 8.4-inch touchscreen and, optionally, a 6D mouse, with which the arm is moved in several axes at once.

When teaching points, the robot works in manual mode. The KUKA controller has four operating modes:

  • T1: manual mode at reduced speed, 250 mm/s at most, for teaching points and testing the program;
  • T2: manual mode at programmed speed, for checking the program at real pace;
  • AUT: automatic operation controlled from the panel;
  • AUT EXT: automatic operation in which the program selection and start come from the line’s PLC.

Before the first point is created, the robot must have its coordinate systems measured. The tool (TCP, i.e. the working point of a gripper, torch or nozzle) is measured, for example, with the XYZ 4-point method: the tool tip is moved to the same spot from four different directions. The base coordinate system (BASE) of a fixture or conveyor is measured with three points.

Program points are saved relative to these systems. When a fixture is moved years later, one base is corrected rather than several dozen points. An error in the measurement works the opposite way: it shifts all positions at once, so the robot misses the target in every motion.

What is done in WorkVisual when programming KUKA robots?

WorkVisual is the KUKA engineering environment for configuring, programming, commissioning and diagnosing controllers running KSS. It is used offline, on a project that is later transferred to the controller, and online, for diagnosing a running cell.

WorkVisual is where you create what cannot be prepared on the pendant alone:

  • industrial network configuration: PROFINET, PROFIBUS, EtherCAT, EtherNet/IP or DeviceNet, depending on the line;
  • input and output mapping: assigning signals from the network to the robot program’s variables;
  • safety over the network: ProfiSafe, CIP Safety or FSoE, i.e. safety signals exchanged with a Fail-Safe type PLC;
  • editing KRL programs and the technology options installed in the controller.

The biggest risk in this layer is a mismatch between the project in the controller and the archive. A robot technician changes a signal on the shop floor but does not update the copy, and at the next modification someone loads an older project and the station loses its working configuration. Comparison protects against this: WorkVisual sets the offline project against the version in the controller and shows conflicts before the download.

An up-to-date WorkVisual project is what allows maintenance to safely restore the station after a controller failure.

A KRL program can also be prepared and tested without a robot. KUKA.Sim is used to simulate the cell, reach, collisions and cycle time, and KUKA.OfficeLite is a virtual controller with the original pendant interface and KRL syntax, which makes it possible to check a program on any computer. This method is known as offline programming.

Looking for an experienced KUKA robot integrator? Get in touch and we will write the KRL program and commission the robot on site.

Where to start with programming KUKA robots?

Programming KUKA robots starts with safety and operating the robot in manual mode, not with writing code. Each following skill builds on the previous ones, so the order matters:

  1. Safe operation and operating modes: manual motion in T1, stops, rules for working in the cell.
  2. Coordinate systems and measurements: WORLD, BASE and TOOL, measuring the tool and the base, checking mastering, i.e. the agreement of the axis positions with the controller.
  3. Motions in forms: PTP, LIN and CIRC, teaching and correcting points, speeds and approximations.
  4. KRL in the editor: the structure of SRC and DAT files, subprograms, loops, interrupts, error handling.
  5. WorkVisual and PLC integration: network configuration, signal mapping, work in AUT EXT.

KUKA College follows the same division. The Robot Programming 1 course teaches the basics: programming motions, logic functions and KRL. Robot Programming 2 develops KRL, work in WorkVisual and collision avoidance. A separate course for integrators (KR C4 Basics) focuses on commissioning the system and configuring the network in WorkVisual.

For a plant the question “where to start” has another side too: who is going to program. A maintenance team usually needs only the first three stages of the list to correct points, restart the cycle after a fault and read messages. A new cell requires the full scope, along with knowledge of the ordering customer’s standard. Automotive groups describe in their specifications their own structure of robot programs and layout of signals from the PLC, which is why a program written in one’s own way will not pass acceptance.

The most expensive mistake at the start is commissioning a new cell by relying on someone who knows only the pendant: the corrections then carry over to the line ramp-up, when every hour of downtime costs the most.

Under the Daimler Powertrain standard we programmed KUKA robots on the production line of the eATS2.0 electric engine, and on the electric motor assembly line for BMW we integrated them with vision systems, drives and a press.

Does programming change with the KR C5 and iiQKA.OS2?

The language does not change. KUKA is introducing the new iiQKA.OS2 operating system together with the KR C5 controller, and according to the manufacturer the new software builds on the KSS core and is fully compatible with KRL.

What changes are the tools around the program. Controllers with iiQKA.OS2 use the smartPAD pro panel with a 10.1-inch screen and the iiQWorks environment, available only for the new system. With KSS you continue to work in WorkVisual and KUKA.Sim.

For a plant with robots on KR C4 this means two things:

  • existing stations with KSS can keep running, the manufacturer does not require a move to the new system;
  • for a new line or a modernisation, you need to decide up front which system the cell will be built on, because the tools and the team’s training depend on it.

Besides KUKA, we also program ABB and Fanuc robots. A comparison of suppliers from a plant’s perspective can be found in the post Which industrial robot supplier should you choose for your facility?.

Commissioning cells with KUKA robots on your line? As an integrator we will prepare the WorkVisual configuration and commission the cells on site.

FAQ

Sources

  • KUKA, KUKA.WorkVisual (configuration, programming, commissioning and diagnostics, supported networks): https://www.kuka.com/en-de/products/robot-systems/software/system-software/kuka_systemsoftware/kuka_work-visual
  • KUKA, smartPAD and smartPAD pro (operator panels, inline forms): https://www.kuka.com/en-de/products/robotics-systems/robot-controllers/smartpad
  • KUKA, KUKA.OfficeLite (virtual controller): https://www.kuka.com/en-gb/products/robotics-system/software/simulation-planning-optimization/kuka_officelite
  • KUKA, iiQKA.OS2 FAQ (KRL compatibility, tools for KSS and iiQKA.OS2): https://www.kuka.com/en-de/products/robot-systems/software/system-software/iiqkaos2-operating-system-industrial-robots/iiqka_os2_faq
  • KUKA College Austria (Robot Programming 1 and 2 courses, KR C4 Basics for Integrators): https://www.kuka.com/en-at/services/kuka-college/kuka-college-austria
  • KUKA, KSS programming manual (program structure: SRC and DAT files).
Scroll to Top