Welcome! Log In Create A New Profile

Advanced

gcode to change filament

Posted by wgaona 
gcode to change filament
September 17, 2015 09:55PM
Hello everbody

I was wondering what would be the best gcode instructions to change the
filament during a printing job with the purpose to print in two or more
colors?

I have written the next few lines to take account any feedback before to test it.
Please be kind, it is my first attempt

G91 ; use relative coordinates
M83 ; set extruder to relative mode
G1 E-2.0 F2400 ; retract 2mm at 40mm/s
G1 Z 5.0 F3000 ; move Z 5mm up at 50mm/s
G90 ; absolute positioning
M83 ; set extruder to relative mode
G1 X-90.0 Y-90.0 F3000 ; move X and Y to park position at 50mm/s
G1 E-120.0 F120 ; retract 120mm at 20mm/s
G4 S10 ;pause of 10s
G1 E60.0 F1200 ; extrude to load filament at 20mm/s
G1 E60 F240 ; extrude to purge filament at 4mm/s
G1 E-2.0 F2400 ; retract 2mm at 40mm/s
G1 X0.0 Y0.0 F3000 ; move to bed's centre at 50mm/s
G91 ; use relative coordinates
M83 ; set extruder to relative mode
G1 Z -5.0 F3000 ; move Z 5mm down at 50mm/s
G90 ; absolute positioning
M83 ; set extruder to relative mode
G1 E2.0 F1200 ; extrude 2mm at 20mm/s
Re: gcode to change filament
September 18, 2015 09:32PM
With a little settings modification, I get this.

Edited 1 time(s). Last edit at 09/18/2015 09:33PM by wgaona.
Attachments:
open | download - IMG_20150918_121629.jpg (97.7 KB)
Re: gcode to change filament
October 20, 2015 06:17AM
Although this may not be relevant to your set up ......

I control my M90 via Octoprint which is running on a Raspberry Pi which means that I am able to use the M0 GCode in order to change filament mid-print. Nophead pointed me to this feature in Octoprint in his blogpost : [hydraraptor.blogspot.co.uk] (I also have a Panelolu2 panel attached).

I insert the following GCode just before the Z height changes to where I want a new colour. In the example below, I am printing at a 0.2mm layer height and want a new colour when Z gets to 9.0mm.


G1 Z9.2 ;go up two layer heights from where we are now - we are going to swop colours somewhere in the middle of layer height 8.8 so outline will appear at height 9.0

G1 X-100 Y-100 F9000 ;send X and Y home
M104 S175 ;Reduce extruder temp a bit
G1 Z200 ;raise nozzle close to home position
M84 ;disable steppers
M0 ; pause so that we can change filament - restart when ready by pushing Panelolu button

G28 ; having changed go home
G1 X-60.0 Y98.0 F9000 ; edge of bed to wipe
G1 Z0.05 ; close to bed
M109 S185 ; raise extruder back to normal
G92 E0 ;reset extruder axis to zero
G1 X-10.0 E5 F200 ;wipe a blob
G1 E-1 F1200 ;retract

G1 Z9.2 F9000 ; which is where we started from

I have used this code several times - the only issue is that the nozzle can ooze hot filament during its travel back to where it started - judicious use of tweezers helps to pull this away if needs be.

Alan
Re: gcode to change filament
October 20, 2015 10:36AM
Quote
Alzibiff
G28 ; having changed go home
G1 X-60.0 Y98.0 F9000 ; edge of bed to wipe
G1 Z0.05 ; close to bed
M109 S185 ; raise extruder back to normal
G92 E0 ;reset extruder axis to zero
G1 X-10.0 E5 F200 ;wipe a blob
G1 E-1 F1200 ;retract

G1 Z9.2 F9000 ; which is where we started from

I have used this code several times - the only issue is that the nozzle can ooze hot filament during its travel back to where it started - judicious use of tweezers helps to pull this away if needs be.

Alan

Am I right in understanding that you put the nozzle on the bed after a filament change and do the ooze-free wipe again? Presumably this can only work if you're not changing filaments at a height where dropping Z back to zero causes the x-carriage to strike the object on the bed?
Re: gcode to change filament
October 20, 2015 03:06PM
Quote
QuackingPlums
Am I right in understanding that you put the nozzle on the bed after a filament change and do the ooze-free wipe again? Presumably this can only work if you're not changing filaments at a height where dropping Z back to zero causes the x-carriage to strike the object on the bed?

Yes and yes!
As said, there IS some ooze even after the post-change bed wipe so there is a case for simply dropping the hot end back to where it was before the filament swop - that is, to dispense with this set of GCode commands.

Alan
Sorry, only registered users may post in this forum.

Click here to login