You are on page 1of 7

Available online at www.sciencedirect.

com
Available
Available onlineonline
Available at
at www.sciencedirect.com
at www.sciencedirect.com
online www.sciencedirect.com
Available online at www.sciencedirect.com

ScienceDirect
Procedia Manufacturing 00 (2019) 000–000
Procedia Manufacturing 00
Procedia Manufacturing
Procedia Manufacturing 00 (2019)
51 (2020) 000–000
133–139
(2019) 000–000 www.elsevier.com/locate/procedia
Procedia Manufacturing 00 (2019) 000–000 www.elsevier.com/locate/procedia
www.elsevier.com/locate/procedia
www.elsevier.com/locate/procedia

30th
30th International
International Conference
Conference on
on Flexible
Flexible Automation
Automation and
and Intelligent
Intelligent Manufacturing
Manufacturing (FAIM2021)
(FAIM2021)
30th
30th International
International Conference
Conference on Flexible
on15-18 June
Flexible Automation
2021, and
Athens,
Automation and Intelligent
Greece.
Intelligent Manufacturing
Manufacturing (FAIM2021)
(FAIM2021)
15-18
15-18 June
June 2021,
2021, Athens,
Athens, Greece.
Greece.
15-18 June 2021, Athens, Greece.
Model-based
Model-based
Model-based hardware
hardware in
in the
the loop
loop control
control of
of collaborative
collaborative robots
robots
Model-based hardware
hardware in
in the
the
a,b,∗
loop
loop control
control
a
of
of collaborative
collaborative
b
robots
robots
Mohammad
Mohammad Safeea
Safeea a,b,∗,, Pedro
a,b,∗ Neto aa , Richard Béaréeb
a,b,∗, Pedro Neto a ,, Richard Béarée b
a Univ
Mohammad
Mohammad Safeea
Safeea , Pedro
Pedro Neto
Neto , Richard
Richard Béarée
Béarée b
a Univ Coimbra, Centre for Mechanical Engineering, Materials and Processes, Department
Coimbra, of Mechanical Engineering, Coimbra, Portugal
a Univ
a Univ Coimbra, Centre
Centre for
for Mechanical
Mechanical Engineering,
Engineering, Materials
Materials
b Arts et
and Processes,
andLISPEN,
Métiers, Processes, Department
Department
Lille, France
of
of Mechanical
Mechanical Engineering,
Engineering, Coimbra,
Coimbra, Portugal
Portugal
Coimbra, Centre for Mechanical Engineering, Materials
b Arts
b Arts et andLISPEN,
Métiers, Processes, Department
Lille, France of Mechanical Engineering, Coimbra, Portugal
b Arts et Métiers, LISPEN, Lille, France
et Métiers, LISPEN, Lille, France

Abstract
Abstract
Abstract
Abstract
Simulation and
Simulation and model-based
model-based design
design software
software packages
packages are are widely
widely used in in many
many engineering
engineering disciplines.
disciplines. When
When it it comes toto robotics
robotics those
those tools
tools
Simulation
are very and model-based
important for robot design simulation
design, software packages
and the are widely used
development used
of in many
control engineering
algorithms disciplines.
before the When it comes
implementation comes
on to real
the robotics those
robot. tools
Simulink
Simulation
are very and model-based
important for robot design simulation
design, software packages
and the are widely used
development of in many
control engineering
algorithms disciplines.
before the When it comes
implementation on to real
the robotics those
robot. tools
Simulink
areMathWorks
by very important
R
is for
an robot
advanceddesign, simulation
model-based and
design the development
tool. It is popular ofincontrol algorithms
education, industrybefore
and the implementation
research. In addition, on the real
Simulink robot. Simulink
supports several
are
by very important
MathWorks  for robot design, simulation and the development of control algorithms before the implementation on the real robot. Simulink
R is an advanced model-based design tool. It is popular in education, industry and research. In addition, Simulink supports several
R

by MathWorks
hardware R is an advanced
components,
 model-based
facilitating aa rapid design tool.
deployment of It is
the popular in
developed education,
programs on industry
the targetand research.
hardware. In In addition,
this study, Simulink
the supportsinterface
SimulinkIIWA several
by MathWorks
hardware is an advanced
components, model-based
facilitating rapid design tool.
deployment of It is popular in education, industry and research. In addition, Simulink supportsinterface
several
hardware
for components,
controlling KUKA facilitating
iiwa robots afrom
rapidSimulink
deploymentis of the
the developed
presenteddeveloped
and
programs
programs
compared to
on
on
the
the
the target
KUKA
hardware.
target Sunrise
hardware. In
In this
Toolbox
study,
study, the
this (KST). the SimulinkIIWA
SimulinkIIWA
This interface is interface
based on
hardware
for components,
controlling KUKA facilitating
iiwa robots afrom
rapidSimulink
deploymentis of the developed
presented and programs
compared toon
thethe target Sunrise
KUKA hardware. In this (KST).
Toolbox study, the SimulinkIIWA
This interface is interface
based on
for
the controlling
User KUKA
Datagram iiwa robots
Protocol (UDP) from
and Simulink
allows is presented
graphical real-timeandcontrol
compared of to the
iiwa KUKA
robots from Sunrise
SimulinkToolbox
without (KST).
a need This
for interface
writing iscode.
any basedTheon
for
the controlling
User KUKA
Datagram iiwa
Protocol robots
(UDP) from
and Simulink
allows is
graphicalpresented
real-timeand compared
control of to
iiwa the KUKA
robots from Sunrise
SimulinkToolbox
without (KST).
aa need This
for interface
writing is
any based
code. on
The
the User
interface Datagram
supports Protocol
different (UDP)
robot and
control allows
modes,graphical
at the real-time
joints levelcontrol
and at of iiwa
the robots
end-effectorfrom Simulink
(EEF) level. without
Example need for writing
applications are any
alsocode. The
provided
the User Datagram
interface supports Protocolrobot
different (UDP)control
and allows
modes,graphical
at the real-time
joints levelcontrol
and at of iiwa
the robots from
end-effector Simulink
(EEF) level. without
Example a need for writing
applications are any
alsocode. The
provided
interface
showing the supports
the different
flexibility robot
and the
the easecontrol
usemodes,
of use of the at the joints
the proposed level and at the end-effector (EEF) level. Example applications are also provided
interface.
interface
showing supports different robot control modes, at the joints level and at the end-effector (EEF) level. Example applications are also provided
showing the flexibility
flexibility and
and the ease
ease ofof use of
of the proposed
proposed interface.
interface.
showing the flexibility and the ease of use of the proposed interface.
©

