3
« on: June 09, 2020, 03:13:49 PM »
I was encouraged when I read this about the latest plug-in:
Major changes for this release, see the release notes for a complete list of changes - ( (Click here for release notes):
(1) Fixed bugs in probing code that sometimes caused a jump in machine
position after the probe motion had completed. This bug also caused a
mis-match between the actual machine position and Mach4's internal
calculated machine position.
Unfortunately, I still seem to be having this problem. I have a converted Grizzly 704 3-axis CNC mill with the following software:
PMDX-414[revA PCB]
SN 38046(A1)
Plug-in 0.53.263
Bootloader 1.14.74
Firmware 0.60.208
Mach4
Version 4.2.0.4300 Licensed
Build 4300
Screen set wx4.set
Windows 10 Home
Version 10.0.18362
I have a touch pad for M6 manual tool changes. I wrote a Lua script that asks you to touch the current tool, and it saves the Z value. Then it asks you to change the tool and touch the pad again. It sets the Z value to the saved value. When I run this without actually changing the tool, the Z work zero changes every time... sometimes by a lot. I don't see how the script could be causing the problem, and I've asked the Mach4 people to see if they can fix it, but they have had no ideas. Here is the script:
function m6()
local inst = mc.mcGetInstance()
local selectedTool = mc.mcToolGetSelected(inst)
local currentTool = mc.mcToolGetCurrent(inst)
local maxDown = -15.0000 --Max distance Z will go down in the touch routine
local rate = 15 --Feed rate the Z will go down in the touch routine
local safeZ = .5 --Coordinates the Z will rapid to after touch move
local CycleWait
if selectedTool == currentTool then
mc.mcCntlSetLastError(inst, "Current tool same as selected tool. No tool change required.")
return
end
mc.mcCntlSetLastError(inst, "Tool Change")
mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0 X0.0 Y0.0") -- Goes to Machine Zero
CycleWait = mc.mcCntlWaitOnCycleStart(inst, "Position the tool less than 1/2 inch over the touch plate and click Start", 1000000) -- waits for cycle start
--Probe move start
mc.mcCntlGcodeExecuteWait(inst, string.format("G91 G31 Z%0.4f F%0.4f", tostring(maxDown), tostring(rate)))
local didStrike, rc = mc.mcCntlProbeGetStrikeStatus(inst)
if (didStrike ~= 1) then
mc.mcCntlSetLastError(inst, "The touch move did not touch.")
mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
return
end
--Probe move end
TouchZ, rc = mc.mcCntlGetPoundVar(inst, 5023) --#5063 = User position #5073 = Machine position #5023 = CurrentZ
mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
CycleWait = mc.mcCntlWaitOnCycleStart(inst, "Change the tool, reposition it over touch plate and click Start", 1000000) -- waits for cycle start
--Probe move start
mc.mcCntlGcodeExecuteWait(inst, string.format("G91 G31 Z%0.4f F%0.4f", tostring(maxDown), tostring(rate)))
local didStrike, rc = mc.mcCntlProbeGetStrikeStatus(inst)
if (didStrike ~= 1) then
mc.mcCntlSetLastError(inst, "The touch move did not touch.")
mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
return
end
--Probe move end
rc = mc.mcCntlSetPoundVar(inst, 5023, TouchZ)
mc.mcCntlGcodeExecuteWait(inst,"G90 G53 G0 Z0.0")
mc.mcToolSetCurrent(inst, selectedTool)
CycleWait = mc.mcCntlWaitOnCycleStart(inst, "Turn the spindle on, click cycle start, and we are cutting.", 1000000) -- waits for cycle start
mc.mcCntlSetLastError(inst, "Tool Change Completed.")
end
if (mc.mcInEditor() == 1) then
m6()
end