• Tags
  • Documentation
  • Order
  • Register
  • Login
Duet3D Logo Duet3D
  • Tags
  • Documentation
  • Order
  • Register
  • Login

DRO half function with a 1 line macro

Scheduled Pinned Locked Moved
CNC
2
3
271
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • undefined
    CthulhuLabs
    last edited by CthulhuLabs 2 Sept 2022, 14:15 9 Feb 2022, 14:15

    So I recently got an edge finder for my CNC and wanted to replicate the half function found on many DROs I have worked with in the past to easily find the center of a part. After scratching my head for a bit and playing around I realized it could be done with one Meta Gcode line in a Macro file. Here is the X version of it:

    ; Half X
    G10 L2 P1 X{move.axes[0].workplaceOffsets[0] + (move.axes[0].userPosition / 2) }

    To use this I touch off on one side of the part and set that as zero for that axis. Next I go to the other side of the part and touch off. Then I run the above macro. This sets the new work offset half way between the old zero and the current position.

    For completeness here is the Y version:

    ; Half Y
    G10 L2 P1 Y{move.axes[1].workplaceOffsets[0] + (move.axes[1].userPosition / 2) }

    I figured I would share as this has proved to be super useful.

    undefined 1 Reply Last reply 9 Feb 2022, 16:08 Reply Quote 5
    • undefined
      dc42 administrators @CthulhuLabs
      last edited by 9 Feb 2022, 16:08

      @cthulhulabs thanks for sharing!

      Duet WiFi hardware designer and firmware engineer
      Please do not ask me for Duet support via PM or email, use the forum
      http://www.escher3d.com, https://miscsolutions.wordpress.com

      undefined 1 Reply Last reply 10 Feb 2022, 01:47 Reply Quote 1
      • undefined
        CthulhuLabs @dc42
        last edited by 10 Feb 2022, 01:47

        @dc42 You are welcome 🙂

        Honestly this might be a good addition to the actual DWC interface when in CNC mode. Just a thought.

        1 Reply Last reply Reply Quote 1
        1 out of 3
        • First post
          1/3
          Last post
        Unless otherwise noted, all forum content is licensed under CC-BY-SA