Here is what I am trying to do. When the print it finished I want to move the print head back over the purge shute.
Then let the print sit for about 10 minutes at 80c on the print bed.
Then after the 10 minutes I want the exhaust fan to turn on and the bed to continue to cool to room temp / finish the standard process.
In all transparency I don’t know anything about g code. I got this from that ai chat bot. I wanted to see if anything could help me validate this before I full send it.
; filament end gcode
; === Park over waste chute, controlled cooldown, then vent ===
; — 1) Get off the part safely —
G91 ; relative positioning
G1 Z10 F1200 ; lift nozzle 10mm
G90 ; back to absolute positioning
no no no, vibe coding is a deeply personal experience, you need to send this and watch the toolhead anxiously, with power cord in hand, terrified for the fate of your plate… this is the true experience that chat bot wanted for you to have
Summary
on a slightly less snarky tone, i wouldn’t trust the bot to do movement commands correct for your model of printer, but sure take the “set this temp and wait” bits, add it to your known good gcode
This code should go in your Machine G-code → Ending G-code (printer end G-code) in your X1C profile in Bambu Studio, NOT in the filament end G-code.
Where in the sequence:
Place it after the last extrusion move but before any motor shutdown commands (M84) or final system shutdown routines in the default ending G-code.
Corrected G-code for X1 Carbon:
; === Controlled cooldown with hardening phase ===
; — 1) Lift and move away from part —
G91 ; relative positioning
G1 Z10 F1200 ; lift nozzle 10mm
G90 ; back to absolute
M83 ; relative extrusion
G1 E-2 F1800 ; small retract
; — 2) Move to safe position (adjust X/Y for X1C if needed) —
G91
G1 X-50 Y50 F12000 ; move away from part (adjust as needed)
G90
; — 3) Hardening phase —
M104 S0 ; hotend OFF
M106 P3 S0 ; exhaust fan OFF initially
M190 R80 ; wait until bed cools to 80C
M300 S1000 P800 ; beep: start hardening window
G4 S600 ; wait 600s (10 min)
; — 4) Vent fumes after hardening —
M300 S1500 P800 ; beep: start venting
M106 P3 S255 ; exhaust fan ON at full speed
; — 5) Release bed to cool naturally —
M140 S0 ; bed heater OFF
Important notes:
The X/Y move coordinates might need adjustment for the X1C build volume - I reduced the move to X-50 Y50 to be safer. Test carefully.
Make sure this code doesn’t conflict with the existing ending G-code that parks the toolhead.
The M106 P3 command controls the chamber exhaust fan on the X1C.
DISCLAIMER: Use this code at your own risk. I take no responsibility for any damage to your printer or prints that may result from using this G-code. Always monitor your first test print closely and ensure the movements don’t cause any collisions.
After thinking about this more, I realized there’s an important issue with my previous suggestion. The X1C runs this sequence when a print finishes:
Filament end G-code (from filament profile) - this includes the automatic filament unload
Machine ending G-code (from printer profile) - where your custom code would go
The problem: If the default ending G-code already turns off the bed heater with M140 S0, your hardening phase will be interrupted since the bed will cool down immediately.
Better approach:
Open your X1C printer profile in Bambu Studio
Go to Machine G-code → Ending G-code
Look for any M140 S0 command in the existing ending G-code and comment it out or remove it (add ; in front to comment)
Add this at the very end of the Machine ending G-code:
; === CUSTOM: Controlled cooldown with hardening phase ===
; NOTE: Standard ending sequence has already run, including filament unload
; — 1) Ensure we're in a safe position —
; (The standard ending code should have already moved the head safely)
; — 2) Hardening phase with controlled bed temperature —
M104 S0 ; hotend OFF (if not already off)
M106 P3 S0 ; exhaust fan OFF initially
M140 S80 ; SET bed to 80C (not turn off yet)
M190 R80 ; wait until bed reaches 80C
M300 S1000 P800 ; beep: start hardening window
G4 S600 ; wait 600s (10 min) at 80C
; — 3) Vent fumes after hardening —
M300 S1500 P800 ; beep: start venting
M106 P3 S255 ; exhaust fan ON at full speed
; — 4) Now turn off bed and let it cool naturally —
M140 S0 ; bed heater OFF
Why this is better:
The standard ending sequence (including filament unload and toolhead parking) completes first
We then take control of the bed temperature, setting it to 80C rather than waiting for it to cool down
After the 10-minute hardening window, we turn on ventilation
Finally we turn off the bed heater
Important: You MUST remove or comment out any existing M140 S0 in your current Machine ending G-code, otherwise the bed will turn off before your hardening phase starts.
DISCLAIMER: Use this code at your own risk. I take no responsibility for any damage to your printer or prints that may result from using this G-code. Always monitor your first test print closely.