# Description
The U1 top cover has a purifier that can cool the chamber or keep… it warm. Snapmaker's own Orca sets the mode in the start G-code from the filaments on the plate. Mainline never sets it.
This PR ports that, the rest of Snapmaker's start G-code changes and the matching filament softening temperatures from Snapmaker's Orca as of [8931178229](https://github.com/Snapmaker/OrcaSlicer/tree/89311782298309040ee28b9a183f33f0f5477b15) (main, 2026-10-15). Every value is copied from Snapmaker's Orca. I didn't tune anything.
## Purifier mode
Snapmaker added a `chamber_cooling_mode` placeholder to `GCode.cpp` in Snapmaker/OrcaSlicer#504. It looks at the lowest softening temperature (`temperature_vitrification`) of the filaments used, skipping filaments flagged `filament_is_high_temperature`. The current commands are from Snapmaker/OrcaSlicer#1005.
| Lowest softening temperature | Mode | Line |
|---|---|---|
| 50 or less | strong cooling | `SET_PURIFIER_MODE MODE=1 DESIRE_TEMP=42 ALARM_TEMP=48 FAN_SPEED=0.6 DELAY_OFF=0` |
| 51 to 70 | weak cooling | `SET_PURIFIER_MODE MODE=1 DESIRE_TEMP=45 ALARM_TEMP=51 FAN_SPEED=0.6 DELAY_OFF=0` |
| above 70 | keep warm | `SET_PURIFIER_MODE MODE=3 DESIRE_TEMP=45 FAN_SPEED=0.6 DELAY_OFF=600` |
Orca already has the lowest softening temperature of the used filaments as `min_vitrification_temperature`, and the BBL H2D and P2S start G-code uses it. So this is plain G-code with no C++ change. The block is right after `M204 S10000`, as in Snapmaker's version.
Mainline has no `filament_is_high_temperature`. Every filament Snapmaker flags has a softening temperature of 90 or more (90 for PCTG, 100 for ABS and ASA, higher for PA and PC), so leaving them in the minimum can't change the mode.
## Other start G-code changes
Also from Snapmaker/OrcaSlicer#1005, in all four nozzle profiles. That PR gives no reasons, so the reasons below are my guesses.
- Pre-extrude the first tool after auto feed and flow calibration (`M104`, `T`, `M109`, `SM_PRINT_PREEXTRUDE_FILAMENT INDEX={initial_extruder}`). The other tools already get this the first time they're used, through the tool change G-code, so now the first tool starts primed too.
- `M107` before `G28 Z I140 J140`, before `DETECT_BED_PLATE`, after `WAIT_CHAMBER_TEMP` and before bed leveling. Today the part fan runs at full speed through all of these. The U1 probes by touching the bed with the nozzle, and Snapmaker's own cleaning macros have commented-out lines that slow the nozzle fan while probing, so I think the fan was affecting probing.
- `M106 S255` at the start of the deep nozzle clean, to turn the fan back on for the wipe, probably so the ooze sets before it's wiped off.
Mainline's tool change G-code already has Snapmaker's pre-extrude step and PVA accel line.
GitHub shows each start G-code as one long changed line, so I put a readable diff of it below. Click "Start G-code diff" to open it. It's the same in all four nozzle profiles, with trailing spaces trimmed.
<details>
<summary><b>Start G-code diff (click to expand)</b></summary>
```diff
@@ -10,4 +10,12 @@
M104 T{initial_extruder} S140
M204 S10000
+;===== top cover purifier =====
+{if min_vitrification_temperature <= 50}
+SET_PURIFIER_MODE MODE=1 DESIRE_TEMP=42 ALARM_TEMP=48 FAN_SPEED=0.6 DELAY_OFF=0 ; strong cooling
+{elsif min_vitrification_temperature <= 70}
+SET_PURIFIER_MODE MODE=1 DESIRE_TEMP=45 ALARM_TEMP=51 FAN_SPEED=0.6 DELAY_OFF=0 ; weak cooling
+{else}
+SET_PURIFIER_MODE MODE=3 DESIRE_TEMP=45 FAN_SPEED=0.6 DELAY_OFF=600 ; keep warm
+{endif}
G28 X Y
DEFECT_DETECT_NOODLE_FIRST
@@ -35,4 +43,10 @@
M104 S0 T2 A0
M104 S0 T3 A0
+
+;==== 预挤出耗材 =====
+M104 T{initial_extruder} S{nozzle_temperature[initial_extruder]}
+T{initial_extruder}
+M109 T{initial_extruder} S{nozzle_temperature[initial_extruder]}
+SM_PRINT_PREEXTRUDE_FILAMENT INDEX={initial_extruder}
M104 T{initial_extruder} S{nozzle_temperature[initial_extruder] - 90}
@@ -45,10 +59,13 @@
ROUGHLY_CLEAN_NOZZLE_WITH_DISCARD
MOVE_TO_XY_IDLE_POSITION_EXTRUDER
+M107
G28 Z I140 J140
;===== 检测钢板 =================
+M107
DETECT_BED_PLATE
;===== 深度清洁喷嘴 =================
+M106 S255
G90
G0 Z5 F10000
@@ -73,4 +90,5 @@
G0 Z5 F10000
WAIT_CHAMBER_TEMP TIMEOUT=180
+M107
{if curr_bed_type=="High Temp Plate"}
G28 Z Z_OFFSET -0.07
@@ -81,4 +99,5 @@
;===== 热床调平 =================
+M107
{if curr_bed_type=="High Temp Plate"}
; Always pass `ADAPTIVE_MARGIN=0` because Orca has already handled `adaptive_bed_mesh_margin` internally
```
</details>
## Not ported
- The fixed 11x11 `BED_MESH_CALIBRATE`. Mainline's adaptive mesh probes only the print area, so it's faster on small prints. Its `Z_OFFSET=-0.07` condition is unchanged.
- Removing the `SET_PRINT_AUTO_BED_LEVELING ENABLE=1` and `SET_TIME_LAPSE_CAMERA ENABLE=1` lines that paxx12 added in #12219. Snapmaker's version doesn't have them.
- `M104` in place of `M109` in the tool change G-code, also from Snapmaker/OrcaSlicer#1005. On the U1 firmware, `T` and `M104` don't wait for temperature, and `SM_PRINT_PREEXTRUDE_FILAMENT` waits only the first time each tool is used (u1-klipper 1.6.0, `klippy/kinematics/extruder.py` and the `INNER_PREEXTRUDE_FILAMENT` macro). Snapmaker also sets its own `tool_change_temprature_wait` setting, which mainline doesn't have. With `M104` in mainline, later tool changes could start printing before the nozzle is up to temperature. That needs its own test.
- The `Graphic Effect Plate` branch of the `G28 Z` offset. Mainline has no such bed type.
## Filament softening temperatures
The purifier mode is picked from `temperature_vitrification`, so the U1 filament values matter now. Where Snapmaker's Orca has the same U1 preset, I used its value ([filament profiles at 8931178229](https://github.com/Snapmaker/OrcaSlicer/tree/89311782298309040ee28b9a183f33f0f5477b15/resources/profiles/Snapmaker/filament)):
| Preset | Old | New | Mode |
|---|---|---|---|
| Snapmaker ABS @U1 (and ABS Benchy, same base) | 189 | 100 | keep warm, no change |
| Snapmaker ASA @U1 | 182 | 100 | keep warm, no change |
| Snapmaker PETG Translucent @U1 | 160 | 70 | keep warm -> weak |
| Snapmaker PETG-CF @U1 | 178 | 70 | keep warm -> weak |
| Snapmaker PLA Glow @U1 | 154 | 45 | keep warm -> strong |
| Snapmaker PVA @U1 | 150 | 45 | keep warm -> strong |
| Snapmaker TPU @U1 | 138 | 30 | keep warm -> strong |
Only PETG-CF's value was set in a U1 preset. Its 178 was added with the original U1 profiles in #10225, and Snapmaker has since changed it to 70 in its own Orca. The rest are inherited from the bundle's `fdm_filament_*` presets, which #2939 set in 2023 for Snapmaker's earlier printers. #2939 raised them from 60 (PLA), 110 (ABS), 80 (PET) and 60 (TPU) to values near those materials' melting points, with no reason given. Snapmaker's Orca no longer has those presets. The other Snapmaker and Generic U1 presets that Snapmaker's Orca also has already match.
Some mainline U1 presets have no U1 version in Snapmaker's Orca. Several of them inherit the bundle's 154 (PLA) or 138 (TPU), so a PLA or TPE print would get keep warm. For these I used the value Snapmaker gives the same material on the U1. In Snapmaker's Orca, every Snapmaker and Generic U1 preset of a material has the same value: 45 for PLA, 70 for PETG and 30 for TPU. These changes are in separate commits so they're easy to drop.
| Preset | Old | New | Mode |
|---|---|---|---|
| Snapmaker PLA @U1 | 154 | 45 | keep warm -> strong |
| Snapmaker PLA Eco @U1 | 154 | 45 | keep warm -> strong |
| Snapmaker PLA Metal @U1 | 154 | 45 | keep warm -> strong |
| Snapmaker PETG @U1 | 178 | 70 | keep warm -> weak |
| Snapmaker TPE @U1 | 138 | 30 | keep warm -> strong |
| Snapmaker TPU High-Flow @U1 | 138 | 30 | keep warm -> strong |
| Snapmaker TPU 95A @U1 | 60 | 30 | weak -> strong |
Left as they are:
- Snapmaker PET @U1 (230) and PA-CF @U1 (203), keep warm. Snapmaker's Orca has no selectable U1 PET or PA-CF preset.
- The Polymaker presets, which are third party. General PLA (62) and Tough PLA (55) get weak cooling where Snapmaker's U1 PLA presets get strong, and Silk PLA (45) gets strong. Snapmaker's Orca has the same values.
## Keys not copied
These keys exist only in Snapmaker's Orca, so mainline would ignore them: `filament_is_high_temperature`, `graphic_effect_plate_temp`, `graphic_effect_plate_temp_initial_layer`, `tool_change_temprature_wait`, `z_hop_when_prime`, `ramming_pressure_advance_value`, `filament_flow_support`, `printer_flow_support`, `top_color_penetration_layers`, `bottom_color_penetration_layers`.
I also left out a printer setting that has nothing to do with the purifier. Snapmaker turns `support_multi_bed_types` off on the 0.2, 0.6 and 0.8 profiles, and mainline turned the bed type selector on in #15174.
## Firmware
The two commands this PR adds exist from U1 firmware 1.3.0, based on the Snapmaker/u1-klipper releases 1.2.0 to 1.6.0. `SM_PRINT_PREEXTRUDE_FILAMENT` is in all of them. `SET_PURIFIER_MODE` and every parameter used here are in 1.3.0 and later. On older firmware an unknown command only prints `Unknown command:"..."` (`klippy/gcode.py`) and the print continues. The 2.0 firmware source isn't published.
The bundle version is bumped from 02.04.00.17 to 02.04.00.18.
# Screenshots/Recordings/Graphs
None, profile G-code and filament values only.
## Tests
Sliced the U1 0.4 nozzle profile through `OrcaSlicer_profile_validator -s` with three default filaments. The start G-code has the pre-extrude step and these purifier modes:
- Snapmaker PLA Basic @U1 gets strong cooling.
- Snapmaker PETG-CF @U1 gets weak cooling.
- Snapmaker ABS @U1 gets keep warm.
I also printed on a U1 with the top cover using these profiles, and everything worked as expected.
[How to Download Pull Requests Artifacts for Testing](https://www.orcaslicer.com/wiki/how_to_download_pr_artifacts)