Arduino, EMC2, and the open-source conundrum

I was flattered to receive a thumbs-up from Bob Warfield on my previous post. Bob is in my mind one of the leading figures in the new wave of CNC practitioners, and his new product, GWizard, is among the most interesting out there. Bob asked a question I’ve heard dozens of times since putting this project online: “what about using an Arduino to generate steps?” As my reply to Bob got longer I decided to make a post of it.

Basically, my position on this question has long been, “why would you want to do that?”

While it’s true that you don’t find parallel ports on laptops or new Dell cheapo boxes, you can easily assemble a brand-new Intel Atom system capable of running EMC2 very nicely for less than what a Mach license costs. These motherboards are so cheap, they come with the CPU and sell for about $75, retail. If you can still get a parport header on a $35 motherboard, where they are going to wring every fraction of a penny out of the manufacturing cost, my sense is that we probably have many years left before they disappear from the earth.

There are a couple of projects I know of in this vein: RepRap uses drip-fed G-Code for its main control chain, and as I understand, there are some issues with the interpretation of arcs that have yet to be addressed; they may not be problematic for RepRap’s own use. There’s another, seemingly more sophisticated effort in the GRBL Project, which uses optimized AVR-native C code to turn an Arduino into a proper interpreter. However, it can’t do trajectory planning, homing, or spindle control, let alone threading, rigid tapping or control of auxiliary mechanisms. Like most open-source projects, it’s the pet project of one or two guys, and with no updates to the website since this past summer, it’s quite likely it’s reached the end of its evolution.

Part of the reason why I feel compelled to rain all over this idea is that the open-source CNC community is tiny and yet has plenty of overlapping and duplicative projects underway. In the past year, we’ve seen two separate groups of people launch new GUIs for EMC. One of them, Touchy, doesn’t provide a toolpath preview, and according to the author, there’s no plans to add it, presumably because he doesn’t want it. The other, Mocca, has all that and more, but is built in OpenLazlo, which one commenter memorably referred to as a “bizarre moon language,” virtually guaranteeing that no one but the original developers will ever touch it. Meanwhile, other people are finding ways to adapt Axis to use a touchscreen despite it being a mess of spaghetti code even the original developers are reluctant to go near.

In fairness to all involved, they’re giving their efforts to the community freely, and one of the points of open source is precisely to enable individuals to scratch their own itches, their way. I’m not complaining. But fragmentation brings costs. HAL files of more than trivial complexity remain byzantine, and GUI customization remains largely an unfulfilled goal. A trip to the EMC forums or mailing list shows dozens of people trying to figure out how to get some part of their machine to work. Meanwhile, a trip to the Mach forums finds hundreds of people writing macros, wizards, or screen layouts. It makes one wonder if the vision of openness and flexibility has it all backwards.

Now it’s true that above a certain level, Mach doesn’t cut it. If you happen to have some seriously large iron around with a dead control, it’s EMC or something far more costly than a Mach license. And there is the little bit of uncertainty that Windows will cause your machine to have a “senior moment” once every so often–while EMC seems rock-solid. But these points are arguing over the area between the 99th and 100th percentiles, when large gaps remain between 50 and 75.

I’ve had numerous people ask me about why I chose the Arduino when there are “better” options available that have more IO pins, true USB, better CPU speed, etc. The simple reason is that Arduino is far and away the most widely-known, used, and supported platform out there, and platforms have enormous value beyond the stuff that fits on a spec sheet. Pretty much the entire history of the PC is a story of platforms beating technologies, and I am not going to fight that.

Likewise, while I do intend to commercialize this project in the form of PCBs, kits, or instructional DVDs, I’d rather capture 10% of several thousand users than 90% of a hundred or so. My biggest marketing problem is going to be to get people to notice, and if the cost of doing that is helping 90% of people to do it for free, I still think the remaining 10% will more than make up.


5 responses to “Arduino, EMC2, and the open-source conundrum

  1. Greg December 13, 2010 at 9:10 pm

    I love your project! jI’ve been using EMC2 on my home built gantry router for a little over a year now and don’t regret choosing it over Mach despite the steeper learning curve. I follow the forums in detail because it’s a great way for me to learn from others experiences. I came to the exact same conclusion as you about the fragmentation and duplication of efforts. I’m sure in the long run natural selection will prevail but I think that possibly more progress could be made if there were an effort to emulate some of what makes Mach attractive to so many. How that could be done I don’t know at this time though some progress in that direction has been made (eg. the conguration wizard) Attracting more users would add to the pool of talent, etc.

    So, I certainly welcome this project of yours. For my part your timing was excellent as I had just bought an Arduino with the idea of doing something similar but being a complete newbie at programming I’m still very low on the learning curve. I’m looking forward to seeing your code when you release it. Keep up the good work!

    Best regards,

  2. Andy Pugh December 21, 2010 at 5:13 am

    With the integration of gremlin, gladevcp and a webcam utility and the ability to add new tabs to Touchy (only in the development branch) it is now fairly easy to add a G-code preview to Touchy, and a webcam to Touchy or Axis.

  3. Anthony January 26, 2011 at 5:36 am

    Yes I agree, why whould you want to make an Arduino a G-Code/Stepper driver? Its like asking a boy to do a mans job. Don’t get me wrong, the Arduino is a great little platform but it has its limitations.

  4. Bob Warfield February 5, 2011 at 10:57 am

    Better late than never getting back to this topic, eh?

    Why would you want a cheap microcontroller to generate steps? Because having one that’s well supported is the biggest thing that stands between Mach3 and stability/performance.

    How do I know this? It’s real obvious to anyone who has run Mach3 from both a parallel port and a Smoothstepper. You get past most if not all of Mach’s bad behavior without having to run Linux . I know for the EMC community, that makes no sense at all. But as you point out, it’s a matter of scale–Mach has a much bigger community and an ecosystem that’s providing more value.


    • Colin February 5, 2011 at 12:16 pm

      I have a saying that when the customer is wrong, and stays wrong, who am I to argue with them? Since your last comment on this topic I’ve started to change my mind a bit. Whether a USB step generator is the *best* idea or not is secondary to the fact that a lot of people want one. And as you say, I can believe it prevents de-gremlinizes Mach.

      On the broader point, I think Mach has been the more successful platform in terms of adoption, while EMC2 has been the more successful in terms of technical superiority. I see it as the first three hours of a trip from Boston to San Francisco by plane or car: The car will be passing Albany while the flier is getting groped by the TSA, but once the plane is in the air, the race is basically over.

      Where I think the tipping point will occur is when somebody makes a control-in-a-box on an appliance model with swappable interface modules for steppers, 0-10V servo drives, spindle drives, relays, etc. EMC2 is already being used to run everything from Sherlines to Sam Sokolik’s 5-axis behemoth (that makes a 1″ tap look like a thumbtack), and 6-axis manipulators with non-Cartesian kinematics. As the GUI problem starts getting solved well (Andy’s comment above is I think an important start), I think we’re going to start seeing developers add richness in really exciting ways. At some point, shop owners might start asking machine salesmen why the Sieg KX3 in their garage does more than the one on the $100k machine in the catalog.

      I think there’s a chance this falls out something like the Linux-AIX/Solaris/HP/etc. competition of not long ago, where vendor-specific OSs fall away for all but the most high-end applications. This is a market that’s very price/feature competitive, so I’ve got to think some of the big players have at least thought about it. And if they have, I’m sure they’d keep it *real* quiet.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: