Ew. Snapmaker’s insistence on dumbing things down hinders power users. The pause function always moves the toolhead straight up and turns off the spindle, then resuming ALWAYS turns the spindle back on (even if you put an M5
before the pause) and brings it back down to where it was. So there’s a bit of stupid trickery to make this work.
First off, the tool change code (it’s so stupid… so so stupid…) Everything is commented what the line is for/does.
M3 P0 ; Change spindle speed to 0, since it WILL come back on, basically an M5
G55 ; Workspace 2 for storing our current position.
G92 X0 Y0 Z0 ; Set current position as origin on workspace 2
M76 ; Pause gcode, brings it to the top and waits. PULL BIT HERE, insert new bit into collet LOOSE so it can move around.
M5 ; Safety M5 to make sure the spindle is off after pause.
G0 Z100 ; Safety retract, modify to suit your needs, distance is above the current position.
G53 ; Change to machine coords for bit 'measuring'
G0 X20 Y20 ; Location of your reference point in machine coords, modify for needs.
G0 Z50 ; Move down a safe distance over your point
G0 Z30 F100 ; Slow down to move to final point, this is the height you should have setup your first bit, it will push the new bit to the same height as the old one.
G4 S5 ; Dwell for you to tighten the bit, set at maybe S30 for 30 seconds.
G55 ; Back to work 2
G0 Z100 F9000 ; back to safety distance
M3 P100 ; Spindle back on
G4 S2 ; Dwell for spindle to speed up
G0 X0 Y0 ; Move back to the original position we stopped at in X/Y
G0 Z0 ; Back down
G54 ; Finally back to work coords 1 to continue where we left off.
For this to work, designate a safe area, preferably so you can touch the waste board as a non-changing reference. When inserting your first bit, do it loosely so jogging down pushes it in a little, then tighten the nut. Write down the Machine Coords
from the touchscreen, this is the location you’ll need for the G53
section above to make all other bits the same exact length. This does require all your bits to be roughly the same length overall.
This should work no matter if you start it in Luban or the touchscreen, as machine coords do not change, they’re based on the homing switches. The G54
work coords (origin) is never touched in the process.
I’ve done a quick video on the movement associated with this, the entire gcode ran is in the video description. Keep in mind when it goes back up is when you pull your current bit, and loosely put in the new one, and when it goes to the corner is when it’s seating the new one and there’s a 5 second pause to tighten (increase this duration). Then it moves back up, starts the spindle, and goes back to position to finish. It’s just a straight line across the build plate… ignore the fact it’s the laser bed and there’s no tool, this was demonstration only.
EDIT: Please be careful when it comes back down after resuming the pause… stupid thing. The only other option would be set the location (the G55
block), then move up a safe distance and use a G4
dwell, but this is unsafe as it might begin moving before you get the tool changed. Needs a proper pause/resume.
Also to resume after the M76, you either have to use Luban to resume, or send the command via commandline. I’ve made a .bat for mine with the contents;
@echo on
curl -X POST "http://[IP HERE]:8080/api/v1/connect?token=[TOKEN HERE]"
curl -X GET "http://[IP HERE]:8080/api/v1/status?token=[TOKEN HERE]&167430879684"
curl -X POST "http://[IP HERE]:8080/api/v1/resume_print?token=[TOKEN HERE]"
For more info on using the above code, check my drag/drop guide in the 2.0 forum. Simply running the .bat will make it continue.
EDIT2: Confirmed, if ran from the touchscreen, you get a resume button on the touchscreen, so that’s likely the best way to run it. Again, this is all speculation with the assumption that the Artisan does still use Marlin. Try at your own peril.