Calling tool_touch_off.ngc subroutine from another subroutine - Probe Basic

More
07 Nov 2021 14:10 #225557 by gunrak
Hi, 

I would like to call tool_touch_off.ngc subroutine from my remapped M6 subroutine, but I am missing parameters:

#<fast_probe_fr> = #1 (set from probe screen fast probe feed rate)
#<slow_probe_fr> = #2 (set from probe screen slow probe feedrate)
#<z_max_travel> = #3 (max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = #4 (max xy distance the tool travels before erroring out if not contact is made)
#<retract_distance> = #6 (distance the tool retracts after making contact during fast feed mode)
#<spindle_zero_height> = #5 (G53 distance from home to spindle nose triggering point on touch plate)
#<tool_diameter_probe_mode> = #8 (activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = #9 (activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = #10 (current tool's diameter used for offseting probe position in x axis)

Where those parameters are stored? Is there any chance I could access them from subroutine and and use them when I call tool_touch_off.ngc?

Best regards,
Guntars
 

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

More
07 Nov 2021 16:01 - 07 Nov 2021 16:03 #225560 by MoshKopp
I have done it like this, 

[code]#<fast_probe_fr> = 50                 (1: set from probe screen fast probe feed rate)
#<slow_probe_fr> = 10                 (2: set from probe screen slow probe feedrate)
#<z_max_travel> = 28                  (3: max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = 0                  (4: max xy distance the tool travels before erroring out if not contact is made)
#<spindle_zero_height> = 87.1121      (5: G53 distance from home to spindle nose triggering point on touch plate)
#<retract_distance> = 0.5             (6: distance the tool retracts after making contact during fast feed mode)
#7= 0                                 (7: n/a)
#<tool_diameter_probe_mode> = 0       (8: activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = 0      (9: activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = 0                  (10: current tool's diameter used for offseting probe position in x axis)

