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

More
4 years 11 months ago #226805 by +Jan+
I have now added an If query at the beginning of the tool length measurement as it is implemented for example at Gmoccapy:
Code:
o<messen_eng> sub o100 if [#<_task> EQ 0] (debug, Task is zero) o100     return [999] o100 endif M64P10 #1700=1200            (Tool change X position) #1701=0        (Tool change Y position) #1702=-1        (Tool change Z position) #1800=-100        (position sicheres Z) #1801=1279.125         (position probe X) #1802=2498        (position probe Y) #1900=#<_coord_system>    (Store coordinate system only G54 till G59) o500 if [#<_current_tool> EQ #<_selected_tool>] ;(debug, Tool already in spindle) o500 else  M5 G54 G90 G0      G53 Z#1702            (Go to tool change Z position) G53 X#1700 Y#1701        (Go to tool change XY position) M6 T#<_selected_tool> #4999=#5400 G43.1 Z0            (TLO reset) G53 X#1801 Y#1802       (Go to probe position) G53 Z#1800            (Go to save Z position) G91 G38.2 Z-197.5  F850        (probing fast) G1    Z2.0  F150        (go up a bit)     G38.2 Z-2.25  F25         (probing slow) #2000=[#5063+#5223]     (Switching point+zero Offset) #2001=[#2000-#2002+#2003](new - diff + old)   #2002=[#2000]           (Save old switch point) #2003=[#2001]            (Save old offset)      G1 Z5.0 F500            (go up away from sensor) G90 G0 G43.1 Z#2001            (TLO set) G53 Z#1800         (Go to save Z position) G53 Z#1702            (Go to tool change Z position) #1803=1            (State tool already measured) ;(debug, Differenz ist: #2001) (Restore old zero (only G54 to G59)     o200 if[#1900 EQ 540] G54 o200 endif o201 if[#1900 EQ 550] G55 o201 endif o202 if[#1900 EQ 560] G56 o202 endif o203 if[#1900 EQ 570] G57 o203 endif o204 if[#1900 EQ 580] G58 o204 endif o500 endif M65P10 o<messen_eng> endsub M2

Is this implemented correctly?
Unfortunately the problem persists and I don't get a debug message when refreshing the preview.

Best wishes

Jan

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

More
4 years 11 months ago #226809 by andypugh
I think that the o100 in front of the return is wrong.

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

More
4 years 11 months ago #226822 by JohnnyCNC
Last year I did a remap based on the same one you based yours on.  I used the the QTDragon GUI, 3DProbe, eBay tool setter, and TTS tooling. My remap handles both fixed length tools and variable length tools.  Variable length tools get automatically measured right after the tool change and fixed length tool use the length listed in the tool table.  I remember getting that error while working through my remap but I don't recall the exact cause.  You may find some clues by looking at my remap.  You can find it  posted here

John

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

More
4 years 11 months ago - 4 years 11 months ago #226853 by d2inventory
Code:
o100 if [#<_task> EQ 0] (debug, Task is zero) o<messen_eng> return o100 endif


this is how you exit the subroutine.

btw, can you reproduce your error in a SIM config? I wasn't able to.

I managed to reproduce it and the above if clause fixed the issue as andy suggested.

Also if you're using a button type of touch probe you should debounce it, mine bounces for a few milliseconds so I used a 5ms debounce.

linuxcnc.org/docs/html/hal/rtcomps.html#_debounce
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 #226930 by +Jan+
 
Hello to the round,
thank you very much for the hints. I have now set up the macro as follows:
Code:
o<messen_eng> sub o100 if [#<_task> EQ 0] (msg, Task is zero) o<messen_eng> return o100 endif M64P10 #1700=1200            (Tool change X position) #1701=0        (Tool change Y position) #1702=-1        (Tool change Z position) #1800=-100        (position sicheres Z) #1801=1279.125         (position probe X) #1802=2498        (position probe Y) #1900=#<_coord_system>    (Store coordinate system only G54 till G59) o500 if [#<_current_tool> EQ #<_selected_tool>] ;(debug, Tool already in spindle) o500 else  M5 G54 G90 G0      G53 Z#1702            (Go to tool change Z position) G53 X#1700 Y#1701        (Go to tool change XY position) M6 T#<_selected_tool> #4999=#5400 G43.1 Z0            (TLO reset) G53 X#1801 Y#1802       (Go to probe position) G53 Z#1800            (Go to save Z position) G91 G38.2 Z-197.5  F850        (probing fast) G1    Z2.0  F150        (go up a bit)     G38.2 Z-2.25  F25         (probing slow) #2000=[#5063+#5223]     (Switching point+zero Offset) #2001=[#2000-#2002+#2003](new - diff + old)   #2002=[#2000]           (Save old switch point) #2003=[#2001]            (Save old offset)      G1 Z5.0 F500            (go up away from sensor) G90 G0 G43.1 Z#2001            (TLO set) G53 Z#1800         (Go to save Z position) G53 Z#1702            (Go to tool change Z position) #1803=1            (State tool already measured) (debug, Differenz ist: #2001) (Restore old zero - only G54 to G59)     o200 if[#1900 EQ 540] G54 o200 endif o201 if[#1900 EQ 550] G55 o201 endif o202 if[#1900 EQ 560] G56 o202 endif o203 if[#1900 EQ 570] G57 o203 endif o204 if[#1900 EQ 580] G58 o204 endif o500 endif M65P10 o<messen_eng> endsub M2

Unfortunately the preview still doesn't work like this, although the If loop works (if I include a syntax error in the code below the If loop Linuxcnc doesn't complain).

I just tried the following for debugging:

- I measured the tool via the MDI: M6 T9
- Up to this point, no error is displayed in the preview.
- If I now set the Z zero point again (somewhere in the machine workspace) the error is displayed.
- If I now delete Z0 in the MDI via G43.1 Z0 and set the Z Origin somwhere in the workspace the error disappears.
- Even if I set the offset to G43.1 Z100 as a test, the error disappears after setting the Z zero point again. 
- Also a reduction of the remapping code as follows:

o<measure_eng> sub
o<measure_eng> endsub
M2

Does not have an affect on the error message.

To make this a bit more understandable I made a short screencast video to the above.



(watch on 720p, otherwise you wont be able to see it clear)

The problem is as far as I understand the value of the determined G43.1 offset. This is about -247 mm for the cutter used in the video.  Does anyone have an explanation for this?

Best regards

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 #226964 by nkp
By the way in version 2.7 it was not possible to reproduce the error.

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

Time to create page: 0.267 seconds
Powered by Kunena Forum