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

    Z offset Macro

    Scheduled Pinned Locked Moved
    General Discussion
    1
    3
    663
    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.
    • schneik80undefined
      schneik80
      last edited by

      I'm working on a Z offset macro to help find the correct z offset value for the I.R. Probe.
      I'm calling M291 to adjust Z so that it just touches the bed. But i can not seem to get the M291 paramaters correct.
      I want the dialog to appear, wait for the user to cancel or OK and proceed running the remaining g code.

      The dialog appears, and I can set S and T values so that the message displays until the user clicks OK but while the message is displayed the remaining G code runs?

      Macro here:
      [c]
      ;Find Offset
      ; Clear any bed transform
      M561
      ; Relative positioning
      G91
      ; Lift Z
      G1 Z5 F6000
      ; Course home X and Y
      G1 X-325 Y-225 F6000 S1
      ; Move away from the endstops
      G1 X5 Y5 F6000
      ; Finde home X and Y
      G1 X-10 Y-10 F360 S1
      ;Set machine 0
      G90
      G92 X0 Y0
      ;Move to Origin Offset
      G1 X171.5 Y102.5 F6000
      ; Move Z down until the switch triggers
      G91
      G1 Z-260 S1 F900
      G1 Z5
      ; Move slowly to Z axis endstop once more (second pass)
      G1 Z-10 S1 F180
      ; Back to absolute positioning
      G90
      ; Tell the firmware we have z room
      G92 Z5.00
      M291 P"MOVE HEAD TO JUST TOUCH BED" R"Z OFFSET" S1 Z1 T0
      ;Set True 0
      G92 Z0.00
      ;Move away
      G1 Z5 F360
      ; probe
      G30 S-1
      ;Tone
      M300 S2200 P100
      G4 P150
      M300 S2200 P100
      G4 P150
      M300 S2200 P100
      [/c]

      1 Reply Last reply Reply Quote 0
      • schneik80undefined
        schneik80
        last edited by

        Using S3 solves my issue.

        1 Reply Last reply Reply Quote 0
        • schneik80undefined
          schneik80
          last edited by

          Now, is it possible to pop a message with the Z position, or better yet write out the Z value into G31?

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