Read Gcode File backwards
-
Hi,
I want to make a macro for Duet2 that allows me to read the lines of a gcode file in reverse.
I have seen that with the M110 command you can know and establish the gcode line, but I don't know how I could implement it.
Any idea how I could do it?Thank you!
-
-
@amimafe probably easier to process Gcode files on a computer. Also its not clear what the goal if this 3xercise is since some actions are order dependent and just reversing the gcode file wont necessarily work (for example, if it were a 3d printer, the start and end gcodes, or retracts/unretracts).
-
Hi @oliof ,
What I want is that if at some point the 3D printer stops extruding I can pause, go back to the gcode position where the failure occurred and continue printing.
The material I print with is not plastic and I need that the correction can be done quickly without the need to modify the gcode.
With industrial PLC it can be implemented more easily, but I would like to know if it could be done with duet or object language.Thank you.
-
-
@amimafe
The firmware essentially already does that.
You just need to monitor your extruder and trigger a pause when it's not extruding.
As you've given no details on what you're "extruding" or how you're doing it, it's impossible for anyone to offer any more than equally vague answers.There is no facility in RRF currently to reverse along previous moves to a point.
That would be the domain of external software which streams gcode to the duet in individual strings.
It is relatively common in plasma cnc cutting controllers for example, but there is no extrusion at play there.
You can use the object model to get the current file position in bytes, but I don't see any way in a macro to extract lines from the job file and pass them as movement commands.
You also have the issue of having to work out what to do with the extruder moves. Do you want the extruder reversing at each move?
What about I/O's, fan or heater commands?
Far better to identify a fault and pause immediately as is already implemented. -
It might help if you use Pause / G60 to save a position when you detect a failure using an appropriate sensor for your extruder, such as optical or AI camera or whatever.
Then you can use G0 and a R parameter to restore the position when you resume print. Note if you pause, it will automatically save the last position of the extruder, and resume from there. So you might already have all you need for free.
Then it all comes down to fast detection of the failure, and even adding extra purge at start to maybe fill in any gaps that can be cleaned up post production.
-
Sorry @OwenD ,
Yes, I hadn't mentioned that. It is a clay printer. I'm going to check what you told me about the G60 and see if this could be solved, although I think it is not exactly the initial idea.
Gracias.
-
Hi @marzubus
Thank you for your help.
I'm going to look into the G60 instruction to see if it can be of any help to me.Thanks again
-
@amimafe If you save a position, check G0/G1 for the R parameter to move back to that position, you can also use offsets to for example move to a Z pos above the previous pos, and then move down into that position.