I had a job making a bunch of cuts along a wonky board, so I wanted to do a Z probe before each section in the middle of where the cuts were about to be made. So, I created this NodeJS script which uses multiple tools that are always the same tool, just different tool names to chunk the job up into different sections.
Here’s a quick video showing how it works and I’ll post the code down below…
And here’s the script and some sample files. You’ll need to install NodeJS first, for this to work.
center_Z_probe_on_tool_changes.zip (4.8 MB)
The main gcode bits to use in ESTLCAM are:
Startup:
(Project <project>)
(Created with Estlcam <build>)
(Machining time about <time> hours)
(Required tools:)
<tools>
G21
G90
G94
M03 S<s><!L>
(Zero Z on center of first tool cut for center Z Probe)
G0 Z20.000
G0 X#100 Y#101 (moves to future center point)
M0 (pause for Z probe)
G38.2 Z-30.000 F100 (Z probe)
G92 Z0.400 (adjust for 0.4 mm probe plate)
G0 Z20.000
M0 (DONE)
(Zero Z complete)
And then tool change:
(Tool change start for center Z Probe)
G90
G0 Z20.000
G0 X#100 Y#101
M0 (Pause to get ready to probe)
G38.2 Z-20.000 F100 (Z probe)
G92 Z0.400 (adjust for 0.4 mm probe plate)
G0 Z20.000
M0 (DONE)
(Tool change complete)
I’m sure I glossed over a number of things while documenting this so if any of this doesn’t make sense, please let me know and I’ll try to clarify.