- GCode and Part Programs
- G&M Codes
- G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
29 Nov 2021 17:48 #227932
by harry4516
Replied by harry4516 on topic G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
I understand what you explain, maybe this is an issue only in Axis-GUI. I'm using qtdragon and don't have a problem with boundaries check.
Anyway, boundaries check should only be done against the machine limits. G43.1 changes (at least in qtdragon) only G45 coordinates, not machine coordinates. In your code above you are mixing machine limits with tool length which could cause problems. But, I don't use axis, so maybe its different there.
Back to the limit problem of the tool-change code.
The calculation with variables #2002 and #2003 is not working correctly. Usually they are the same and don't have any effect. But as these are global variables they could get a value from somewhere else and then the strangest things happen. I have tested it for a week and never got reliable results, including the limit problem discussed here.
I have changed the code into two files, one for reference measurement and the second for use (M6) during normal operation.
Maybe it is useful for somebody, its attached here. We are using it for a few days and didn't have any more problems.
Anyway, boundaries check should only be done against the machine limits. G43.1 changes (at least in qtdragon) only G45 coordinates, not machine coordinates. In your code above you are mixing machine limits with tool length which could cause problems. But, I don't use axis, so maybe its different there.
Back to the limit problem of the tool-change code.
The calculation with variables #2002 and #2003 is not working correctly. Usually they are the same and don't have any effect. But as these are global variables they could get a value from somewhere else and then the strangest things happen. I have tested it for a week and never got reliable results, including the limit problem discussed here.
I have changed the code into two files, one for reference measurement and the second for use (M6) during normal operation.
Maybe it is useful for somebody, its attached here. We are using it for a few days and didn't have any more problems.
Please Log in or Create an account to join the conversation.
01 Dec 2021 19:22 #228144
by +Jan+
Replied by +Jan+ on topic G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
Good evening,
thanks for the macros, I will have a look.
I can't confirm this, as long as no other macro uses the same parameters there should be no problems. The tool measurement works stable for me with the code since weeks. After I have measured the tool after starting Linuxcnc I set Z0 to sacrificial plate level with another macro (see attachment) or manually to another point. When I do this, there are no problems except for the faulty preview (which also shows up with an empty remap file). I hope to get around to experimenting with D2inventory's hints in the next few days.
Best regards
Jan
thanks for the macros, I will have a look.
The calculation with variables #2002 and #2003 is not working correctly.
I can't confirm this, as long as no other macro uses the same parameters there should be no problems. The tool measurement works stable for me with the code since weeks. After I have measured the tool after starting Linuxcnc I set Z0 to sacrificial plate level with another macro (see attachment) or manually to another point. When I do this, there are no problems except for the faulty preview (which also shows up with an empty remap file). I hope to get around to experimenting with D2inventory's hints in the next few days.
Best regards
Jan
Attachments:
Please Log in or Create an account to join the conversation.
20 Apr 2022 11:41 #240730
by andypugh
Did you create the pull request? I think that units conversion is handled by some functions in the axis code:
github.com/LinuxCNC/linuxcnc/blob/master...scripts/axis.py#L285
Replied by andypugh on topic G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
This seems to be something missed as G43.1 was introduced some time after Axis was completed.
[/i][/i][/code]if o.canon.max_extents_notool[i] > machine_limit_max[i]: to: [code]if o.canon.max_extents_notool[i] + (o.last_tool_offset[i] / 25.4) > machine_limit_max[i]:[/i][/i][/i]
Did you create the pull request? I think that units conversion is handled by some functions in the axis code:
github.com/LinuxCNC/linuxcnc/blob/master...scripts/axis.py#L285
Please Log in or Create an account to join the conversation.
- d2inventory
- Offline
- Senior Member
Less
More
- Posts: 42
- Thank you received: 10
01 Jul 2022 11:21 #246350
by d2inventory
I have now
Replied by d2inventory on topic G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
Did you create the pull request? I think that units conversion is handled by some functions in the axis code:
github.com/LinuxCNC/linuxcnc/blob/master...scripts/axis.py#L285
I have now
Please Log in or Create an account to join the conversation.
01 Oct 2023 23:01 #282034
by andypugh
Please Log in or Create an account to join the conversation.
02 Oct 2023 13:07 #282062
by andypugh
Replied by andypugh on topic G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
The behaviour can probably be explained by this sequence
The G-code extents are calculated at the point that the G-code program is loaded, using the tool-length data that was current at that point.
When the run button is pressed the system checks the G-code extents, unaware that the tool length might have changed.
In the scenario described, if you were to press the "cancel" button, reload the g-code and then press "run" again the calculation should be correct.
The "fix" here is wrong, apart from anything else it can only use the data from the last tool loaded, so can not be correct for any program with multiple tools used.
The max/min_extents_notool[] data already includes the effect of tool lenght offsets (it's the raw position of the spindle inside the axes, the version without the "notool" is the position of the tool tip inside the axes.)
The G-code extents are calculated at the point that the G-code program is loaded, using the tool-length data that was current at that point.
When the run button is pressed the system checks the G-code extents, unaware that the tool length might have changed.
In the scenario described, if you were to press the "cancel" button, reload the g-code and then press "run" again the calculation should be correct.
The "fix" here is wrong, apart from anything else it can only use the data from the last tool loaded, so can not be correct for any program with multiple tools used.
The max/min_extents_notool[] data already includes the effect of tool lenght offsets (it's the raw position of the spindle inside the axes, the version without the "notool" is the position of the tool tip inside the axes.)
The following user(s) said Thank You: +Jan+
Please Log in or Create an account to join the conversation.
23 Oct 2023 14:22 #283604
by +Jan+
Replied by +Jan+ on topic G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
I actually always get the message, regardless of whether the tool used in the program has already been measured or not. In addition, it is inconvenient if I always have to click away a dialog box, since I actually use a hardware start button that is not bound to the monitor.
Therefore, I changed today on good luck - I am no coder - a small thing at the code. Now limit violations of the Z-axis are ignored in the function. In X&Y the check still works. Since the tool length does not change exactly predictably with every tool change anyway, I can accept that I have to take a look at it myself.
Here the original definition (from an older 2.8 master version)
The only line I changed is this:
Best wishes
Jan
Therefore, I changed today on good luck - I am no coder - a small thing at the code. Now limit violations of the Z-axis are ignored in the function. In X&Y the check still works. Since the tool length does not change exactly predictably with every tool change anyway, I can accept that I have to take a look at it myself.
Here the original definition (from an older 2.8 master version)
def run_warn():
warnings = []
if o.canon:
machine_limit_min, machine_limit_max = soft_limits()
for i in range(3): # Does not enforce angle limits
if not(s.axis_mask & (1<<i)): continue
if o.canon.min_extents_notool[i] < machine_limit_min[i]:
warnings.append(_("Program exceeds machine minimum on axis %s")
% "XYZABCUVW"[i])
if o.canon.max_extents_notool[i] > machine_limit_max[i]:
warnings.append(_("Program exceeds machine maximum on axis %s")
% "XYZABCUVW"[i])
if warnings:
text = "\n".join(warnings)
return int(root_window.tk.call("nf_dialog", ".error",
_("Program exceeds machine limits"),
text,
"warning",
1, _("Run Anyway"), _("Cancel")))
return 0
The only line I changed is this:
for i in range(2): # check only for x & y violations
Best wishes
Jan
Please Log in or Create an account to join the conversation.
- GCode and Part Programs
- G&M Codes
- G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis
Time to create page: 0.155 seconds