User Macros & G-Code Questions

I engraved a grid into a secondary spoilboard on my SO5 so I can line up workpieces on a known zeroing point. I’ve used the log get boilerplate code from the rapid movement shortcuts on the jog page, testing my versions with MDI before creating a User Macro. The code (to position XY -40", -20") patterned after what CM sends is:
N0 G1 X-1016.0 Y-508.0 F5000.0
this seems to work, but so does
G53 G90 G0 X-1016.0 Y-508.0
My questions are:

  • Is one preferred over the other in a user macro?
  • Do I need the preceding “/” in UMs?
  • Can I set the XY zeros from within this UM?

Also, when I click “Create from current zero” it generates:
G10L2P1X1016.000Y508.000Z15.875
and while I understand that it’s setting the G54 offset, I don’t get why the values are positive when my workspace is negative. Maybe I’m just misinterpreting how this is used. The fact that the controller appears to only support a subset of standard G-code doesn’t help :upside_down_face:

Thanks in advance for any insights.

1 Like

If you want to narrow your search terms, you can search for GRBL. That should get you the exact set of supported g-code features.

There is a list of supported G-codes at:

but note that some of them are handled by Carbide Motion, not Grbl.

1 Like

A few seconds viewing that page shows that it is incomplete. G10 and G53 are missing.

I prefer the second form. It is very explicit in what it is doing - using machine co-ordinates, absolute mode. The only thing missing is an explicit units selection (G20 vs G21). It should work no matter what the current modal state of the controller is.

The first form appears to be using a default co-ordinate system. It’s also using a default distance mode. It would probably work fine, until it doesn’t. Perhaps Carbide Motion is adding ‘secret’ extra commands to ensure it works more predictably. Regardless, if you are looking at it later, it’s not as obvious what it is doing.

1 Like

Thanks to everyone for the assistance. I’ve noticed that this line:
$x G92.1 G49 G10 L2 P1 X0 Y0 Z0 G54 G21 G90
gets sent by CM a lot. Some of the codes in there are allegedly ignored … go figure.
I’ve also found that while the preceding slash isn’t strictly necessary, it will keep CM from potentially filtering/modifying the code.