EMC2 Installation and Setup


I will start off by saying I am NOT a Linux expert, guru, or enthusiast, nor do I know everything about EMC2. I do operate mainly in the Windoze environment. However I feel that EMC2 is the best option for a CNC controller - having a decent background in electronics and dealing with the delays of a mainstream OS, a real-time OS like the Linux kernel EMC2 runs on will prove much more reliable, consistent and accurate than anything which has to 'wait its turn' to use resources.

My mill is a hobby project - I don't currently have anything designed for immediate production so for now I am concentrating on aiding the EMC2 project and making my mill as user friendly, safe and accurate as possible.  Don't take that statement for anything other than it is.  EMC2 is safe software, and EMC2 is accurate software.  The beauty and downfall of EMC2 is the broad range of possibilities for it.  There are people running anything from DIY CNC routers to converted benchtop mills to 5+ axis industrial level machines with EMC2.  While this configurability makes it an extremely robust, durable and flexible piece of software - it scares off many people for a host of reasons - being open source the documentation is a bit lacking and written occasionally in somewhat of a geek speak (no offense guys - the reality is more of us need to help "decode" so you can concentrate on programming and features), and initially configuration was achieved by writing (yes, typing in a text editor) the configuration files.

Don't let that put you off.  With the 2.2 release of EMC2 a convenient utility called StepConf was included - it's on the menu bar under Applications (similar to the Start button in Windows).  For a simple step/direction stepper or step/direction servo setup this is all you'll need - everything is covered in there from driver type to testing each axis to make sure it works as expected.  You can specify which pins are which - just like in the other popular software packages and the polarity of the signal in the Stepconf interface to accommodate a VERY large variety of hardware options.  The only addition many of us would like to see is the addition of a second parallel port setup page. And additional page I'll create later will include that as one of the Advanced Configuration tutorials.  In that I will cover a few of the additional features I added and get you comfortable poking around in the configuration text files.

Not running by the parallel port?  Simple - there is a whole host of interface boards already supported by EMC2 - unfortunately they aren't configurable in the Stepconf wizard.  You'll have to do it 'old school' and modify one of the sample configurations provided.  There are setup templates (of a sort) for just about every supported piece of hardware - go grab one of those and start playing around with it.  If something isn't supported poke around the wiki and see what you come up with - Wiki LinkThe most useful tool I've found is the mailing list - there's scores of people there who are eager to help and a number of the developers monitor that list - after all it's as effective as the bug reporting system and the features request function.  I get as many responses from them as from other users.  For real time support there's an IRC channel - I only used it once but many people do rely on it and the wiki is filled with transcripts of issues resolved over IRC.  Information of getting on IRC is available here.

Some basic assumptions that I'm making if you are here:
  1. You are familiar with at least a Windows system
  2. You have installed an operating system from an install CD before
  3. You understand how a step/direction CNC mill works at least in concept
  4. You desire to try an easy to use, powerful and affordable controller
Even if you haven't done some of these items you can still proceed there just may be some areas that you get confused in.  I don't cover the installation prompts as they are pretty basic covering things like location, computer name (hostname), keyboard layout, first username, etc.  These are pretty standard questions across all the different flavors of operating systems available across the world so if you haven't done #2 you still should be Ok, but read through the installation instructions on the EMC2 homepage.  If you don't understand how a step/direction CNC controller works, this is actually a good way to learn about it.  Basically the computer sends a signal telling the machine to step a certain increment and a direction signal telling it which way to go, and does that for all axes.  That's a pretty basic explanation, but it's a pretty basic system.  #4 - what else can I say?!?



I'll start from the top - most of this information is already covered via the EMC2 homepage and in the manual but I'll take you through what I did.

