Cutter diameter compensation being erroneously enabled

More
16 Oct 2021 15:31 #223302 by funkenjaeger
I have M6 remapped to an NGC script that handles automatic tool changing and touches off on a tool setter after each change, to set the tool length offset.  That all works fine when I command a tool change via MDI (e.g. T1 M6).For some reason which continues to elude me, it errors out when the tool change is commanded from within a G-code file, and the error doesn't make any sense:
ERROR: Cannot set auxiliary digital output with cutter radius compensation on
This is perplexing because I don't use cutter radius compensation, and nowhere in my code do I ever use a G41 or G42, and yet when this error occurs, the modal codes in the GUI show that - sure enough - G42 shows as active.  Using debug messages, I narrowed it down as best I could - the relevant section of code is this:
G43																			(Enable tool length compensation)
		
		(Measure tool to get offset)
		G53 G0 X#<_ini[TOOLSENSOR]X_LOC> Y#<_ini[TOOLSENSOR]Y_LOC>					(Move to tool setter postion)
		G53 G0 Z#<_ini[TOOLSENSOR]Z_PROBE_START>									(Move Z  to safe height above tool setter to start probe)
		;S500 M4																		(Run spindle in reverse at minimum speed)
		M64 P2																		(Turn on optical sensor)
		(debug,Probing optical, ccomp: #<_ccomp>)
		G38.3 G90 Z#<_ini[TOOLSENSOR]Z_PROBE_END> F#<_ini[TOOLSENSOR]SEARCH_VEL>	(Probe move to optical sensor)
		M65 P2																		(Turn off optical sensor)
		M66 P6 L4 Q0.5																(Wait for optical input to go inactive)
		(debug,Probing coarse, ccomp: #<_ccomp>)
		G38.2 G90 Z#<_ini[TOOLSENSOR]Z_PROBE_END> F#<_ini[TOOLSENSOR]COARSE_VEL>	(Measure coarse)
		(debug,Backing off, ccomp: #<_ccomp>)
		;G38.5 G91 Z#<_ini[TOOLSENSOR]Z_BACKOFF> F#<_ini[TOOLSENSOR]COARSE_VEL>		(Back off until probe breaks contact)
		G0 G91 Z#<_ini[TOOLSENSOR]Z_BACKOFF>										(Back off safe distance)
		(debug,Probing fine, ccomp: #<_ccomp>)
		G38.2 G91 Z[-2*#<_ini[TOOLSENSOR]Z_BACKOFF>] F#<_ini[TOOLSENSOR]FINE_VEL>	(Measure fine)
		(debug,Measured fine, probe result #5070)
		#<new_tlo> = #5063
		(debug,Backing off, ccomp: #<_ccomp>)
		G0 G91 Z#<_ini[TOOLSENSOR]Z_BACKOFF>										(Back off safe distance)
		;G38.5 G91 Z#<_ini[TOOLSENSOR]Z_BACKOFF> F#<_ini[TOOLSENSOR]COARSE_VEL>		(Back off until probe breaks contact)
		(debug,Setting TLO, ccomp: #<_ccomp>)
		G43.1 Z#<new_tlo>															(Set TLO)
		
		;G1 Z#<_ini[TOOLSENSOR]Z_BACKOFF> F#<_ini[TOOLSENSOR]SEARCH_VEL>				(Back off safe distance)
		(debug,Turning off spindle, ccomp: #<_ccomp>)
		M5																			(Stop spindle)
		G53 G90 G0 Z#<_ini[TOOLSENSOR]Z_SAFE>										(Z up to safe position)

And the resulting log messages when a tool change is commanded from within a G-code file:
Sat16 10:45 Started program from line 1
Sat16 10:46 Tool 5: Tool 5 
Sat16 10:46 Probing optical, ccomp: 400.000000
Sat16 10:46 Probing coarse, ccomp: 400.000000
Sat16 10:46 Backing off, ccomp: 400.000000
Sat16 10:46 Probing fine, ccomp: 400.000000
Sat16 10:46 Cannot set auxiliary digital output with cutter radius compensation on

This seems to indicate that cutter compensation is in fact disabled (#<_ccomp>=400 means G40) at all points prior to when this fails. It appears to be failing on the third G38.x move. It's as though for some reason when it executes that line, G42 is being set behind the scenes for some reason.
I also don't understand what an 'auxiliary digital output' has to do with it - I do some M64/M65 earlier in the sequence, but that's not in the vicinity of the G38.2 line where it's failing. I also don't understand why setting an auxiliary digital output would depend on the state of cutter compensation anyway.

So in summary, I'm really perplexed by this. This is the second bizarre issue I've encountered recently and it's starting to make me think that there's something fundamentally broken in my LinuxCNC install that could cause these inexplicable issues. I'm running 2.8.2 installed from ISO, and I haven't really made any "backend" changes to LinuxCNC so it's pretty much the vanilla stable release.

Any thoughts/ideas would be appreciated!

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

More
16 Oct 2021 15:34 #223303 by funkenjaeger
Sorry the g-code is tough to read, here's another try on the formatting:
G43    (Enable tool length compensation)

(Measure tool to get offset)
G53 G0 X#<_ini[TOOLSENSOR]X_LOC> Y#<_ini[TOOLSENSOR]Y_LOC>    (Move to tool setter postion)
G53 G0 Z#<_ini[TOOLSENSOR]Z_PROBE_START>    (Move Z  to safe height above tool setter to start probe)
;S500 M4    (Run spindle in reverse at minimum speed)
M64 P2    (Turn on optical sensor)
(debug,Probing optical, ccomp: #<_ccomp>)
G38.3 G90 Z#<_ini[TOOLSENSOR]Z_PROBE_END> F#<_ini[TOOLSENSOR]SEARCH_VEL>    (Probe move to optical sensor)
M65 P2    (Turn off optical sensor)
M66 P6 L4 Q0.5    (Wait for optical input to go inactive)
(debug,Probing coarse, ccomp: #<_ccomp>)
G38.2 G90 Z#<_ini[TOOLSENSOR]Z_PROBE_END> F#<_ini[TOOLSENSOR]COARSE_VEL>    (Measure coarse)
(debug,Backing off, ccomp: #<_ccomp>)
;G38.5 G91 Z#<_ini[TOOLSENSOR]Z_BACKOFF> F#<_ini[TOOLSENSOR]COARSE_VEL>        (Back off until probe breaks contact)
G0 G91 Z#<_ini[TOOLSENSOR]Z_BACKOFF>    (Back off safe distance)
(debug,Probing fine, ccomp: #<_ccomp>)
G38.2 G91 Z[-2*#<_ini[TOOLSENSOR]Z_BACKOFF>] F#<_ini[TOOLSENSOR]FINE_VEL>    (Measure fine)
(debug,Measured fine, probe result #5070)
#<new_tlo> = #5063
(debug,Backing off, ccomp: #<_ccomp>)
G0 G91 Z#<_ini[TOOLSENSOR]Z_BACKOFF>    (Back off safe distance)
;G38.5 G91 Z#<_ini[TOOLSENSOR]Z_BACKOFF> F#<_ini[TOOLSENSOR]COARSE_VEL>    (Back off until probe breaks contact)
(debug,Setting TLO, ccomp: #<_ccomp>)
G43.1 Z#<new_tlo>    (Set TLO)

;G1 Z#<_ini[TOOLSENSOR]Z_BACKOFF> F#<_ini[TOOLSENSOR]SEARCH_VEL>                (Back off safe distance)
(debug,Turning off spindle, ccomp: #<_ccomp>)
M5    (Stop spindle)
G53 G90 G0 Z#<_ini[TOOLSENSOR]Z_SAFE>    (Z up to safe position)

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

More
17 Oct 2021 23:51 #223427 by funkenjaeger
I was overdue for a fresh start anyway, so I went ahead and started over with MX linux and LinuxCNC 2.9.0-pre from buildbot (versus 2.8.2 on debian from official ISO previously).

I'm still experiencing the same issue - so I'm well and truly stumped.

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

More
21 Oct 2021 00:19 - 21 Oct 2021 00:19 #223722 by funkenjaeger
Postmortem (of sorts), for posterity:
With the help of @cGFudHMh and @grandixximo on discord, I finally got past this.  Apparently it was erroring on line 14 of the NGC file, but then proceeding to execute all the way down beyond line 110 (through numerous regular moves and G38.x probe cycles) before actually stopping and indicating an error.  The reason it errored on line 14 (an M64) was because somehow G42 was active when it reached that point, even though that's not something I set anywhere in any of my routines, gcode files, etc.  Inserting a G40 prior to that line got everything working again.

Still no idea what the actual root cause was, or why it executed over 100 more lines of code (over many seconds and a lot of movement) after encountering an error, but at least I'm up and running again for the time being.

Full M6 remap NGC file attached for reference.
Attachments:
Last edit: 21 Oct 2021 00:19 by funkenjaeger.

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

More
24 Oct 2021 22:45 #224136 by andypugh
This is, as you say, weird.

If you can pare it down to a minimal example which shows the problem then it might be worth adding it to the issues list. But it needs to be in a form that a developer which does not have your machine can investigate it with. Can you see the same problem with your G-code and the sim/axis/gladevcp/probe demo config?

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

More
24 Oct 2021 23:24 #224144 by funkenjaeger
I'll have to play around some more to see if I can distill it down to a minimal, machine-independent test case.
 

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

Time to create page: 0.068 seconds
Powered by Kunena Forum