Documentation › Simulation to a Real Robot › KUKA

KUKA Robots

Turn a trajectory simulated in BabaCAD Robotics Web into a KUKA KRL program, then copy it to the robot controller with a USB stick · KR C2, KR C4 and KR C5 controllers

download

Download

One plugin works for every KUKA model in BRW. It is the KUKA post processor: it recognizes the active KUKA arm and turns its simulated trajectory into a KRL program (.src and .dat), for a KR C4 / KR C5 or a KR C2 controller. Nothing needs to be installed, and the computer does not need a network connection to the robot.

FileContains
BRW-KUKA-PostProcessor.zipthe plugin folder brw-plugin and README.txt
brw-plugin.jsthe plugin alone; put it in a folder named brw-plugin
All settings (path tolerance, approximation, speeds, program name) are at the top of brw-plugin.js and explained in README.txt.
checklist

Supported Models

BRW modelRobotAxis speeds used
Kuka kr6KR 6 (KR 6-2)datasheet, KR 6-2 / KR 16-2 family
Kuka kr15KR 15estimate
Kuka kr16KR 16 (KR 16-2)datasheet
Kuka kr 6 r700 sixxKR 6 R700 sixx (KR AGILUS)datasheet
Kuka kr 70 r2100KR 70 R2100estimate
Kuka kr 210 r2700 extraKR 210 R2700 extra (KR QUANTEC)datasheet
Kuka kr 500 r2830KR 500 R2830 (KR FORTEC)estimate

The axis speeds only decide how fast each motion of the program runs, so that it takes about as long as in the simulation. The override on the smartPAD or KCP scales them in every case. Other KUKA models whose name starts with "Kuka" are post-processed too, with slow generic speeds and a warning in the console.

play_circle

1. Generate The Program In BRW

  1. Open BabaCAD Robotics Web and pick the KUKA model of your robot. With several arms in the scene, click the KUKA arm so it is the active one.
  2. Import / Export → select the brw-plugin folder.
  3. Build the posture queue and press Play full once, so BRW computes the trajectory. Check the motion on screen.
  4. Press User Command 1 for a KR C4 / KR C5 controller, or User Command 2 for a KR C2. The plugin recognizes the model, checks every point against the robot's motion ranges and writes the KRL program as two files, .src and .dat. Chrome and Edge ask once for the folder (select your USB stick); Firefox and Safari save the files to Downloads. The files are named like BRW_KR16_C4_1008_1530.src.
usb

2. Load It On The Controller

  1. On the smartPAD log in as Expert (Main menu → Configuration → User group).
  2. Plug the USB stick into the controller's USB port.
  3. In the Navigator select the .src and .dat files on the USB drive, Edit → Copy, open KRC:\R1\Program and Edit → Paste. On a KR C2 the commands are under File. KR C2 cabinets older than edition 2005 have no USB port; copy the files over the network there.
  4. Select the program. In T1 hold the enabling switch and press Start. The robot first moves slowly to the start pose (BCO run, 10 %), then follows the simulated path.
  5. Run the whole program in T1 with a low override before you raise the override or switch to T2 / AUT.
Safety first. The real arm makes the same moves as the simulation, including through anything that is not modelled in BRW. Clear the work cell, start in T1 with a low override and keep the enabling switch and the emergency stop within reach.
code

What The Program Contains

KR C4 and KR C2 programs

Both use the same KRL commands. They differ in how the path is cut into motions: very short PTP motions cannot be blended within the controller's interpolation cycle and make the robot slow down or stop, and the KR C2 has less memory and computing power.

ControllerCommandShortest motionMost PTP points
KR C4 / KR C5 (KSS 8.x)User Command 10.05 s20000
KR C2 (KSS 5.x)User Command 20.1 s3000

If a long path needs more points, the plugin thins it more coarsely and says so in the console.

DEF BRW_KR16_C4_1008_1530( )
;FOLD INI
  ...
  BAS (#INITMOV, 0)
;ENDFOLD (INI)
$APO.CPTP = 10
BAS (#VEL_PTP, 10)
PTP {A1 0.000, A2 -90.000, A3 90.000, A4 0.000, A5 0.000, A6 0.000}
BAS (#VEL_PTP, 12)
PTP {A1 -5.258, A2 -86.494, A3 88.247, A4 -1.753, A5 3.506, A6 7.011} C_PTP
...
WAIT SEC 1.00
...
END

Not included yet: external axes (a trajectory that moves a linear rail or rotary table is refused), and tool I/O, gripper or process commands. Add those in the program on the controller if you need them.

3d_rotation

KUKA Joint Data

The plugin converts the simulator's angles to KUKA's axis values: KUKA = sign · sim + offset. It works from the simulator's own angles, so the joint mapping set in BRW does not change the program.

A1A2A3A4A5A6
Sign−1+1+1−1+1−1
Offset0°−90°+90°0°0°0°

The BRW Home pose is the KUKA pose A1 0, A2 −90, A3 90, A4 0, A5 0, A6 0: upper arm vertical, forearm horizontal. KUKA's A1, A4 and A6 turn the other way round from the simulator's joints, so their sign is −1.

Before the first run, make a short test program: in BRW queue the Home pose and a pose that turns only joint 1 by about 20°, generate the program and run it in T1 with a low override. The robot must turn the same way as the model on screen. Repeat it for joints 4 and 6 if the tool allows.