# Macro for zeroing X, Y and Z

**URL:** <https://forum.onefinitycnc.com/t/macro-for-zeroing-x-y-and-z/28969>\
**Category:** Macros for BB\
**Created:** [October 14, 2024, 6:36pm UTC](https://forum.onefinitycnc.com/t/macro-for-zeroing-x-y-and-z/28969 "2024-10-14T18:36:22Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![349iq2345](https://avatars.discourse-cdn.com/v4/letter/3/bb73d2/32.png) [@349iq2345](https://forum.onefinitycnc.com/u/349iq2345)\
**Post date:** [October 14, 2024, 7:17pm UTC](https://forum.onefinitycnc.com/t/macro-for-zeroing-x-y-and-z/28969/2 "2024-10-14T19:17:49Z")

</div>

Hey Lars,

you move to the desired X Y Z coordinate with a G0 command. Prepend G90 G53 to your G0 command in the same line to make sure that you move in machine coordinates first.

Then after the machine reached the new position, you set all axes to workpiece zero with this command:

G92 X0 Y0 Z0

G92 also works if you used the jog pane or the gamepad to move to the desired position.

---

_[View the full topic](https://forum.onefinitycnc.com/t/macro-for-zeroing-x-y-and-z/28969)._
