Troubleshooting Z Touch plate during tool change

Long time reader, first time poster :slight_smile:

Could use some suggestions on Z-axis touch plate troubleshooting. I created a very simple tool change test. The gcode is posted below if it helps. I am using the same start gcode and tool change gcode that allows the user to home xy, then home z, then start the cuts. (Using a dewalt 660). the start up code works flawlessly, ztouchplate works fine in start code. When getting to tool change, the x and y will home as expected, the z home starts but never recognizes the touch plate when it makes contact. Just continues to drive the mill into the plate. I did all the obvious testing including attempting to manually trigger the touchplate by tapping the alligator clip on the touch plate directly.

If I power off and back on and start the job again, the same thing happens, ztouch works fine during start code, ignores the touchplate contact during tool change.

The basic clip of gcode for the homing is this:

;No. 2: Engraving 1

M00 Change tool: 2mmBallFinishing

M0 Click to Home XY
G1 Z25 F500
G28 X Y
M0 Click to Home Z
G28 Z
G1 Z2 F150
M0 Click after Turning on Spindle
G1 Z-19.2 F150
G92 X0 Y0 Z0
G1 Z2 F150

Full gcode that I am using for the job is this:

;Project simplesquare
;Created by Estlcam version 11 build 11.220
;Machining time about 00:01:01 hours

M0 Click to Home XY
G1 Z25 F500
G28 X Y
M0 Click to Home Z
G28 Z
G1 Z2 F150
M0 Click after Turning on Spindle
G1 Z-19.2 F150
G92 X0 Y0 Z0
G1 Z2 F150
G00 X0.0000 Y0.0000 Z0.0000 F2100
G00 Z2.0000 F480

;No. 1: Part 1
G00 X114.8993 Y8.4100 F2100
G00 Z0.5000 F480
G01 Z0.0000 F180 S24000
G01 Z-1.0000 F180
G01 X115.0033 Y8.4134 F900
G01 X115.1068 Y8.4236 F900
G01 X115.2095 Y8.4406 F900
G01 X115.3108 Y8.4642 F900
G01 X115.4104 Y8.4944 F900
G01 X115.5078 Y8.5310 F900
G01 X115.6025 Y8.5740 F900
G01 X115.6943 Y8.6230 F900
G01 X115.7826 Y8.6780 F900
G01 X115.8672 Y8.7386 F900
G01 X115.9476 Y8.8046 F900
G01 X116.0236 Y8.8757 F900
G01 X116.0947 Y8.9516 F900
G01 X116.1607 Y9.0321 F900
G01 X116.2213 Y9.1166 F900
G01 X116.2763 Y9.2050 F900
G01 X116.3253 Y9.2968 F900
G01 X116.3683 Y9.3915 F900
G01 X116.4049 Y9.4889 F900
G01 X116.4351 Y9.5885 F900
G01 X116.4587 Y9.6898 F900
G01 X116.4757 Y9.7925 F900
G01 X116.4859 Y9.8960 F900
G01 X116.4893 Y10.0000 F900
G01 Y44.8993 F900
G01 X116.4859 Y45.0033 F900
G01 X116.4757 Y45.1068 F900
G01 X116.4587 Y45.2095 F900
G01 X116.4351 Y45.3108 F900
G01 X116.4049 Y45.4104 F900
G01 X116.3683 Y45.5078 F900
G01 X116.3253 Y45.6025 F900
G01 X116.2763 Y45.6943 F900
G01 X116.2213 Y45.7826 F900
G01 X116.1607 Y45.8672 F900
G01 X116.0947 Y45.9476 F900
G01 X116.0236 Y46.0236 F900
G01 X115.9476 Y46.0947 F900
G01 X115.8672 Y46.1607 F900
G01 X115.7826 Y46.2213 F900
G01 X115.6943 Y46.2763 F900
G01 X115.6025 Y46.3253 F900
G01 X115.5078 Y46.3683 F900
G01 X115.4104 Y46.4049 F900
G01 X115.3108 Y46.4351 F900
G01 X115.2095 Y46.4587 F900
G01 X115.1068 Y46.4757 F900
G01 X115.0033 Y46.4859 F900
G01 X114.8993 Y46.4893 F900
G01 X80.0000 F900
G01 X79.8960 Y46.4859 F900
G01 X79.7925 Y46.4757 F900
G01 X79.6898 Y46.4587 F900
G01 X79.5885 Y46.4351 F900
G01 X79.4889 Y46.4049 F900
G01 X79.3915 Y46.3683 F900
G01 X79.2968 Y46.3253 F900
G01 X79.2050 Y46.2763 F900
G01 X79.1166 Y46.2213 F900
G01 X79.0321 Y46.1607 F900
G01 X78.9516 Y46.0947 F900
G01 X78.8757 Y46.0236 F900
G01 X78.8046 Y45.9476 F900
G01 X78.7386 Y45.8672 F900
G01 X78.6780 Y45.7826 F900
G01 X78.6230 Y45.6943 F900
G01 X78.5740 Y45.6025 F900
G01 X78.5310 Y45.5078 F900
G01 X78.4944 Y45.4104 F900
G01 X78.4642 Y45.3108 F900
G01 X78.4406 Y45.2095 F900
G01 X78.4236 Y45.1068 F900
G01 X78.4134 Y45.0033 F900
G01 X78.4100 Y44.8993 F900
G01 Y10.0000 F900
G01 X78.4134 Y9.8960 F900
G01 X78.4236 Y9.7925 F900
G01 X78.4406 Y9.6898 F900
G01 X78.4642 Y9.5885 F900
G01 X78.4944 Y9.4889 F900
G01 X78.5310 Y9.3915 F900
G01 X78.5740 Y9.2968 F900
G01 X78.6230 Y9.2050 F900
G01 X78.6780 Y9.1166 F900
G01 X78.7386 Y9.0321 F900
G01 X78.8046 Y8.9516 F900
G01 X78.8757 Y8.8757 F900
G01 X78.9516 Y8.8046 F900
G01 X79.0321 Y8.7386 F900
G01 X79.1166 Y8.6780 F900
G01 X79.2050 Y8.6230 F900
G01 X79.2968 Y8.5740 F900
G01 X79.3915 Y8.5310 F900
G01 X79.4889 Y8.4944 F900
G01 X79.5885 Y8.4642 F900
G01 X79.6898 Y8.4406 F900
G01 X79.7925 Y8.4236 F900
G01 X79.8960 Y8.4134 F900
G01 X80.0000 Y8.4100 F900
G01 X114.8993 F900
G00 Z2.0000 F480

