Setup and Interfacing of A KUKA Robotics Lab PDF
Setup and Interfacing of A KUKA Robotics Lab PDF
Lab
Ivar Eriksen
1B Background
The department of Engineering Cybernetics at NTNU has recently acquired a former SINTEF robotics
laboratory. The laboratory consists of two KUKA KR-16 robots, one mounted on the floor, and one
mounted on the end of a GÜDEL gantry crane. Setup of the laboratory is challenging in both the dated
software and unique setup of the hardware. The old interface had a significant communication delay,
and it was difficult to establish an overview of the system. This project is an effort to revitalize the
laboratory for modern robotics research. The project includes surveying the available hardware,
outlining the possible choices of middleware for communication and control, and creating or extending
drivers for use with the unique robot setup. Two control interfaces are of particular interest
(KUKAVARPROXY and KUKA.RSI) with regards to possibility of using the laboratory for both research
and laboratory assignments for control engineering students.
_____________________
Jan Tommy Gravdahl
Professor, supervisor
Abstract
ii
Sammendrag
iii
Preface
The technical work for this thesis has been independently executed, including
information gathering, configuration and software design. This has been an
exciting project to work on, and I have enjoyed developing the laboratory and
trying out my ideas on real hardware. During the time spent working on this thesis
the Department of Engineering Cybernetics (ITK) have provided full access to
the robotics laboratory, including 3D models and basic hardware documentation
that followed the laboratory from SINTEF.
I would like to thank both my supervisor Tommy Gravdahl and my co-
supervisor Mathias Hauan Arbo for their support and guidance throughout an
eventful year.
I would also like to thank Filippo Sanfilippo for introducing me to jOpenShow-
Var and KUKAVARPROXY, on which much of this work is based.
iv
Contents
Abstract ii
Sammendrag iii
Preface iv
1 Introduction 1
v
2.6.4 Collision monitoring . . . . . . . . . . . . . . . . . . . . 19
2.6.5 Workspace monitoring . . . . . . . . . . . . . . . . . . . 20
2.7 External axes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
2.8 Robot Sensor Interface . . . . . . . . . . . . . . . . . . . . . . . . 21
2.9 Fieldbus . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
3 Robot software 25
3.1 Robot Operating System . . . . . . . . . . . . . . . . . . . . . . 25
3.2 ROS 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3 ROS Industrial . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3.1 Godel - Robotic blending . . . . . . . . . . . . . . . . . . 33
3.3.2 Descartes . . . . . . . . . . . . . . . . . . . . . . . . . . 33
3.3.3 Robot support packages . . . . . . . . . . . . . . . . . . 33
3.4 Gazebo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.5 Orocos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
3.5.1 Bayesian Filtering Library . . . . . . . . . . . . . . . . . 35
3.5.2 Kinematics and Dynamics Library . . . . . . . . . . . . 35
3.5.3 Real-Time Toolkit . . . . . . . . . . . . . . . . . . . . . . 36
3.6 YARP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.7 OpenRAVE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.8 RoboDK . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.9 FlexGUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
3.10 KUKAVARPROXY . . . . . . . . . . . . . . . . . . . . . . . . . . 38
vi
4.4.1 Physical access . . . . . . . . . . . . . . . . . . . . . . . 45
4.4.2 Remote access . . . . . . . . . . . . . . . . . . . . . . . . 45
4.5 Control of mathematically coupled external axes with RSI . . . . 47
4.6 Path planning and robot motion . . . . . . . . . . . . . . . . . . 48
References 69
vii
List of Tables
viii
List of Figures
ix
Abbreviations
IPOC Interpolation cycle. 14, 22, 49, 51, 55, 56, 59, 60, 63–65, 69
KRC KUKA Robot Controller. 3–10, 13–15, 20, 22, 23, 25, 26, 38, 41–43, 46, 47,
49–51, 54, 55, 59, 61, 64, 65, 69
KRL KUKA Robot Language. 15, 16, 18, 21–23, 37–39, 41, 55, 61, 63–66
x
KSS KUKA System Software. 3, 7, 13, 14, 21, 38, 46, 49, 54, 57
KVP KUKAVARPROXY. 2, 23, 38, 41, 47, 50, 51, 53–57, 59–61, 64–66, 69
PTP pose-to-pose. 17
ROS Robot Operating System. 2, 25, 26, 28, 32–37, 44, 48–51, 53, 54, 63–67, 69
RSI Robot Sensor Interface. 2, 21–23, 41, 47, 49–51, 54, 63–65, 69
xi
RTD round-trip delay time. 54, 55, 57, 59, 62, 63
TCP Tool Center Point. 16, 19–21, 46, 49, 50, 63, 65, 66, 69
xii
Chapter 1
Introduction
In Isaac Asimov’s The Caves of Steel, R. Daneel once said “Aimless extension of
knowledge, however, which is what I think you really mean by the term curiosity,
is merely inefficiency". The lens with which curiosity is focused into research is
laboratories. To this purpose the Department of Engineering Cybernetics (ITK)
acquired a previously used robotics laboratory during the summer of 2016.
SINTEF and Hydro originally commissioned the laboratory in 2005 for research
1
2 CHAPTER 1. INTRODUCTION
• Use of mathematically coupled external axes with ROS using Robot Sensor
Interface (RSI)
Chapter 2
KUKA is one of the biggest robot manufacturing companies in the world[5]. The
company was founded in 1898, and soon expanded into welding and welding
solutions. After the rise of the Unimate, the first industrial robot, KUKA saw
an opportunity in industrial manipulators. And by 1971 they delivered Europe’s
first welding transfer line with robots to Volkswagen AG. In 1973 KUKA made
the first robot with six electromechanically driven axes. In 1996 they released
the KUKA Robot Controller (KRC) 1 controller, which was the first PC based
controller running both Windows and a real-time OS[6].
Several versions of the KRC and KUKA System Software (KSS) exist, and
there have been some major changes between versions. Unless specified, all
information regarding KRC and KSS in this text refers to version 5.4 and KRC 2
2005 edition for use with standard robots. There might be small changes in KRC
and KSS for use with heavy-duty, palletizer or press-to-press robots.
3
4 CHAPTER 2. KUKA ROBOT SYSTEM
Figure 2.1: KRC 2 layout. Adapted from [7, Fig 2-2]. Courtesy of KUKA.
The KVGA has a proprietary connection to the KUKA Control Panel (KCP),
and offers a standard VGA plug for an extra monitor. This monitor will show the
same image as is on the KCP display. MFC3 handles most of the communication
between the computer and robot systems. It connects the servo controllers,
E-STOP controller and DeviceNet bus.
Figure 2.2: Power module placement in the KRC 2. Courtesy of KUKA[7, Fig
2-20].
2.1. KUKA ROBOT CONTROLLER 7
The KRC has four different modes for stopping a robot’s movement.
Ramp-down braking
Equivalent to EN 60204-11 STOP 2. This is used for deceleration during
normal operation. Will keep the planned path during braking.
Path-maintaining braking
Equivalent to EN 60204-1 STOP 1. This uses servos to decelerate the robot.
Once the robot is stationary, or after a maximum allowed time of 1 second,
it applies the brakes and cuts power to the servos. Will keep the planed
path during braking.
Path-oriented braking
Equivalent to EN 60204-1 STOP 0. This immediately cuts power to the
servos and applies the brakes. It will attempt to follow the planned path
using what remains of available energy in the drive circuit.
Short-circuit braking
Only used during controller shutdown, power failure or connection loss
between the RDC and DSE. The brakes are immediately applied and power
to the servos are cut.
controller remains powered off for long periods, or the controllers are frequently
turned on and off, the batteries might deplete or lose the ability to retain charge. If
the KRC is turned off or loses power without working battery backup, mastering
information will be lost.
2.1.7 Safety
The safety system consist of external and internal safeguards. The external
safeguards are installation specific, like fences, gates, pressure mats, etc. Internal
safeguards consists of axis monitoring, workspace monitoring, operating modes,
etc. Electronic Safety Circuit (ESC) is responsible for monitoring all safety related
hardware. The KRC 2 safety electronics are made in accordance with the now
withdrawn EN 954-1 Category 3. This guarantees a single fault in the safety
system will not interfere the function of said system. The KRC has four operating
modes, different safety features are available depending on the active mode. See
table 2.1 for the different modes. The KCP is outfitted with a local emergency
stop. In addition to this, there is an input for external emergency stop.
External safeguards like safety gates, safety mats and laser fences are con-
nected to the Operator safety input. In automatic mode, triggering this input
will stop robot movement. Its intended purpose is to protect an operator entering
the cell during normal operation, for example at a loading station. While there are
both mechanical end stops and software limit switches, these are only intended
as machine protection and should not be relied upon for operator safety. To move
the robot in T1 or T2, one of the enable switches on the KCP must be pressed
down.
2.2 KR 16
Figure 2.4: Rotational direction for robot axes. Courtesy of KUKA[8, Fig 1-2].
12 CHAPTER 2. KUKA ROBOT SYSTEM
Figure 2.5: Principal dimensions and working envelope of the KR 16. Courtesy of
KUKA[8, Fig 3-9].
2.3. KUKA SYSTEM SOFTWARE 13
When starting KSS, VxWorks along with all robot programs is loaded into
a RAM disk. According to [13] the x86 MMU is used to protect this RAM disk,
along with VxWorks RAM space from Windows XP. This ensures VxWorks will
run as expected, even if Windows XP segfaults (bluescreen). This places a limit
on how much space one can use for creating programs for the robot.
Communication between VxWorks and Windows is done over a virtual net-
work utilizing standard TCP/IP protocols. While most of the KSS runs on VxWorks,
KUKA Human-Machine Interface (KUKA.HMI) runs in Windows XP. KUKA.HMI
14 CHAPTER 2. KUKA ROBOT SYSTEM
is the graphical user interface (GUI) for KSS. All robot programming and most of
the configuration can be done directly from KUKA.HMI. In addition to KUKA.HMI,
KUKA.Cross3, which runs in Windows, sets up and manages the connection and
information flow between VxWorks and Windows. There is also a KUKA Cross-
Com Visual Basic library that is used internally by KUKA. Among other functions,
it allows reading and writing to global variables on the KSS.
KUKA offers several "tech packages", which expands the functionality of
KSS. This includes packages for specialized operation, like KUKA.ArcTech which
provides support functions for for arc welding, as well as more general packages
for communication with other systems like KUKA.RSI and KRL.Ethernet.
By default three user levels are configured in KSS. These are user, expert
and administrator. Not all functions are available for all users, and most con-
figuration options are unavailable for the user level. Additional users and access
levels can be set up on the KSS[14].
3 Submit interpreter
Periodic tasks. Worth noting is that it might not complete a single run,
or complete several runs depending on the execution time of code in the
SPS.SUB.
2.5. SUBMIT INTERPRETER 15
4 Windows
Execution of all Windows programs and functions, including updating of
GUI is in this step.
In an e-mail from KUKA Support it was clarified that part 1 and 2 runs at a
higher priority than part 3. Windows has the lowest priority on the controller,
and runs instead of the VxWorks idle task. Depending on complexity of part 1
and 2, run time for part 3 and 4 might be reduced.
2.6 Programming
KRL is a high level programming language created by KUKA. It is based on PAS-
CAL, and used on all KRC controllers. A KRL program consists of a .SRC file and
an optional .DAT file. All program code is in the .SRC file. To increase readability
a .DAT file, referred to as a datalist, can be used to initialize variables with data,
and store it between program runs. KRL has support for conditional branching,
loops, timers and interrupts[15]. Using interrupts it is possible to react to input or
events during program execution. Table 2.4 has the most common KRL keywords.
KRL has support for both subprograms and functions. Whereas a function returns
16 CHAPTER 2. KUKA ROBOT SYSTEM
configuration
Keyword Data type Range
Keywords Function
FOLD Used to organize code in logical blocks. A fold can be opened
or closed, hiding the code contained within the fold. One
must have user level expert or above to see a FOLD.
STRUC Create a composite data type.
ENUM Create an enumeration data type.
DECL Declare a variable.
IF, ELSE, ENDIF Used for conditional branching.
SWITCH Conditional branching. Can be used to avoid many nested
IF statements
FOR Counting loop
WHILE Conditional loop
REPEAT Conditional loop. Condition is checked at end of loop. Code
is run atleast once
LOOP Infinite loop. Must use EXIT to end loop.
PTP Point-to-point motion. Moves all joints into the position
supplied. This can either be supplied as joint angles or a
Cartesian position.
PTP_REL Same as PTP, but moves relative to current position.
LIN Linear motion between a start point and a end point.
CIRC Circular motion. Defined by three points: a start point, a
end point and a auxiliary point. These are used to calculate
an arc that the robot follows.
: Geometric operator. Calculates transformation of two coor-
dinate systems.
between coordinate frames can be calculated using the geometric operator ":".
The four predefined Cartesian coordinate systems is listed in Table 2.5. In addition
to Cartesian coordinate systems, there is a joint coordinate system. This is axis
specific, and all joint values are used to define a point in space.
with path maintaining braking. The monitoring-tunnel must be adjusted for each
movement where it is required. Collision monitoring is not available for external
axes[18].
account during path planning. For non-coupled motions, like the feed servo for a
welding gun, this is not required. Asynchronous motions are either coordinated
or uncoordinated. Coordinated motions are controlled from the KRL program,
while uncoordinated motions are controlled from a separate operating panel.
With a ROBROOT kinematic system, the ERSYSROOT coordinate system is de-
fined. This is located at the zero point of the first axis in the kinematic system.
The WORLD coordinate system can be offset from ERSYSROOT, and a transform
between ROBROOT and WORLD is calculated using ERSYSROOT along with current
axis positions for the kinematic system[19]. This allows the controller to compute
the TCP position in reference to the WORLD coordinate system. Using a ROBROOT
system, the position of the external axes must be supplied for any robot move-
ment where it is required to move the external axes. If only a Cartesian point is
specified, the controller will try to reach this point only using the robot axes. If
the point is out of reach for the robot an error will be reported and the program
halted.
Normal mode
Remote system
Fast mode
Remote system
This object is then automatically updated against the KRL variable when RSI
sends or receives data. Table 2.6 shows pre-existing RSI objects. Incoming data
can be used for input to sensor guided motion. RSI will try to apply any position
or axis corrections within the same IPOC it receives them. This allows for precise
position control in 12ms steps. Large corrections will cause steep acceleration
and fast motions.
RSI works on a lower level than the KRL interpreter, and some of the safety
features of the controller is ignored. If a Cartesian, or joint value, correction is
issued using RSI, the KRC will attempt to reach the new set point within the
current 12ms IPOC. Validity of the new point is not checked before the move-
ment is initiated. Programming errors can lead to very sudden and unexpected
movements. It is recommended to limit workspace size to minimum requirements
to minimize consequences of errors.
During normal KRL execution, velocity and acceleration is automatically
limited to the defined maximum speed for the robot. It is possible to limit this
further by setting a maximum joint speed for the current KRL program using
OV _PRO. By limiting robot velocity to what is necessary for the planned motion,
the damage caused by programming errors can be limited. These limits are
enforced if the robot is being remote controlled using KVP. However, RSI does
2.9. FIELDBUS 23
Keyword Description
DEF_RIst Send the Cartesian actual position
DEF_RSol Send the Cartesian command position
DEF_AIPos Send the axis-specific actual position of axes A1 to A6
DEF_ASPos Send the axis-specific command position of axes A1 to A6
DEF_EIPos Send the axis-specific actual position of axes E1 to E6
DEF_ESPos Send the axis-specific command position of axes E1 to E6
DEF_MACur Send the motor currents of robot axes A1 to A6
DEF_MECur Send the motor currents of external axes E1 to E6
DEF_Delay Send the number of late data packets
not honor these restrictions. During testing in T1 mode it was found that the
KRC will enter a protective STOP mode after the velocity exceeds the limit of 250
mm/s. We have not attempted to exceed maximum velocity or acceleration for
the robot, but assume the controller will apply brakes and abort the program with
error 1101 COMMAND ACCELERATION EXCEEDED or 1102 COMMAND VELOCITY
EXCEEDED[22].
2.9 Fieldbus
Fieldbus is a set of standards defining networks and protocols for communication
in process automation, usually between a PLC and programmable sensors and
devices. It was first standardized by ISA in 1992, and received significant expan-
sion when standardized by IEC in 2000[23]. Various transmission protocols and
topologies exist within these standards, but the trend for the last years is to move
to devices using Ethernet as a transmission media[23].
GSD (equipment master data) file, which is used when configuring the master for
work with a slave. The maximum transfer rate is between 9600Kbps and 12Mbps
depending on cable length[23].
Interbus is divided into two section, local loop and remote bus. Devices like
sensors and actuators are connected to the local loop, which is terminated in
remote nodes. These nodes are connected through the remote bus, usually over
Category 5, twisted-pair copper wiring. One pair is usualy used for power, and the
local loop and remote bus uses 1 or 2 pairs for communication. Data is forwarded
from nodes in a ring structure, with a maximum of 4096 local and remote modules.
The transmission protocol has a data rate of 500Kbps and is designed to have very
little overhead[23].
Chapter 3
Robot software
25
26 CHAPTER 3. ROBOT SOFTWARE
In accordance with these goals, today there are over 7000 unique ROS pack-
ages[25]. These packages are loosely connected, and it is easy to change out
components to suite whatever needs one might have. ROS has native bindings
for Python, C++ and LISP, with experimental support for Java and Lua.
Nodes in ROS are usually programs designed for specific tasks. A complete sys-
tem consists of many nodes, where each node is responsible for part of the
total control of the robot. In figure 3.1, nodes are marked as ellipses. The
kuka_hardware_interface is responsible for communication between ROS and
the KRC. The robot_state_publisher is responsible for computing all necessary
transformations for the robot.
Xacro is an XML macro language. It makes it easier to work with large URDF
models. It has support for parameters, simple math functions, inclusion of other
files, parameters and conditional blocks. This makes it easy to use concise URDF
files to build large, complex robot models.
MoveIt! is a motion planner for ROS. According to [30] it is "state of the art
software for mobile manipulation, incorporating the latest advances in motion
planning, manipulation, 3D perception, kinematics, control and navigation". It
has a modular design, and supports several libraries for planning, kinematics and
collision checking. MoveIt! can be interfaced through C++, Python, or a GUI.
Figure 3.4 illustrates the integration of MoveIt! with ROS.
rqt is a qt based GUI framework for ROS. It can be expanded by plugins, and
is the preferred way to create new GUI applications for ROS. Over 20 plugins is
available, including plugins for robot diagnostics and control[31].
rviz is a 3D visualization tool for ROS, that can be run through rqt or as a
standalone app. In addition to render robots poses, it is used for displaying sensor
3.1. ROBOT OPERATING SYSTEM 29
base_link
base_link-base joint_a1
base link_1
xyz: 0.26 0 0
rpy: 0 -0 0
joint_a2
link_2
xyz: 0.68 0 0
rpy: 0 -0 0
joint_a3
link_3
joint_a4
link_4
xyz: 0 0 0
rpy: 0 -0 0
joint_a5
link_5
xyz: 0 0 0
rpy: 0 -0 0
joint_a6
link_6
xyz: 0.158 0 0
rpy: 0 1.5708 0
joint_a6-tool0
tool0
data, forces, path visualization (with MoveIt!), navigation data, and more[32].
3.2 ROS 2
Several limitations exist in the current ROS design, most notably are missing real-
time support, lack of security features and support for running multiple robots
at the same time. In order to address these issues, it was not deemed feasible to
maintain backwards compatibility, and work was started on ROS 2[34]. Among
other infrastructure changes, ROS 2 is designed to be real-time safe, and uses
Data-Distribution Service for Real-Time Systems (DDS) for communication. A list
of changes between ROS 1 and ROS 2 is in [35]. The default DDS implementation
used in ROS 2 is eProsima Fast RTPS[36]. It offers both authentication and
encryption of traffic[37]. The first non-beta release of ROS 2, Ardent Apalone,
was released on December 8, 2017[38]. A communication bridge for allowing ROS
1 and ROS 2 packages to communicate is available with the ROS 2 distribution.
new features can create a Focused Technical Project (FTP), where development is
funded by interested RIC members.
3.3.2 Descartes
Descartes is another example of an FTP. It is a path planning library for semi-
constrained Cartesian paths. Semi-constrained in this context means that the
path is specified with less degrees of freedom compared to what is available on
the robot. This could for example be for drilling, where rotation around the drill
bit is indifferent. As it is a Cartesian planner, it takes a list of Cartesian points,
and calculates a trajectory following these points[41]. MoveIt! currently lacks a
good Cartesian planner, and there is an open issue on GitHub for integrating the
Descartes with MoveIt![42].
<robotname>_support
Necessary 3D models and XACRO files for creating a robot URDF. By using
34 CHAPTER 3. ROBOT SOFTWARE
<robotname>_moveit_config
Configuration files for using MoveIt! with robot.
<robotname>_moveit_plugins
Robot specific MoveIt! plugins, like kinematic solvers.
<robotname>_gazebo
Configuration files for using Gazebo
<manufacturer>_driver
Driver for connecting the robots to ROS. Naming is inconsistent across
manufacturers
3.4 Gazebo
Gazebo is a 3D physics simulation environment for robotics, which started at the
Robotics Research Labs, University of Southern California[44]. By simulating a
wide range of sensors, with optional noise, it provides a realistic environment
for the simulated robots[44]. It has support for several physics engines, but the
choice must be made at compile time. Open Dynamics Engine (ODE) is the default
physics engine, and is distributed with the binary release[45]. Gazebo uses the
SDF format to describe the simulation, with Collada or STL files for describing 3D
objects.
ROS uses Gazebo as the primary physics simulation tool. The Gazebo release
cycle is independent from the ROS release cycle, a specific Gazebo version is
therefore locked to a ROS distribution in order to maintain lifecycle compatibility.
1 https://github.com/ros-industrial/kuka_experimental
3.5. OROCOS 35
A SDF description is auto generated from an URDF file when using Gazebo with
ROS. A <gazebo> element is added to URDF to provide information needed by
Gazebo that not specified in the URDF standard.
3.5 Orocos
Herman Bruyninckx of Katholieke Universiteit Leuven first launched the idea of
an open control framework for robotics, Open RObot Control Software (Orocos),
on the EURON mailing list in December 2000. The project was made possible by
an EU grant, and the initial version was released in 2002[46]. This release then
turned into the Real-Time Toolkit (RTT). By 2009 both the Bayesian Filtering
Library (BFL) and the Kinematics and Dynamics Library (KDL) had been added
as subprojects to Orocos. They provide stand-alone functionality, allowing them
to be used outside Orocos. While lack of activity on the project web site1 might
indicate this project is dead, all three sub projects have seen releases on Github
over the past two years[47]–[49]. The Orocos project is focused on creating
a framework for real-time control of robots[46], as such both KDL and BFL is
real-time safe.
RTT is a C++ framework for creating real-time applications that is modular and
run-time configurable[54]. RTT programs are divided into packages that consists
of one or more components. Each component then implements some functionality.
Components are run by the Orocos deployer. Orocos State machine Description
(osd) provides support for event driven components[55].
OroGen is a code generator for RTT that assists in the creation of new
RTT components. One specifies the component in a definition file, and oroGen
creates C++ and CMake files based on this specification[56]. Orocos Compo-
nent Library (ocl) contains optional RTT infrastructure components. The ROS
rtt_ros_integration package provides RTT and ROS integration.
3.6 YARP
Yet Another Robot Platform (YARP) stems from research in humanoid robotics
at the LIRA Laboratory at University of Genova, and the CSAIL and AILabs at
Massachusetts Institute of Technology[57]. It started out as a library to increase
maintainability and usability of software in complex systems with changing hard-
ware. It does this by providing communication and hardware abstraction[57]. A
YARP based system is organized into small processes, where each is responsible
for a task. The underlying communication mechanism is plugin based, and can
be easily changed to suit requirements and available hardware without changing
code in the processes[58].
3.7. OPENRAVE 37
3.7 OpenRAVE
3.8 RoboDK
3.9 FlexGUI
FlexGUI is a web based GUI for robot and factory management, created by PPM
A/S. Since it is web based, it can run on any device with a web browser. FlexGUI
4.0 connects to ROS, and is able to control any ROS enabled robot. Custom control
and monitoring screens is created from within a web browser, and allows for
creating a GUI highly customized to the current user and process. With Factory
Designer it is possible to create a screen containing all processes in a plant. While
advanced features like Factory Designer is not free, part of FlexGUI has been
open sourced, and is available via ROS-I[62].
38 CHAPTER 3. ROBOT SOFTWARE
3.10 KUKAVARPROXY
KVP is created by the IMTS S.r.L. Company, and released in binary form on
sourceforge1 together with openshowvar. It acts as a TCP/IP bridge between
external systems and KSS. According to [63] a maximum of 10 simultaneous
connections to KVP is supported. KVP runs on the Windows side of the KRC,
and is able to communicate with the VxWorks side of the controller via KUKA
CrossCom. This communication is illustrated in Figure 3.5. We have not been
successful in finding any documentation on the KUKA CrossCom library. The
only place KVP appears to be documented is in [63]. KVP appears to have been
used successfully in numerous research projects as well as commercial software
like roboDK[63]–[66].
Figure 3.5: Communication between and external system and KSS using KVP.
1 https://sourceforge.net/projects/openshowvar/
Chapter 4
Two of the planned research scenarios for the laboratory is additive manufacturing
and testing gripping scenarios. Both of these will most likely require gathering
and processing of (depth) images, which is computationally expensive. The
computing power of the KRC 2 controller is limited, and outdated by today’s
standard. Instead of upgrading the KRC controllers, it was decided to let them
only handle motion and safety, and use a external system to handle everything
else.
For open-loop control, a path can be preplanned and used to generate KRL
files, for example with the postprocessors from RoboDK. These files would then
be uploaded to the KRC and executed. For closed-loop control, the ability to
adjust the path during execution is required. In our laboratory we can use either
RSI or KVP to achieve closed-loop control.
39
40 CHAPTER 4. ROBOT CELL SETUP
• 2x SWS-020 toolchangers
• 1x E-STOP controller
The KRC 2 for the gantry mounted KR 16 is fitted with an expansion cabinet
for controlling the gantry. The RDC for the gantry is placed on the right leg,
seen from the control station. Apart from the gantry, setup for both robots
are identical. The Schunk FTC-50-80 force-torque sensors are mounted on the
robots, and connected to the KRC over DeviceNet. The SWS-020 toolchanger is
pneumatically operated, and controlled over Profibus via the SMC EX250. The
SMC EX250 is placed on 3rd axis arm of the KR 16. The auxiliary DC power
system consists of two power supplies placed at the KRC, and DC-DC converters
at each robot base. Together these supply 24V, 12V and 5V to equipment and
tools on the robot.
4.2. SELECTION OF MIDDLEWARE 41
Figure 4.1: The laboratory as seen from the control station. The KRC cabinets are
on the left side, with the control computer on the right side.
Availability
Free to use? Available sourcecode?
Adaptability
How easy is it to adapt to the current task at hand?
Interoperability
Is it already integrated into other frameworks? How easy is it to integrate
with other frameworks?
42 CHAPTER 4. ROBOT CELL SETUP
Expected lifetime/Community
Is this something that will be around for years to come? How big is the
userbase?
ROS has almost 19 000 wiki pages, along with some 18 000 users on the
primary support platform1 , meaning there is a large community around ROS[70].
According to [70] ROS has over 13 million downloads of over 9000 unique packages.
By utilizing existing packages in the robotics lab, we are able to spend less time
on creating a support framework and more time on completing the wanted task.
The major drawback of ROS is the lack of hard real-time support. It is possible to
use Orocos for tasks with real-time demands, and offloading non-real-time tasks
to ROS. Due to the high number of preexisting packages, and interoperabillity
with other middleware, it was decided to interface the laboratory with ROS.
As ROS is primarily targeted for Ubuntu, this was a natural choice of Operating
System for the control computer. In [4], the laboratory was set up using ROS
Indigo and Ubuntu 14.04. MoveIt! was released for ROS Kinetic in late December
2016, and it was decided to upgrade the laboratory to Kinetic and Ubuntu 16.04
Xenial Xerus. Both Kinetic and Xenial are Long Term Support (LTS) releases, with
support until April 2021[71].
1 https://answers.ros.og
4.3. SAFETY 43
4.3 Safety
The following safety hazards have been identified in the robot cell:
• Collision
4.3.3 Collision
Two main collision scenarios have been identified:
44 CHAPTER 4. ROBOT CELL SETUP
• Floor
• Gantry rail
• Gantry leg
• Fence
While this will help in minimizing collision, it will not negate the risk com-
pletely. The robots could still collide with each other inside the defined workspace.
For the gantry robot, the elbow joint and robot base could collide with the floor
or gantry rails and legs even though the TCP is inside the defined workspace.
As the robot needs to come in contact with the toolholders during a tool change
operation, protecting against these are not possible using workspace monitoring.
The KRC has collision monitoring, but this requires tuning for each pro-
grammed path. Since this is a laboratory setup, where robot paths are expected
to change often, this is not suitable for use in our case.
release during motion, followed by the tool being thrown over the security fence.
To negate this risk, one should check that the robot is stationary and positioned
at a toolholder before releasing the tool lock.
4.4 Security
The security risks are identified as unauthorized access, use or modification of
the robot cell. These can again be divided into physical or remote access.
software directly, rather than transfer it to the system via other media simplifies
this work. Should the computer not have an Internet connection, the process
of installing the latest security and bug fixes will become cumbersome, and
likely something that is not done regularly. Moreover, it will ease the software
development process, as changes made during laboratory testing can easily be
synchronized to a centralized repository.
As this is a small laboratory, where it is relatively easy to gain physical
access, we consider the risk of a targeted, Internet based attack to be minimal.
Untargeted attacks usually exploit known security holes in software, and patches
to fix security issues are frequently released. Ubuntu has support for automatically
installing security updates, limiting this attack vector[72].
ROS is not designed with security in mind, and has no mechanisms for au-
thentication or authorization of incoming traffic. Running ROS on a system with
Internet connection and no firewall would allow anyone to take control of the
system. Security must therefore be solved outside of ROS itself before the control
computer is connected to the Internet.
To highlight this problem, scans for open ROS installations in NTNU’s network
was performed on 8 occasions during February and March of 2017. These revealed
an average of 6 accessible installations, spread over 13 unique IP addresses. While
this is a low number of installations, each of them could expose control of real
hardware to anyone on the Internet.
While Ubuntu by default comes without an enabled firewall, it has support for
a kernel level firewall through Netfilter[73]. This can easily be used to only allow
incoming traffic that is related to current outgoing traffic. With all unwanted
incoming traffic blocked, the risk from security holes in software that opens
outgoing connections still remain. Automatically installing security updates will
reduce this risk, but not entirely remove it. In addition, there are plans for moving
the control computer from a public routable network, to a internal NTNU network.
This network uses a NAT to allow outgoing Internet traffic while limiting the
exposure of connected devices.
With proper security measures, like automatic updates and a firewall, we
believe the benefits far outweighs the risks of connecting the control computer to
the Internet.
4.5. CONTROL OF MATHEMATICALLY COUPLED EXTERNAL AXES WITH RSI47
before counteracting these corrections. This is not easily implemented into the
current kuka_rsi_hw_interface, and would require restructuring the driver.
The ability to use workspace monitoring makes up for the added complexity
of the controller code. In addition to workspace monitoring, it will make it
possible to check the Cartesian TCP position before releasing the tool lock on the
toolchanger. It is not possible to set the mathematical coupling of axes at runtime.
If it is removed, it will not be possible to use Cartesian workspace monitoring
with the KVP driver. The KVP driver is unaffected by this problem as we only
use fully specified joint values.
interfaces uses the same ROS Control interfaces. The Joint State Interface, along
with the Joint State Controller is used to publish the current joint values on the
joint_states topic. As the KRC does not provide joint velocity or acceleration
values, only joint position is published. The Joint Command interface is used to
receive a joint value from ROS, which is forwarded to the KRC. Update frequency
for the RSI interface is controlled from the KRC and follows the IPOC. The KVP
interface attempts to follow the IPOC 12ms update rate, but is dependent on read
and write speed from KVP.
It is possible to use ROS Control as a Orocos Component, enabling hard-
realtime control of the robot. A example of how to create this integration is
available on GitHub1 .
MoveIt! is the best supported path planner for ROS. It uses a concept of move
groups to plan motions. A move group is a collection of joints that should be con-
trolled simultaneously. When given a start and goal position, it plans a collision
free path in joint space between the points. Using iterative parabolic time param-
eterization MoveIt! can add optional time parameters to this path, generating a
trajectory. This parameterization is based on velocity and acceleration limits[75].
The generated path or trajectory is handed over to a joint trajectory controller.
This controller is responsible for executing the trajectory on actual hardware. An
example for a trajectory controller is the ROS Control Joint Trajectory controller.
1 https://github.com/skohlbr/rtt_ros_control_example
50 CHAPTER 4. ROBOT CELL SETUP
Chapter 5
Based in part on work done in [4], the following areas have been identified for
improvements.
Workspace monitoring
In order to enable workspace monitoring, we need the ability to control
mathematically coupled axes from ROS.
51
52 CHAPTER 5. DEVELOPMENT AND EXPERIMENTAL WORK
Since Windows XP is running as the VxWorks’ idle task, the CPU time avail-
able for Windows will depend on controller load. As the exact task planning for
VxWorks on the KRC is unknown to us, we have to assume non-deterministic be-
haviour for windows runtime. In Figure 5.1 it is assumed all VxWorks tasks finish
before Windows XP uses the remaining IPOC. This is most likely an oversimplifi-
cation, but illustrates some wait-delays that may occur during KVP processing.
A number of ICMP ping tests should be done to find an average RTD. Timing
a number of read and write tests with different variables, will provide data on
KVP latency. By testing with two different libraries, and all other parts being
equal, any major difference in test results should be due to performance of the
libraries on the control computer.
In [63] it is concluded that access time is the same regardless of data type.
To confirm this on a KRC2, tests will be run with a single data type (INT ) and a
composite data type (E6AXIS).
To see if multiple connections affects access time, tests should be run using
both a single connection and multiple connections.
While it is nice to know how long it takes to write to a variable, there might be
an unknown delay from KVP reports the variable as written until it is accessible
from a KRL program. To get an idea of the order of magnitude of this delay, a
write-copy-read strategy, which is illustrated in Figure 5.2, is used.
5.1.1 Results
CHAPTER 5. DEVELOPMENT AND EXPERIMENTAL WORK
All tests are conducted with the robot stationary and no program selected
on the controller. Access time is measured from a command is issued until it is
completed. This includes formatting of KVP packages and network delay. Each
test is run 1000 times. In the 5 thread WRITE-COPY-READ test, only one of the
threads is used for measurement. The remainder of the threads run read and write
operations in order to add load to the network and controller.
Table 5.1: Round-trip delay time (RTD) for ICMP ping requests in ms. n=1000
5.1.2 Discussion
During tests in the lab, it has not been possible to use more than 5 simultaneous
connections. This might be from some underlying differences in KUKA CrossCom
between KSS 5.x and KSS 8.x, which is propagated to KUKAVARPROXY.
Results from the ICMP ping test in Table 5.1 places the network RTD in the
expected range of below 1ms.
In [63] access time is reported as 4.27ms average using JOpenShowVar on a
KRC4. This is higher than the 2.64ms - 3.64ms average access time on the KRC 2
56 CHAPTER 5. DEVELOPMENT AND EXPERIMENTAL WORK
Test Threads Max Min Median Mean Std. dev # > 30ms
Read 1 61.66 1.64 2.05 2.40 0.96 5
Write 1 58.76 1.57 2.00 2.32 0.95 4
Read 5 622.96 4.95 10.68 11.34 2.38 114
Write 5 78.78 4.05 10.17 10.92 1.52 273
Table 5.5: Additional C++ read and write test in ms. n=500 000
5.1. ACCESS TIME FOR KUKAVARPROXY 57
every time a request is sent. Further studies could asses this by introducing a
random wait [0-12ms] between each request.
LOOP
PTP AXIS_ACT
ENDLOOP
Listing 5.1: KRL code to move robot using KVP
60 CHAPTER 5. DEVELOPMENT AND EXPERIMENTAL WORK
The testing the movement latency, a program on the control computer is set
up to measure time from writing a new position to the robot until the external
accelerometer detects movement.
5.2.1 Results
Table 5.6: RTD between the Arduino and the control computer in ms. n=200
5.2.2 Discussion
RTD between the Arduino and control computer is within the expected range. For
C++ this test was done using Boost’s serial port library. For the actual movement
test, this library produced too high readings due to resetting of the serial port
after a timeout. It was therefore dropped in favor of using the POSIX termios.h
library. This is used by Boost on Linux, and removing the extra layer provided by
boost should not affect performance in a negative way.
The first result from both the C++ and Java datasets was abnormally large,
and has been discarded. The extra time for these results is most likely from the
Arduino opening the serial port.
The mean movement latency of 5.74 ms for jOpenShowVar and 6.71 ms for
BoostCrossCom is roughly half of the 12 ms IPOC. With the expected results
around 12 ms, both libraries perform better than expected. The only major
difference between jOpenShowVar and BoostCrossCom is in maximum time,
where BoostCrossCom has a 1/3 higher maximum compared to jOpenShowVar.
On average one should be able to update the robot position once every IPOC.
This is comparable with the performance of RSI. However, unlike RSI, the simple
KRL program we used for this test is not able to abort or affect an ongoing motion.
and extra input has to be sent from the external system. Necessary changes was
made for kuka_rsi_hw_interface to send changes in X,Y,Z for the ST_PATHCORR
object. Currently, the link between external axes and the #WORLD frame is hard-
coded to align with our setup. This solution has performed well during testing,
and no additional work is needed for it to work with our hardware setup. Should
this code be considered for inclusion in the official repository, some more work
is needed to make the coupling between axes and directions configurable at run
time.
By updating the controller with the next goal pose after the motion has started,
path interpolation during the KRL advance run can update the motion profile to
avoid a full stop at the current goal. For this to work, there must be enough time
left of the ongoing motion for the KRC to update the motion profile. If this is not
the case, the robot will slow down near to a full stop at the current pose, before
starting the next motion. The result of this is a jerky motion.
The RSI driver uses the Joint Trajectory Controller from ROS Control to
handle path interpolation. The interpolated points will be sent to the KRC every
12 ms, allowing for control of velocity and acceleration from ROS. Testing have
shown that this update rate is too fast for KVP, producing both jerky motion and
skipping some trajectory points altogether.
named after Þrívaldi, a 9 headed jötunn from Norse mythology. The GitHub
organization uses the anglicized version of the name, and is located at https:
//github.com/itk-thrivaldi
1 https://github.com/itk-thrivaldi/thrivaldi_examples
Chapter 6
Access time and movement latency for KVP with a C++ and Java library have
been investigated. The findings from this investigation show a mean access time
that is lower than the 12ms IPOC. This makes KVP a viable control method for
the robots, and shows that a KRC 2 2005ed has comparable performance with the
results on a KRC 4 from [63].
Using ST_PATHCORR to adjust TCP position along with external axes position,
we have enabled the use of mathematically coupled external axes with RSI. This
has allowed us to set up workspace monitoring, significantly improving lab safety.
With KVP as a control interface to the robot, we are able to increase safety by
utilizing functions from the KRC, like velocity limits. That gives us the opportunity
to allow bachelor and master students use the laboratory for learning and research
where precise trajectory control is not needed. At the same time, we have the
possibility to use RSI for research that requires precise trajectory control, or
hard-realtime robot control.
Both the force-torque sensor and the tool change have been integrated with
ROS, with visual and collision models added to the URDF model. By only allowing
release of the tool when the toolchanger is near the tool holder we have prevented
accidental release of the tool.
Areas identified for further work are
67
68 CHAPTER 6. CONCLUSION AND FUTURE WORK
With the rare setup of a 9 DOF robot hovering over the workspace of a 6 DOF
robot, and in the hopes that it meets a better fate than Þrívaldi, who was slain by
Thor, the laboratory is ready to tackle unique challenges.
References
69
70 REFERENCES
[49] Bfl moved to github | the orocos project, [Online]. Available: http : / /
orocos.org/orocos/bfl-moved-github (visited on 10/25/2017).
[50] K. Gadeyne. (2001). Bfl: Bayesian Filtering Library, [Online]. Available:
http://www.orocos.org/bfl (visited on 10/25/2017).
[51] Add documentation for eigen matrix library · issue #6 · toeklk/orocos-
bayesian-filtering, [Online]. Available: https://github.com/toeklk/
orocos-bayesian-filtering/issues/6 (visited on 10/25/2017).
[52] User manual | the orocos project, [Online]. Available: http://orocos.
org/kdl/user-manual (visited on 10/25/2017).
[53] Orocos_kdl - ros wiki, [Online]. Available: http : / / wiki . ros . org /
orocos_kdl (visited on 10/25/2017).
[54] The orocos real-time toolkit | the orocos project, [Online]. Available: http:
//orocos.org/rtt (visited on 10/25/2017).
[55] The orocos component builderś manual, [Online]. Available: http://www.
orocos . org / stable / documentation / rtt / v2 . x / doc - xml / orocos -
components-manual.html (visited on 10/25/2017).
[56] Code generator for components and type handling in rock - the robot
construction kit - and the orocos toolchain, [Online]. Available: https:
//github.com/orocos-toolchain/orogen (visited on 10/25/2017).
[57] G. Metta, P. Fitzpatrick, and L. Natale, “Yarp: Yet another robot platform,”
International Journal of Advanced Robotic Systems, vol. 3, no. 1, p. 8, 2006.
[58] P. Fitzpatrick, E. Ceseracciu, D. E. Domenichelli, A. Paikan, G. Metta, and
L. Natale, “A middle way for robotics middleware,” Journal of Software
Engineering for Robotics, vol. 5, no. 2, pp. 42–49, 2014.
[59] R. Diankov and J. Kuffner, “Openrave: A planning architecture for au-
tonomous robotics,” Robotics Institute, Pittsburgh, PA, Tech. Rep. CMU-RI-
TR-08-34, vol. 79, 2008.
74 REFERENCES
[71] Distributions - ros wiki, [Online]. Available: http : / / wiki . ros . org /
Distributions (visited on 11/10/2017).
[72] Automaticsecurityupdates - community help wiki, [Online]. Available:
https://help.ubuntu.com/community/AutomaticSecurityUpdates
(visited on 11/06/2017).
[73] Ubuntu 16.04 firewall, [Online]. Available: https://help.ubuntu.com/
lts/serverguide/firewall.html (visited on 11/06/2017).
[74] Joint_trajectory_controller - ros wiki, [Online]. Available: http://wiki.
ros.org/joint_trajectory_controller (visited on 12/02/2017).
[75] Concepts | moveit! [Online]. Available: http : / / moveit . ros . org /
documentation/concepts/ (visited on 12/02/2017).
[76] Force-torque sensor type FTC / FTCL assembly and operating manual, ver-
sion 02/FTC/en/2009-12-28/SW, Schunk, 2008.
[77] Generate ikfast plugin tutorial - moveit_tutorials indigo documentation,
[Online]. Available: http : / / docs . ros . org / kinetic / api / moveit _
tutorials/html/doc/ikfast_tutorial.html (visited on 12/13/2017).