Imran's personal blog

March 11, 2012

SkeinForge, Marlin for CNC Work

Filed under: Uncategorized — ipeerbhai @ 2:58 am

Hi All,

So I’ve built a CNC Mill.  Now, I’m figuring out how to use it.  I like to draw in OpenSCAD, and then I use Marlin/SkeinForge as my control software, and I run OS X ( Macintosh ).  This causes a few problems.

1. There’s few G-Code generators that work on Mac.

2. SkeingForge seems to default its F speed as IPM( which makes sense — that’s a common convention ), but Marlin interprets it as mmPM( which is 25.4 times slower ), which is common in 3d printing.  This means motions are too slow to be useful ( barely even visible ).  This is easily fixed by removing the G-Code header, which homes and sets to mm.  The default unit in Marlin is very happy with skeinforge once you make this change.

3. SkeinForge generates negative G-Code.  As in, move negative units, assuming 0,0,0 is the center of the machine.  The problem with this is that Marlin assumes 0,0,0 to be the lower left corner.  So, nothing can move more negative than this value.

In other words — this scenario doesn’t work without changes.  But, I’ve mostly figured it out.

1. Chop layer thickness = 0.16

2. Drill margins, top and bottom = 3.175 ( for 1/8 inch endmill )

3. Feed rate = 6.0 mm./s, max Z drill rate = 0.1 mm/s, travel feed = 16.0 mm/s ( 124 would be max speed of the bot @ 12 volts.  About 293 IPM )

4. Multiply X, Y to center.  I use X = 80, Y = 100.

This will come very close.  You’ll need to open the GCode file and remove the homing commands and the M108 code.  Replace M101 and M103 with M104 S210.0.  In theory, M103 should be replaced with M104 S0.0, but Marlin is meant for printing, so it executes this code at the wrong time on the motion path.  I would add G1 X160 Y160 Z25 to the  the end of the GCode file — this will move the toolhead out of the way, and turn it off.

I’ll have to make a couple of changes to Marlin.  M101 and M103 should execute M104 commands.  The various shut-down commands should be executed via timer thread.  M84 should call kill().  But the changes are minor.  I think I can make them compatible with printing, so that the same code will do both printing and milling.



Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

Create a free website or blog at

%d bloggers like this: