Z offset Macro



  • 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]



  • Using S3 solves my issue.



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


Locked
 

Looks like your connection to Duet3D was lost, please wait while we try to reconnect.