Go Down

Topic: EMC2.4/AXIS over USB w/Arduino and a call to the crowd. (Read 14 times) previous topic - next topic


Feb 18, 2012, 04:05 am Last Edit: Mar 28, 2012, 09:15 pm by dewy721 Reason: 1
After looking at RepRap, rStepper, Grbl and others, I found that although they are all really cool projects for turning an Arduino into a G-Code parsing CNC controller made by some really clever people. 3-Axis only, or 3d-printing choices only just didn't fit what I was looking for...

An industry compliant solution that accepts custom codes, canned routines, offsets, tool compensation, encoder feedback for closed-loop control and a UI that lets me see what I'm about to make all on a platform that can grow with me AND my machine. All the way up to 9-axises! You know, THE WHOLE WORKS!

Well I'm glad to say I found one, and its free to boot! Called EMC/Linux, its been around for decades and its very well documented. Perfect! Just one problem, how to get this wonderful piece of software to talk to an Arduino that wants to become a CNC machine one day.

After looking around the web for weeks and pouring over documents, forums and posts that said "it can't be done" blah blah blah. I was becoming discouraged.

But, I discovered it could be done! And this is how:

EMC has an underlying interface called HAL, a virtual breadboard or sorts that can do tons of stuff including loading a python script. A python script can use serial communications and talk to one or more Arduino's simultaneously. Interesting...

That python script could then collect the X/Y/Z/Whatever coordinates from EMC's HAL interface and send the data over to the Arduino, the Arduino then moves the machine accordingly and tada! CNC magic happens!

So in a nutshell, here is a sketch, instructions, a python script and a HAL config to interface an Arduino to EMC in a useful way, and all the code is wrapped up inside the sketch for ease of use.

If anyone finds this useful, have any constructive suggestions or code contributions/improvements please let me know.

There's enough code to get a plotter up and running, but hopefully laid out well enough that one could interpret and expand it to their needs.

It currently supports:
 Stepper motors (microstepping as well)
 A plotter solenoid.
 ATX psu control for automatic power up/down
 LCD display (alpha)
 Closed-loop feedback (Arduino controlled.)
 Machine power status LEDs
 Power control button that will tell EMC to turn the power on/off.

So check it out at: https://github.com/dewy721/EMC-2-Arduino

If you do add to it, PLEASE let me know. It would be interesting to see what others make from it, or a link to it so others can benefit too.

Hack it, mod it, improve it, tag it, post it. This is now a crowd-source project, and its now public domain. Enjoy!


That is cool you started this I am working on emc2 and arduino. It will power a 4x8 router and plasma table (to start with).


I just realized that all your files are ino's don't quite know what to do with them yet. any help would be a great. really exited about this project, I will be trying to get stepper motors to work.


Mar 23, 2012, 02:27 am Last Edit: Mar 23, 2012, 08:06 am by dewy721 Reason: 1
The .ino files you can open with the Arduino software. I'm currently making a stepper version for 4-axies. (3+optional rotary chuck/print head.)

Here's the alpha version if you'd like. This one loses the servo/encoder support in favor of steppers instead. (I added an optional fourth axis to boot!)

I've moved the project over to GitHub at https://github.com/dewy721/EMC-2-Arduino were I can facilitate its development better.


What is the difference between:   EmcArduino_02b   and    EmcArduino_04a?

Also,  when you edit the my-mill.hal file do you comment out all lines containing "parport"  or just the ones that start with "net" ?

GREAT IDEA!    This is going to be fantastic,   please keep it up.

Go Up