G43.1 Dynamic Tool Length Measurement - Program Exceeds machine maximum on axis

More
4 years 11 months ago - 4 years 11 months ago #227810 by harry4516
this code, I think it was first created by Talla83, has a couple of issues and should not be used as it is.

The lines:
#2001=[#2000-#2002+#2003](new - diff + old)
#2002=[#2000] (Save old switch point)
#2003=[#2001] (Save old offset)

are just doing nothing. 2002 and 2003 always have the same value, and -#2002+#2003 = 0, so have no effect, which can be tested by debug output  (debug, var2002: #2002) ...

Maybe +Jan+'s problem is that this code leaves Z at a wrong value if it stops by error or if LinuxCNC is restarted. The result is, that Z may go over its limits.

When using this code you need to manually reference the Z null of your work piece after every error or restart of LinuxCNC. Then it will work as expected.
Last edit: 4 years 11 months ago by harry4516.

Please Log in or Create an account to join the conversation.

More
4 years 11 months ago - 4 years 11 months ago #227827 by d2inventory
Talla83's code shouldn't matter as you can reproduce this fault without it.

Just use G43.1 in MDI and it's easy to reproduce without a real tool change.

The issue is, as I pointed out, that the warning check in Axis (the GUI) doesn't take the tool length offset into consideration. So the Z-shift when using G43.1 Z-10.0 f.e. isn't taken into account when checking the boundaries.

If your program exceeded the Z-axis by 5mm and you use G43.1 Z-10.0 the program would fit by 5mm but the check still thinks it's 5mm above Z-max because the TLO isn't used in the bounds check. Maybe I'm just explaning it really bad, dunno :D
Last edit: 4 years 11 months ago by d2inventory.

Please Log in or Create an account to join the conversation.

More
4 years 11 months ago #227932 by harry4516
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.
 

Please Log in or Create an account to join the conversation.

More
4 years 11 months ago #228144 by +Jan+
Good evening,
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 

File Attachment:

File Name: messen_z.ngc
File Size:631 B

Please Log in or Create an account to join the conversation.

More
4 years 6 months ago #240730 by andypugh

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]
[/i][/i][/code]
 
This seems to be something missed as G43.1 was introduced some time after Axis was completed. 

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.

More
4 years 4 months ago #246350 by d2inventory

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 :D

Please Log in or Create an account to join the conversation.

Time to create page: 0.389 seconds
Powered by Kunena Forum