Quick actions to set zero

I would like to make some quick actions to set my XY zero to a known location. I have a Shapeoko 5 Pro 2x4 running Carbide Motion build 640 and use inches. Ideally, I would set the zero without moving the gantry (I could manually check the zero by jogging to current XY if needed).

As background, I have a series of shallow 0.6" dogholes set at -4.04" increments in machine coordinates in both X and Y. Based on those dogholes I know the location of my stock and I would like to easily set zero either on multiples of -2.02" (based on center of doghole or between two dogholes) or in multiples of -2.02" plus 0.3" (based on edge of doghole).

I think that is too many possible locations for a separate quick action for each. So, it might be best to have one quick action to set the zero to the center of the center-most grid point (X-24.24 Y-12.12) and then separate quick actions to increment X zero or increment Y zero by 4.04, 2.02, or 0.3.

Any suggestions about the code for the quick actions? Or a better approach to accomplish the same thing.

Also, I am a programmer (mostly C++), but I am really struggling with G-code. I cannot find any good documentation about the specific implementation on Shapeoko. I found this page: Supported G-codes but it seems not to be correct as many of the G-codes that I see in snippets here are either not listed or are listed as ignored. Is there any real documentation on the Carbide 3D implementation of grbl that I can trust?

I am pretty sure you will have to move the machine to a known position using the G53 (Machine Coordinates) system, then set zero relative to that known position.

The list at:

https://carbide3d.com/hub/faq/supported-gcodes/

should be correct/accurate/compleat.

There are of course many others, but Grbl is memory-constrained, so doesn’t implement loops, variables, branching, or even specialty ops such as threading.

For full details on G-code see:

but it’s a pretty weird language, and only folks who use commercial systems and Linux CNC and Mach3 use it.

There is:

That said, if you can cope with Python, I have been working on a programming system:

but it’s off-topic/unsupported here at best, see:

2 Likes

I don’t have CM in front of me for a screenshot, but there’s a button to create a Quick Action to save the current program zero. That will create the proper G-code and add an entry to reset it at any time.

6 Likes

8 minutes and 45 seconds in demonstrates the zero quick action :beers:

4 Likes

HeuristicBishop robgrz and WillAdams,

Thanks so much for your fast responses. Looking at the quick action it looks like the built-in macro generator makes a line of G-code

G10L2 P1 X___ Y___ Z___

I don’t think the Supported G-codes list is complete because it doesn’t include G10L2. So if G10L2 is a G-code that is undocumented but works, do you know if G10L20 also works?

If so I think I could do the following. I think I could use the G10L2 to set the center most grid point and then make 8 other macros, all based on G10L20 that would go +/- X and +/- Y in increments of 2.02" or 0.30". These would let me fairly rapidly set any position on the doghole centers or edges.

I think I will have to move the gantry, but if I can do that in increments of 2.02" that shouldn’t be too bad.

I use this list of LinuxCNC Gcodes (LinuxCNC "G-code" Quick Reference) which GRBL 1.1 supports

Linked from: Home · gnea/grbl Wiki · GitHub

2 Likes

So I worked on this yesterday and found that while it is easy to create new quick action buttons, it is not so easy to click them repeatedly. Each time you click one, you have to click another pop-up box, and then it kicks you up out of the quick action button box. I wind up doing like 3 extra clicks for every one action.

So I decided that it was easier to just edit the button to directly set the zero that I want. My quick command is

G20
G10 L2 P1 X___ Y___

And I just edit the blanks to the value that I want and click. There is no gantry move required, and I don’t have to worry about all of the complications I was bringing in above. And if I use one specific zero frequently then I can save it separately.

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.