next up previous contents index
Next: II. Part 2 - Up: I. Part 1 - Previous: 4.3 Ray's three disk   Contents   Index


The NIST EMC software can be installed on Linux PCs, Sun Solaris boxes, or most any Unix machine. Currently the distribution is set up for Linux.

0. For LINUX installations only: Download and install the New Mexico Tech RT-Linux, real-time patches and modules. If you have a system using a 2.0.x kernel get the kernel sources for 2.0.36 and RT-Linux patches and modules version 09J. If you have a 2.2.x kernel use RT-Linux 2.0 and kernel 2.2.13. The kernel sources are available from The New Mexico Tech RT-Linux patches and modules are available from

0.a: Follow the instructions from for installing the RT-Linux, however I have the following additional recommendations. - For RedHat Linux 5.2 users, check out Tim Goldstein's installation instructions at - Get the archive with the pre-patched kernel sources rather than patching your own. - Before untarring the archive move any existing directory or link /usr/src/linux to a different name. - Untar the archive in the directory /usr/src. - After untarring the archive create a symbolic link so that /usr/src/linux points to the linux directory that was included in the archive. For example cd /usr/src ln -s rtlinux-2.0/linux linux

- When you configure the kernel, under Loadable Module Support say Yes to set version info and to enable the Kernel module loader, and under Processor type say no to Symmetric Multi-processing support unless you actually have a multi-processor system. - Test the examples in the rtl directory, before trying to install EMC. Make sure the min and max values out of the measurements example are in the thousands and not in the millions.

1. Download the appropriate .tgz file from either the subdirectory for your platform. Read the README file within those subdirectories for the details. The linux_2_0_36 directory contains the code/binaries tested under linux kernel version 2.0.36 with RedHat 5.2 and the New Mexico Tech RT-Linux patch 09J. Th linux_2_2_13 directory contains the code/binaries tested under linux kernel version 2.2.13 with RedHat 6.1 and the New Mexico Tech RT-Linux patch 2.0. All the distributions contain the NIST Real-time Control System (RCS) header files and linkable library, EMC source code, and other miscellaneous files. The RCS source code is not included in this archive, since it would make it larger, but is available at

2. Log in to your Linux PC. Become root.

3. Copy the EMC distribution archive from wherever you downloaded it to into /usr/local, cd there, and unpack the archive. This looks like:

root> cp emc-<date>.tgz /usr/local root> cd /usr/local root> tar xzvf emc-<date>.tgz

4. You should see the following files in /usr/local:

readme - more instructions
packup - a script for making the .gz files below
putback - a script for checking the code back in to NIST
install - a script for installing and compiling this software
compile - a script for just compiling this software
clean - a script for removing EMC/RCS software (not alltar.gz) - a list of files used by packup to build the RCS archive
rcslib.exc - ones not to include - a list of files used by packup to build the EMC archive
emc.exc - ones not to include - a list of these files, for building the floppy
skel.tgz - the gzip archive for the directory skeleton
rcslib.tgz - the gzip RCS archive
emc.tgz - the gzip EMC archive
linux.tgz - the full archive

5. Run the 'install' script:

root> ./install

The install script creates the directory skeleton for emc/plat; unzips the RCS code; and unzips the EMC code and compiles it.

6. For linux_2_0_36 only: You will need to setup shared memory. The linux 2.2.13 distribution of EMC uses mbuff which is a more flexible and automatic method than the linux 2.0.36 described below.

Edit the file lilo.conf to add the line indicated. You should set the mem value to 1 Mb less than the total amount of memory you have in your system.

image=/boot/vmlinuz label=linux root=/dev/hda3 append="mem=31m" <- add this read-only

For a 64 MB machine, the "31" would be "63", etc.

Run lilo, as root:

root> lilo

and reboot.

7. Run the Controller in simulation.

To run the EMC code on a real machine, you need to set up all the hardware, create the wrappers or use ones provided, configure system parameters via the INI files, and code up the discrete I/O controller or use one provided. However, you can just run a simulation "out of the box."

This is done by running the bash script,, from the top-level emc directory.

The script will run several programs in the background, and then start a graphical user interface. There are several different interfaces that can be configured, but the current default tkemc is shown in tkemc.gif in this directory.

Before you can do anything you will need to come out of E-STOP (press the <F1> key) and turn the machine on (press the <F2> key).

You can then jog the axis using the arrow keys and page up/page down. Press F4 to go to Auto mode where you can run rs274ngc G-code part programs. The example programs are in the programs subdirectory. cds.ngc is a standard circle-diamond-square program.

You may want to run tkbackplot or emcplot3d (not yet available) to better visualize what is going on.

8. Trouble Shooting.

9. Editing and Recompiling

You may need to recompile the EMC code for a number of reasons. You may have modified the source code, or you may have downloaded just a few new files. To recompile, do the following:

root> cd /usr/local  
root> ./compile

If you want to compile code in any of the subdirectories individually, cd to the EMC source directory and run individual makes:

root> cd /usr/local/emc/src 
root> make PLAT=linux clean depend install

next up previous contents index
Next: II. Part 2 - Up: I. Part 1 - Previous: 4.3 Ray's three disk   Contents   Index
root 2003-05-26