In Part 1, we explored key KUKA system files such as $machine.dat, $config.dat, and bas.src, which are critical to the robot’s control architecture. In this follow-up, we take a deeper look at how these files are used to logically integrate an external axis, such as a rotary turntable or linear track, into the robot system.
Synchronising an external axis with a 6-axis KUKA robot effectively adds a 7th axis. For this to work, the controller must both recognise and manage the external axis, integrating its motion control alongside the robot’s native joints. This setup includes both registration (declaring the axis in system files) and configuration (linking its kinematics and coordinate systems).
External Axis Registration in $config.dat
To integrate an external axis into a KUKA controller, the system must first recognise it as a machine in the $config.dat file. This is done using the MACHINE_DEF[] registers.
The primary robot is usually defined in MACHINE_DEF[1]. For example:
MACHINE_DEF[1] = {
NAME[] "Robot",
COOP_KRC_INDEX 1,
PARENT[] "WORLD",
ROOT {x 0.0, y 0.0, z 0.0, a 0.0, b 0.0, c 0.0},
MECH_TYPE #ROBOT,
GEOMETRY[] " "
}
To add an external axis, such as a turntable:
MACHINE_DEF[2] = {
NAME[] "E1",
COOP_KRC_INDEX 1,
PARENT[] "WORLD",
ROOT {x 1200.0, y 0.0, z 0.0, a 0.0, b 0.0, c 0.0},
MECH_TYPE #EASYS,
GEOMETRY[] " "
}
Note that MECH_TYPE #EASYS indicates the mechanism is an External Axis System. The ROOT coordinates specify the physical origin of the external axis relative to the world coordinate system (absolute parent, located at the robot base by default). This is critical for accurate motion and is typically determined through calibration.

External Axis Reference Frame Configuration
Once registered, the external axis must be correctly linked to the robot’s coordinate system. This ensures consistent positioning and motion planning. There are two ways to do this.
1. Direct Method Using EK()
KUKA provides the EK() function to establish the kinematic reference between robot and external axis:
$BASE = EK(MACHINE_DEF[2].ROOT, MACHINE_DEF[2].MECH_TYPE, BASE_DATA[1])
MACHINE_DEF[2] points to the external axis definition in $config.dat. BASE_DATA[1] is the chosen user reference frame. The result assigns $BASE to the combined transformation of the external axis and base frame.
2. Standardised Method Using bas.src
For a more maintainable and standardised option, KUKA encourages using the BAS subroutine defined in system file bas.src. We can set up the external axis synchronisation like this in the main program:
BAS(#EX_BASE, 1)
Here’s what happens behind the scenes:
- The function calls the EX_BASE(BASE_NO, MACH_IDX) method inside the BAS function, inside bas.src (you can open bas.src to have a closer look).
- BASE_NO refers to the #BASE frame, e.g., BASE_DATA[1].
- MACH_IDX refers to the external axis, e.g., MACHINE_DEF[2].
So inside bas.src, the method executes:
$BASE = EK(MACHINE_DEF[MACH_IDX].ROOT, MACHINE_DEF[MACH_IDX].MECH_TYPE, BASE_DATA[BASE_NO])
Note that the EX_BASE() is initially set to EX_BASE(BASE_NO, 0) which means no external axis is linked to the controller.
Therefore, both methods (direct or via bas.src) achieve the same result, linking the external axis’ kinematic origin with the chosen user reference frame.
Conclusion
Integrating an external axis with a KUKA robot involves bolting on hardware, as well as logically registering, calibrating, and configuring that axis within the robot’s control system. By correctly updating system files like $config.dat and bas.src routines, we ensure the robot understands where the external axis is, how it moves, and how to include it in coordinated motion. Properly integrating external axes help achieve more advanced applications like coordinated welding, extended-reach assembly, and part manipulation on rotary positioners.



You must be logged in to post a comment.