Figure 6: SHM Simulink Inter Task Communication.
very powerful. The realized data exchange enables
software engineers to expand their Simulink models
and to build up control systems for all available hard-
ware, Figure 6. User-defined protocols may be de-
signed to minimize the amount of information. Even
the integration of kernel and user-space sockets into
Real-Time models is feasible (Kiszka, 2004). The
implementation of shared memory is very efficient.
Within a short time it is possible to expand the trans-
ferred data set, to establish new named SHM and to
adapt the required Simulink S-Functions. Addition-
ally it is possible to create S-Functions which are able
to read and write to some shared memory. Even the
access to different SHM in one S-Function is feasi-
ble. Up to now it was possible to run different Real-
Time executables at the same time on one system.
With this presented SHM interface it is now possible
to communicate and exchange data between different
Real-Time modules. Each module and each commu-
nication can be constructed and designed within the
Simulink environment. The design of parallel and
distributed systems with Simulink becomes possible.
The SHM interface is very stable and guarantees a
high degree of operational reliability. The presented
Simulink model of figure 5 is an example application
of the designed SHM interface. High accessing fre-
quencies f
a
of f
a
> 1kHz can be achieved without
difficulty. Application crashes (QRtaiLab, User-space
transceiver, Real-Time executable) do not influence
the interface.
All in all the realized Real-Time-Simulink seems to
be more comprehensive than RTWT. This, however,
is countered by a longer training period.
6.1 Future Works
In the near future it should be possible to commu-
nicate with the SDH2 even in kernel space. There-
fore, an extension of the SDH2 C++ library is nec-
essary. Aside from the facts that the sampling rate
could be increased and that no additional software
will be required for working with the robot hand, it
could even facilitate the working environment. RTAI
Simulink uses mailboxes for inter-task communica-
tion. This paper shows how to use shared memory.
Perhaps shared memory is more suitable to transfer
time-critical information particularly with regard to
matrices. Raising time delays because of growing
message queues are unfeasible. This will be essen-
tial if a large amount of data has to be transferred.
While working on reactive grasping skills it will be
necessary to debug different evaluation algorithms.
Especially for large tactile matrices the mailbox com-
munication becomes unusable. It was shown in sec-
tion 4 that the maximum size of a matrix is restricted
to [15 × 10]. Maybe the usage of shared memory is
able to solve the problem. Furthermore, the assem-
bling of own SHM-based Simulink scopes is consid-
erable. That is based on the fact that the usage of
external software to debug the Real-Time Simulink
models slows down the developing work.
ACKNOWLEDGEMENTS
This project is supported by SCHUNK GmbH & Co.
KG, Lauffen.
REFERENCES
D. M. Dawson, W. D. (2002). Matlab-based control systems
laboratory experience for undergraduate students: to-
ward standardization and shared resources.
Kiszka, J. (2004). Real-time ethernet on top of rtai. Tech-
nical report, University of Hannover, ISE - Real Time
Systems Group, Germany. www.rts.uni-hannover.de.
Mathworks (2010). Generate c code from
simulink models and matlab code.
http://www.mathworks.com/products/rtw/.
Quaranta, P. and Mantegazza, P. (2001). Using matlab
simulink rtw to build real-time control applications in
user space with rtai-lxrt. Technical report.
Quaranta, P. and Mantegazza, P. (May 27 2002). Interfac-
ing linux rtai with matlab and simulink through real
time workshop. Technical report, University of Ap-
plied Sciences of Southern Switzerland (SUPSI), Dept.
of cs and ee (DIE).
Ramadurai, S. (2001). Using real time linux target to com-
pile and execute a simulink program. Technical report,
Clemson University, Intelligent Systems.
RTAI (2010). The realtime application interface for linux
from diapm. https://www.rtai.org.
SCHUNK GmbH & Co. KG (2010). Servo-electric 3-finger
gripping hand sdh. http://www.schunk.com.
W. E. Dixon, D. M. D. (2001). Towards the standardization
of a matlab-based control systems laboratory experi-
ence for undergraduate students. Technical report.
SHARED MEMORY IN RTAI SIMULINK FOR KERNEL AND USER-SPACE COMMUNICATION AT THE
EXAMPLE OF THE SDH-2 - QRtaiLab For SDH-2 Matrix Visualization
165