This is my first post, but I am a long time follower of this forum.
I am running my 4th mach3 machine, second using tool changer. On my previous machine I tool existing tool change code and customized it myself for my machine. I recently purchased a Roctech (chinese) atc machine with HSD spindle. It is an impressive machine, but requires insane amounts of setup. Most of the circuit boards and software on it were junk, so I upgraded to a ethernet smoothstepper coupled with a PMDX board. So far so good. Computer had strange chinese plugins tied into mach3, so I reinstalled it with a fresh copy and essentially started over. My z axis is set so machine zero is with spindle at top of the z vertial movement. Work zero is top of the table. So tool offsets are typically larger negative numbers (around -15 to -18")
hopefully you have enough background now. So down to the problem .
occasionally (1 in 50), typically first tool change made during gcode run, the machine will take a very fast negative z direction dive straight for my table. It sort of acts like it doesn't know where it is. The machine is always zeroed properly when this happens. I am attaching my m6start code along with some simple g code where i experienced the problem recently. I have tried everything, I feel like it is most likely just poorly written m6 script or bad post processor settings. I know enough to be dangerous, and I sense that one of you users on here will look at this and know pretty quickly what is wrong.