M6 remap with tool_touch_off.ngc causing gcode parser to fail

  • zmrdko
  • zmrdko's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
21 Oct 2024 13:55 - 21 Oct 2024 23:14 #312749 by zmrdko
i am using remapped m6, where I call tool_touch_off.ngc after each tool change
this is causing error:
[code][qtpyvcp.plugins.gcode_properties][DEBUG] P value out of range with G10 L1 (gcode_properties.py:681)

https://github.com/kcjengr/probe_basic/blob/main/configs/probe_basic/subroutines/tool_touch_off.ngc#L93
https://github.com/kcjengr/qtpyvcp/blob/main/src/qtpyvcp/plugins/gcode_properties.py#L677

from the tests I did, the issue is with having parameter #5400 there
So something is unable to translate parameter number into actual parameter and hence throwing error code with P value out of range with G10 L1

Question is, if I did something wrong - like placing tool_touch_off.ngc all into M6 remap call
or is there a bug with interpreting parameter number in call:

[code][code]result, seq = gcode.parse(self.loaded_file, self.canon, unitcode, initcode)
[/code][/code][/code]
Last edit: 21 Oct 2024 23:14 by zmrdko.

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

More
21 Oct 2024 14:19 - 21 Oct 2024 14:21 #312751 by Aciera

i am using remapped m6
 

Could you post your remap?

[edit]
I presume you are getting this when loading the gcode.
Last edit: 21 Oct 2024 14:21 by Aciera.

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

  • zmrdko
  • zmrdko's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
21 Oct 2024 15:30 #312760 by zmrdko
here is the remap:
O<m6remap> sub
;(debug, change: current_tool=#<_current_tool>)
;(debug, change: selected_tool=#<_selected_tool>)

;o100 if [EXISTS[#<_ini[tool_change]xpos>]]
;  (debug, [tool_change]xpos exists: #<_ini[tool_change]xpos>)
;o100 else
;  (debug, [tool_change]xpos does not exist)
;o100 endif

;o110 if [EXISTS[#<_ini[tool_change]ypos>]]
;  (debug, [tool_change]ypos exists: #<_ini[tool_change]ypos>)
;o110 else
;  (debug, [tool_change]ypos does not exist)
;o110 endif

M73

#<tmp_current_tool> = #<_current_tool>
#<tmp_selected_tool> = #<_selected_tool>
#<init_x> = #<_x>
#<init_y> = #<_y>
#<init_z> = #<_z>

(only do toolchange if the current tool is different from selected tool)
o100 if [#<tmp_current_tool> NE #<tmp_selected_tool>]

  (go to tool change position defined in ini, via safe Z0)
  G90
  G0 G53 Z#5163
  G0 G53 X#<_ini[tool_change]xpos> Y#<_ini[tool_change]ypos>

o100 endif

M6 (use built in M6 behavior)

(tool touchoff after M6 tool change)
o110 if [#<tmp_current_tool> NE #<tmp_selected_tool>]
  o<tool_touch_off> call
o110 endif

(go to initial XY position via safe Z0 then go initial Z0 position)
G90
G0 G53 Z#5163
G0 X#<init_x> Y#<init_y>

O<m6remap> endsub [1]
m2

github.com/zmrdko/probe_basic/blob/4671e...routines/m6remap.ngc

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

  • zmrdko
  • zmrdko's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
21 Oct 2024 15:32 #312762 by zmrdko

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

More
21 Oct 2024 15:44 - 21 Oct 2024 17:39 #312764 by Aciera
Have you tried inserting a debug statement in your 'tool_touch_off.ngc' to see what the value of '#5400' actually is when that G10 L1 .. line is called?

For example:

#<new_tool_length_offset> = [ABS[#<spindle_zero_height> + #5063 - #<offset_z>]]
(debug, Current Tool Number : #5400)
G10 L1 P #5400 Z [#<new_tool_length_offset>] (5400 = tool number)

[edit]

You may need to add an if case so as not to run parts of your remap if not in task mode (ie block it from being run on load)

something like:
o100 if [[#<_task> EQ 1]
....
o100 end if
Last edit: 21 Oct 2024 17:39 by Aciera.
The following user(s) said Thank You: zmrdko

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

  • zmrdko
  • zmrdko's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
21 Oct 2024 23:13 #312805 by zmrdko
Thank you, it worked!!
The following user(s) said Thank You: Lcvette

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

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