Gmoccapy: make Tool Table exit more verbose#3792
Gmoccapy: make Tool Table exit more verbose#3792zz912 wants to merge 1 commit intoLinuxCNC:masterfrom
Conversation
|
I have no problem with this addition. |
|
Please resolve the review if the changes are OK. Then we can merge it. |
|
IMO this PR needs a proper commit message, I have no idea what a "Tool Table exit" is and why / how it affects (only?) gmoccapy. |
This PR adds another popup message (4.) for situations when the operator selects offset == 0, or previously was offset == 0 and the operator changed the offset != 0. |
I wonder what the rationale is justifying this behaviour or if it is simply a bug in the interpreter. It certainly isn't documented here https://linuxcnc.org/docs/devel/html/gcode/g-code.html#gcode:g43 Playing around with this a bit in qtvcp and axis, it seems there are bugs like this in other GUIs too. Maybe the proper place to fix this is somewhere else? |
That's an interesting question. I just took it for properties. It didn't occur to me that it could be a bug.
If this is a bug, it should be fixed elsewhere. But that's beyond my capabilities. |
Looking at this a bit more closely makes me think that this is actually a phantom problem as I'm not sure there IS an internal state like 'activated' / 'deactivated' tool offset as such. All we seem to do with G43/G49 is change the values of the internal tool length compensation. For G49 they are all set to zero. linuxcnc/src/emc/rs274ngc/interp_convert.cc Line 6183 in f82c475 The displayed 'G43' / 'G49' in the 'active gcodes' only reflects whether the current internal tool length values are all zero ('G49') or not ('G43') linuxcnc/src/emc/rs274ngc/interp_write.cc Line 110 in f82c475 So 'activating G43 with zero offsets' does not actually 'deactivate' tool compensation it only makes 'G49' appear in the active gcodes list because all internal tool offset values are zero. |
|
Thank you for looking into this. I agree that for LCNC developers this sentence "Activating G43 with zero offsets deactivates tool compensation." is inaccurate. However, for a CNC machine operator it is correct. For LCNC developers, the sentence should be "Activating G43 with zero offsets makes 'G49' appear in the active gcodes list." However, a CNC machine operator will not even know what a "gcode list" is. We are currently in a situation where LCNC developers should decide whether: If this is correct behavior, it should be added to the documentation and this PR should be merged. I consider myself an LCNC tester, not a developer. Both options are acceptable to me. BTW: linuxcnc/src/emc/rs274ngc/interp_write.cc Lines 110 to 113 in f82c475 These lines prove that LCNC really works with zero values and not with 10E-9. |
What made you think that it used 10E-9 for tool offsets? |
|
I wonder what dangerous consequences that could have? If tool offsets are 0, then there are no offsets, and it doesn't matter if machine displays "G43" or "G49". |
This situation can occur when you use a CNC machine as a conventional machine. It is the case when you use manual mode for machining as well. You have for example:
Another situation:
I think this is a problem mainly for Gmoccapy users who are spoiled by automatic G43. |
|
Thanks for the explanation, I understand how that can be surprising and annoying. Still not sure if there is something in the interpreter that should be changed, allowing an active G43 in case tool offsets are zero would be an easy change. |
I would be in favor of changing it. IMO it IS a bit problematic to present G43, G43.1, G49 as being modal and then silently change it to G49 when the tool offset values happen to be all zero. This is indeed rather unexpected behavior. |
|
I have a different opinion. Tool 1 is in spindle with G43 active and Z-Offset = 22 mm Using only AUTO Mode with generated code by Cam will add a G43 after each tool change, but how often do we change a tool in Manual mode and than we need to take care to enter again G43 to get the correct values. I do not know, if my wishes are utopia, but I like to dream ;-) Imho G43 can be active, even if the tool offsets are "zero", My touch probe have all offsets to zero and all my tools have there offsets. Norbert. |
|
Hello Norbert.
I think you misunderstood the functionality of this PR. Several Gmoccapy users had problems with race conditions caused by the integrated AUTOMATIC_G43 in gmoccapy.py, not just me. I think we have SAME opinion.
This PR does not apply to AUTOMATIC_G43 when changing a tool. This PR applies to AUTOMATIC_G43(popup message) when changing the offset for the same tool in the tooltable page. We continue with AUTOMATIC_G43 in other situations.
Could you please send me the version of LCNC you are using and the tool.tbl you are using? I can double check, but I think it is impossible. I made video in the past: #2613 (comment) |
Norbert probably means that there is no reason this behaviour would be harmful, not that it currently is that way. I don't want to add further to the confusion and am going to implement that G43 can be active with all offsets identical zero. |
|
See #3816 [edit] |
|
@Sigma1912 was faster it seems ;) |

LinuxCNC core behavior:
Activating G43 with zero offsets deactivates tool compensation.
In this situation, G43 behaves like G49.
If the CNC operator is not aware of this, it can have dangerous consequences.
@hansu was not aware of this in the past. See:
#3706 (comment)
I struggled with this as well.
Therefore, I made exiting the Tool Table in Gmoccapy more verbose and added the option to activate G43 when the active offset changes from zero to non-zero.
I would like to ask @Sigma1912 for their opinion on whether this is OK.