Hi,
No. The Z would go to zero, trip the switch and all would stop
My apologies, I've had a much closer look at the code and realised its not quite how I thought. These are the two lines in the function:
mc.mcCntlMdiExecute(inst, "G00 X0 Y0")--Without Z moves
--mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z0")--With Z moves
Note the first line mc.mcCntlMdiExecute(inst, "G00 X0 Y0") just moves direct to x0y0 irrespevtive of where the Z axis is. If its up above the material
all is well but if the tool is still down in the material then it will drag through it on the way to x0y0.
The second line mc.mcCntlMdiExecute(inst, "G00 G53 Z0\nG00 X0 Y0 A0\nG00 Z0") goes to Z zero, but in machine coordinates, and then to x0y0, and then to z0
in work coordinates. Thus the initial move is up and out of the way. When you say the machine stops is because it hits the Z axis limit switch. That's your own fault...
whats the point of having a Home location that errors out? The home location should be say 1mm inside the Limit switch so that you can drive to the Home location
without a Limit fault.
Just as an example: my mill has three switches on each axis, two Limits and one Home switch. The Limit switches are and the very end, about 1mm inside the mechanical
stops. I have set the SoftLimits to be about 1mm inside the Limit switches and the Home switch about 1mm inside the SoftLimits. That means my Home location is 2mm
inside the Limits, and consequently I can drive to the Home location WITHOUT triggering either a Limit OR a SoftLimit.
I have attached a pic. You can see the switch on the left is slightly closer to the top of the Z axis and is the Z axis upper Limit switch whereas the switch on the right is somewhat lower,
ie the Z axis Home switch.
I have elected to have two Limit switches and one Home switch per axis, and all on their own breakout board input but you don't have to do that. You could use the upper limit switch
as a Limit and a Home, but you need to set a realistic Home Offset parameter so that Mach can distinguish between a Home and a limit. Lets say you choose a Home Offset of 2mm
then in the code above the Z axis would go to the near (within 2mm) the top, but would not trigger the Z axis limit.
Craig