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

More
4 years 11 months ago - 4 years 11 months ago #227025 by +Jan+
I made a few more attempts. If I comment out the remap m6 in the ini the problem does not occur, even if I manually set g43.1 z-247 and the zero point accordingly in the MDI.

If I start Linuxcnc with empty m6 remap file:
Code:
o<messen_eng> sub o<messen_eng> endsub M2

the problem occurs as soon as I set g43.1 z-247 via the MDI with the corresponding Z zero point.
The problem occurs only after a certain offset. g43.1 z-20 works fine, for example.

To be sure, I reproduced the above on a simulated machine (sim.axis/axis_mm.ini - I just configured the Z axis to Z max 0.1 and Z min -300 and enabled the m6 remap). Again, the error occurs (also with empty M6 remap file).

@ NKP
Did you test this with my Z Axis Config?
Z max 0.1
Z min -300

@d2inventory
Thanks also for the hint with the debouncing of the switches. I have built a switch with inductive proximity sensor. It should not need this, right?

Best wishes

Jan
Last edit: 4 years 11 months ago by +Jan+.

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

More
4 years 11 months ago - 4 years 11 months ago #227033 by d2inventory
can you attach your sim config where you can reproduce the issue?

for debouncing, I don't know. do you have an oscilloscope to measure it?
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 - 4 years 11 months ago #227034 by +Jan+
Hi,
enclosed you find a zip file.
It contains the remap file in the file path specified in the ini. Also the whole Axis Simulation Config folder. Please use the file "axis_mm.ini", which I have adapted according to my Z axis, m6 remap and the macro file path. Also I attach the NGC file which I used last for the tests.

Best regards and thanks in advance

Jan

 

File Attachment:

File Name: probekreis.ngc
File Size:123 B
 

File Attachment:

File Name: linuxcnc.zip
File Size:30.75 KB
Last edit: 4 years 11 months ago by +Jan+.

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

More
4 years 11 months ago #227198 by d2inventory
Ok, I can reliably reproduce the fault.Attached is the config I'm using. To get the debug messages you gotta run it from the terminal.linuxcnc path/to/config/tool-sensor-test.ini

You can trigger the tool touch probe on the right side panel (Probing is active when the feed rate is 5, aka slow :D )

If you start the config for the first time there are no linuxcnc.var and linuxcnc.var.bak files in the config directory. I think this is where the issue comes into play.
On this first start look at the program movement from the Y perspective and you will see it will exceed Z axis limit.
If you set the G54 origin (Nullpunkt) to -5 the program will fit into the machine.
Now you can measure the tool height with "T1 M6" in MDI and use the "Sensor Trigger" button to make a measurement. (Remember it probes twice, so click wait a second and click again ;-) )
After measurement you can play the program without warning message. If you check the Y-perspective again you can see it's at the bottom of the machine now.

Now go to G54 X0 Y0 Z5 and do a touch of again. This would set the G54 origin at machine X0Y0Z0 before any tool measurement and this makes the program run out of the machine boundaries. But the preview shows that the program is perfectly fine inside the machine boundaries.

Now I'm not sure how to get rid of this warning yet but I thought if you and I can reproduce the issue with the same setup we can find a solution soon :D

I am in the IRC channel if you want to have a quicker back and forth chat on how to fix this issue.
The following user(s) said Thank You: +Jan+

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

More
4 years 11 months ago #227259 by d2inventory
Ok, I think I found the issue and a way to fix it.

This is the line that throws the warning:
github.com/LinuxCNC/linuxcnc/blob/master...cripts/axis.py#L1850

Both of those checks need to have the tool length offset added to them.

So from:
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]:

But just dividing by 25.4 only works if the machine is in metric and the default LinuxCNC program is loaded. I still need to find the function for proper conversion so I can make a pull request. Maybe have a discussion if that is the right way to do it, but I can't see why not. The preview drawing accounts for TLO so why shouldn't this warning check do.

Anyway, you can try this fix in your own axis python script (you already edited that anyway for loggin, right?), gotta sleep now :P
The following user(s) said Thank You: +Jan+

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

More
4 years 11 months ago - 4 years 11 months ago #227324 by +Jan+
Hello,
first of all, thank you very much for working on my problem. Unfortunately, I have not yet had the time to reproduce your findings on the machine. I should be able to change the Axis file by that time... :-) For me it would be an acceptable workaround to comment out the error message completely, to solve it in a clever way would be great of course. If a real conflict with the machine limits occurs, the software aborts the cycle with further error messages after I click run anyway.

Best regards and thanks again.

Jan
Last edit: 4 years 11 months ago by +Jan+.

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

Time to create page: 0.390 seconds
Powered by Kunena Forum