Tool-change macros with parameters
-
Good evening,
when using duet-boards on CNC-Mills (or other devices != 3D Printer) it is required to create/write a set of tool-change macros for each tool(-position):
tfree1.g, tpre1.g, tpost1.g, tfree2.g, tpre2.g, tpost2.g, and so on and so forth ...
For my current project I created these files, but they contain just a single line to call a generic, parametrized version:
; tfree1.g calls my tool-change macro M98 P"tfree.g" X1
It would be nice if such a mechanism would be supported out of the box inside RRF.
And I could get rid of 57 macros (19 tools) in my sys-folder -
@rero it would be nice to be able to have tfree.g etc work without the number and just call one set of tool change files, especially if it's a single head machine.
I'm lazy and use a macro to create multiple of the same file.
E.g.while iterations < 4 set var.filename = "tpost"^{iterations}^".g" echo >{var.filename} "; autogenerated tpost"^iterations^".g file" echo >>{var.filename} "M98 P""0:/sys/AFC/tpost.g"" A"^{iterations}
-
@rero From looking at the RRF code it looks like it will first try tfree with a number on it - but will then if this doesn't work it will then try a file without a number as a fallback.
https://github.com/Duet3D/RepRapFirmware/commit/7cea891dcdc276e12edda2c991ce8fb415cfc03a
-
@dwuk oh really? I'll try that and see if it works
-
@dwuk great find!
Just tried it on my test-setup and it works as intended.
Only complaint: no information about the upcoming tool-number in the tpre.g macro.
But for my concrete needs I should be able to move existing tpre-code to tpost.-> Maybe someone can add this information to https://docs.duet3d.com/User_manual/Tuning/Tool_changing ?
Another idea: having another tXXX-macro which is executed in case a tool has been already selected previously (e.g. to probe a current milling-tool again).
-
@rero the next tool should be available in the object model under state.nextTool
-
@jay_s_uk thanks for pointing out!
"Can't see the forest for the trees" ...
-
@rero said in Tool-change macros with parameters:
-> Maybe someone can add this information to https://docs.duet3d.com/User_manual/Tuning/Tool_changing ?
paging @droftarts