M98 issue after update from 3.4.6 to 3.5.4
-
I have recently updated to 3.5.4 from 3.4.6 and the DWC keeps loosing its connection while running the pre print macros and an error message pops up in the control screen when this happens. The message reads,
Connection interrupted, attempting to reconnect...
Operation failed (Reason: Service Unavailable)I think this happens when it reads the following line in the macro,
M98 P"/macros/autoz/scripts/autoz_probe.g" K1 H5 A4 S0.004
Are the variables allowed at the end of the M98 line? The pre print macros continue and the print job finishes without any other issues.
-
@thaug29 yes, you can have parameters passed into a macro as detailed here https://docs.duet3d.com/en/User_manual/Reference/Gcode_meta_commands#macro-parameters
what board are you using?
-
@jay_s_uk I'm using the 6HC
-
@thaug29 can you post the contents of the macro?
-
@jay_s_uk
#############################################################
; AutoZ - Automatic probe offset adjustment
;
; to use autoz, please place the following near the end
; of your slicer start gcode
; M98 P"/macros/autoz/autoz.g" <<< Place in slicer
;##################################################################;##################################################################
; prepare
;##################################################################M98 P"/macros/autoz/autoz_settings.g" ; Load your settings
M98 P"/macros/autoz/scripts/autoz_globals.g" ; Load autoz framework
G29 S2 ; Disable mesh
M290 R0 S0 ; Reset baby stepping;##################################################################
; Probe the nozzle on teh Z-pin
;##################################################################;G1 E-5 F1000
M98 P"/macros/autoz/scripts/autoz_move_up.g" ; large z hop incase the nozzle is low and you have a high pin
M400
M98 P"/macros/autoz/scripts/autoz_goto_zpin.g" ; go to the z pin
M400
M98 P"/macros/autoz/scripts/autoz_adjust_safe_zdrive.g" ; set z drive safe physics
M400
M98 P"/macros/autoz/scripts/autoz_probe.g" K1 H5 A4 S0.004
M400if !exists(global.macrocallresult)
echo "Call to macro failed. Aborting"
abort
;end ifvar nozzleheight = {global.macrocallresult}
echo "nozzleheight: ", {var.nozzleheight}M98 P"/macros/autoz/scripts/autoz_restore_zdrive.g" ; restore the z drive to the state before autoz
M400
M98 P"/macros/autoz/scripts/autoz_move_up_small.g" ; move up 2mm
M400;##################################################################
; Load the magprobe
;##################################################################M98 P"/macros/autoz/scripts/autoz_move_up.g"
M400
M98 P"/macros/magprobe_attach.g" ; pick up and verify clicky
M400
M98 P"/macros/autoz/scripts/autoz_goto_zpin_magprobe_offset.g" ; move the clicky probe switch body over the z pin
M400
M98 P"/macros/autoz/scripts/autoz_adjust_safe_zdrive.g" ; set z drive safe physics
M400;##################################################################
; Probe magprobe body on the Z-pin
;##################################################################M98 P"/macros/autoz/scripts/autoz_probe.g" K1 H5 A4 S0.004
M400if !exists(global.macrocallresult)
echo "Call to macro failed. Aborting"
abort
;end ifvar magprobeheight = {global.macrocallresult}
echo "magprobeheight: ", {var.magprobeheight};##################################################################
; Probe the bed
;##################################################################M98 P"/macros/autoz/scripts/autoz_move_up.g" ; hop to clear the switch
M400
M98 P"/macros/autoz/scripts/autoz_goto_bedcenter.g" ; go to the center of the bed
M400M98 P"/macros/autoz/scripts/autoz_probe.g" K0 H5 A4 S0.004
M400if !exists(global.macrocallresult)
echo "Call to macro failed. Aborting"
abort
;end ifvar bedheight = {global.macrocallresult}
echo "bedheight: ", {var.bedheight};##################################################################
; Calculate probe offset
;##################################################################var nozzleswitchoffset = {var.magprobeheight - var.nozzleheight + global.switchoffset}
echo "nozzleswitchoffset: ", {var.nozzleswitchoffset}var probeoffset = {var.bedheight - var.nozzleswitchoffset}
echo "probeoffset: ", {var.probeoffset};##################################################################
; Set probe offset as baby step offset
;##################################################################M290 R0 S{var.probeoffset}
M400;##############################################
; Finish up
;##############################################M98 P"/macros/autoz/scripts/autoz_restore_zdrive.g" ; restore the z drive to the state before autoz
M98 P"/macros/autoz/scripts/autoz_move_up.g" ; small z hop
M400
M98 P"/macros/magprobe_dock.g" ; unload the clicky probe
M98 P"/macros/autoz/scripts/autoz_goto_bedcenter.g" ; go to the center of the bed;##############################################
; Done
;##############################################