Notifiche
Cancella tutti

Auto retraction question  

  RSS
gb160
(@gb160)
Reputable Member
Auto retraction question

Hi, I'm interested about the auto retraction feature thats implemented on the core one, I think it's used after filament has been loaded, and also at the end of every print.

How would I go about figuring out exactly what goes on when this happens? 
I'm interested in reproducing the exact steps via gcode.
I presume I would need to look somewhere in the Core one firmware files to see exactly what goes on, but have no idea where to start looking.
If anyone can offer any help or insight it would be greatly appreciated.

Thanks.

 

Postato : 13/10/2025 12:01 pm
hyiger
(@hyiger)
Honorable Member
RE:

 

Posted by: @gb160

Hi, I'm interested about the auto retraction feature thats implemented on the core one, I think it's used after filament has been loaded, and also at the end of every print.

How would I go about figuring out exactly what goes on when this happens? 
I'm interested in reproducing the exact steps via gcode.
I presume I would need to look somewhere in the Core one firmware files to see exactly what goes on, but have no idea where to start looking.
If anyone can offer any help or insight it would be greatly appreciated.

Thanks.

 

I believe that is the M600 g-code (filament change) which would be here: M600.cpp

Questo post è stato modificato 2 days fa da hyiger
Postato : 13/10/2025 3:13 pm
hyiger
(@hyiger)
Honorable Member
RE: Auto retraction question

For some odd reason, it looks like Prusa doesn't merge branches back into master. This might be more accurate (i.e. up-to-date): https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/v6.4.0-RC/lib/Marlin/Marlin/src/gcode/feature/pause/M600.cpp

Postato : 13/10/2025 3:37 pm
gb160
(@gb160)
Reputable Member
Topic starter answered:
RE: Auto retraction question

 

Posted by: @hyiger

For some odd reason, it looks like Prusa doesn't merge branches back into master. This might be more accurate (i.e. up-to-date): https://github.com/prusa3d/Prusa-Firmware-Buddy/blob/v6.4.0-RC/lib/Marlin/Marlin/src/gcode/feature/pause/M600.cpp

Thanks buddy, I'm not 100% sure this is what I'm looking for, but it's a start.
Ideally I need to look at what commands are getting executed when a print ends...the printhead moves to park position then the important bit I'm interested in...it purges a tiny bit of filament then a very slow retraction (you hear the retraction going on and the filament gets fed back out of the printer)

My understanding is this is to relieve any pressure built up in the nozzle, and it is very effective in stopping any filament oozing out of the nozzle. This is the exact behaviour I want to reproduce in Gcode.
I need to reproduce this mid-print, (don't ask 😂), but my attempts so far have failed. 

Any idea where I would find that ? 

Postato : 14/10/2025 7:04 am
Steve
(@steve-5)
Estimable Member
RE: Auto retraction question

@gb160,

The operations sequence to which you are referring is the "ramming" to form the filament tip followed by a retraction to pull the filament out of the hotend to prevent ooze.  This sequence can be replicated in g-code by sending move commands to the extruder motor.  For reference, here is the link to the Buddy firmware g-code which may be helpful in designing the custom code; buddy-firmware-specific-g-code-commands

Regards, 

Steve

Postato : 14/10/2025 1:05 pm
1 persone hanno apprezzato
hyiger
(@hyiger)
Honorable Member
RE:

 

Posted by: @gb160

 

Thanks buddy, I'm not 100% sure this is what I'm looking for, but it's a start.
Ideally I need to look at what commands are getting executed when a print ends...the printhead moves to park position then the important bit I'm interested in...it purges a tiny bit of filament then a very slow retraction (you hear the retraction going on and the filament gets fed back out of the printer)

My understanding is this is to relieve any pressure built up in the nozzle, and it is very effective in stopping any filament oozing out of the nozzle. This is the exact behaviour I want to reproduce in Gcode.
I need to reproduce this mid-print, (don't ask 😂), but my attempts so far have failed. 

Any idea where I would find that ? 

 

OK, I think I know what you are after. I've been poking around in the firmware code and found this: FILAMENT_RUNOUT_RAMMING_SEQUENCE  So as @Steve pointed out you can send this to the extruder.

I guess something like this in the "Before Layer Change G-code"

; Ram filament before layer change in middle of print
{if layer_z > max_layer_z / 2}
G1 E7 F1500
G1 E-50 F2700
G1 E-5 F50
G1 E-50 F1500
{endif}
Questo post è stato modificato 10 hours fa 2 tempo da hyiger
Postato : 15/10/2025 1:29 am
1 persone hanno apprezzato
gb160
(@gb160)
Reputable Member
Topic starter answered:
RE: Auto retraction question

 

Posted by: @hyiger

 

Posted by: @gb160

 

Thanks buddy, I'm not 100% sure this is what I'm looking for, but it's a start.
Ideally I need to look at what commands are getting executed when a print ends...the printhead moves to park position then the important bit I'm interested in...it purges a tiny bit of filament then a very slow retraction (you hear the retraction going on and the filament gets fed back out of the printer)

My understanding is this is to relieve any pressure built up in the nozzle, and it is very effective in stopping any filament oozing out of the nozzle. This is the exact behaviour I want to reproduce in Gcode.
I need to reproduce this mid-print, (don't ask 😂), but my attempts so far have failed. 

Any idea where I would find that ? 

 

OK, I think I know what you are after. I've been poking around in the firmware code and found this: FILAMENT_RUNOUT_RAMMING_SEQUENCE  So as @Steve pointed out you can send this to the extruder.

I guess something like this in the "Before Layer Change G-code"

; Ram filament before layer change in middle of print
{if layer_z > max_layer_z / 2}
G1 E7 F1500
G1 E-50 F2700
G1 E-5 F50
G1 E-50 F1500
{endif}

Man you're a star ! Thanks for this.
Im gonna give this a try later.

I won't be needing it on layer change, hopefully just need to use it once.
Long story short I need to basically stop printing altogether for a short period of time (while other stuff is going on) , and oozing with certain filaments has meant I have to babysit the printer during this process. 
I've got it very close with a simple extrude then a slow retraction, hopefully this approach will solve the problem once and for all.

Postato : 15/10/2025 7:38 am
gb160
(@gb160)
Reputable Member
Topic starter answered:
RE: Auto retraction question

On these numbers ,  i think the approach is right, but I cant see those numbers being right for what I want.
eg, unless im interpreting these numbers wrong, thats retracting 105mm of filament being retracted. Surely thats going to back the filament completely out of the extruder? ie, to change the filament.

I'd love to know exactly what speed/lengths Prusa uses for this 'ramming' just at the end of a print... They back it out enough to stop the oozing, but obviously nowhere near the amount thats used for filament change.

This is definitely the right path though. Thanks for your assistance mate ( and @steve-5 )

Postato : 15/10/2025 10:41 am
Condividi: