Tool Length Probe - SUBROUTINE_PATH

More
29 May 2022 21:16 #244152 by re_relentlessly
Tool Length Probe - SUBROUTINE_PATH was created by re_relentlessly
Hello,
M6 Tool Change Remapping with Tool Length Measurement - LinuxCNC
I am trying to setup automatic tool length probing during tool change, and am using the above thread as the basis for it.
It downloaded the linked files and put them in a directory relative to the ~/linuxcnc path.
~/linuxcnc/configs/probing/
I ensured (based on googling) that the files are executable
chmod +x *.ngc
But something seems to be off with my:
SUBROUTINE_PATH 
because every time i try to execute the M400 P2 R40, as per the linked thread, linuxcnc just complains "Mcode greater than m199"
It there any way to verify if the custom directory and files are loaded?

I am using
linuxcnc 2.8.2
Axis gui
running on a raspberry pi 4
7i76e mesa card
[RS274NGC]
	# M6 remap for probe
	# change/add/use SUBROUTINE_PATH to point to the location where these tool-change subroutines are located:
	# abs path is for "tested" functions, macros is gmoccapy stuff
SUBROUTINE_PATH = /home/pi/linuxcnc/configs/probing
REMAP=M6 modalgroup=6 ngc=tool-change-indymill
	#<feature mask> enable #<_ini[section]name> read only variables: 4
	#<feature mask> enable #<_hal[Hal item]> read only variables: 8
FEATURES = 12
ON_ABORT_COMMAND=O <on_abort> call
	# Tool probe setup and calibration
	# M401 raw probe - use with care
REMAP=M401 modalgroup=10 ngc=probe-indymill
	# Normal probe with P = 0; other words set config or calibrate
	# P = mode, IJK are XYZ probe coords, Q is current tool, DE are feeds, R is calibration tool length
REMAP=M400 modalgroup=10 argspec=Pijkqrde ngc=probe-calib-indymill
 

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

More
31 May 2022 13:13 #244284 by andypugh
Replied by andypugh on topic Tool Length Probe - SUBROUTINE_PATH
You have changed the names of the files, for example to "probe-calib-indymill" but have you changed the name of the subroutine inside each file to match?

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

More
31 May 2022 20:19 #244312 by re_relentlessly
Replied by re_relentlessly on topic Tool Length Probe - SUBROUTINE_PATH
I did change the name inside the files, but perhaps I did it incorrectly, I have attached all three files.


 
Attachments:

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

More
01 Jun 2022 00:30 #244328 by andypugh
Replied by andypugh on topic Tool Length Probe - SUBROUTINE_PATH
That all looks OK, or if there is something wrong there I haven't spotted it.

SUBROUTINE_PATH = /home/pi/linuxcnc/configs/probing

Is definitely correct?

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

More
01 Jun 2022 01:00 #244332 by re_relentlessly
Replied by re_relentlessly on topic Tool Length Probe - SUBROUTINE_PATH
Attached a screen capture, looks right to me
user@cnc:~/linuxcnc/configs/probing $ pwd
/home/pi/linuxcnc/configs/probing
user@cnc:~/linuxcnc/configs/probing $ ls
probe-calib-indymill.ngc  probe-indymill.ngc  tool-change-indymill.ngc
Do the custom subroutine files need to be relative to the ini in some special way (only in directories below, only in same directory)?
Is it possible that one simply cannot have custom M codes above 199? I though it was possible.
Am I missing some component that needs to be loaded?

Hal snippet below showing what modules that are being loaded
# Generated by PNCconf at Thu Feb 24 16:47:42 2022
# Using LinuxCNC version:  2.8
# If you make changes to this file, they will be
# overwritten when you run PNCconf again

loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hostmot2
loadrt hm2_eth board_ip="10.10.10.2" config=" num_encoders=1 num_pwmgens=0 num_stepgens=4 sserial_port_0=10xxxx" 
setp    hm2_7i76e.0.watchdog.timeout_ns 5000000
loadrt pid names=pid.x,pid.y,pid.y2,pid.z,pid.s
loadrt abs names=abs.spindle
loadrt lowpass names=lowpass.spindle
loadrt filter_kalman names=kalman.spindle
# toggle 
loadrt toggle count=1
loadrt toggle2nist count=1
# add / or
loadrt and2 count=2
addf and2.0 servo-thread
addf and2.1 servo-thread

addf hm2_7i76e.0.read          servo-thread
addf motion-command-handler   servo-thread
addf motion-controller        servo-thread
addf pid.x.do-pid-calcs       servo-thread
addf pid.y.do-pid-calcs       servo-thread
addf pid.y2.do-pid-calcs       servo-thread
addf pid.z.do-pid-calcs       servo-thread
addf pid.s.do-pid-calcs       servo-thread
addf abs.spindle              servo-thread
addf lowpass.spindle          servo-thread
addf kalman.spindle			  servo-thread
addf toggle.0                 servo-thread
addf toggle2nist.0            servo-thread
addf hm2_7i76e.0.write         servo-thread
setp hm2_7i76e.0.dpll.01.timer-us -50
setp hm2_7i76e.0.stepgen.timer-number 1
Attachments:

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

More
02 Jun 2022 09:47 #244433 by andypugh
Replied by andypugh on topic Tool Length Probe - SUBROUTINE_PATH
Custom M-codes run rom 100 to 199. But this isn't a custom M-code in the original sense, this is an M-code remap and the docs specifically say that you can remap the region you are using.

Perhaps there is another conlicting SUBROUTINE_PATH somewhere?
Consider adding the path to your M-codes to the PROGRAM_PREFIX too?

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

More
03 Jun 2022 00:41 #244479 by re_relentlessly
Replied by re_relentlessly on topic Tool Length Probe - SUBROUTINE_PATH
I managed to figure out the problem. With your help (thank you Andypugh) I figured out that i had 2  "[RS274NGC]" sections in the ini, consolidating them fixed the loading issue.

I have fiddled with the scripts a bit, but they are throwing errors, some I managed to fix, by defining various variables, but some I still don't understand.

the current one I am trying to fix is
o151 if [EXISTS[#<_hal[gmoccapy.searchvel]> NE 0]
        ( feed rate for touching switch/touch-off plate first time )
        #<_ProbeFeed1> = #<_hal[gmoccapy.searchvel]>
    0151 else 
        #<_ProbeFeed1> = #<_ini[toolsensor]Z_FEEDRATE1>
    0151 endif
    o161 if [EXISTS[#<_hal[gmoccapy.probevel]>] NE 0]
        ( feed rate for touching switch/touch-off plate second time )
        #<_ProbeFeed2> = #<_hal[gmoccapy.probevel]>
    0161 else 
        #<_ProbeFeed2> = #<_ini[toolsensor]Z_FEEDRATE2>
    0161 endif
It keeps throwing an error about _hal[gmoccapy.searchvel, but I don't have gmoccapy enabled, and the code isnt clear enough to me for me to figure out how to or what variable to set to have it not use that value

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

More
04 Jun 2022 01:34 #244552 by re_relentlessly
Replied by re_relentlessly on topic Tool Length Probe - SUBROUTINE_PATH
more progress has been made, had to adjust 2 or three lines in the script
probe-calib-indymill.ngc
line 135-136, move the comment on 136 to 135
line 141-142, move the comment on line 142 to 141

looks like this after the changes
o133 if [EXISTS[#<_ProbeFeed1>] EQ 0]
        ( use the gmoccapy preferences file if gmoccapy is in use)
        (#<_ProbeFeed1> = #<_hal[gmoccapy.searchvel]>)
        #<_ProbeFeed1> = #<_ini[toolsensor]Z_FEEDRATE1>
    o133 endif

    o134 if [EXISTS[#<_ProbeFeed2>] EQ 0]
        ( use the gmoccapy preferences file if gmoccapy is in use)
        (#<_ProbeFeed2> = #<_hal[gmoccapy.probevel]>)
        #<_ProbeFeed2> = #<_ini[toolsensor]Z_FEEDRATE2>
    o134 endif

I also had to tweak the custom ini settings
[TLM]
TRAVEL_HEIGHT = -8
TRAVEL_FEEDRATE = 200
[TOOLSENSOR]
X = 10
Y = 5
Z = -90
Z_SEARCH = -1
TRIES_RETRACT = 3
Z_FEEDRATE_RAPID = 300
TRIES_NUMBER = 2
TRIES_TOLERANCE = 0.1
Z_FEEDRATE1 = 150
Z_FEEDRATE2 = 75

Still not sure I have them all quite right, since I am still having 2 remaining issues.
1. tool probing errors out with warning about linear move exceeding z axis limit
2. EOF error related to O <on_abort> call

more debugging is in my future

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

Time to create page: 0.069 seconds
Powered by Kunena Forum