ccc 2020
2020
2020TheThe Authors.
TheAuthors.
Authors. Published
Published
Published by Elsevier
by Elsevier Ltd. Ltd.
by Elsevier
Ltd.

 c 2020
This
This
This 2020
is
The
isisan
an
an
The
Authors.
open
open
open access
access
Authors.
access
Published
article
article
Published
article
by Elsevier
under
under
by
under the CC
CC Ltd.
BY-NC-ND
theBY-NC-ND
Elsevier
the CC
Ltd.BY-NC-ND licenselicense
license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
(https://creativecommons.org/licenses/by-nc-nd/4.0/)
(http://creativecommons.org/licenses/by-nc-nd/4.0/)
This is an open
Peer-review access
under article under
responsibility of the scientific
the CC BY-NC-NDcommittee license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
of the
the
Peer-review
This is an open
Peer-review under
accessresponsibility
article under
of of
thethe
the CCscientific
BY-NC-ND
scientific committee
committee license
Peer-review under responsibility of the scientific committee of the FAIM
under responsibility of ofFAIM
the FAIM2020.2021.
(http://creativecommons.org/licenses/by-nc-nd/4.0/)
FAIM 2020.
2020.
Peer-review under responsibility of the scientific committee of the FAIM 2020.
Keywords: Collaborative
Keywords: Collaborative Robots;
Robots; Model-based
Model-based design;
design; Simulink;
Simulink; Hardware
Hardware inin the
the loop
loop control;
Keywords: Collaborative Robots; Model-based design; Simulink; Hardware in the loop control; control;
Keywords: Collaborative Robots; Model-based design; Simulink; Hardware in the loop control;

ning
ning along
along with
with the
the robot-controller,
robot-controller, where
where the
the PC
PC can
can be
be used
used
1. Introduction ning
for
ning along
performing
along with
with the robot-controller,
computationally
the where
expensive
robot-controller, where the PC
operations,
the PC can
can be
for
be used
treat-
used
1.
1. Introduction
Introduction for
for performing
performing computationally
computationally expensive
expensive operations,
operations, for
for treat-
treat-
1. Introduction ing
for data from
performing
ing data
data from sensors or even
computationally
from sensors or for
or even for implementing
expensive operations,
for implementing control control
for algo-
treat-
control algo-
Due to the demand from industry, KUKA has introduced ing
ing data from sensors
rithms. sensors or even
even for implementing
implementing control algo- algo-
Due
Due to
to the
the demand
demand from
from industry,
industry, KUKA
KUKA has
has introduced
introduced rithms.
rithms.
the
the iiwa
Due
iiwa series
to the
series of collaborative
demand
of from
collaborative manipulators,
industry, KUKA
manipulators, the
has
the result of
introduced
result of the
the The
rithms.
The robotics community
robotics community has
has presented various
presented various software
software
the iiwa series of collaborative manipulators, the result of the The
The robotics
packages related community has
has presented various software
joint
the
joint
joint
research
iiwa series
research
research
efforts
of
efforts
efforts
between
collaborative
between
between
KUKA
KUKA
KUKA
Roboter
manipulators,
Roboter
Roboter
and
the
and
and
the
result
the
the
German
of
German
German
the packages
packages related to
robotics
related to
to
robot
robot simulation
community
robot simulation
simulation
and
and control.
presented
and control.
control.
The
The Robotics
various
The
software
Robotics
Robotics
Aerospace
joint research
Aerospace Center (DLR)
efforts
Center [1].
between
(DLR) [1]. Those robots
KUKArobots
Those have
Roboter
haveandseven degrees
the German
seven degrees Toolbox
packagesfor
Toolbox for MATLAB
related
MATLAB (RTB)
to robot
(RTB) described
simulation andin
described in [3]
control.
[3] is
is used by many
The Robotics
used by many
Aerospace
of freedom
Aerospace Center
(DOF)
Center (DLR)
and
(DLR)are [1]. Those
designed
[1]. Thoseto robots
mimic
robots have
the
have seven
seven degrees
anatomy of the
degrees Toolbox
students
Toolbox for
and
for MATLAB
researchers
MATLAB (RTB)
(RTB) described
worldwide.
described in
This
in [3]
[3] is
is used
toolbox
used by
by many
provides
many
of
of freedom
freedom (DOF)
(DOF) and
and are
are designed
designed to
to mimic
mimic the
the anatomy
anatomy of
of the
the students
students and
and researchers
researchers worldwide.
worldwide. This
This toolbox
toolbox provides
provides
human
of freedom
human arm.
arm. KUKA
(DOF)
KUKA iiwa
and are
iiwa robots are
designed
robots are considered
to mimic
considered thesensitive
anatomy
sensitive manip-
of
manip-the packages
students
packages for
and
for the
the fundamental
researchers
fundamental algorithms
worldwide. This
algorithms in
in robotics,
toolbox
robotics, which
provides
which
human
ulators
human arm.arm.
due KUKA
to the
KUKA iiwa
integratedrobots
iiwa robots are
torque considered
sensors
are consideredin sensitive
their manip-
joints.
sensitive This
manip- packages
are essential
packages for the
forfor fundamental
thetheir modeling
fundamental algorithms
and control.
algorithms in
inRoyrobotics, which
Featherstone
robotics, which
ulators
ulators due
due to
to the
the integrated torque sensors in their joints. This are
are essential
essential for
for their
their modeling
modeling and
and control.
control. Roy
Roy Featherstone
Featherstone
sensitivity
ulators dueis
sensitivity is the integrated
toimportant to
integrated
important to
torque
torque sensors
guarantee
guarantee sensors in
in their
co-worker’s
co-worker’s
joints.
theirsafety
joints.in
safety in
This
hu-
This
hu- described
are essential
described the
the algorithms
for their
algorithms for
modeling
for modeling
and
modeling robot
control.
robot dynamics
Roy [4]
Featherstone
dynamics [4] ac-
ac-
sensitivity
man robot
sensitivity is important
interaction
is important to guarantee
applications.
to guarantee On co-worker’s
the other
co-worker’s safety
hand,
safety in
Simulink
in hu-
hu- described
companied
described the
by
the algorithms
software
algorithms for
for modeling
implementation
modeling robot
robot dynamics
(including
dynamics [4]
Simulink)
[4] ac-
ac-
man
man robot
robot interaction
interaction

applications.
applications. On
On the
the other
other hand,
hand, Simulink
Simulink companied
companied by
by software
software implementation
implementation (including
(including Simulink)
Simulink)
by MathWorks
man
by MathWorks R is anapplications.
robot interaction
R

 is an important
important engineering
On the other
engineering tool used
hand,
tool used for
Simulink
for the
the [5]. The
[5]. The SpaceDyn
companied SpaceDyn
by software toolbox
toolbox introduced in
implementation
introduced in(including
[6] integrates
[6] integrates float-
Simulink)
float-
by MathWorks
development
by MathWorks ofR is an important engineering tool used for the
R
high-tech applications
is an important and
engineeringis widely
tool used popular in
for the [5].
ing
[5]. The
base SpaceDyn
The dynamics
SpaceDynas toolbox
such
toolbox itintroduced
can be
introducedusedin [6]
infor integrates
[6]simulating float-
integrates space
float-
development
development of
of high-tech
high-tech applications
applications and
and is
is widely
widely popular
popular in
in ing
ing base
base dynamics
dynamics as
as such
such it
it can
can be
be used
used for
for simulating
simulating space
space
education,
development
education, research
of and
high-tech
research and industry. For
applications
industry. For example,
and is
example, in
widely
in [2]
[2] Simulink
popular
Simulink in robots.
ing base
robots. Another
dynamics
Another toolbox
as such which
it
toolbox which can can
be be
used
can be used
for for the
simulating
used for model-
space
the model-
education,
is used
education,to research
develop
research andand
and industry.
implement
industry. For
a example,
dynamic
For example, in
walking
in [2]
[2] Simulink
controller
Simulink robots.
robots. Another
ing/simulation
Anotherof oftoolbox
toolbox which
manipulators
whichisiscan
can be
be used
described in for
usedin [7].the
for This
the model-
tool-
model-
is used
is used toto develop
develop and implement
implement aa dynamic
dynamic walking
walking controller
controller ing/simulation
ing/simulation of manipulators
manipulators is described
described in [7].
[7]. This
This tool-
tool-
for
is
forused to develop and
aa human-sized
human-sized bipedal
and robot.
implement
bipedal robot. aThus, combining
dynamic
Thus, walkingthe
combining ease
controller
the ease of
of box
box integrates
ing/simulation
integrates graphical
of
graphical user
manipulators
user interface
is
interface (GUI),
described
(GUI),in 3D
[7].
3D simulator
This tool-
simulator
for
use
for a
of
a human-sized
Simulink
human-sized on bipedal
an robot.
external
bipedal robot. Thus,
computer
Thus, combining
with
combiningthe the ease
capabilities
the ease of
of box
and
box integrates
utilizes
integrates graphical
symbolic
graphical mathuser
for
user interface
producing
interface (GUI),
the
(GUI), 3D
3D simulator
physical quan-
simulator
use of Simulink on an external computer with the capabilities and
and utilizes
utilizes symbolic
symbolic math
math for
for producing the physical quan-
use
of
use of
KUKA
of
of KUKA
Simulink
iiwa
Simulink
KUKA iiwa
on
robot
on
iiwa robot
an
an
robot has
external
has its
external
has its
computer
merits for
computer
its merits
merits for
with
many
with
for many
the capabilities
applications.
applications. In
the capabilities
many applications. In tities
and of
of the
the robot.
titiesutilizes symbolic
robot. The
The math for producing
Machine
Machine Vision
Vision Toolbox
producing the
the physical
Toolbox (MVT)
physical
(MVT) quan-
quan-
intro-
intro-
of
robotics,
of KUKAit is not
iiwa uncommon
robot has its to have
merits an
for external computer
many applications. In
run-
In tities
duced
tities of
in
of the
the robot.
[8], is
robot. a The
The Machine
MATLAB
Machine Vision
toolbox
Vision Toolbox
which
Toolbox (MVT)
integrates
(MVT) intro-
vision
intro-
robotics,
robotics, it
it is
is not
not uncommon
uncommon to
to have
have an
an external
external computer
computer run-
run- duced
duced in
in [8],
[8], is
is a
a MATLAB
MATLAB toolbox
toolbox which
which integrates
integrates vision
vision
robotics, it is not uncommon to have an external computer run- and
duced
and image-processing
in [8], is
image-processing a algorithms,
MATLAB as
toolbox
algorithms, as such
which the
such the user can
integrates
user can extend
vision
extend
and image-processing
his/her robotic algorithms, as
as such the
the user can
can extend
robotic application with
with machine vision capabilities [9].

∗ Corresponding author.
Corresponding author. Tel.:
Tel.: +351 239 790 700
+351 239 700 ;; fax:
fax: +351 239239 790 701.
701. and image-processing
his/her applicationalgorithms,
machine such
vision user extend
capabilities [9].
∗ Corresponding
E-mail address: author. +351 239 790
Tel.:(Mohammad
ms@uc.pt 790
Safeea). +351 239 790
700 ; fax: +351 790 701. his/her robotic application with machine vision capabilities [9].
∗ Corresponding
E-mail address: author. Tel.:(Mohammad
ms@uc.pt +351 239 790 700 ; fax: +351 239 790 701.
Safeea). While
his/her
While the
robotic
the previous
previous software
application
software packages
with machine
packages are
vision
are used
used for
for perform-
capabilities [9].
perform-
E-mail address: ms@uc.pt (Mohammad Safeea). While the previous software packages are used for perform-
E-mail address: ms@uc.pt (Mohammad Safeea). ing advanced
While mathematical
the previous operations
software packagesrelated to
are used robotics, they
for perform-
ing
ing advanced mathematical operations related to robotics, they
2351-9789
2351-9789
2351-9789
2351-9789


cc©2020
2020
2020
copen
2020
The
The
The Authors.
Authors.
Authors.
Thearticle
Authors.
Published
Published
Published
Published
by
by
by
by Ltd.
Elsevier Elsevier Ltd.
Elsevier Ltd. ing advanced
advanced mathematical
mathematical operations
operations related
related to to robotics,
robotics, they
they
Thisis
This isan
2351-9789
This is an
an
open
 c 2020
open
access
access article
Thearticle
access under
Authors. under
the CC
Published
under the CC
theElsevier
BY-NC-ND
by Elsevier
BY-NC-ND
Ltd.
CC BY-NC-ND
license
Ltd.
license
license (https://creativecommons.org/licenses/by-nc-nd/4.0/)
(http://creativecommons.org/licenses/by-nc-nd/4.0/)
(http://creativecommons.org/licenses/by-nc-nd/4.0/)
This is an open
Peer-review
Peer-review access
under
under article under
responsibility
responsibility the scientific
of the
the CC BY-NC-ND
of the scientific
committeelicense (http://creativecommons.org/licenses/by-nc-nd/4.0/)
committee
of the
the FAIM of the FAIM 2021.
2020.
This is an open
Peer-review access
under article under CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/)
Peer-review under responsibility of the scientific committee of the FAIM 2020.
responsibility
10.1016/j.promfg.2020.10.020
of scientific committee of FAIM 2020.
Peer-review under responsibility of the scientific committee of the FAIM 2020.
134 Mohammad Safeea et al. / Procedia Manufacturing 51 (2020) 133–139
M. Safeea et al. / Procedia Manufacturing 00 (2019) 000–000 2

do not support direct control of robots from an external com- 2. SimulinkIIWA interface
puter, consequently other packages have been proposed for this
purpose. The Kuka Control Toolbox (KCT) [10] and the JOpen- The KUKA iiwa 7R800 and 14R820 are programmed using
ShowVar [11, 12] are used for controlling 6 DOF KUKA robots the Java based Sunrise.Workbench engineering suite. In addi-
from MATLAB/Java. However, KCT and JOpenShowVar sup- tion, various packages for controlling the robot from an exter-
port the KRC controller only, as such they can not be used for nal computer have been proposed, by using MATLAB, ROS
controlling KUKA iiwa robots (provided with the newer Sun- and C++. However, no Simulink interface is available for these
rise controller). The Robot Operating System (ROS) is another kind of robots (according to our knowledge). Simulink is a pop-
option for controlling robots from an external computer. Sev- ular tool for developing control algorithms, because it imple-
eral packages have been proposed for different types of manip- ments relevant libraries, including interfaces to a wide range
ulators. In [13] the authors used the ROS interface, iiwa stack, of sensors, actuators and other hardware components. In addi-
for controlling iiwa robot to perform autonomous MRI-guided tion, Simulink allows the development and implementation of
ultrasound, and in [14] the authors presented the KUKA-IIWA- powerful control algorithms graphically, without requiring to
API, an interface for controlling iiwa using ROS. This interface write any code. Due to those advantages, we present an inter-
provides data acquisition and point-to-point (PTP) motion fea- face for on-the-fly control of KUKA iiwa manipulators using
tures, but it does not support on-the-fly control feature. Simulink, this interface supports several operation modes elab-
Recently, the KUKA Sunrise Toolbox (KST) [15] is intro- orated in subsection 2.1. The interface consists of two parts, the
duced. It is a MATLAB toolbox that allows controlling KUKA SimulinkIIWA Sunrise application (runs in the robot controller)
iiwa robots from an external computer. KST implements Trans- demonstrated in subsection 2.2, and the SimulinkIIWA subsys-
mission Control Protocol Internet Protocol (TCP/IP) to connect tem blocks (in Simulink) described in subsection 2.3. The in-
with the robot. It integrates several functionalities including (1) terface is available in the public repository [16], which includes
networking functions, (2) point-to-point motion functions, (3) additional documentation including a web-link to video tutori-
on-the-fly control functions, (4) setters and getters of robot pa- als.
rameters, (5) general purpose control functions and (6) phys-
ical interaction functions. KST allows the user to control the 2.1. Supported operation modes
robot remotely from MATLAB scripting language. Due to its
complex design, it does not implement Simulink integration. SimulinkIIWA interface supports different on-the-fly control
As such, we developed the SimulinkIIWA interface for con- modes, each operation mode is provided in a different applica-
trolling KUKA iiwa robots from Simulink. Unlike the KST tion that the user can run from the teach pendant of the robot.
and the previously listed ROS-interfaces (all TCP/IP based), Those applications were written using the Sunrise.Workbench.
the SimulinkIIWA has a different nature, Table I. It is based on The control modes provided by the SimulinkIIWA interface are:
the User Datagram Protocol (UDP), it supports on-the-fly con-
trol only, and it implements the Desktop Real-TimeTM toolbox, • Cartesian/Joints position control mode which is built
which provides real-time kernel for performing real-time simu- upon the DirectServo [17]. In this control mode the user
lations or hardware-in-the-loop implementation from Simulink. can control the robot at EEF or joints level, due to the
Since that the Desktop Real-TimeTM toolbox is available only utilization of the DirectServo this operation mode is very
for Windows and Mac, the presented interface can only be used reactive.
under those two operating systems. Simulink comes with a rich • Cartesian/Joints position control mode which is built
library supporting control, digital signal processing, artificial upon the SmartServo [17]. Due to the utilization of the
intelligence, interfacing with hardware in addition to others, SmartServo this mode provides smoother motions, but it
which gives the ability to develop hardware-in-the-loop control is less reactive than the first mode.
algorithms graphically without requiring written code. • Impedance control mode, suitable for applications that
involve physical interaction between the manipulator and
the surroundings.
Table 1. Comparison, KST vs SimulinkIIWA interface.
All interfaces support feedback from the various sensors in-
Comparison criteria KST SimulinkIIWA tegrated in the robot.
Supported OS Linux, Windows, Mac Windows and Mac
Programming tool MATLAB (code-script) Simulink (graphical)
2.2. SimulinkIIWA Sunrise application
Communication protocol TCP/IP UDP
Messaging format ASCII Binary The SimulinkIIWA Sunrise Application (SSA) is a multi-
Running threads Two Three threaded application which runs on the Sunrise controller. This
Programming blocks 100+ different methods Three blocks application is written using the Sunrise.Workbench. The main
Supported functionalities Seven different categories Only real-time
thread of the application implements the DirectServo and the
SmartServo (from KUKA), and is used for on-the-fly control
of the manipulator. This application shall be synchronized to
the robot, several flavors are provided according to the control
2
Mohammad Safeea et al. / Procedia Manufacturing 51 (2020) 133–139 135
M. Safeea et al. / Procedia Manufacturing 00 (2019) 000–000 3

mode required for operating the robot as described previously


in subsection 2.1.

2.3. SimulinkIIWA subsystem blocks

For controlling the robot from an external computer using


Simulink, three different subsystem blocks are provided by the
proposed interface, Fig 1. The user can copy the blocks and
insert them in his/her customized block diagram. Those blocks
communicate with the robot using UDP protocol and are used:

• For controlling the robot at EEF level, the Simulink block


Command IIWA in Cartesian Space is provided, Fig
1 (left). This block has six inputs representing the target
pose (position/orientation) of the EEF. In such a case, the
(X,Y,Z) position and the (α, β, γ) rotation angles of the
EEF are streamed to the robot using UDP protocol. The
Fig. 1. Simulink block for controlling the robot at EEF level (left), controlling
(X,Y,Z) coordinates are taken relative to the base frame the robot at joints level (middle), acquiring feedback about the state of the robot
of the robot, and (α, β, γ) are the fixed rotation angles from its controller (right).
around axes Z,Y and X (respectively) of the base frame
of the robot.
• For controlling the robot at joints level, the Simulink
block Command IIWA in Joint Space is provided,
Fig 1 (middle). This block has seven inputs representing
the reference positions of the robot joints. In such a case
the joints angles are streamed to the robot using UDP
protocol.
• For acquiring feedback about the state of the robot, the
Simulink block IIWA State is provided, Fig 1 (right).
This block has twenty seven outputs, organized: (1) the
outputs one to seven represent the joints torques due to
external forces acting on the structure of the robot, (2) the
outputs eight to fourteen represent the raw torques mea-
surements at the joints as acquired from the integrated
torque sensors, (3) the outputs fifteen to twenty one rep-
Fig. 2. Human-robot interaction example implemented in Simulink using the
resent the actual joints positions as acquired by the in-
proposed interface, the user is moving the EEF by applying a force at the robot,
tegrated encoders, (4) the outputs twenty two to twenty the arrow shows the direction of the motion (orientation is kept fixed in this
four represent the components of the external force at the example).
flange, (5) the outputs twenty five to twenty seven repre-
sent the components of the external moment at the flange.
tion performance for the SimulinkIIWA interface and the KST
is provided. A use case is also provided showing the use of the
SimulinkIIWA interface for performing a pick and place oper-
3. Tests and Results ation. More examples can be found in the web-page of the pre-
sented interface, including drawing geometrical shapes using
In this section two different tests and a use case are proposed. the robot, and for commanding the joints in impedance mode.
In Test 1 an example application is provided demonstrating
the capabilities of the proposed interface. The SimulinkIIWA 3.1. Test 1
is used in developing a control algorithm for manually guiding
iiwa robot at the EEF level, Fig. 2. In this example a feedback In this example, the user can guide the robot at EEF level
about the forces at the flange of the robot is acquired and used as while keeping the orientation of the robot fixed, Fig 2. A video
input for the control algorithm. Based on this feedback the mo- demonstration of the test is available in [18]. For the sake of
tion commands are calculated and streamed to the robot. Virtue simplicity, this example is made different to our previous work
to the graphical user interface in Fig. 3, the user can change the in [19], in which the user can move the robot manually, includ-
stiffness along each axis separately (X, Y or Z), or even con- ing orientation control, at one direction at a time (implementing
strain the motion to only one or two dimensions. Meanwhile, in force and position feedback). Figure 3 shows the Simulink di-
Test 2 a detailed comparison between the network communica- agram used for the control scheme in Test 1. In the presented
3
136 Mohammad Safeea et al. / Procedia Manufacturing 51 (2020) 133–139
M. Safeea et al. / Procedia Manufacturing 00 (2019) 000–000 4

block diagram the subsystem IIWA State is used to acquire


a feedback about the external force at the flange frame of the
robot, the orientation of the EEF is kept fixed using the block
Orientation Value. Then, the applied forces along the X, Y
and Z directions of the base frame of the robot are used as inputs
to the following motion controller subsystems:

• Subsystem X motion control is used to calculate the


X reference coordinates, or the motion command along
the X axis according to the X component of the force-
feedback at the flange of the robot. The building blocks
of this subsystem are shown in Fig 4. From the figure
the subsystem consists of (a) a dead zone filter (b) a gain
(c) an integrator (d) a constant bias and (e) a summing
block. The dead zone filter is used to cut off the noise
from the measurement and also to add an initial resis-
tance to the motion. The gain is used to change the resis-
tance of the motion according to the filtered force. The
integrator is used to calculate the motion command, rep-
resented by the displacement along the X axis from the
initial position. The constant is used to specify the initial
position. The summing block is used to sum the initial
position with the integrated motion command, the result
is used for the X input of the subsystem Command IIWA
in Cartesian Space, which streams the reference X
coordinate to the robot.
• Subsystem Y motion control is used to calculate the
Y reference coordinates, or the motion command along
Fig. 3. Simulink block diagram for the example of hand-guiding the EEF in
the Y axis according to the Y component of the force- Cartesian space in Test 1.
feedback at the flange of the robot. Similar to subsystem
X motion control.
• Subsystem Z motion control is used to calculate the
Z reference coordinates, or the motion command along
the Z axis according to the Z component of the force-
feedback at the flange of the robot. Similar to subsystem
X motion control.

The reference coordinates calculated from the previous sub-


systems are used as inputs to the block Command IIWA in
Cartesian Space provided by the SimulinkIIWA interface.
This block streams motion reference positions using UDP pro-
tocol to the robot, which are used by the Sunrise controller as
motion commands that drive the robot. The block diagram in
Fig 3 also includes the Real-Time Sync block from Simulink,
this block utilizes the real-time kernel for executing Simulink
models in real-time on a personal computer (laptop or desktop)
with Windows or Mac operating systems. In addition, the pre-
sented Simulink block diagram includes graphical potentiome- Fig. 4. Simulink block diagram for the X motion control block.
ters which are used to change the values of the gain blocks,
accordingly changing the resistance of the motion with the ap-
plied force for each axis separately. 3.2. Test 2
Tests using KUKA iiwa 7R800 were performed and the
force/coordinates data at EEF were collected from Simulink In this test, technical comparison between the SimulinkIIWA
and then plotted as shown in Fig 5. and the KST is presented in terms of the communication archi-
tecture and performance. Given that Simulink is used for real-
time hardware-in-the-loop control, the SimulinkIIWA interface
is designed to support only the real-time control of KUKA iiwa
4
Mohammad Safeea et al. / Procedia Manufacturing 51 (2020) 133–139 137
M. Safeea et al. / Procedia Manufacturing 00 (2019) 000–000 5

80 50
X
Y

Socket duration (milliseconds)


60
Force (N)/ Coordinates (cm)

Z
Fx
40
Fy
40 Fz
+Flim 30
-Flim
20

20
0

-20 10

-40
0 5 10 15 20 25 30 35 0
Time (seconds) 0 500 1000 1500 2000
Iteration
Fig. 5. Coordinates and force-feedback at EEF with time for the example guid-
Fig. 6. Time interval between two consecutive motion commands (UDP sock-
ing the EEF in Cartesian space.
ets) received by the robot from Simulink (using SimulinkIIWA interface). The
dashed line represents the average value.

25
robot. Consequently, we opted to build the interface upon UDP
communication protocol. UDP is better suited for data stream-
Socket duration (milliseconds)

ing than the TCP/IP protocol. However, using UDP does not 20
guarantee the arrival of every message to the server. This is why
the KST and other ROS interfaces for KUKA iiwa implement a 15
TCP/IP protocol, where losing a message in particular type of
commands (onetime-execution command) will lead to execu-
tion errors (for example in point-to-point motion). Because of 10
its ACK-NACK (acknowledgment, negative acknowledgment)
design, the server application of KST implements two sepa-
5
rate threads, the main thread and the communication thread.
The main thread is used for the main control loop. The com-
munication thread is used for receiving and transmitting data. 0
0 500 1000 1500 2000
Only one socket is used, a response message is sent for each
Iteration
command received. On the other hand, the SSA implements
three different threads, one is used for the control loop, another Fig. 7. Time interval between two consecutive feedback data messages (UDP
is used for receiving position command stream from Simulink sockets) sent from the robot to Simulink (using SimulinkIIWA interface). The
dashed line represents the average value.
and the third is used for streaming the state feedback from the
robot to Simulink. The SimulinkIIWA interface does not im-
plement ACK-NACK. Two different sockets are running at the onds, the average time interval is 5.6 milliseconds. The slow
same time, one socket is used to stream feedback data, another rate for feedback data streaming is caused by the fact that the
socket is used to receive position command stream. This fact al- SimulinkIIWA interface is designed to feedback the state data
lows the SimulinkIIWA interface to operate at higher network for (1) actual joints positions, (2) the external torques, (3) the
rates. In our tests the KST achieves 275 HZ rate for motion measured torques of all the joints and (4) the force and the mo-
commands transmission [15]. On the other hand, Fig. 6, shows ment acting at the EEF, all together, leading to considerable
the timing interval between each two consecutive UDP motion processing time by the robot controller to acquire the various
commands received by the robot from Simulink, where the tim- measurements. Finally, the timestamps shown in the figures 6
ing data was collected at the controller side. Using the Sunr- and 7 are calculated at the robot side, where we took advantage
sie.OS a timestamp is recorded when each motion command of the deterministic nature of the Sunrise.OS to achieve higher
message is received. The results show that the SimulinkIIWA accuracy in timing measurements.
interface is able to achieve 1KHz rate for motion commands
stream capacity. The figure also shows that the timing intervals 3.3. Use case
are not regular, there are sporadic spikes with a maximum of 42
milliseconds. However, the average time interval is 1 millisec- To further test the proposed interface, a KUKA iiwa robot
ond. At the same time, the interface achieved an average 177 Hz is controlled from an external computer using Simulink to ma-
rate for the feedback data stream, Fig. 7, where the maximum nipulate a box in a pick and place operation as shown in the
time interval between two consecutive feedback data measure- snapshots of Fig. 8. First the robot moves from the home po-
ments sent from the robot to Simulink is around 20 millisec- sition towards the box Fig. 8 (a). When the robot reaches an
5
138 Mohammad Safeea et al. / Procedia Manufacturing 51 (2020) 133–139
M. Safeea et al. / Procedia Manufacturing 00 (2019) 000–000 6

(a) (b) (c) (d)


Fig. 8. Snapshots of KUKA iiwa robot performing a pick and place operation, the robot is controlled from an external computer using SimulinkIIWA interface. (a)
Robot moves from home position towards the box. (b) Robot reaches the box location and closes its gripper. (c) Robot starts manipulating the box. (d) Robot places
the box in the target position.

appropriate picking location of the box, the gripper is closed


Fig. 8 (b). Afterwards, the robot starts moving the box Fig.
8 (c) towards the target location. When the release position
is reached the robot leaves the box Fig. 8 (d). The block di-
agram of the Simulink program for this example is shown in
Fig. 9, A MATLAB Function block (named Cartesian Path) is
used to program the path for the pick and place motion, the in-
put to this block is the simulation time (from Simulink’s Clock
block), while the outputs are the Cartesian coordinates (calcu-
lated as a function of time). Those Coordinates are fed to the
block Command IIWA in Cartesian space of the SimulinkIIWA
for controlling the robot. In this use case the control is open
loop at Simulink side, where we rely on the robot’s internal
servo closed loop control (of the direct servo motion) to track
the reference coordinates. The gripper used is custom made in
our laboratory and it is also controlled from Simulink. The con-
trol command for the gripper is also a function of time (cal-
culated in the block Gripper Command), and streamed to the
gripper using the block Gripper Ctl. From this example, it is
shown that the presented interface is a useful tool in education,
allowing students to have a hands-on experience by prototyping
and testing their Simulink algorithms on the real robot.

4. Conclusion Fig. 9. Simulink block diagram for the pick and place use case example.

In this study we presented the SimulinkIIWA interface and


compared it with the KST for controlling KUKA iiwa robots Acknowledgements
from an external PC. Using this interface, the user can design
and run complex control algorithms in Simulink for iiwa ma- This research was partially supported by Portugal 2020
nipulators graphically and without a need to write any code. project DM4Manufacturing POCI-01-0145-FEDER-016418
The interface supports different control modes, spanning Carte- by UE/FEDER through the program COMPETE 2020,
sian and joint space, either in impedance or in position control and the Fundação para a Ciência e a Tecnologia (FCT)
modes. It also supports feedback from the robot sensors includ- SFRH/BD/131091/2017 and COBOTIS (PTDC/EME-
ing the joint torques/positions, in addition to the forces and mo- EME/32595/2017). This research is also sponsored by
ments acting at the EEF. The SimulinkIIWA interface is based FEDER funds through the program COMPETE Programa
on UDP protocol which is advantageous for the on-the-fly con- Operacional Factores de Competitividade, and by national
trol applications. To show the flexibility and the ease of use of funds through FCT Fundação para a Ciência e a Tecnologia
the proposed interface various examples are provided. under the project UIDB/00285/2020.
6
Mohammad Safeea et al. / Procedia Manufacturing 51 (2020) 133–139 139
M. Safeea et al. / Procedia Manufacturing 00 (2019) 000–000 7

References

[1] Bischoff, R., Kurth, J., Schreiber, G., Koeppe, R., Albu-Schffer, A., Beyer,
A., Eiberger, O., Haddadin, S., Stemmer, A., Grunwald, G. and Hirzinger,
G., 2010, June. The KUKA-DLR Lightweight Robot arm-a new reference
platform for robotics research and manufacturing. In ISR 2010 (41st In-
ternational Symposium on Robotics) and ROBOTIK 2010 (6th German
Conference on Robotics), 1–8.
[2] Hubicki, C., Abate, A., Clary, P., Rezazadeh, S., Jones, M., Peekema, A.,
Van Why, J., Domres, R., Wu, A., Martin, W. and Geyer, H., 2018. Walk-
ing and Running with Passive Compliance: Lessons from Engineering: A
Live Demonstration of the ATRIAS Biped. IEEE Robotics & Automation
Magazine, 23–39.
[3] Corke, P., 1996. A robotics toolbox for MATLAB. IEEE Robotics & Au-
tomation Magazine, 24–32.
[4] Featherstone, R., 2014.Rigid body dynamics algorithms. Springer.
[5] Featherstone, R., Spatial Vectors and Rigid-Body
Dynamics software packages [On-line]. Available:
http://www.royfeatherstone.org/spatial/index.html#spatial-software/.
[6] Yoshida, K., 1999. The SpaceDyn: a MATLAB toolbox for space and mo-
bile robots. International Conference on Intelligent Robots and Systems,
1999. IROS’99. Proceedings. 1999 IEEE/RSJ , 1633–1638.
[7] Dean-Leon, E., Nair, S. and Knoll, A., 2012, December. User friendly
Matlab-toolbox for symbolic robot dynamic modeling used for control de-
sign. IEEE International Conference on Robotics and Biomimetics (RO-
BIO), 2181–2188.
[8] Corke, P., 2005. The Machine Vision Toolbox: a MATLAB toolbox for
vision and vision-based control. IEEE Robotics & Automation Magazine,
16–25.
[9] Corke, P., 2007. MATLAB toolboxes: robotics and vision for students and
teachers. IEEE Robotics & Automation Magazine, 16–17.
[10] F. Chinello and S. Scheggi and F. Morbidi and D. Prattichizzo., 2011.
KUKA Control Toolbox. IEEE Robotics & Automation Magazine, 69–79.
[11] Sanfilippo, F., Hatledal, L.I., Zhang, H., Fago, M. and Pettersen, K.Y.,
2014, July. JOpenShowVar: an open-source cross-platform communication
interface to kuka robots. Proc. of the IEEE International Conference on In-
formation and Automation (ICIA), Hailar, China, 1154–1159.
[12] Sanfilippo, F., Hatledal, L.I., Zhang, H., Fago, M. and Pettersen, K.Y.,
2015. Controlling Kuka industrial robots: Flexible communication inter-
face JOpenShowVar. IEEE robotics & automation magazine, 96–109.
[13] Hennersperger, C., Fuerst, B., Virga, S., Zettinig, O., Frisch, B., Neff, T. and
Navab, N., 2017. Towards MRI-based autonomous robotic US acquisitions:
a first feasibility study. IEEE transactions on medical imaging, 538–548.
[14] Mokaram, S., Aitken, J.M., Martinez-Hernandez, U., Eimontaite, I.,
Cameron, D., Rolph, J., Gwilt, I., McAree, O. and Law, J., 2017. A
ROS-integrated API for the KUKA LBR iiwa collaborative robot. IFAC-
PapersOnLine, 15859–15864.
[15] Safeea, M. and Neto, P., 2019. KUKA Sunrise Toolbox: Interfacing Collab-
orative Robots With MATLAB. IEEE Robotics & Automation Magazine,
91–96.
[16] SimulinkIIW interface package [On-line]. Available:
https://github.com/Modi1987/Simulink-iiwa-interface/.
[17] KUKA Sunrise.Connectivity Servoing 1.7. KUKA Roboter GmbH, 2015.
[18] Video demonstration of Test 1 [On-line]. Available:
https://youtu.be/PLOWiyzmVqA/.
[19] Safeea, M., Béarée, R. and Neto, P., 2017. End-effector precise hand-
guiding for collaborative robots. in Iberian Robotics conference, Springer,
595–605.

You might also like