(Or, how I learned to stop worrying and love the HAL)

As suggested in my last group of pictures, I have been running my ghettomill on EMC2 for a while now.  The switch was predicated on Mach3’s habit of making my steppers sound like they were chewing gravel while topping out at 11-12 ips.  Not Good.  I saw no need to actually pay for that kind of performance beyond 500 lines, so I decided to explore EMC2, if for no other reason than to avoid having to break out my dusty stack of floppies with DOS 6.22 and TurboCNC.  (That said, props to Dave at DAK Engineering for being a serious badass.  My laziness is no reflection on the quality of TurboCNC.)

For those of you that plumb the depths of technical history out of a sheer desire for knowledge, EMC2 is an outgrowth of what was a NIST project circa 1993.  the original EMC – Enhanced Machine Controller – was designed as a reference implementation of the RS-274D Numerical Control language, better known to the machinist community as “G-Code”.  EMC puttered around academia and government employee circles for about 7 years, collecting fans and impressing users.  About that time a group of volunteers moved it to SourceForge, and the evolution towards EMC2 consumed the next three years.

The modified and polished EMC was released as EMC2, incorporating better functionality, isolated trajectory planning, isolated motion planning and a key feature, the Hardware Abstraction Layer, or HAL.  Incorporation of the HAL allowed changes to be made to EMC2 without rewriting the code or recompiling.

If, like me, you’re searching for a Mach alternative, EMC2 is a fantastic program/package with more flexibility, capability, capacity, bells, whistles and options than you are ever likely to use.  That said, it’s not impossible to use effectively without a computer science degree; however, the learning curve is quite steep.  My goal here is to share my approach to EMC2 setup and use from my standpoint as a mechanical engineer with a long history in electronics, and two very brief semesters of computer programming.

First and foremost, here a copies of my HAL file, INI file and a Port Pinout of the connections between my physical mill and computer.  See my system diagram below for any further details.

Second, the HAL documentation exists online here and linuxcnc.org has a multitude of support documents, including the “EMC2 Getting Started” PDF.  I would personally avoid the “HAL User Manual” unless you’re intent on learning about using HAL independently from EMC2.

Here’s the original pics…

Complete Wiring Diagram (Warning: Full Res @ ~6MP)

The machine just prior to completion

The front panel of the controller

My DIY Pendant, awaiting it's DIY MPG...

Right Hand X-Axis Limit Switch & Cable Tray

Detail of the Original Z Axis Sled

Tramming the table

The machine just prior to completion

Manual (MDI) mode in Mach3

The first G-Code that was run on this machine