Step 1 - Prepare your machine
- Perform a clean installation of Ubuntu 10.04 x86 and apply all available updates.
- From now on, all commands that follow a white dot have to be typed in a terminal window (follow the rule that for each dot corresponds one command on a single line).
- Get the following packages:
- sudo apt-getinstall cvs subversion build-essential libtool automake libncurses5-dev bison flex libboost-dev libboost-program-options-dev libgsl0-dev gfortran sablotron tcl8.5-dev tk8.5-dev xaw3dg-dev libpvm3 pvm-dev libgtkhtml2-dev libvte-dev ocaml-native-compilers libqt4-dev libqwt5-qt4-dev xfonts-100dpi xfonts-75dpi ssh
- If you don’t already have it get realtimesuite archive, then extract it:
- sudo wget http://sourceforge.net/projects/rtaixml/files/realtimesuite/1.1/realtimesuite-1.1.tar.gz/download
- sudo mv download /usr/src/realtimesuite-1.0.tar.gz
- cd /usr/src
- sudo tar -xvzf realtimesuite-1.0.tar.gz
- Ensure that /usr/src folder contains at least the following subfolders: ‘boot’, ‘comedi’, ‘comedi_calibrate’, ‘comedilib’, ‘comedi-nonfree-firmware’, ‘ede’, ‘efltk’, ‘jrtailab’, ‘kernel’ ‘qrtailab’, ‘rtai-3.8.1’, ‘rtaixml-1.0’, ‘scicoslab’.
- Install EFLTK library:
- cd /usr/src/efltk
- sudo autoconf
- sudo ./configure --disable-mysql --disable-unixODBC
- sudo ./emake
- sudo ./emake install
- sudo gedit /etc/ld.so.conf
- Add a line with the path /usr/local/lib and save.
- Make symbolic link:
- cd /usr/src
- sudo ln -s rtai-3.8.1 rtai
Step 2 - RTAI Patched Kernel
- Get Linux 2.6.32 Kernel patched with RTAI from LinuxCNC:
- cd
- echo deb http://www.linuxcnc.org/lucid lucid base emc2.4 > /tmp/linuxcnc.list
- echo deb-src http://www.linuxcnc.org/lucid lucid base emc2.4 >> /tmp/linuxcnc.list
- sudo mv /tmp/linuxcnc.list /etc/apt/sources.list.d/
- gpg --keyserver pgpkeys.mit.edu --recv-key 8F374FEF
- gpg -a --export 8F374FEF | sudo apt-key add -
- sudo apt-get update
- sudo apt-get install linux-headers-2.6.32-122-rtai linux-image-2.6.32-122-rtai
- NOTE: in case you are in trouble downloading patched Kernel, the required .deb installers are included in the realtimesuite package (under kernel subfolder).
- Make symbolic link:
- cd /usr/src
- sudo ln -s linux-headers-2.6.32-122-rtai linux
- Reboot in the new Kernel:
- After reboot, check if patched kernel is running (2.6.32-122-rtai):
Step 3 - First RTAI v3.8.1 Installation
- Install Comedilib:
- cd /usr/src/comedilib
- sudo sh autogen.sh
- sudo ./configure --sysconfdir=/etc
- sudo make
- sudo make install
- sudo make dev
- Check the number of CPUs available on your machine:
- cat /proc/cpuinfo | grep processor | wc -l
- Enter RTAI compiling options:
- cd /usr/src/rtai
- sudo make menuconfig
- Under Machine, set the number of CPUs that you previously found.
- Exit Configuration, choosing ‘Yes’ when prompted to apply changes.
- Compile and install RTAI:
- sudo make
- sudo make install
- sudo sed -i 's/\(PATH=\"\)/\1\/usr\/realtime\/bin:/' /etc/environment
- Reboot the system.
- After reboot, set RTAI kernel modules to be loaded at system startup:
- cd /usr/src/boot
- sudo cp rtailab /etc/init.d/
- sudo chmod a+x /etc/init.d/rtailab
- sudo update-rc.d rtailab defaults
- Now load RTAI kernel modules without Comedi:
- sudo /etc/init.d/rtailab preload
Step 4 - Comedi Installation
- Create directory:
- sudo mkdir /usr/local/include/linux
- Install Comedi:
- cd /usr/src/comedi
- sudo sh autogen.sh
- sudo ./configure --with-linuxdir=/usr/src/linux-headers-2.6.32-122-rtai --with-rtaidir=/usr/realtime
- sudo make
- sudo make install
- sudo depmod -a
- sudo make dev
- sudo ldconfig
- Install Comedi Calibrate:
- cd /usr/src/comedi_calibrate
- sudo autoreconf -i -B m4
- sudo ./configure
- sudo make
- sudo make install
Step 5 - Second RTAI v3.8.1 Installation
- Copy and link the following files:
- sudo cp /usr/src/comedi/include/linux/comedi.h /usr/local/include/
- sudo cp /usr/src/comedi/include/linux/comedilib.h /usr/local/include/
- sudo ln -s /usr/local/include/comedi.h /usr/local/include/linux/comedi.h
- sudo ln -s /usr/local/include/comedilib.h /usr/local/include/linux/comedilib.h
- Enter RTAI compiling options:
- cd /usr/src/rtai
- sudo make menuconfig
- Under Addons, select ‘Real Time COMEDI support in user space’ (by pressing spacebar).
- Under RTAI Lab, select ‘RTAI Lab’.
- Exit and save configuration.
- Install RTAI:
- sudo make
- sudo make install
- sudo cp /usr/src/comedilib/include/comedilib.h /usr/local/include/
- Navigate with your web browser to http://www.comedi.org/hardware.html and find your DAQ hardware in the list; take note of name under “Driver” column.
- Edit rtailab startup file with driver for your DAQ board:
- sudo gedit /etc/init.d/rtailab
- Replace driver on lines 33 and 55 with the one you found on Comedi website. Save and close.
- Reboot system.
Step 6 - Scicoslab v4.4 Installation
- Navigate with File Browser to /usr/src/scicoslab
- Right-click on ‘scicoslab-gtk_4.4.1-1_i386.lucid.deb’ and select ‘Open with GDebi’.
- Install package.
- Repeat for ‘tkdnd1_1.0-1_i386.lucid.deb’.
- Add RTAI toolbox and palette to Scicoslab:
- sudo ln -s /usr/realtime/bin/rtai-config /usr/local/bin
- cd /usr/src/rtai/rtai-lab/scicoslab/macros/
- sudo make install
- make user
- cd /usr/local/bin
- sudo ln -s /usr/lib/scicoslab-gtk-4.x/bin/scilab scilab
- Start Scicoslab as root and check the presence of toolboxes->RTAI in the upper menu:
Step 7 - QRTAILab v0.1.12 Installation
- Install QRTAILab:
- cd /usr/src/qrtailab/qrtailab-0.1.12
- sudo qmake-qt4
- sudo make
- sudo make install
Step 8 - RTAI-XML v1.0 Installation
- Install RTAI-XML (pay attention to terminal outputs, you’ll get useful informations on how to use it):
- cd /usr/src/rtaixml-1.0
- sudo make all
- sudo make install
- Set RTAI-XML modules to be loaded at system startup:
- sudo cp /usr/src/boot/rtaixml /etc/init.d/
- sudo chmod a+x /etc/init.d/rtaixml
- sudo update-rc.d rtaixml defaults
- Start RTAI-XML modules:
- sudo /etc/init.d/rtaixml start
Step 9 - Set up jRTAI-Lab 1.2.0 for remote control
- The following instructions are for Ubuntu 10.04, though you can easily run jRTAI-Lab on any OS that supports Sun Java Virtual Machine 6.
- Install JVM6:
- sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
- sudo apt-get update
- sudo apt-get install sun-java6-jre
- Allow execution of jRTAI-Lab and run it:
- sudo chmod a+x /usr/src/jrtailab/jRtaiLab-1.2.0.jar
- java -jar /usr/src/jrtailab/jRtaiLab-1.2.0.jar
Congratulations, you’re done! |
|