KUKA LBR iiwa Sunrise: Troubleshooting prc XML Errors

Jason IP8 min read
Other ManufacturerRoboticsTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

Driving a KUKA LBR iiwa from a Grasshopper/KUKA|prc toolchain means exporting an XML motion file, moving it to the controller via USB, and letting a Sunrise Java application parse it through the KUKA|prc library. Three failure classes dominate first commissioning: workspace/base mismatch faults reported on the smartPAD as Arbeitsraumfehler, Java null-pointer exceptions thrown the moment the XML is parsed, and unit confusion between the degrees used in Grasshopper and the radians consumed by Sunrise.

This reference walks each failure to root cause and gives the verification steps that confirm the fix before you enable Automatic mode.

Terminology: Arbeitsraumfehler is the German-language pendant message for a work-envelope error. If your smartPAD language is set to German you will see this string instead of the English equivalent; the diagnostic path is identical.

Failure 1: Arbeitsraumfehler / Work Envelope Error on XML Load

Symptom

The Grasshopper simulation runs clean, the XML exports without complaint, but the moment the Sunrise application loads the file from the USB drive the pendant reports a work envelope error and the application aborts before the first motion.

Root cause

The toolpath is generated relative to a base frame in the CAD/Grasshopper environment, but the base object placed in the Grasshopper definition does not correspond to the base frame trained on the robot. A common trap in the shipped example definitions is that the robot in the example is not located at the world origin. If you build your own scene assuming the robot sits at the origin, every posted point is offset by the example's robot transform, which pushes the commanded Cartesian targets outside the reachable envelope of the 7-axis arm.

Resolution sequence

  1. Open the example definition and read the actual position/orientation of the robot component. Do not assume origin placement.
  2. Rebuild your scene so the Grasshopper base object geometry is coincident with the physical base frame you trained in Sunrise Workbench (same origin, same orientation of X/Y/Z).
  3. Confirm the base is trained on the robot, not just declared. A declared-but-untrained frame yields a default identity transform and silently relocates the whole path.
  4. Verify the base name string in the Sunrise Java application matches the name in the Sunrise Workbench object template tree character-for-character. The lookup is by string; a case or whitespace difference fails.
  5. Re-post the XML, reload, and re-run.
Check Where Failure signature if wrong
Base geometry position Grasshopper / KUKA|prc scene Whole path offset; work envelope error
Base trained Sunrise Workbench object frame, touch-up on robot Path executes in wrong location or unreachable
Base name string Java call into KUKA|prc library Null object or frame-not-found exception
Tool name + TCP Sunrise Workbench tool template Null pointer at parse/execute line
Angle units in XML Posted XML vs Sunrise expectation Drastically reduced motion, or envelope error

Failure 2: Null Pointer When the Application Calls the prc Library

The iiwa's biggest advantage over a KRL controller here is that the Sunrise application is ordinary Java running under Sunrise Workbench, so you can debug it exactly like any other Java program instead of guessing from pendant messages.

  1. Switch Sunrise Workbench into the Debug perspective.
  2. Set a breakpoint on the line that throws — typically the call that hands the tool name, base name, and I/O group to the KUKA|prc library.
  3. Run to the breakpoint and inspect each argument in the variables view to identify which reference is null.

The three usual culprits:

Object Requirement Fix
Tool Both the tool name and its TCP frame must exist in the object template tree Create the missing TCP child frame; a tool with no TCP resolves to null
Base Name must resolve to an existing, trained frame Correct the string or train the frame
I/O Group Must exist in the Sunrise I/O configuration if referenced Create the I/O group, or explicitly pass null if the application does not use digital I/O
Do not chase this from the pendant. The smartPAD message tells you an exception occurred; only the debugger tells you which reference was null. Breakpoint-and-inspect is faster than trial-and-error edits to name strings.

Parameterizing tool and base

Hard-coding the tool and base names in the Java application means every scene change requires a Workbench rebuild and redeploy. If your workflow needs operators to swap tools without redeploying, restructure the application to read the tool and base identifiers from the loaded XML (or from a small companion configuration file on the USB drive) and resolve them at runtime via the same name-based lookup. Validate the resolved objects for null immediately after lookup and abort with a readable message rather than letting the exception surface as a raw pendant fault.

Failure 3: Degrees vs Radians — the Redundancy Angle Trap

KUKA|prc always works internally in degrees. There is no user-facing degree/radian switch in KUKA|prc. On export, it converts to whatever the target platform expects — and Sunrise expects radians. So seeing radian values in the posted XML while Grasshopper displays degrees is correct behavior, not a bug.

The practical consequence is on the redundancy angle (E1) of the 7-axis LBR:

  • Enter the E1 value in degrees in Grasshopper. KUKA|prc handles the conversion.
  • If you enter radians by mistake, the value is treated as degrees and is numerically much smaller, so you observe far less elbow reconfiguration than intended — a classic "the redundancy input does nothing" complaint.
  • Also confirm the angle display units configured in Sunrise Workbench so you are comparing like with like when you read joint values back off the pendant.

