PAUSE does not pause the print ("Printer not homed")

Basic Information:

Printer Model: FLSUN QQ
MCU / Printerboard: MKS
klippy.zip (550.0 KB)

Describe your issue:

I want to do “pause at layer”. I have added a postprocessing script in Cura to pause at a specific layer. This is what the script inserts into the gcode:

;added code by post processing
;script: PauseAtHeight.py
;current layer: 230
M83 ; switch to relative E values for any needed retraction
M104 S0 ; standby temperature
M84 S3600 ; Keep steppers engaged for 1h
M0 ; Do the actual pause
M104 S205 ; resume temperature
G1 F5400 ; restore extrusion feedrate
M82 ; switch back to absolute E values
G92 E1692.45565

Because I read that M0 does not mean pause in Klipper, I have added this to my printer.cfg:

[gcode_macro M0]
gcode:
  PAUSE

This is supposed to trigger the PAUSE macro from fluidd.cfg (or mainsail.cfg, but I believe they are identical).

When I ran the job, it did indeed stop at the requested layer, but there was an error message:

echo: Printer not homed

When I tried to resume (using the RESUME macro) it said:

!! Must home first: 0.121 -14.453 46.200 [22485.305]

So I clicked the Home button and the printer homed. Then I tried to resume again and it said:

echo: Extruder not hot enough
// Print is not paused, resume aborted

So it seems like the print was never actually paused, maybe because the RESPOND aborted macro execution? And why was that RESPOND even executed, it seems to depend on printer.toolhead.homed_axes not being "xyz". I don’t quite understand what the issue is.

I read somewhere that this can happen if the print was paused for a long time and ran into the idle timeout but in my case everything happened within a couple of minutes.

I think as a workaround I will try to call PAUSE_BASE instead of PAUSE but that can hardly be the recommended solution.

M84 turns off motors, and Klipper doesn’t support any delay variable for this gcode. It will simply turn off the motors and discard the rest of that line.

1 Like

What is the purpose of inserting all that code? Why not just insert PAUSE?

:bulb:

The script comes with Cura, it has a number of options and generates this code.

image

Honestly injecting M84 S3600 when the option says “Keep motors engaged” feels almost like a bug. I can see where they’re coming from, but still there should be another option to not generate M84 at all.

Well, as you can see in “Method”, this functionality is tuned for Marlin and definitively does not care for Klipper or its requirements or capabilities.
As pointed out by @theophile all these shenanigans that Cura inserts would not be needed for Klipper
You might want to check and address this here: Improving Cura for Klipper and Smooth Motion Firmware 🏃 · Ultimaker/Cura · Discussion #16012 · GitHub

I’m sure it works fine with Marlin which is the method you’ve chosen, but Klipper doesn’t support all of the same gcodes as Marlin.

You could maybe create a macro for that particular gcode and just call PAUSE.
This keeps it compatible.

These are the available methods, unfortunately no Klipper (although we might be able to get a pull request merged for that):
image

Anyway, I have removed the M84 from the gcode. Pausing works now, but resuming doesn’t.

19:22:45 $ RESUME
19:22:45 echo: Extruder not hot enough
19:22:45 !! Must home first: 0.200 -14.374 46.200 [44964.601]
19:22:45 !! Must home first: 0.200 -14.374 46.200 [44964.601]
19:22:45 !! Must home first: 0.200 -14.374 46.200 [44964.601]
19:23:17 $ G28 X Y
19:23:43 $ RESUME
19:23:43 echo: Extruder not hot enough
19:23:43 // Extrude below minimum temp
         // See the 'min_extrude_temp' config option for details
19:23:43 !! Extrude below minimum temp
19:23:43 echo: Extruder not hot enough

It appears to me that there are two issues, one is the temperature, which probably means I have to remove the M104 lines as well.

But it also seems that the homing issue is not resolved. The PAUSE now works but the RESUME doesn’t, so it still loses its “homed” state at some point.

If I resolve the temperature issue and home manually before resume, it might work, I’m gonna try that now.

Cura inserts M104, which does not wait for the temperature and since you let it cool to 0 you run into this issue.

IMO, none of the inserted gcodes is needed if you are using the default macros that Mainsail or fluidd are providing. There you could even add a simple SET_PAUSE_AT_LAYER LAYER=xxx in your sliced gcode at the beginning and Klipper will do the rest.

I do not see any indication of this in what you have posted. Also, I can confirm the a.m. macros are working as intended.

I read that this macro only works if you have SET_PRINT_STATS_INFO in your gcode which I have not.

I think that because of !! Must home first.

I can confirm that the issue was indeed the M104 without that resuming works. As for the Must home first I believe I might have run into the idle timeout because I had to change the filament and the idle timeout is apparently 10 minutes.

Something is fishy here. A regular PAUSE does not invalidate homing unless you let it run into idle timeout.
If this is the case, the macros also allow you to change this behavior.

Well, if you rather fiddle around with a post-processor that does not produce Klipper compliant gcode. Your choice.

It’s not really by choice, I just assumed that making PauseAtHeight work is easier that making SET_PRINT_STATS_INFO work because it also requires fiddling with macros.

Klipper’s PAUSE does not reduce the temperature, is that correct?

See GitHub - pedrolamas/klipper-preprocessor: Klipper Preprocessor script for Cura

See GitHub - fluidd-core/fluidd-config: Fluidd base configuration for Klipper

Hm, am I understanding this correctly? The PAUSE/RESUME macros will restore the temperature upon resume, but I am responsible to reduce it. I can either do that by configuring [idle_timeout] (which has the additional advantage that I can remove the M84 so I don’t lose homing state during pause) or I can reduce the temperature manually after calling PAUSE?

Never used this functionality, but as far as my understanding goes, yes.
Also, you could probably use the

#variable_user_pause_macro : ""    ; Everything insight the "" will be executed after the klipper base pause (PAUSE_BASE) function

function

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.