We use a special version of the Linux open-source operating system called Enhanced Machine Controller to control our DIYLILCNC. The EMC team recently released an updated version of their Linux distribution. To celebrate, I’ve written this how-to explaining how easy it is to set up a cheap Linux PC for controlling CNC devices like the DIYLILCNC.
One aspect of CNC control that is sometimes a challenge is the need for a parallel port (also known as DB-25 or COM port); many newer machines do not come with on-board parallel ports. Luckily, Newegg carries some great cheap barebones computer systems with on-board parallel ports. Here’s the hardware that I spec’ed for this project:
Since I don’t believe in wasting money on an optical drive, we’ll just install the operating system via USB. Don’t worry, it’s easy! You’ll need a 1 gigabyte (or more) USB flash drive as well as a Windows or Linux machine to set up the installer.
Ready? Here we go…
Part 1: Set up a USB Flash Drive as a Linux Boot Disc
Step 1: Download EMC/Linux 10.04 Live CD ISO from linuxcnc.org.
Download the newest version (10.04 at the time this was written) of EMC from http://linuxcnc.org. You can use an older version if you want, but you’ll need to go through extra steps that aren’t covered here.
Step 2: Download UNetbootin
Download UNetbootin, a program that lets you set up a USB flash drive as a Linux boot disc.
Step 3: Find the Drive Letter of Your USB Flash Drive
Plug in your USB drive and find the letter identifier, usually listed under My Computer in Windows. In the example, it’s J:.
Step 4: Run UNetbootin.
In UNetbootin, select the EMC ISO as the Diskimage, and select your USB Drive letter. Hit OK, and UNetbootin will process for a while. When you are prompted to restart, exit the program and eject your USB drive.
Part 2: Build Your Computer
When you’re working with any kind of electronics, you want to take care to avoid static discharge which could fry various important components. If you do a lot of computer building/breakdowns, you may want to invest in an antistatic wrist strap. At the very least, try to touch something that’s grounded before handling unshielded components.
Step 5: Gather Your Parts (RAM, Hard Drive, Barebones Case & Motherboard)
Step 6: Remove the Side Panel by Loosening the Screw on the Back.
Step 7: Remove the Front Panel by Unhooking the Plastic Tabs on Top.
Step 8: Remove Both Screws on the Front Panel
Step 9: Lift the Interior Panel Back and Up.
Step 10: Now You're Ready to Put the Parts in!
Step 11: Insert the RAM.
Step 12: Insert the Hard Drive.
The hard drive sits in the front of the case, and attaches with a screw. It’s actually easier to insert & screw in first, then attach cables, despite what the picture shows.
Step 13: Attach the Power and SATA Cables to the Hard Drive
Thats it! Close the case back up and start plugging in the power, monitor, keyboard & mouse.
Part 3: Installing Linux from a USB Flash Drive
Once your case is reassembled, plug in your monitor, keyboard, mouse and power. Also plug in the flash drive you set up with UNetbooting in Part 1.
Now turn it on!
Step 14: At the Boot Screen, Hit 'Esc'.
Step 15: Select USB as the Boot Device
Step 16: Use the Default Options in the UNetbootin Menu
Step 17: Ubuntu Installer Boots from the USB Drive
Step 18: Click the Install Icon on the Desktop
Step 19: Follow the Prompts, and Ubuntu will Install
After installing, you’ll need to remove the thumb drive and reboot.
Part 4: Configuring Enhanced Machine Controller for CNC Control
Restart you Linux box, and you’ll be ready to setup configurations for a CNC device. In this example, we’ll plug in settings for the DIYLILCNC.
Step 20: Run a Latency Test
While you run the latency test, you should do things that tax the computer, for example typing ‘glxgears’ in the Terminal. Let the test run for a few minutes.
Step 21: The Lower Middle Number is What you Want.
Step 22: Run Stepconf Wizard & Create a New Configuration.
Step 23: Basic Machine Info
Step 24: Parallel Port Setup
Step 25: X Axis Configuration.
Step 26: Y Axis Configuration.
Step 27: Z Axis Configuration.
Step 28: Advanced Configuration Options. Leave these blank!