liminfo

KUKA Reference

Free reference guide: KUKA Reference

26 results

About KUKA Reference

The KUKA KRL Reference is a searchable cheat sheet for KUKA Robot Language (KRL), the programming language used on KUKA industrial robots with KRC4 and KRC5 controllers. It covers KRL fundamentals including program structure (DEF...END blocks), variable declarations (DECL for INT, REAL, BOOL, CHAR, E6POS, E6AXIS, FRAME types), control flow (IF/ELSE/ENDIF, SWITCH/CASE/ENDSWITCH, FOR/WHILE/REPEAT loops), and execution control (HALT for program stop, WAIT SEC for timed delays, WAIT FOR for condition-based waiting).

The motion command section provides detailed syntax for all three interpolation types: PTP (point-to-point) for fastest axis-interpolated movement with unpredictable paths, LIN (linear) for straight-line TCP movement in precision applications, and CIRC (circular) for arc motion via auxiliary and end points. It includes relative motion commands (PTP_REL, LIN_REL), velocity configuration ($VEL.CP for path speed in m/s, Vel percentage for PTP), and approximation positioning ($APO.CPTP, $APO.CDIS) for smooth corner blending with C_PTP and C_DIS motion flags.

Additional sections cover digital and analog I/O control ($IN[n], $OUT[n], $ANIN[n], $ANOUT[n], PULSE output), system timers ($TIMER[1-20]), FOLD blocks for code organization on SmartPad, interrupt handling (INTERRUPT DECL with WHEN/DO, BRAKE for immediate stop, RESUME for path return), tool and base coordinate systems ($TOOL, $BASE, TOOL_DATA[n], BASE_DATA[n], 3-point calibration), load data configuration ($LOAD), and WorkVisual offline programming including project creation, EtherCAT I/O mapping, and SafeOperation safety configuration with SIL2/PLd compliance.

Key Features

  • Complete KRL program structure: DEF/END blocks, DECL variable types (INT, REAL, BOOL, E6POS, E6AXIS, FRAME), and control flow statements
  • All motion commands: PTP (axis interpolation), LIN (linear), CIRC (circular) with relative variants PTP_REL/LIN_REL and velocity settings
  • Approximation positioning ($APO) with C_PTP, C_DIS, C_ORI, and C_VEL flags for smooth corner blending in continuous paths
  • Digital I/O ($IN/$OUT), analog I/O ($ANIN/$ANOUT), PULSE output, and system timer ($TIMER) commands for process control
  • Interrupt programming: INTERRUPT DECL with WHEN/DO conditions, BRAKE for emergency stop, RESUME for path recovery
  • Tool and base calibration: $TOOL, $BASE, TOOL_DATA, BASE_DATA, 3-point measurement method, and $LOAD payload configuration
  • FOLD block syntax for SmartPad-friendly code organization including INI FOLD initialization patterns
  • WorkVisual project workflow: controller setup (KRC4/KRC5), EtherCAT I/O mapping, SafeOperation safety config, and deployment

Frequently Asked Questions

What is KRL and which KUKA controllers support it?

KRL (KUKA Robot Language) is the proprietary programming language for KUKA industrial robots. It runs on KRC4 and KRC5 controllers and is programmed via the smartPAD teach pendant or WorkVisual offline software. KRL uses a structured, procedural syntax with DEF/END program blocks, typed variable declarations (DECL), and specialized motion commands. All KUKA robots from the KR AGILUS to the KR QUANTEC series use KRL for programming.

What is the difference between PTP, LIN, and CIRC motion commands?

PTP (Point-to-Point) moves each axis independently at maximum speed, resulting in the fastest travel but an unpredictable curved path. LIN (Linear) moves the TCP along a straight line, essential for welding, cutting, and precise material handling. CIRC (Circular) traces an arc defined by an auxiliary point and an end point. PTP uses Vel in percentage (1-100%), while LIN and CIRC use absolute speed in m/s. Use PTP for repositioning and LIN/CIRC for process-critical paths.

How does approximation positioning ($APO) work in KUKA?

Approximation allows the robot to blend between motion segments without stopping at exact target points. Set $APO.CPTP (0-100%) for PTP approximation or $APO.CDIS (mm) for distance-based approximation. Add the C_PTP or C_DIS flag to motion commands: PTP p1 C_PTP followed by LIN p2 enables blending. The last point in a sequence (without a C_ flag) is reached exactly. This significantly reduces cycle times in multi-point paths.

How do I control digital and analog I/O in KRL?

Digital I/O uses $OUT[n] = TRUE/FALSE to set outputs and $IN[n] to read inputs. Use WAIT FOR $IN[n] to pause until a signal arrives. For timed pulses, PULSE($OUT[n], TRUE, duration) activates an output for a specified time. Analog I/O uses $ANOUT[n] for voltage/current output and $ANIN[n] for sensor readings. System timers $TIMER[1-20] provide elapsed time measurement with $TIMER_STOP for start/stop control.

What are FOLD blocks and why are they used?

FOLD blocks (;FOLD ... ;ENDFOLD) are a KRL code organization feature that collapses multiple lines into a single visible line on the SmartPad teach pendant. They improve readability by hiding implementation details like $BWDSTART, LDAT_ACT, FDAT_ACT assignments behind a descriptive header line. The INI FOLD at program start contains initialization code (BAS(#INITMOV, 0)) for speed, coordinate system, and tool setup. FOLDs are essential for maintaining clean, operator-friendly programs.

How do interrupts work in KRL for asynchronous event handling?

Declare interrupts with INTERRUPT DECL n WHEN condition DO subroutine(). Enable with INTERRUPT ON n and disable with INTERRUPT OFF n. When the condition triggers during motion, the robot immediately executes the subroutine. Use BRAKE inside the subroutine for immediate stop, then WAIT FOR conditions as needed, and RESUME to return the robot to its original path. This is critical for sensor-triggered stops, part detection, and emergency handling in production.

How do I calibrate tool and base coordinate systems?

Set the tool (TCP) with $TOOL = TOOL_DATA[n] where the data contains X, Y, Z offsets and A, B, C rotations relative to the flange. Use the 4-point or XYZ reference method on the SmartPad for precise TCP calibration. For base frames, $BASE = BASE_DATA[n] defines the work coordinate system using the 3-point method (origin, X-axis direction, XY-plane point). Always configure $LOAD with payload mass, center of gravity, and inertia for safe dynamic performance.

What is WorkVisual and how do I deploy programs to the controller?

WorkVisual is KUKA offline engineering software for project configuration, I/O mapping, safety setup, and program management. Create a project by adding a KRC4/KRC5 controller, configure the EtherCAT bus topology and map physical I/O to logical signals ($IN/$OUT addresses). Set up SafeOperation with Cartesian workspace limits, axis monitoring, and safe speed settings for SIL2/PLd compliance. Deploy to the real controller via Extras > Transfer > Deploy, which requires a controller restart.