Hello Guest it is March 29, 2024, 08:06:24 AM

Author Topic: "Touch" GUI does not obey Tool Table offset, but "Probe" GUI does?  (Read 1102 times)

0 Members and 1 Guest are viewing this topic.

"Touch" GUI does not obey Tool Table offset, but "Probe" GUI does?
« on: September 09, 2019, 05:18:34 AM »
Hi,

I do a touch move with a 3d Probe in Z- Direction.
Tool length offset for my Probe is 155,0763.


The Tab "Probing" and "Single Axis Move" correctly use the offset from the tool Table selected tool.
The Button "Touch" (mcTouchOff.lua) on the main screen does not use this and sets a complete different value.

Because the "Touch off Plate" is used in x, y and z direction as same offset, it is also not possible to use this to compensate with the correct length offset.

This is the code from mcTouchOff.lua:
Code: [Select]
function SetFixOffset(Axis, Direction)
if (Axis == 'X') then
Pos = mc.mcAxisGetProbePos(inst, mc.X_AXIS, 1)
OffsetVal = (((ToffPlate + ToffToolRadius) * Direction) + Pos)
elseif (Axis == 'Y') then
Pos = mc.mcAxisGetProbePos(inst, mc.Y_AXIS, 1)
OffsetVal = (((ToffPlate + ToffToolRadius) * Direction) + Pos)
elseif (Axis == 'Z') then
Pos = mc.mcAxisGetProbePos(inst, mc.Z_AXIS, 1)
OffsetVal = ((ToffPlate * Direction) + Pos)
end
...


Code from mcProbing.lua:
Code: [Select]
if (SetWork == 1) then
local HeightOffset = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT, OffsetNum)
local HeightOffsetW = mc.mcToolGetData(inst, mc.MTOOL_MILL_HEIGHT_W, OffsetNum)
local NewWOVal = MeasPointMACH - HeightOffset - HeightOffsetW
Probing.SetFixOffset(nil, nil, NewWOVal)
end

So my assumption would have been, that two default Mach4 scripts should use the same Z Calculation in touching?
Or have i missed something how to use this correctly?

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: "Touch" GUI does not obey Tool Table offset, but "Probe" GUI does?
« Reply #1 on: September 09, 2019, 07:03:56 AM »
If I remember right the touch off module has an option to set a tool offset or the fixture offset. If you use it to set a tool offset you need to cancel any active tool height offset before touching. It's target audience is those not using tool changers. Think single tool using the tool to touch instead of a probe. That is why it doesn't have a coarse fast touch then back of a little and do a slow (more accurate) touch. Probes give so a fast initial touch is fine. Carbide tools in particular don't give much without breaking/chipping.

Code: [Select]
So my assumption would have been, that two default Mach4 scripts should use the same Z Calculation in touching?
We try real hard not to have multiple things that do the exact same thing. If touch and the probe tab did the same thing there wouldn't have been a reason to write the touch off module. But say you have 2 buttons that need to do the same thing. We try to write a single function and that function is called by both buttons. So, using the same code from multiple places is fine and recommend. But doing similar things does not == doing the same thing.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: "Touch" GUI does not obey Tool Table offset, but "Probe" GUI does?
« Reply #2 on: September 09, 2019, 07:19:23 AM »
Thank you for the Answer.
So I summarize - Touch GUI is not for probes...
This is not self explaining by viewing this button nor explained in the help texts.


But... The most used Button - Find X, Y and Z in one operation - is only in the "Touch" Menu.
The Probe menu does not have such an very convenient operation.
So it needs to be added by myself. Right?


And a second idea:
Even if the Touch GUI make use of TLO - it will still work for all without toolchangers...
So adding this single subtraction to the "Touch" would allow Probe and ATC users to use the cool Touch functions without breaking anything for non ATC users... right?
Another great feature of "Touch" is, it is not in a separate TAB and you can see the DRO's while using it.


Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: "Touch" GUI does not obey Tool Table offset, but "Probe" GUI does?
« Reply #3 on: September 09, 2019, 09:32:45 AM »
Yes, you can customize Mach to suit your needs. The TouchOff module was explicitly not compiled to serve as an example and to allow others to add, modify, do whatever suits them.

Yeah, I know lots of things that could be added/modified in the TouchOff module. That list is nearly limitless........ unlike the time I have to do it.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!
Re: "Touch" GUI does not obey Tool Table offset, but "Probe" GUI does?
« Reply #4 on: September 09, 2019, 10:04:56 AM »
Thank you for your time supporting me here then :).
I will change it to my needs.

One last question:
"explicitly not compiled to serve as an example"
Is there a list where to see what serves as an example and what not?

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: "Touch" GUI does not obey Tool Table offset, but "Probe" GUI does?
« Reply #5 on: September 09, 2019, 10:33:41 AM »
No, no list. If it existed it would change consistently. luac, mcc and some mcs files are compiled. Any lua scripts (modules, macros, wizards, screen scripts, etc.) in your Mach4 root directory that are not compiled can be viewed as examples.
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!