Tool Change Macro

  • Hey!

    So when we have a tool change, we want to run a macro which is essentially just an offset between the two extruders (in our case syringes).

    As part of this macro, we need to move our U axis (already set up/defined and we can move it with normal G1 U50 commands and such).

    As a test, we put the following gcode in all the tfree0, tpre0, and tpost0 files:

    G1 U50

    To clarify, we put the above gcode into tfree0 and tfree1 and then ran a tool change through the gcode console and it didn't activate the macro. We then put it into tpost0 and tpost1 and tried again, with nothing happening. Etc.

    To explain further, when we upload and try to print the below gcode print file, the tool change does not run the macro that we defined (in this case it only moves the U axis).

    G1 X50
    G1 X-50
    G1 Y50
    G1 Y-50
    G1 Z50
    G1 Z-50

    As I understand from @dc42 's explanation here, when the program sees the T0 or T1 commands, a tool change occurs and should run the gcode in the tpre, tpost, and tfree files, but we are unable to accomplish this.

    Any suggestions? Thank you!

  • Why not put the 50mm offset in with G10 in your configration file?

    Also it doesn't sound like you have the U axis setup to replace the X axis?

    See Link

  • administrators

    Did you home the printer first? Tool change files are not run if the printer has not been homed.

  • Sorry to distal. But now I'm interested in what your printer is and looks like

  • @dc42 We did not home it first. Our printer technically isn't assembled yet so we are trying to do as much as we can before that.


    edited out 🙂

  • To explain our process for a tool change:

    We have dual extruders (in our case actually syringes) but both extruders are connected by a rack system that works as a see-saw.

    So, when we do a tool change, we need a macro that will (1.) offset distance between the two syringes and (2.) activate the U-axis motor.

    The U-axis motor will be connected to the see-saw/rack system that will rotate to lift one syringe and lower the syringe that will be printing.

    See here:

    The U-axis will rotate one direction to lift one syringe, and then when the other tool change occurs, it needs to rotate the opposite direction to lift the other syringe.

    So...this is just to explain our reasoning.

  • administrators

    You can send G92 X0 Y0 Z0 to pretend that the printer has been homed.

  • @dc42

    Just an update, you are legitimately and objectively awesome. We got it to work!

    Just to try to help people in the future who have this same problem, in your config file, make sure to set the axis mins and max, otherwise it won't be able to move in the direction where the mins and max aren't defined.

    We also set our X axis offset at 50 as a test, but the first print sometimes the X axis won't do the offset, but after redoing the same print file, the X axis offset will work so I think it has to do with the same problem. Will report back with an update

Log in to reply