Possible mistake in ConfigTool resume.g
oliof last edited by
due to a question on the LPCSTM RRF discord, I did some source code spelunking, and found a discrepancy.
Regarding pause and resume, the documentation tells us in https://duet3d.dozuki.com/Wiki/G1
Rn Return to the coordinates stored in restore point #n (see G60). Any X, Y, Z and other axis parameters in the command are used as offsets from the stored position. Axes not mentioned are not moved, so use offset 0 for axes you want to restore to the stored value. For example, G1 R0 X0 Y0 Z2 will move to 2mm above the position stored in restore point 0.
the documentation should mention that triggering a pause also stores coordinates at restore point 1 and M60 is not needed in pause.g / filament-change.g -- I seem to remember this is mentioned somewhere around restore points but I can't quickly search through the whole corpus of GCodes anymore due to the splitting up of the dictionary. Splitting up neccessitates some redundancy it seems.
documentation agrees with source code since commit hash 73461819be81e0f8294a3810e644a9d88adf27d2, so that's good.
ConfigTool seems to generate a resume.g that's not restoring Z position (see https://github.com/Duet3D/ConfigTool/blame/e563ba7a060ae684b48be20d6d4b44c35ba887d2/public/templates/resume.ejs). ConfigTool creates a resume.g that looks like this:
; resume.g ; called before a print from SD card is resumed ; ; generated by RepRapFirmware Configuration Tool v<%- version %> on <%- (new Date()).toString() %> G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move G1 R1 X0 Y0 ; go back to the last print move M83 ; relative extruder moves G1 E10 F3600 ; extrude 10mm of filament
it should be
; resume.g ; called before a print from SD card is resumed ; ; generated by RepRapFirmware Configuration Tool v<%- version %> on <%- (new Date()).toString() %> G1 R1 X0 Y0 Z5 F6000 ; go to 5mm above position of the last print move G1 R1 X0 Y0 Z0 ; go back to the last print move M83 ; relative extruder moves G1 E10 F3600 ; extrude 10mm of filament
otherwise the nozzle ends up 5mm above the original print position.
some people report the ConfigTool resume.g works for them without any changes. I admit the source code around this is a bit hairy with a lot of conditionals and I may have missed a magic restore Z position piece. Either way, this requires a documentation update if Z is implicitly restored on resume, or an update of the config tool to generate a working resume.g ... which one is it?
oliof last edited by
@oliof Well spotted, thank you. I'm going to update the resume.g template shortly.
fcwilt last edited by
I don't know where the code in my resume came from but it has this:
G1 R1 Z5 G1 R1 X0 Y0 G1 R1 Z0
which would seem to have the same result as
G1 R1 X0 Y0 Z5 G1 R1 X0 Y0 Z0