Welcome! Log In Create A New Profile

Advanced

Custom G-code at start and end to purge and retract filament

Posted by woodencase01 
Custom G-code at start and end to purge and retract filament
August 14, 2013 09:19AM
Hi,

I'm currently working on a g-code for slicer that will purge a bit of plastic at the beginning and retract at the end.

Start:
G28 ; home all axes
G1 Z0.5 F2000; slightly raise from bed
G1 X3 F900; move to purging zone
M116; Wait for temperature to be reached
E 1.5; extrude 1.5mm
G92 E0; set extruder value back to 0
G1 X0 F900; back to home
G1 Z0 F2000; back to home

End:
G92 E0; set extruder value back to 0
G1 E-1 F900; retract 1mm
M104 S0 ; turn off temperature
G28 X0 ; home X axis
M84 ; disable motors

The problem is that it doesn't look like it is working. I have the following message from Repetier at the beginning of a print:
09:03:36.604 : N143528 G28 *10
09:05:51.581 : N143529 M105 *63
09:05:51.582 : N143530 G1 Z0.5 F2000 *13
09:06:26.716 : N143531 M105 *54
09:06:26.721 : N143532 G1 X3 F900 *46
09:06:26.723 : N143533 M116 *54
09:06:26.728 : N143534 E0 *31
09:06:26.729 : N143535 G92 E0 *82
09:06:26.732 : N143536 G1 X0 F900 *41
09:06:26.735 : echo:Unknown command: "N143534 E0 *31"
09:06:26.736 : N143537 G1 Z0 F2000 *17
09:06:26.738 : N143538 M109 S194 *124
09:06:26.740 : N143539 G90 *9
09:06:26.741 : N143540 G92 E0 *80

Where is the problem?
Re: Custom G-code at start and end to purge and retract filament
August 14, 2013 10:40AM
The following line is producing the error:

E 1.5; extrude 1.5mm

I believe you want this instead:

G1 E1.5; extrude 1.5mm.

By the way, here is a little hint on reading the output from Reptier:

09:06:26.728 : N143534 E0 *31
09:06:26.729 : N143535 G92 E0 *82
09:06:26.732 : N143536 G1 X0 F900 *41
09:06:26.735 : echo:Unknown command: "N143534 E0 *31"

I've highlighted the line number, which is the large number that starts with an N. You can see that the line number in the error message corresponds with the first line I've copied here. The delay between sending the line and the error message is a result of buffering in the firmware. It accepts the line, but doesn't process the line right away.
Re: Custom G-code at start and end to purge and retract filament
August 14, 2013 10:41AM
There is probably no "E" command.

It should be something like this:

G92 E0
G1 F500 E2
G92 E0

This resets E, purges 2mm, then resets E again.

I tried retracting at the end of the print, but it didn't really work. The filament would still ooze, and you just deplete the hotend even more.
Re: Custom G-code at start and end to purge and retract filament
August 14, 2013 11:13AM
Thank you for your help!

I've retracted at the end to avoid filament jamming, I'm currently testing it. I'm using a prototype all metal hot end and it happened once that the filament got jammed after a nice print, I want to avoid it as much as I can.
Has anybody tested it before?
Sorry, only registered users may post in this forum.

Click here to login