Marlin and Fusion 360: Tool Change

I use Fusion 360 to create all my gcode files, due to the fact that Esltcam felt so limited in features. I’m still waiting for my grbl board to ship, but for the time being i decide to see if i can do tool change with marlin firmware.

I insert this line into my gcode when ever i want to have the machine to do a tool change. This what i created:

(Pause for Tool Change)
G0 Z40 - This will move Z up 40 mm
G0 X0 Y0 F100 - This will home X and Y to the work-space 0, not machine 0
M00 Tool Change - This will pause the job until you completed the tool change, Ask you to click button to continue.
G28 Z - This will get the new Z 0 for you new bit
G92 Z20.06 - This the height of your probe block offset
G0 Z20 - This will move Z up 20 mm
M25 - This Ask you to resume print.

This kinda works, the issue is that before G0 z40 Marlin want to home to Z0 at that particular X, Y coordinate. If you aren’t there or a late response, this will cause the machine to fail homing. How can i fix this issue?

 

NVM! After looking around on the forum , i found the solution https://github.com/guffy1234/mpcnc_posts_processor