Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: nc42 on January 20, 2022, 11:52:04 AM

Title: Probing Help, angle measurement
Post by: nc42 on January 20, 2022, 11:52:04 AM
I'm trying to run a angle measurement from the probing page and keep getting the error: "invalid plane selection for coordinate rotation" my loaded Gcode includes a G17 and I have tried inputting a G17 in the MDI but still get the same error. Any ideas out there?
Title: Re: Probing Help, angle measurement
Post by: nc42 on January 20, 2022, 01:03:20 PM
I used the hammer fix, just removed the plane check from the lua script....
Title: Re: Probing Help, angle measurement
Post by: brianthechemist on February 11, 2022, 03:59:04 PM
having exactly this problem.  could you give me some info to find the "hammer fix" ?
Title: Re: Probing Help, angle measurement
Post by: nc42 on February 11, 2022, 04:36:55 PM
Under the Operator menu select "Open Script Editor"

Then under "Modules" open mcProbing.lua

Search for "invalid plane selection for coordinate rotation" or part of it and delete each instance of the if then statement that leads to the error.

Check that it actually works because I don't really know what I'm doing and can't be held responsible for this idea if it goes bad... That said it's worked for me
Title: Re: Probing Help, angle measurement
Post by: brianthechemist on February 11, 2022, 04:41:24 PM
Haha, perfect timing.  I assumed you meant sledgehammer method :) i did exactly as you say and will test it in a few minutes. 
Title: Re: Probing Help, angle measurement
Post by: brianthechemist on February 11, 2022, 07:24:57 PM
Hmm.  Not working.  Maybe I did something wrong? (I can't imagine that it is that complicated).

Did I comment it out incorrectly?

Code: [Select]
------------- Get current state -------------
local CurFeed = mc.mcCntlGetPoundVar(inst, mc.SV_FEEDRATE)
local CurZOffset = mc.mcCntlGetPoundVar(inst, mc.SV_ORIGIN_OFFSET_Z)
local CurFeedMode = mc.mcCntlGetPoundVar(inst, mc.SV_MOD_GROUP_1)
local CurAbsMode = mc.mcCntlGetPoundVar(inst, mc.SV_MOD_GROUP_3)
local CurPlane = mc.mcCntlGetPoundVar(inst, mc.SV_MOD_GROUP_2)
local CurXPosition = mc.mcAxisGetPos(inst, mc.X_AXIS)
local CurYPosition = mc.mcAxisGetPos(inst, mc.Y_AXIS)

--if (CurPlane ~= 170) and (RotateCoord == 1) then
-- mc.mcCntlSetLastError(inst, "Probe: Invalid plane selection for coordinate rotation")
-- do return end
--end

------------- Check Probe -------------
rc = Probing.CheckProbe(1, ProbeCode); if not rc then; do return end; end

------------- Check direction -------------
if (CurXPosition > XPos) then
BackOff = -BackOff
OverShoot = -OverShoot
ProbeRad = -ProbeRad
end