Optimizing the redundancy angle

KUKA|prc does not automatically resolve the E1 redundancy — the optimal elbow position is highly application-dependent. A workable approach today is to drive E1 from an evolutionary solver (Galapagos) inside Grasshopper, using a fitness function built on the output of the KUKA|prc Analysis component. Useful objectives to minimize:

  • Total process/cycle time
  • Collision count reported by the Analysis component
  • Proximity to joint limits across the toolpath
  • Singularity/axis-reversal events

Sweep E1 as a single slider for a constant-elbow strategy, or as a small set of sliders interpolated along the path if the process needs the elbow to migrate.

Setting the Default XML Directory in the File Chooser

On a shared robot, letting the file dialog open in the user's Documents folder invites operators to load the wrong XML. The dialog is a JFileChooser subclass exposed as PRC_FileChooser, instantiated from the CORE_ChooseXML() routine in PRC_Core.

Why setCurrentDirectory("E:") is rejected

JFileChooser.setFileFilter() takes a FileFilter object and compiles fine. setCurrentDirectory() does not take a String — it takes a java.io.File. Passing a string literal produces a "method is not applicable for the arguments" compile error in Workbench. Likewise, constructing new PRC_FileChooser("E:\\") fails with "constructor is undefined" unless that subclass actually declares a String constructor.

Working fix

// In PRC_Core, after the chooser is created:
fileChooser.setCurrentDirectory(new java.io.File("E:\\"));
fileChooser.setFileFilter(filter);

This compiles and pins the dialog to the USB volume. The cleaner long-term fix is to edit PRC_FileChooser.java itself — it extends JFileChooser, so set the default path inside its constructor (or add a String-argument constructor that wraps the path in a File). That keeps the customization in the file-chooser class instead of scattering it through PRC_Core, and it survives library-side edits to the core routine.

Drive letter caution: Hard-coding E:\ assumes the USB volume always enumerates to the same letter. If the mount point can shift, guard the call with an existence check on the File object and fall back to the previous default rather than handing the dialog a non-existent directory.

Commissioning Checklist After a Long Shutdown

If the cell has been idle for years and Sunrise Workbench plus the surrounding software stack were reinstalled, verify the software layer before blaming geometry:

  1. Confirm the Sunrise Workbench version matches the controller's installed Sunrise version — a mismatch produces obscure synchronization and deployment failures.
  2. Confirm all required Sunrise technology options/packages used by your application are installed and licensed on the controller.
  3. Re-synchronize the project to the controller and confirm the deployment completes without warnings.
  4. Re-verify tool and base frames on the physical robot. Touch-up data does not survive a controller reimage.
  5. Run one short, low-speed XML in T1 with the operator's hand on the enabling switch before any Automatic-mode run.

Verification

Step Expected result
Load XML from USB in T1 No pendant fault; application reaches first motion statement
Breakpoint on library call Tool, TCP, and base references all non-null; I/O group non-null or intentionally null
Jog to first posted point Physical TCP lands on the intended feature; confirms base transform
Inspect XML joint values Angles in radians — correct for Sunrise; Grasshopper inputs stay in degrees
Vary E1 slider by 30 deg Visible elbow reconfiguration in simulation and on the robot
Open file dialog Opens directly on the USB path, filtered to XML

FAQ

What does Arbeitsraumfehler mean on a KUKA smartPAD?

It is the German-language work-envelope error: the commanded Cartesian target lies outside the robot's reachable workspace. On an LBR iiwa running a posted toolpath, the usual cause is a base frame mismatch between the CAD scene and the frame trained on the robot, which offsets the entire path.

Why does KUKA|prc export radians when Grasshopper shows degrees?

KUKA|prc always works internally in degrees and converts on export to whatever the target platform requires. Sunrise expects radians, so radian values in the posted XML are correct. Always enter values, including the E1 redundancy angle, in degrees.

How do I find which object is null when the Sunrise application crashes on XML load?

Use the Debug perspective in Sunrise Workbench, set a breakpoint on the failing line, and inspect the variables. Check that the tool name and its TCP both exist, that the base name resolves, and that the I/O group exists or is explicitly passed as null.

How do I change the default XML directory in the prc file chooser?

Call fileChooser.setCurrentDirectory(new java.io.File("E:\\")) — the method takes a java.io.File, not a String, which is why passing a literal fails to compile. For a cleaner fix, set the default path inside PRC_FileChooser.java, which extends JFileChooser.

Can KUKA|prc automatically optimize the 7th-axis redundancy angle?

No automatic resolution is provided; the optimal elbow position is application-dependent. Drive E1 from Galapagos in Grasshopper with a fitness function built on the KUKA|prc Analysis component output, minimizing process time and collisions.

Back to blog