TEMPERATURE_WAIT does not wait for the temperature

Basic Information:

Printer Model: Delta kossel custom
MCU / Printerboard: MKS Robin nano V3.1
Host / SBC: Raspberry pi 3B
klippy.log

klippy.log (38.4 KB)

Describe your issue:

I’m making a simple macro that should wait for the hotend temperature go down to 50 degrees and then shut down the machine.

The problem is that the WAIT_TEMPERATURE command is not executed and the machine shuts down instantly after G28.

the same problem goes for the M109 S50 command.

[gcode_macro COOLDOWN_SHUTDOWN]
gcode:
    M140 S0                         # Turn off bed
    M104 S0
    M106 S255
    G28
    SET_PIN PIN=CaseLight VALUE=0	# Apagar leds
    TEMPERATURE_WAIT SENSOR=extruder MINIMUM=50
    #M109 R50		                 # Wait for hotend temp.
    #G4 P300000                      # Wait 5 min
    M106 S0
    M84                             # Disable steppers    
    POWER_OFF_PRINTER               # Turn off printer

[gcode_macro POWER_OFF_PRINTER]
gcode:
  {action_call_remote_method("set_device_power",
                             device="Printer",
                             state="off")}

If i use the g4 command it works as expected, after the specified time the machine shuts down.

On the other hand, if I use g4 in the END_PRINT macro, it waits for the specified time, but the machine does not turn off… And indeed, TEMPERATURE_WAIT and M109 do not work either.

In the case of the END_PRINT macro after the m109 or WAIT_TEMPERATURE commands, the machine does not turn off unlike the COOLDOWN_SHUTDOWN macro.

[gcode_macro END_PRINT]
gcode:
    M140 S0                         # Turn off bed, extruder, and fan
    M104 S0
    G91                             # Move nozzle away from print while retracting
    G1 z2 E-3 F300
    G90                             # Home
    G28
    SET_PIN PIN=CaseLight VALUE=0	# Apagar leds
    CLEAR_PAUSE
    M106 S255
    TEMPERATURE_WAIT SENSOR=extruder MINIMUM=50
    #M109 R50		                # Wait for hotend temp.
    #G4 P300000                      # Wait 5 min
    M106 S0
    M84                             # Disable steppers
    POWER_OFF_PRINTER               # Turn off printer

I don’t understand what is the order and/or preference of the commands inside the macros, I’m very confused.

You maybe mixed up MINIMUM and MAXIMUM:

https://www.klipper3d.org/G-Codes.html#temperature_wait

I have tried TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=50 right now with the same result on COOLDOWN_SHUTDOWN macro, the machine shuts down instantly after G28.

Also how is it that in the macro END_PRINT the machine does not turn off after the G4?

You’ll have to forgive me, I don’t know how I did the test but it’s clear that it’s bad.

The COOLDOWN_SHUTDOWN macro now works as expected!

thank you very much!!

I don’t understand English perfectly and I had a misunderstanding while reading the klipper documentation.

The END_PRINT macro now reaches further than before. Wait for the temperature of 50C then turn off the fan, turn off the motors, but do not turn off the machine. what could be the problem?

[gcode_macro END_PRINT]
gcode:
    M140 S0                         # Turn off bed, extruder, and fan
    M104 S0
    G91                             # Move nozzle away from print while retracting
    G1 z2 E-3 F300
    G90                             # Home
    G28
    SET_PIN PIN=CaseLight VALUE=0	# Apagar leds
    CLEAR_PAUSE
    M106 S255
    TEMPERATURE_WAIT SENSOR=extruder MAXIMUM=50
    M106 S0
    M84                             # Disable steppers
    POWER_OFF_PRINTER               # Turn off printer

[gcode_macro POWER_OFF_PRINTER]
gcode:
  {action_call_remote_method("set_device_power",
                             device="Printer",
                             state="off")}
1 Like

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