o<tool_touch_off> call [#<fast_probe_fr>] [#<slow_probe_fr>] [#<z_max_travel>] [#<xy_max_travel>] [#<spindle_zero_height>] [#<retract_distance>] [#<go_back_to_start_pos>] [#<tool_diameter_probe_mode>] [#<tool_diameter_offset_mode>] [#<tool_diameter>]



 
[/code]
Last edit: 07 Nov 2021 16:03 by MoshKopp.

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

More
07 Nov 2021 16:59 #225562 by Lcvette

Hi, 

I would like to call tool_touch_off.ngc subroutine from my remapped M6 subroutine, but I am missing parameters:

#<fast_probe_fr> = #1 (set from probe screen fast probe feed rate)
#<slow_probe_fr> = #2 (set from probe screen slow probe feedrate)
#<z_max_travel> = #3 (max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = #4 (max xy distance the tool travels before erroring out if not contact is made)
#<retract_distance> = #6 (distance the tool retracts after making contact during fast feed mode)
#<spindle_zero_height> = #5 (G53 distance from home to spindle nose triggering point on touch plate)
#<tool_diameter_probe_mode> = #8 (activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = #9 (activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = #10 (current tool's diameter used for offseting probe position in x axis)

Where those parameters are stored? Is there any chance I could access them from subroutine and and use them when I call tool_touch_off.ngc?

Best regards,
Guntars

 

those parameters are set from the offsets page in probe basic.

 
Attachments:

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

More
07 Nov 2021 17:44 - 07 Nov 2021 17:59 #225568 by MoshKopp
Yes, I know, but if you want to use tool_touch_off.ngc outside it didnt work.

o<tool_touch_off> call [#<fast_probe_fr>] [#<slow_probe_fr>] [#<z_max_travel>] [#<xy_max_travel>] [#<spindle_zero_height>] [#<retract_distance>] [#<go_back_to_start_pos>] [#<tool_diameter_probe_mode>] [#<tool_diameter_offset_mode>] [#<tool_diameter>]

runs the tool_touch_off subroutine, and this one will have parameters.

with #1 #2 #4 etc. you will get the error that Parameter missing
with value like I did it works 

How can I use the parameters from Offset page? will have more handling instead of using 2 times parameters
 
Last edit: 07 Nov 2021 17:59 by MoshKopp.

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

More
08 Nov 2021 12:26 - 08 Nov 2021 12:27 #225673 by gunrak

I have done it like this, 

#<fast_probe_fr> = 50                 (1: set from probe screen fast probe feed rate)
#<slow_probe_fr> = 10                 (2: set from probe screen slow probe feedrate)
#<z_max_travel> = 28                  (3: max z distance the tool travels before erroring out if not contact is made)
#<xy_max_travel> = 0                  (4: max xy distance the tool travels before erroring out if not contact is made)
#<spindle_zero_height> = 87.1121      (5: G53 distance from home to spindle nose triggering point on touch plate)
#<retract_distance> = 0.5             (6: distance the tool retracts after making contact during fast feed mode)
#7= 0                                 (7: n/a)
#<tool_diameter_probe_mode> = 0       (8: activates the tool diameter probe subroutine section)
#<tool_diameter_offset_mode> = 0      (9: activates the tool diameter offset position for probe subroutine section)
#<tool_diameter> = 0                  (10: current tool's diameter used for offseting probe position in x axis)

o<tool_touch_off> call [#<fast_probe_fr>] [#<slow_probe_fr>] [#<z_max_travel>] [#<xy_max_travel>] [#<spindle_zero_height>] [#<retract_distance>] [#<go_back_to_start_pos>] [#<tool_diameter_probe_mode>] [#<tool_diameter_offset_mode>] [#<tool_diameter>]
 

 
This is exactly what I implemented few month ago when I initially set up my router. I had run into issue when I updated values in UI and forgot to update them in subroutine and that caused some mess, that is why I am looking for solution where I can avoid to 'hardcode' values in subroutine and I would prefer if I could somehow get them from the place they are stored and then pass them in to call as parameters. Or some other solution if there is any. 
Last edit: 08 Nov 2021 12:27 by gunrak.

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

More
08 Nov 2021 12:41 #225679 by gunrak

those parameters are set from the offsets page in probe basic.

 

[/quote]

That is correct and tool_touch_off.ngc works fine as far as it is called from UI and I guess when it is called from UI parameters are included, but in case if I call tool_touch_off.ngc from subroutine parameters are missing that is the main problem that I have.

Any ideas how I could get parameters from UI that you listed in picture?
The following user(s) said Thank You: zmrdko

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

More
29 May 2024 08:46 #301737 by zmrdko
Related question: Is it possible to somehow pass parameter values for tool touch off from ini file? The idea is that the values are not lost by copying config, etc.

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

More
29 May 2024 11:19 #301743 by Aciera
Not sure if this is what you are looking for but by default you should be able to access values from the ini file in gcode using this format

#<_ini[section]name>
The following user(s) said Thank You: zmrdko

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

More
29 May 2024 11:22 - 29 May 2024 11:24 #301744 by zmrdko
Yes, I am aware of that. But question is more like where to put this expression, so that probe basic gets the value from INI to tool touch off parameters.
Last edit: 29 May 2024 11:24 by zmrdko.

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

More
29 May 2024 15:17 #301751 by spumco
If you look at the tool_touch_off subroutine, the tool touch-off position values appear to be stored as persistent variables in the .var file.

Specifically #5181, #5182, & #5183 (X/Y/Z).

I don't have a linux machine in front of me right now, so I can't open the UI and see exactly how the 'set tool touch off position' button works, but I suspect it just writes the values of the three fields to the appropriate variable numbers without any super-complicated backstage stuff.  It also (probably) reads those values at UI launch.

I'm not sure what the value is of using the INI file to store the location vs. just using the .vars file... but far be it from me to challenge someone wanting a 'peculiar' feature or change; I'm guilty of fiddling with all sorts of stuff like this.

If you want to store & retrieve the values from your INI file, I think you could do it like this:
Edit INI file:
[TOOL_SETTER] (or whatever you want)
TOOL_SETTER_X = 0.000
TOOL_SETTER_Y = 1.234
TOOL_SETTER_Z = 5.678

Edit tool_touch_off.ngc:
...
#<tool_touch_x_coords> = #<ini[TOOL_SETTER]TOOL_SETTER_X
#<tool_touch_y_coords> = #<ini[TOOL_SETTER]TOOL_SETTER_Y
#<tool_touch_z_coords> = #<ini[TOOL_SETTER]TOOL_SETTER_Z
...

I think that should work, but please be careful to test at really low speeds.  Note that this 'hack' has nothing to do with the on-screen tool touch-off locations which are managed through the GUI.  You can still enter the location on-screen, but you've essentially hijacked the tool setter subroutine so it ignores the on-screen values (which are still stored are variables).

Further, if you update Probe Basic your 'hack' is likely to get overwritten and will need to be re-done.  The subroutine will need to be edited again, and if you've made any changes to the UI those will also need to be re-added to the updated version.

Possibly you could create a new 'touch off location' display field and stick it in a new user tab - those shouldn't get over-written if you update PB.

I did something similar for my ATC sequence by using INI values for the Z-movement locations and speeds rather than the values hard-coded in the tool change subroutines.
The following user(s) said Thank You: zmrdko

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

Moderators: KCJLcvette
Time to create page: 0.121 seconds
Powered by Kunena Forum