Specifications

4
CHAPTER 2. IMPLEMENTATION OF SOFT- AND HARDWARE
Since the RTOS and the application are linked together in a "single" execution space, system call
mechanism is implemented by means of a simple function call (not using a software interrupt
which produces higher overhead).
Having less overhead makes higher sample rates for acquiring, computing controller actions and
sending data possible.
2.1.3 RTAI-LXRT
RTAI requires the use of kernel calls to access peripherical hardware in the Hard Real-Time pro-
cess. To be able to use user space calls as well, an addition to RTAI is needed, called RTAI-LXRT. LXRT
allows Hard Real-Time programs to run in user space (as opposed to kernel space). Since RTAI runs
only in kernel space, LXRT is seen as an extension that brings this kernel API to userland programs.
This allows to define Real-Time and non Real-Time threads in the same program so that one could
read/write a file (= no Real-Time) while the other runs with a deterministic period (= Real-Time). It
also allows Inter Process Communication (IPC) with standard Linux processes or allows Real-Time
programs to have a GUI integrated. LXRT allows to communicate with these programs.
An measurements by Peter Soetens [11] on modest hardware (Intel Pentium II 300Mhz) showed
that an additional 3[µs] overhead on top of the standard scheduler (RTAI) latency of 3[ µs] is worth the
benefits of LXRT for most applications. For this report RTAI-LXRT makes high sample rates possible
without losing the ability to change parameters on-the-fly within Simulink.
2.2 Software: explanation and installation
2.2.1 Operating System (OS) and Matlab
For the installation steps of the OS and Matlab, just walk trough appendices C, D and E. The
content in these appendices is almost completely adapted from W.T. Oud [6], however there are some
important changes:
Different hardware.
New Simulink targets.
More recent Linux kernel, and shift from Debian to Knoppix distribution for ease of installation.
More recent RTAI version.
Appendix C can be used to install the Knoppix 3.3 distribution (Linux OS) and to set an user account,
update/install additional packages and make an internet connection available.
Appendix D shows how to install Matlab and configure it correctly.
Appendix E explains how to patch the kernel with RTAI and install the proper targets for the Matlab
Real-Time Workshop.
Finally, the data acquisition boards PowerDAQ PD2-MF-16-500/16H and PowerDAQ PD2-AO-
16/16 need to be connected to the PC via PCI slots and can be installed using the supplied PowerDAQ
manual [7].