Tool change macro - how to tell firmware change did not occur
-
What I'm trying to achieve is to tell firmware that tool change failed and it should not change currently selected tool. My printer has tool changer similar to E3D Tool Changer -> one tool can be mounted onto printer carriage, the rest of them are waiting in tool docks.
According to manual, in firmware 3.3 and later tool change macros are run regardless of whether axes are homed or not.
In tfreeX.g I'm checking if X and Y axes are homed, if yes than tool change sequence is run, if not I'd like to block firmware from changing tool. Simplified tool change macro look like this:
if move.axes[0].homed == true && move.axes[1].homed == true ;check other conditions and free tool else abort "PRINTER NOT HOMED"
So now, when tool 0 is selected and axes are not homed, when I try to select tool 1 than printer displays "PRINTER NOT HOMED", no movement is done (what is expected) and tool 1 is selected as current tool (what is not expected).
How can I tell firmware that tool change failed and it should not think that tool has been changed successfully?
I tried setting global variable during change procedure and check it in daemon.g file, it works but it's overly complicated and hard in maintenance, it's more like hack than solution.
So how should it be done in correct way?
-
@maczar_ I am not sure if M99 would work to abort the tool change macro. Worth testing. If that does not work to indicate the tool change failed then T0 P0 may work to set the original tool, although i have not tested that.
-
Create a global variable in your config.g that will be incremented is selection fails, and then put a "if" condition in your homing files
Just have a T-1 in your homing and maybe a M17 to fail the homing process if your global variable was incremented
-
@T3P3Tony
I tried M99 and it ends current macro, but it does not stop firmware from selecting next tool.
Using Tx P0 does not work either, as when it is called from tool change macro it does change tool to x, but when macro from which it was called is completed, than it is overwritten anyway.The only way of doing this is to set global variable in tool change macro and check it in daemon.g and in case of fail select previous tool. It works, but it's more hack than solution.
Currently I used blocking message in while loop when tool change fails. It asks user to manually change tools to match requested configuration. It makes sense when there's an error during tool change procedure (for example new tool was not properly lock on extruder carriage and it fell off), but it is a bit irritating when printer is not homed and tool change is triggered accidentally.
I think it would be the best if macro can return a value to inform firmware that tool change failed.
-
-
@maczar_ I have moved this to the firmware wishlist for consideration.