Strange purge behaviour ?
-
I have a simple gcode file I'm printing for tweaking the slicer settings in cura 3.2 - the chimera mount for the IR probe actually.
Every now and then, instead printing the file I select to print, the printer goes into some strange filament purge mode or something. It ignores the gcode, and comes to the front of the bed where it "pulses" or purges a large dollop of filament onto the bed. I have to cancel it. If I try to repeat the print, it'll do it again.
If I reboot the Duet, print the same gcode file again, it'll print the file correctly, without hassle.
1.20 - any ideas what's going on or why it's doing this?!
-
You would need to show us the gcode file for us to have much chance of diagnosing the problem.
-
Hi David - I don't see how to attach gcode files, so I've shared it:
https://drive.google.com/open?id=1KLUclgBKoZpMBF9ndHHgXnKgsEm4vHqj
But the issue happened several times this evening, with slightly different variants of that file. As I say, if I reboot the Duet, it will print the exact same file without an issue.
I don't think this is the gcode, or if it is it would be weird it only triggers some times and not others. I mean there doesn't seem to be anything in there that would trigger this weird thing it does. I've not left it to complete, but it's quite a sizable blob of plastic, maybe a hazelnut in size?
-
This code near the start of your gcode file:
G28 X0 Y0 Z-0.2;move X/Y to min endstops
G92 E0 ;zero the extruded length
G1 F200 E10 ;extrude 10mm of feed stockmay be responsible.
-
But why does it do it sporadically? On a reboot, that gcode will print perfectly.
It's not got something to do with relative extrusion has it? If you remember, the start and end gcode for the default profiles for the K8400 in Cura has absolute extrusion by default, which I took out on your recommendation and replaced with relative extrusion. I can't think of anything else that's changed.
The problem seems to come from when I make a minor change trying to improve print quality, say raising the nozzle temperature slightly. When I send the new gcode file to print I get this weird purge behaviour. If I reboot, I can continue as normal.
-
Do you have M83 in your config.g? If so then the Duet expects extruder moves to be relative. If that is the case then you need to slicer the file using relative extrusion which you seem to have done, but also remove any M82 (use absolute extrusion) commands for your start and end gcodes. Also, using relative extrusion, there is no need to zero the extruder. So change the first M82 to M83. Comment out both the G92 E0s. I'd also comment out out the G1 E10 but that's up to you. Then comment out both of the M82s at the end. These are the main cause of your problems.
The final M82s override the M83 you have in config.g. That's why when you reboot the Duet it loads M83 (relative) again and works OK but when you try to print without re-booting, the printer is left in absolute extrusion mode from the previous print.
HTH
-
No I don't have M83 in my config.g. Do I need it in there? I thought it was just an option ticked in Cura?
So I changed the default K8400 profile start gcode to the following:
[[language]] G21 ;metric values G28 X0 Y0 Z-0.2;move X/Y to min endstops G1 F200 E10 ;extrude 10mm of feed stock G1 F9000
And I just checked, and Cura inserts an M82 without asking! So it ends up with:
[[language]] M82 ;absolute extrusion mode G21 ;metric values G28 X0 Y0 Z-0.2;move X/Y to min endstops G1 F200 E10 ;extrude 10mm of feed stock G1 F9000 M83 ;relative extrusion mode
It looks like I might need some of the Cura "escape" codes (magic brackets).
-
The 10mm extrusion at the start is just to get the filament flowing and leave a blob at the home position before printing. It's what the printer always used to do before the upgrade to Duet, so I thought I'd best leave it in there. Not sure it's needed TBH.
-
And I just checked, and Cura inserts an M82 without asking! So it ends up with:
[[language]] M82 ;absolute extrusion mode G21 ;metric values G28 X0 Y0 Z-0.2;move X/Y to min endstops G1 F200 E10 ;extrude 10mm of feed stock G1 F9000 M83 ;relative extrusion mode
Compared to the file that you linked to earlier, there is no G92 E0 to reset the absolute extrusion position to 0 in that code.
I suggest you put M83 at the beginning of your start and end GCode.
-
Yes, I just changed it to test deckingman's suggestions and re-generated the gcode.
So if I can't "escape" the M82 Cura inserts, it would have
[[language]] M82 ;absolute extrusion mode (cura inserted) M83 ;my addition to start gcode ... as above start gcode M83 ;relative extrusion mode (cura inserted) ```And then to add another M83 to the end gcode, so it would have:
[[language]]
M83 ;my addition to end gcode
M104 S0
M106 P2 S0
G1 E-3 F300 ;retract the filament a bit before lifting the nozzle, to release some of the pressure
G1 Z140
G28 X0 Y0 ;move X/Y to min endstops, so the head is out of the way
;G1 Z+0.5 E-3 X-20 Y-20 F9000 ;move Z up a bit and retract filament even more
M84 ;steppers off
M104 S0Does that look right?
-
Looks about right. Try it and see. I don't use Cura so I'm not familiar with the codes that it generates.
By way of explanation, both relative and absolute moves are in fact relative to something. The difference is that relative moves are relative to the last move, but absolute moves are relative to when the extruder (or axis) was last "zeroed" or homed.
So assuming you home the extruder at the start of a print then use absolute move to do G1 E10, it will move the filament 10mm from where it was at the start, and as the start was at 0, you'll get 10mm of movement. You'll get exactly the same behaviour by using relative coordinates because it will move 10mm from the last move. The difference happens when you issue the next move. If you use absolute coordinates and do another G1 E10, the extruder won't move because the filament is already at 10mm from where it started at the beginning of the file. But using relative coordinates, the extruder will move the filament another 10 mm - i.e 10 mm from the last time it moved.
If you look through a gcode file, if it was sliced using absolute coordinates, each successive extruder move (ignoring retractions) will be larger than the previous one because it is the distance the filament should move to relative to when it was zeroed or homed - i.e. at the start of a file. If the file is sliced using relative, successive moves will be generally smaller and my be smaller or greater than the previous one because they are relative to the previous move, not the start of the file.
So it's important that Duet knows which coordinate system the slicer has used. By way of further explanation, if the last two G1 E moves in a file looked like this;
G1 E140
G1 E145Then if Duet thinks the coordinates are absolute and the extruder was homed at the start, for the very last move, the extruder will move only 5 mm because it "remembers that it is already at 140mm (actually it doesn't work quite that way but let's not go into that here). If on the other hand you "tell" Duet that these are relative moves then the last command will move the extruder 145mm.
Hope I've clarified things and not further confused you.
Ref priming the extruder at the start, if Cura supports it, I suggest you use a skirt rather than just extrude 10mm of filament. What this does is lay down a bead of filament around the object that you are going to print, a few mm away from it so yiu won't get the blob that simply extruding 10mm will give you.
-
Thank you very much for that explanation of relative and absolute extrusion. I thought it was something like that but it wasn't very clear in my head! That's a big help in understanding it.
I'll give it a try later this afternoon hopefully!