;No. 2: Engraving 1

M00 Change tool: 2mmBallFinishing

M0 Click to Home XY
G1 Z25 F500
G28 X Y
M0 Click to Home Z
G28 Z
G1 Z2 F150
M0 Click after Turning on Spindle
G1 Z-19.2 F150
G92 X0 Y0 Z0
G1 Z2 F150
G00 X84.9496 Y39.9496 Z2.0000 F2100
G00 Z0.5000 F480
G01 Z0.0000 F180
G01 Z-0.5000 F180
G01 X109.9496 F480
G01 Y14.9496 F480
G01 X84.9496 F480
G01 Y39.9496 F480
G01 Z-1.0000 F180
G01 Y14.9496 F480
G01 X109.9496 F480
G01 Y39.9496 F480
G01 X84.9496 F480
G00 Z2.0000 F480
G00 X0.0000 Y0.0000 F2100

M05

Unless I am missing something you are not performing a ztouch function. Ztouch command is G38.2, you are performing an XY home, followed by a Z home. If you have changed the tool between those Z homes the tool length will most probably have changed and the Z is just trying to get to the old Z0

Thanks for the comment Mike, I’ll give the G38.2 a try. I am using G28 Z in the start gcode to do the same thing, and it is working correctly, recognizing the contact to the touch plate as the Zmin being triggers, just not working during tool change.

No, the G28 Z is how you home in the basic setup. G38.2 is only for setups where you are doing something like homing up.

I don’t see anything wrong with that gcode. There shouldn’t be anything to stop the homing sequence from working. That is very strange.

Is there anything else that might be different, like you don’t plug in the router until after you home the first time?

I would focus on M119 and try to find cases where it either triggers too much or doesn’t trigger at all. That will eliminate a lot of variables.

Thanks Jeff, I am in both cases using a 660 that is plugged in, the same tool but (never actually changed the tool in this test) With alligator clipped at the same point. (as indicated also tasted touching the alligator clip directly to the plate to manually trigger. I’ll keep playing with it Thanks!

Just a couple notes to update on my troubleshooting in case it helps anyone else. I took the project, and using the estlcam 3d functions, saved one file for roughing and a second file for finish (in otherwords, no manual editing in the gcode file). Identical start gcode to home and z probe to the touch plate. Ran roughing pass, clean run, tool moved to orgin as expected. Turned off the 660, then I disabled the steppers via the lcd, did a tool change for a 2mm ball mill, connected the alligator clip and loaded the finishing file. X and Y homes cleanly, z homing drive the tool into the touch plate. turned off power to everything via the power strip, turned it back on with no changes to anything. Reran the finishing file, X and Y homed cleanly, Z homed correctly and reacted to hitting to touch plate correctly.

Really don’t have any conclusive explanation on this, but had repeated the test 3 times in a row.

Short version, reboot the mpcnc between files resolves this.