Welcome! Log In Create A New Profile

Advanced

G-code for retraction at the end

Posted by Sardi 
G-code for retraction at the end
March 10, 2016 01:34PM
After googling for what I need I found this to be the code I need:

G92 E0; set extruder value back to 0
G1 E-1 F100; retract 1mm at speed of 100mms

I will change the amount and speed, but want to know do I need G92 to set the extruder to 0.
I found answers where one says it is needed, and other answers saying, of course, the opposite.

So which is it? grinning smiley
Re: G-code for retraction at the end
March 10, 2016 01:52PM
I dont think you need it tbh ,it will retract in with it or withought it.
Re: G-code for retraction at the end
March 11, 2016 02:41AM
that depends wether you have your extruder set to relative or absolute movements. [reprap.org]

You can be sure to move only 1mm back if you leave the G92 lin in there. If you have your extruder in absolute mode and at the end of your print your extruder is at a high value it will move all the way back to position -1.
Re: G-code for retraction at the end
March 12, 2016 04:47PM
Yes, I definitely need the G92 E0; set extruder value back to 0 or the extruder will just go back all the way to -1. And yes, my extruder is in absolute mode so that code is necessary.
Re: G-code for retraction at the end
March 13, 2016 03:28AM
But why is your Extruder in absolute mode?


Slicer: Simplify3D 4.0; sometimes CraftWare 1.14 or Cura 2.7
Delta with Duet-WiFi, FW: 1.20.1RC2; mini-sensor board by dc42 for auto-leveling
Ormerod common modifications: Mini-sensor board by dc42, aluminum X-arm, 0.4 mm nozzle E3D like, 2nd fan, Z stepper nut M5 x 15, Herringbone gears, Z-axis bearing at top, spring loaded extruder with pneumatic fitting, Y belt axis tensioner
Ormerod 2: FW: 1.19-dc42 on Duet-WiFi. own build, modifications: GT2-belts, silicone heat-bed, different motors and so on. Printed parts: bed support, (PSU holder) and Y-feet.
Ormerod 1: FW: 1.15c-dc42 on 1k Duet-Board. Modifications: Aluminium bed-support, (nearly) all parts reprinted in PLA/ ABS, and so on.
Re: G-code for retraction at the end
March 13, 2016 05:03AM
My bad, I misread the g-code. Absolute are the coordinates, the extruder is in relative mode winking smiley
Re: G-code for retraction at the end
March 13, 2016 08:38AM
Using Cura could give you absolute Extruder movement.


Slicer: Simplify3D 4.0; sometimes CraftWare 1.14 or Cura 2.7
Delta with Duet-WiFi, FW: 1.20.1RC2; mini-sensor board by dc42 for auto-leveling
Ormerod common modifications: Mini-sensor board by dc42, aluminum X-arm, 0.4 mm nozzle E3D like, 2nd fan, Z stepper nut M5 x 15, Herringbone gears, Z-axis bearing at top, spring loaded extruder with pneumatic fitting, Y belt axis tensioner
Ormerod 2: FW: 1.19-dc42 on Duet-WiFi. own build, modifications: GT2-belts, silicone heat-bed, different motors and so on. Printed parts: bed support, (PSU holder) and Y-feet.
Ormerod 1: FW: 1.15c-dc42 on 1k Duet-Board. Modifications: Aluminium bed-support, (nearly) all parts reprinted in PLA/ ABS, and so on.
Re: G-code for retraction at the end
March 15, 2016 01:56PM
I have tried tihs code with my files, and it turns out I do need both lines in my end g-code

G92 E0 and G1 E-1 F100.

When I put only G1 E-1 F100 it retracts back to -1 although the start g-code has M83 ; use relative distances for extrusion code.
Re: G-code for retraction at the end
March 16, 2016 10:02AM
New issue.

This is my g-code

start
;Sliced at: {day} {date} {time}
;Basic settings: Layer height: {layer_height} Walls: {wall_thickness} Fill: {fill_density}
;Print time: {print_time}
;Filament used: {filament_amount}m {filament_weight}g
;Filament cost: {filament_cost}
G21        ;metric values
G90        ;absolute positioning
M83 ; use relative distances for extrusion
M203 X6000 Y6000 Z500 E3000 ; will allow 100mm/s sliced gcodes to work... if they have time/distance to get up to speed
G1 Z5 F200 ; lift nozzle
G1 X2 Y50 F2000; Go to wait for warm position
M116; Wait for all temperatures

end
M140 S0       ;heated bed heater off
M104 S0       ;extruder heater off
G92 E0 ; set extruder value back to 0
G1 E-15 F300 ;retract 15mm filament speed 300
G1 X0 Y210	; park the machine
M0; stop

Now it does the retract of 15mm, but the G1 X0 Y210 is done with the ultra slow speed of 1mms and I dont know what is the cause of that.
Re: G-code for retraction at the end
March 16, 2016 10:57AM
Quote
Sardi
Now it does the retract of 15mm, but the G1 X0 Y210 is done with the ultra slow speed of 1mms and I dont know what is the cause of that.

Have you tried specifying the speed? e.g G1 X0 Y210 F5000

Erik
Re: G-code for retraction at the end
March 16, 2016 11:25AM
Quote
Sardi
New issue.

This is my g-code
<...>
end
M140 S0       ;heated bed heater off
M104 S0       ;extruder heater off
G92 E0 ; set extruder value back to 0
G1 E-15 F300 ;retract 15mm filament speed 300
G1 X0 Y210	; park the machine
M0; stop

Now it does the retract of 15mm, but the G1 X0 Y210 is done with the ultra slow speed of 1mms and I dont know what is the cause of that.

Your last command containing a speed was "G1 E-15 F300" Therefore all speeds thereafter will be at 300mm/m (5mm/s) until you set a new speed.
Thus to move faster you will need another speed in the move command, e.g. "G1 X0 Y210 F6000" to move at 100mm/s. Or you can put a speed by itself before the move e.g. "G1 F6000"

Dave
Re: G-code for retraction at the end
March 17, 2016 01:11PM
Ormerod and dmould, you are both right. New speed setting was needed. I put F5000 and now everything is as I want it to be winking smiley
Sorry, only registered users may post in this forum.

Click here to login