KUKA · KRL

KUKA KRC4 template

PICK_PLACE_MASTER.src + PICK_PLACE_MASTER.dat
  • Interrupt-based search on $IN[1] — BRAKE on contact, exact position captured
  • Every instruction explained in plain-English comments
  • Teach XHOME, XABOVEPICK, XPLACE_APPROACH and XPLACE_POS on the SmartPAD — the search finds the pick height automatically
  • Tested on a real KUKA robot (KRC4 / KSS 8.x)
Copy both files to KRC:\R1\Program\
ABB · RAPID

ABB RobotStudio demo

PATH2_ABB_SEARCH_DEMO.mod
  • Runs in RobotStudio with no I/O setup — simulated search and gripper
  • Comments show exactly which real signals to create and where
  • Easy settings block — search depth, lift distance, place offset
  • Validated in RobotStudio (RobotWare 6.x)
Load into RobotStudio and run — works out of the box

How the search routine works

Fixed pick heights break the moment your stack height varies — different part counts, compressed packaging, mixed batches. A search routine removes the problem: the robot moves down slowly from the approach position while watching a sensor input, and stops the instant the part is detected.

01 — ARM

Interrupt watches the sensor

On KUKA, INTERRUPT DECL 1 WHEN $IN[1]==TRUE arms a background watch on the gripper sensor. On ABB, SearchL does the same job natively.

02 — SEARCH

Slow move down

The robot moves down from the taught approach position. The moment the input goes TRUE, the interrupt fires — BRAKE stops motion immediately.

03 — CAPTURE

Found position saved

The contact position is stored and used as the real pick point. The gripper closes, the robot lifts clear, places, and repeats.

Setup before you run

KUKA — teach on the SmartPAD

XHOMERobot home / safe position — all axes near zero, no obstructions
XABOVEPICKSafe approach point above the pick zone — search starts here
XPLACE_APPROACHSafe point directly above the place position (100–200mm above XPLACE_POS)
XPLACE_POSExact position where the part is released
$OUT[1]Gripper close / vacuum on — set to your actual output number
$IN[1]Part detected / vacuum confirmed — triggers the search interrupt

No pick position to teach — the search finds it every cycle. XPLACE_APPROACH and XPLACE_POS must be taught before running. See the Before You Run section below.

ABB — teach on the FlexPendant

pSearchTopTop of search — teach the position the robot searches down from, above the part (the demo just uses its current position after jHome)
pPlacePlace position — the demo calculates it as an offset from the pick; on a real robot, teach your actual place position
diPartFoundDigital input to create — part detection sensor (vacuum switch, photoeye, proximity)
doGripDigital output to create — gripper close / vacuum on

The file runs in RobotStudio as-is with no I/O setup — the search and gripper are simulated. The comments walk you through the real-robot version step by step: teaching the positions, creating diPartFound and doGrip (Controller → Configuration → I/O System → Signal), and the exact SearchL and SetDO lines that replace the simulated moves.

Before you run — what to teach and where to find it

The KUKA files use two positions that must be taught on the pendant before the program will run correctly. Both are declared in the .DAT file with all coordinates set to zero as placeholders. Here is how to find them and what to teach.

Understanding the .DAT file

Every KUKA program has two files. The .SRC contains the code. The .DAT contains the position data — the actual X,Y,Z,A,B,C coordinates. When you teach a position on the pendant, KUKA writes the coordinates into the .DAT automatically.

By default the pendant shows programs in fold view — sections are collapsed. To open a fold:

  1. Navigate to the fold line (starting with ;FOLD)
  2. Press the Open/Close Fold softkey at the bottom of the smartPAD
  3. On a touchscreen controller: double-tap the fold line
  4. To open all folds: Edit > Unfold all
  5. To view the .DAT file: press the filename tab at the top of the editor, or Edit > Open DAT file

Teaching XPLACE_APPROACH and XPLACE_POS

These two positions have zero coordinates in the .DAT when you download. The robot will loop without placing until they are taught. Teach XPLACE_APPROACH first, then XPLACE_POS.

XPLACE_APPROACH100–200mm directly above the place point, same X,Y,A,B,C as XPLACE_POS. Navigate to the PLACE_APPROACH inline form in the SRC, jog to this point, press Touch Up.
XPLACE_POSThe exact drop-off point. Navigate to the PLACE_POS inline form, jog to the drop point, press Touch Up. The robot must retract straight back up to XPLACE_APPROACH without sweeping through the placed part.

Always test at 5% override first and verify each position before running at speed.

Need a full palletizing program?

The Path2 generator builds complete KUKA KRL and ABB RAPID palletizing programs from your pallet pattern and box sizes — including gripper signals, separator sheets and depalletizing. Validated in RobotStudio and tested on a real KUKA robot.

Open the palletizing generator →