Introduction: PrusaSlicer: Disable Partial Preheat

I have an Ender 3 v2 and follow the recommended practice of tramming the bed with the printer preheated. However, I noticed that every time I started a print, the nozzle temperature setpoint decreased to 150 degrees. The printer cooled for a bit, then heated back up to 210 degrees to begin printing. This causes a small amount of unnecessary thermal wear and, more importantly, wastes time during the start of the printing process. I'm impatient, so I went searching for a solution.

Turns out this behavior was the result of PrusaSlicer. Prusa printers have automatic bed tramming, for which the printer doesn't have to be preheated. PrusaSlicer therefore partially preheats the nozzle during the bed tramming process, which means less waiting for the nozzle to reach temperature while preventing oozing. If, however, you don't use auto bed tramming at the start of each print, there isn't a reason to partially preheat the nozzle. In fact, it causes a preheated nozzle to cool for 10 seconds, then heat up again.

Fortunately, this behavior can be adjusted in PrusaSlicer. The G-code put at the start of each print is in the Printer Settings tab under Custom G-code in the Start G-code box. If the Custom G-code section is not visible, make sure Expert settings are enabled (see photo). I will include an explanation of the default G-code for my printer (Ender 3 v2) and what I changed it to. The best G-code for you may be different from mine to work better with your printer/workflow.

Supplies

PrusaSlicer (expert settings enabled) and a 3D printer

Step 1: The Default G-code

The default G-code for the Ender 3 v2 is:

G90 ; use absolute coordinates
M83 ; extruder relative mode
M140 S{first_layer_bed_temperature[0]} ; set final bed temp
M104 S150 ; set temporary nozzle temp to prevent oozing during homing
G4 S10 ; allow partial nozzle warmup
G28 ; home all axis
G1 Z50 F240
G1 X2 Y10 F3000
M104 S{first_layer_temperature[0]} ; set final nozzle temp
M190 S{first_layer_bed_temperature[0]} ; wait for bed temp to stabilize
M109 S{first_layer_temperature[0]} ; wait for nozzle temp to stabilize
G1 Z0.28 F240
G92 E0
G1 Y140 E10 F1500 ; prime the nozzle
G1 X2.3 F5000
G92 E0
G1 Y10 E10 F1200 ; prime the nozzle
G92 E0

The included comments (after the semicolon) are very useful in explaining what's going on here. For extra context, M140 and M104 allow the printer to continue executing code while the temperature of the bed/nozzle are changing, but M190 and M109 will wait for the set temperature to be reached before continuing. So to summarize the first few lines of code, the printer will start the bed heating to the set bed temperature and start the nozzle heating to 150 degrees. It will then wait for 10 seconds (G4 S10), home the axis (G28), move to a resting positing (G1 Z50 F240 and G1 X2 F10 F3000), then set the nozzle and bed temperature to their final values (M104... M190... and M109...). The M190 and M109 lines will prevent the printer from continuing until the bed and nozzle have reached temperature.

If this G-code is run on a preheated printer with the nozzle already at temperature, the nozzle's set temperature is decreased to 150 degrees and the nozzle is cooled for 10 seconds instead of heated. The nozzle is then heated back to 210 degrees before starting to print.

Step 2: My G-code

Here is my G-code:

G90 ; use absolute coordinates
M83 ; extruder relative mode
M140 S{first_layer_bed_temperature[0]} ; set final bed temp
M104 S{first_layer_temperature[0]} ; set final nozzle temp, allow printer to continue
G4 S6 ; allow partial nozzle warmup
G28 ; home all axis
G1 Z40 F240
G1 X2 Y10 F3000
M190 S{first_layer_bed_temperature[0]} ; wait for bed temp to stabilize
M109 S{first_layer_temperature[0]} ; wait for nozzle temp to stabilize
G1 Z0.28 F240
G92 E0
G1 Y140 E10 F1500 ; prime the nozzle
G1 X2.6 F5000
G92 E0
G1 Y10 E10 F1200 ; prime the nozzle
G92 E0

The key difference is in Line 4. Instead of setting the nozzle temperature to 150 degrees, it sets the nozzle temperature to the first layer temperature. This causes the nozzle and bed to set themselves to the first layer temperature.

There are some other minor tweaks. Most importantly, Line 9 from the original G-code has been removed (redundant since final nozzle temp has already been set in Line 4). I also decreased the delay after starting nozzle heating (6 seconds instead of 10), decreased the height of the rest position after homing (40mm instead of 50), and moved the second nozzle prime from an X coordinate of 2.3 to an X coordinate of 2.6 (I was having issues with the lines overlapping).

If you run mesh/auto bed tramming as part of your starting G-code, this fix isn't for you. (Beds are trammed, not leveled. It's about the bed's position relative to the x-y motion of the print head, not relative to the center of the earth.)

Step 3: Keep Tweaking

I recommend continuing to customize your G-code. It can make your printer's actions better match your workflow and lead to a more enjoyable and rewarding 3D printing experience. Be aware that each flavor of firmware can interpret the same G-code differently, so make sure you're writing code for the same firmware that code will run on. The Ender 3 v2 ships with a version of Marlin, so I referenced the Marlin docs for this project and found them clear, precise, and helpful.