Macro to set Z Height

In Carbide Motion I’d like to create a macro to set my Z. I normally have my Z set to my spoil board but occasionally I want to change it to the top of my stock but would like an easy way (macro) to get it back to spoil board. Thoughts on creating a simple macro?

With a bit of fiddling, I came up with the following:

  • Zero off your bed.
  • Move the Z axis to a known location. In the MDI tab, enter
    G53 G90 G00 Z-5
    On the Job screen, note the Z position In my case, it was 88.225. Add 5 to it (corresponding to the location you just moved to), so now 93.225

EDIT i.e., the bed is 93.225 mm below Machine Z Zero.

Now create a new Quick Action
Name Zero Off Bed
Description
GCode

G21 G90 G54

G10 L2 P1 Z93.225

EDIT - Moving the Z axis wasn’t necessary.

Thanks Michael! Can you give me a quick rundown of the gcode? Or I can go look it up

First line is just some defaults - mm units, absolute positioning, default co-ordinate system

Second line is the magic - Set Z axis in G54 co-ordinate system so that Machine Z Zero corresponds to that value in work co-ordinates.

Ok I’ll give that a go tomorrow

Hmm, now that I’ve rebooted, the macro doesn’t work anymore. Hold off on that.

Some more fiddling show it works when bitsetter is DISABLED, and is completely broken when bitsetter is enabled.

It looks like CM is adding the tool offset length to the Z co-ordinate, and there’s no way to over-ride it. Broken in both MDI and Quick Actions.

1 Like

I don’t think I’d use a macro this way. You’d have to redo the macro any time you change an endmill.
Just a couple quick commands through the MDI should take care of it.

1 Like

Well that’s a bummer!

If you’re zeroed at the wasteboard, you can just take note of your Z axis MACHINE position while at work zero(will always be negative). When you need to, return to that position and set zero.

3 Likes

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