Skip to content
Ch 1236 / 37

Step 12.36 — Replace PRINT_START with a skeleton that waits on the chamber

Step 36 of 37 · Chapter 12 — Software: Pi OS image, Klipper/Moonraker/Mainsail, firmware, printer.cfg

(no image — see text)

Parts: none.

Do: LDO's stock PRINT_START is three lines and takes no parameters: replace it with the first block. Paste the second block under PRINT_END, and add the third line under M107 inside PRINT_END. Keep the rest of PRINT_END.

[gcode_macro PRINT_START]
#   Slicer start G-code:  PRINT_START BED=[first_layer_bed_temperature] EXTRUDER=[first_layer_temperature] CHAMBER=0 FILAMENT={filament_type[initial_tool]}
#   CHAMBER=0 (the default) skips the chamber wait entirely and does a timed soak instead.
#   FILAMENT= is the slicer's filament type. The Nevermore runs only for the types in
#   `filtered`; a hand-run PRINT_START with no FILAMENT filters too.
gcode:
    {% set bed      = params.BED|default(100)|float %}
    {% set extruder = params.EXTRUDER|default(240)|float %}
    {% set chamber  = params.CHAMBER|default(0)|float %}
    {% set soak     = params.SOAK|default(8)|int %}
    {% set filament = params.FILAMENT|default("")|string|upper %}
    {% set filtered = ["ABS", "ASA", "HIPS", "PC", "PA", "PP", "FLEX"] %}
    {% set filter   = filament == "" or filament in filtered %}

    CLEAR_PAUSE
    BED_MESH_CLEAR
    SET_GCODE_OFFSET Z=0

    SET_DISPLAY_TEXT MSG="Homing"
    G28                                    ; cold home; Z on the nozzle-probe pin
    G90
    G0 X175 Y175 Z30 F3600                 ; park over centre  <-- 350 only

    SET_DISPLAY_TEXT MSG="Bed {bed}C"
    {% if filter %}
      UPDATE_DELAYED_GCODE ID=_NEVERMORE_OFF DURATION=0
      SET_FAN_SPEED FAN=nevermore SPEED=1  ; filtered material: filter from the start of the soak
    {% endif %}
    M140 S{bed}
    M190 S{bed}                            ; wait for the bed

    {% if chamber > 0 %}
      SET_DISPLAY_TEXT MSG="Chamber {chamber}C"
      M106 S255                            ; part fan stirs the chamber while soaking
      TEMPERATURE_WAIT SENSOR="temperature_sensor chamber_temp" MINIMUM={chamber}
      M107
    {% else %}
      SET_DISPLAY_TEXT MSG="Soak {soak} min"
      G4 P{soak * 60000}
    {% endif %}

    SET_DISPLAY_TEXT MSG="QGL"
    M104 S150                              ; 150C for QGL: hot enough to be dimensionally
    TEMPERATURE_WAIT SENSOR=extruder MINIMUM=145   ; honest, cold enough not to ooze
    QUAD_GANTRY_LEVEL
    G28 Z                                  ; re-home Z hot; this is the Z0 that counts

    SET_DISPLAY_TEXT MSG="Meshing"
    BED_MESH_CALIBRATE ADAPTIVE=1

    SET_DISPLAY_TEXT MSG="Hotend {extruder}C"
    G0 X5 Y5 Z10 F3600                     ; park at the purge-line start, so ooze lands there, not under the part
    M109 S{extruder}

    ##  TODO Ch 14: purge / prime line goes here, once the nozzle is calibrated.

    G21
    G90
    M83                                    ; relative extrusion
    G92 E0
    SET_DISPLAY_TEXT MSG="Printing"
[gcode_macro _NEVERMORE_SCRUB]
description: PRINT_END calls it. After a filtered print the Nevermore runs on for scrub_min, then stops.
variable_scrub_min: 10         # minutes; 0 stops it at the end of the print
gcode:
    {% if printer["fan_generic nevermore"].speed > 0 and scrub_min > 0 %}
      UPDATE_DELAYED_GCODE ID=_NEVERMORE_OFF DURATION={scrub_min * 60}
    {% else %}
      SET_FAN_SPEED FAN=nevermore SPEED=0
    {% endif %}

[delayed_gcode _NEVERMORE_OFF]
gcode:
    SET_FAN_SPEED FAN=nevermore SPEED=0
    _NEVERMORE_SCRUB

check Check

The macro parses at the config check. Do not run it: G28 will fail until Step 12.33's TODO is closed in Ch 13.

What you're looking at

PRINT_START is the macro the slicer calls at the top of every print. It holds the warm-up sequence: home, heat the bed, soak the chamber, level the gantry, mesh the bed, then bring the hotend up. A machine still expanding will not level repeatably.

Filter note: FILAMENT= comes from the slicer profile Ch 13 makes. filtered is Prusa's own filtration list for the Core One (ASA, ABS, HIPS, PC, PP, FLEX) plus PA; PLA, PETG and PVB print with the Nevermore off and its carbon spared. After a filtered print PRINT_END keeps the Nevermore running for scrub_min minutes, then stops it; the next filtered print cancels that timer, and an unfiltered one leaves it to finish. PRINT_END already ends with BED_MESH_CLEAR, which pairs with the mesh you just added.

Ordering note: bed heat and soak come first, then QGL hot, then the mesh — matching the Voron wizard's own order and the rule that a thermally unstable machine will not QGL repeatably (survey §3.3, §4.4 #16). SET_DISPLAY_TEXT needs [display_status], which arrived with [include mainsail.cfg]. src

Caution

TEMPERATURE_WAIT has no timeout. If the chamber never reaches CHAMBER, the macro blocks forever and the only way out is cancelling the print. Keep CHAMBER=0 (timed soak) until you have measured what your chamber actually reaches with the door shut and the bed at your print temperature. src

Source: leviathan-printer-rev-d-sbv2.cfg · Klipper docs § TEMPERATURE_WAIT · Voron startup wizard