langweiler
Posts: 6
Joined: Sun Feb 23, 2025 4:13 am

No retract at end of print

I use Simplify3D with a Flashforge Creator 3. The slicer does not seem to insert a filament retract at the end of the print. The result is typically a very long string after the print table has moved to the bottom.

Is that desired behaviour? Am I missing a slicer setting? Or would I have to add the retract manually to the ending script?

This is what the default ending script looks like:

G28 X Y ; home XY axes
G1 Z200 ; lower build platform
M107 ; turn off cooling fan
M104 S0 T0 ; turn off right extruder
M104 S0 T1 ; turn off left extruder
M140 S0 ; turn off build platform
M652 ; turn off case fan
M18 ; disable motors
S3D-Taylor
Posts: 77
Joined: Tue Jun 20, 2023 10:55 am

Re: No retract at end of print

By default, retraction occurs during layer changes, so there's no usually no need to add additional retraction commands in the ending script. You can open your gcode in a text editor and see something like:

G92 E0.00000
G1 E-1.00000 F1800 ; retraction
; layer end
G28 X Y ; home XY axes
G1 Z200 ; lower build platform
M107 ; turn off cooling fan
M104 S0 T0 ; turn off right extruder
M104 S0 T1 ; turn off left extruder
M140 S0 ; turn off build platform
M652 ; turn off case fan
M18 ; disable motors

That said, if you want a larger retraction value in the ending script, you can add it yourself in the beginning of the ending script.
User avatar
BaronWilliams
Posts: 183
Joined: Tue Jul 15, 2014 8:30 pm

Re: No retract at end of print

This is my end script. It has retraction, but it's done differently.

Most of the end scripts out there don't address oozing all that well when printing with PETG, which oozes like crazy. I use PETG a lot, so I needed to fix this.

This script is for a QIDI I-Fast with 2 extruders and meant for PETG which oozes like crazy, but doesn't ooze at 170 C or lower.

The main tweaks here that are different from the usual end script is that it retracts the active extruder tool head as usual, but it waits for the retraction to complete, and it does NOT turn the part cooling fans off, but instead turns them up 100%, immediately after retraction is complete, in order to help the active extruder tool cooldown faster to help avoid oozing. It waits for the extruder tools to cooldown with the part cooling fans on at 100%, before it ends. This works quite well actually.

Notice that the script waits for home command (G28) to complete before it ends. And finally it waits for the active tool to lower to 170 C before it turns it off. This is to ensure that the part cooling fans remain on until they are no longer needed. They do help cooldown the extruders and perform, in my opinion, a required step in the end script, which helps reduce oozing.

Code: Select all

G92 E0; Reset extruder to zero.
G1 E-2 F1800 ; Retract 2 mm @ 30 mm/s.
M400 ; Wait for movement to stop.
M106 S255 P0 ; Set part cooling fans to 100% to help cool tools.
{IF "[current_tool]==0"} M104 S0 T1 ; Turn off inactive tool T1, but don't wait for it.
{IF "[current_tool]==1"} M104 S0 T0 ; Turn off inactive tool T0, but don't wait for it.
{IF "[current_tool]==0"} M104 S170 T0 ; Cooldown active tool T0 to prevent oozing, but don't wait for it.
{IF "[current_tool]==1"} M104 S170 T1 ; Cooldown active tool T1 to prevent oozing, but don't wait for it.
G28 ; home XYZ axes
M400 ; Wait for movement to stop.
{IF "[current_tool]==0"} M109 R170 T0 ; Wait for active tool T0 to cooldown.
{IF "[current_tool]==1"} M109 R170 T1 ; Wait for active tool T1 to cooldown.
{IF "[current_tool]==0"} M104 S0 T0 ; Turn off active tool T0.
{IF "[current_tool]==1"} M104 S0 T1 ; Turn off active tool T1.
M106 S0 P0 ; Turn part cooling fans off.
Note that on the I-Fast G-Code command M106 S255 P0 controls both extruder tool part cooling fans. This is not true on a lot of other 3D printers, where the right fan is P0 and the left fan is P1 typically.

Edit: I found out after closer inspection that M109 R170 is not supported on the I-Fast. Option R waits for the cooldown or heat up, option S waits for heat up only. The I-Fast turns off the extruder if option R is used. Dissapointing.
Last edited by BaronWilliams on Sat Mar 15, 2025 2:36 pm, edited 1 time in total.
langweiler
Posts: 6
Joined: Sun Feb 23, 2025 4:13 am

Re: No retract at end of print

Thanks a lot, guys! This is what I was looking for. For the moment I will go with the following addition to my ending script:

G1 F1800 E-2 ; retract filament

This appears to be good enough for most applications. I will try the more sophisticated version next time I need to print PETG.

Return to “Troubleshooting and Bug Reports”