G-code Units (inch vs. millimeter)

Call me broken but I can’t quite part with my inches. I know all the advantages of using the metric system but I think in inches. I’ll work on that…

Question: Does ground control automatically convert units in the g-code? I calibrated my machine in mm as well as every other setting in ground control. I made my g-code (in inches) and when I loaded it in GC, I noticed the manual move commands switched to inches. The cut came out scaled correct and was just what I wanted.

Follow-up question: Do we need to make sure we match our g-code units with how our machine was set up? I answered my own question with my test but wanted to make sure so I don’t screw things up on a bigger cut. I made one g-code in Easel (created in inches then switched over to mm right before export). The second was made in Makercam and left in inches for the export (this is the one that ran fine).

Long story short - can we make our g-code using whatever units we want and GC will automatically convert it so things are scaled correctly?

1 Like

units of the gcode is controlled by the CAM generator/post processor. If you setup your cuts in your CAM using mm; the post processor with put a G20 command in the gcode … this tells the controller (Ground Control) that the gcode is in mm. If you used inches in your CAM program then a G21 command will be generated telling the controller that the gcode is in inches.

You can not convert inches to mm by changing G21 to G20 or vise versa.

you can calibrate the machine in mm and use inches or mm.

The key is just to make sure that your units are consistent through the CAM to Gcode process. If you are going to convert from inches to mm or vise versa, you need to do it in the CAD portion and stay consistent for that project.

At least this is the way I understand it… :slight_smile:


Thanks for the response. That’s what it seems like from what I saw. Great then I’ll proceed. I calibrated in mm to get better accuracy but will continue to design in inches without converting. Love it!


The firmware converts distance units to steps, inches or mm or furlongs or cubits just changes the conversion factor. I suspect a machine (ignoring the Maslow’s unusual non-cartesion drive system) that actually has mm or inch size steps is exceedingly rare.

If you find a place where it doesn’t convert properly (furlongs and cubits aren’t implemented yet…) that’s a bug and should be reported

Convenience perhaps, but some non-maslow shops routinely work in millionths of inch or submicron tolerances. A 64th (or even 32nd) of an inch is smaller than a mm, admittedly requiring some arithmetic to convert to decimal until Bar implements fractional inch entry :slight_smile:

Better to use the system that was forced upon you in childhood than crash your Mars lander because you lost that intuitive understanding and misconverted


I wish I could find a tape with 64th or even 32nd inch graduations to measure the motor distance… that would be slightly better than what we can get with a mm tape.

My 10ft Starrett calipers are currently at my beach house in Arizona. :slight_smile:


Spendy, but cheaper than a Starrett. Coincidentally I just got another MSC flyer (not as good as the Enco sales) in the mail today, although I giggle search-fu’d the link.


Didn’t realize there were so many Arizonian beach houses