Thursday, July 16, 2009

EMC2 on a modern laptop?

My HobbyCNC router has been running fine with an old Pentium brick for hardware, FreeDOS and TurboCNC for a while. However its kinda slow booting the brick, and the TurboCNC user interface is as far from sexy as you get. Given its free its... well... OK.

There are other commercial alternatives that look a lot better, and works under windows if you please. Then there's EMC2 :)

EMC2 is a GPL machine controller, running on linux with a graphical user interface called Axis. More specificly its a real-time patched Ubuntu 8.04 distro, with EMC2.3.1. Yes, there's even a live-CD if you just want to try it out withput committing hardware. Not wanting to put a new brick on the desk for running my HobbyCNC router, as well as having a spare laptop lying around, I figured I'd have a go with the laptop even though the manuals tell you not to.

The main problem with modern laptops is there's no parallel port. But there's oodles of USB ports. First thought, use a USB-to-LPT cable. Sadly EMC2 does not support that (yet at least), it needs a true LPT port. This has to do with the inner workings of EMC2, using hardware in the parallel port as a "reliable" way of making fast enough clock ticks.

But wait, there's a PCMCIA slot here as well. Time to grab a PCMCIA parallel port expansion card. I got my self a NetMos Technology chipset based one, as it's supposed to work with Ubuntu. And it works indeed - even with EMC2. I won't do this as a step by step instructions for now - but outline the process.

First enable the LPT port in the BIOS, even though there's no physical port. The card is then immediately recognized in Ubuntu as seen by the output of lspci -v. This also show my LPT port located at 0x1000, yours may differ. I do not load either the parport_cs, nor parport drivers, as it cause EMC2 to fail at startup.

Next run the EMC2 configuration wizard, selecting my HobbyCNC controller card, with the LPT port at 0x1000, configuring the pins per HobbyCNC instructions, as well as the router and stepper properties.

EMC2 now starts without complaints. Jogging the router work fine, and Axis shows a nice 3D rendering of the work being done. Success :D

Even though I'm still in the testing and adjusting phase with EMC2, its looking very good IMHO. Should the laptop route give me problems later, I'll simply get myself a newer brick instead, because it looks like EMC2 is here to stay on my desktop!