About

Home for TuxCNC - A low cost (free, but easy to install) CNC package running under Linux. Development is currently a low key affair whilst the core team streamline and document the code base. Once the restructuring is complete, the sources will be made public via CVS. In the meantime, keep up with significant milestones here.

Zathras machine on the TuxCNC.org system.
BDI home page.

| Home | emc2 overview »

EMC overview

The Enhanced Machine Control (EMC) is the original project from NIST that has spawned a number of projects. A short review of the current code follows - Comments on some of the derivatives will appear in future articles. The EMC project was started in the early 1990's primarily to validate various ideas and also to demonstrate the practicalities of using commodity PC hardware to replace proprietary CNC controls. The early works was conducted on a K&T three axis machine and later, a Bridgeport Series I. Many of the functions implemented in the user interface reflect the usage of a Bridgeport as a test bed.

Perhaps the main obstacle in widespread adoption of EMC in the early days was a requirement for a patched, functional realtime GNU/Linux kernel. The RT patch was originally the RTLinux package from FSM Labs and later, RTAI - Both required a degree of knowledge of configuring and compiling kernels. Much of the difficulties were alleviated when the BDI series of disks were released..
With a functional kernel and realtime subsystem installed, further difficulties were often experienced when compiling the NIST RCSlib, due in part by an overly complex and (some would say) ugly makefile structure.

RCSlib is the result of an even older NIST project to provide a platform independent communications library capable of passing data to many clients simultaneously - Although supposedly written in C++, it predates most modern programming practices and methods along with the current "standard" libraries. The cross platform support also imposed a number of ugly and confusing programming styles that put many potential hackers off. Running sloccount over RCSlib provides the following numbers:

cpp: 71912 (38.06%)
java: 62605 (33.13%)
ansic: 52607 (27.84%)
sh: 1328 (0.70%)
csh: 368 (0.19%)
asm: 130 (0.07%)
sed: 2 (0.00%)


Compare this to the reduced libnml from later derivatives:

cpp: 21436 (89.84%)
ansic: 2423 (10.16%)



The EMC code is even worse, as it consists of many monolithic files with large amounts of duplicated code - Fixing a bug in one file meant having to check several more, or more often than not, forgetting about the possibility of the same bug occurring in other sources.
The sloccount stats for EMC:

cpp: 61833 (50.77%)
ansic: 41629 (34.18%)
sh: 10481 (8.61%)
java: 7147 (5.87%)
tcl: 539 (0.44%)
csh: 150 (0.12%)


The core realtime code will only work on an ix86 processor due to the linking in of a pre-compiled smallmath.o object file (origins & licence unknown). Fixing this "small" issue, and it may be possible to run EMC on another processor...

It should be pointed out that the makefiles are not included in the above figures... Problems with supporting 2.6.xx series kernels was one of the concerns addressed by the BDI-4 build.

Due to the adhoc development of RCSlib and EMC over the year, some of the sources are GPL, others, a "not for commercial use", and a few, copyright of "XXXX" without any attendant license (It must be assumed "proprietory & restricted"). The remainder or the code is public domain - Anyone contemplating using the code for anything other than personal use needs to do a complete and full audit.

Bootnote: The CVS repository at sourceforge has been shut down and no futher development will probably take place there.