First download the CD iso for the Live CD (listed on the EMC2 homepage).  You have a choice of which version of Ubuntu to download - when I installed only 6.06 was available.  Now 8.04 is out, and has been out long enough that it seems to be a stable release.  Your choice on which to download.  6.06 has EMC2 version 2.2.2 included whereas 8.04 has EMC2 2.2.5 included.  Either way this tutorial will remain the same - there are no changes to the Wizard.  Long term you're probably best to get the 8.04 version now and be on the OS with the longest support path.  Once you download, check the md5checksum (google md5checksum for tools to do that on your OS) and if it checks out with that posted on the page, burn the ISO disc image (most CD/DVD burning software can do that but if yours won't check google again - I know there are some freeware or trial packs that will let you burn an ISO disc image).  This tutorial isn't geared towards the brave souls who want to compile their own distribution (myself included!) - if you're that courageous this is way below you.

Now that you have a Live CD burnt put it in the drive and boot to the CD, you may need to make a change in BIOS or select a different boot device during the POST (Power On Self Test).  It will take a little while to get to the Live CD desktop - after all you're running from a CD which is a LOT slower than from a hard drive.  The Live CD is convenient in that it will not only install that version of the software if you choose, but allow you to a) see if the machine you are planning on installing on is suitable for software step generation and b) take it for a test drive - even so far as hooking things up to your current parallel port and BOB and testing on your mill all without making a single change to your computer - so you can try it out on your 'daily driver' desktop or - gasp - the PC already running your mill!

If you think you might like it go ahead and install the whole OS.  I recommend starting with a barren system (don't try to upgrade a current Linux install to real time and EMC2 - leave that for later, if you have room a dual boot is easily setup though allowing you to keep that hideous Windows OS) and install the Live CD.   Since you're probably setting up a dedicated computer for the CNC system (be it mill or lathe - this material will concentrate mainly on mill since that is what I have setup) is it that hard to string up a simple network or use USB keys to transfer your G-Code files back and forth to your regular MS machine?  Didn't think so.  EMC can run on such outdated hardware (and often runs better on outdated hardware than on cutting edge hardware) that a dedicated PC for the mill is relatively cheap.  I picked a machine off the curb (in the right of way is public property) so I got my control machine for free and just needed a hard drive - had an old 20GB drive in the closet - and a stick of PC133 memory which I also had in the junk closet to beef it up a tad.

Also - avoid laptops - they are notoriously bad for proprietary hardware, built in interrupts that will cause massive delays on the latency test  and a lack of parallel ports.  I have run the simulation mode on my laptop - mainly to verify G-Code when I've been out of town or otherwise away from my home computer.  And most, if not all, USB to Parallel adapters do not work so don't bother wasting your money thinking that will make the old laptop in the closet run your mill or lathe.  Built in graphics and audio can also cause poor results.  Given that fact, my current machine has built in graphics and works ok - I tried to use standalone cards but the Gateway BIOS wouldn't let me disable the onboard completely and I could never manage to get X-Windows to correctly recognize the five different cards I tried and give me anything but 640x480 16bit color - however even in that mode the latency numbers didn't improve.  Unacceptable to me so onboard graphics it was.  I was able to shutdown the sound and use an old PCI Soundblaster card which made a slight improvement.

Once you've played with the Live CD and realized its potential, go ahead and click the Install Icon .  Even if you're still skeptical - the installer can manage a basic dual boot without much hassle - best if you have a spare hard drive and a slot to stick it into if you want to go that route.  The installer will ask you the typical questions that an OS install will ask - I recommend that you have things connected to the internet and all the accessory cards installed at the point you install the better off you'll probably be - I'm not 100% confident that it goes off in search of drivers and the newest versions of packages but it can't hurt.  I've done it both ways and they both worked.

Once you've installed EMC2 and booted up it is highly recommended to peruse the Ubuntu Help - in 8.04 it’s accessible via the question mark (?) in the top bar, in 6.06 the Help Documents are under the System menu. Vital issues might to study might include things like configuring a DSL connection or just getting familiar with Linux in general.  H ere's the index to the rest of the tutorial:

Go to Page 1


Last updated August 12, 2008 for more information contact info@distinctperspectives.com