Toolsetter always works before running spindle, error sometimes after running it

More
09 May 2022 08:11 - 09 May 2022 08:13 #242363 by SvenH
Guys, I have a problem with my toolsetter that puzzles myself and the guy that did its configuration.
We did some troubleshooting a while back but could not find what was going on. I'll try to be as complete as I can in providing info.

If you have any thought on what is going on, please share so we can include it in our next trouble shooting session.


I have this type of toolsetter:
www.ebay.com/itm/384063494901?hash=item5...5:g:qp0AAOSwL9xgXYjh

If I use it immediately after starting up the machine and linuxcnc, it always works.
If I use it after running a program or even after spindle warm up, it often stops within the gcode that runs the toolsetter, at the point where the tool tip starts the slow approach of the toolsetter. I think this is 50 mm above the toolsetter platform.
There is no error message, it just stops, the "run button/arrow to the right" greyed out ie the program is still running.

I can stop it but if I try and continue from there my tool length is percieved as incorrect resulting in error messages.
I then have to restart linuxcnc and home the machine again.
After this I can always use the toolsetter.

For a while I tried tapping the toolsetter to jerk the switches which seemed to work some but not all of the times.
Lately, tapping never worked.

During install, the guy that did the configuration said that this tool setter was extremely accurate  with if I recall the difference in switching being pushed and releasing below 0.05 mm.
Could this accuracy result in not switching the toolsetter to "fully up" ending up with the program in a loop/something it can't solve?
However, I think this is unlikely as I can always use the toolsetter immediately after restarting linuxcnc.

We did try if we could open up the toolsetter and see if there is anything wrong, but it could not be opened.
Maybe we should just change out the toolsetter, they have halved in price now...
Do any of you have any experience like this?
Last edit: 09 May 2022 08:13 by SvenH.

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

More
09 May 2022 09:01 #242364 by andypugh
So, the sequence fails before the tool contacts the toolsetter? Does the slow probe move actually start?

Can you attach the G-code that runs the tool setting sequence?

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

More
09 May 2022 13:48 #242376 by SvenH
It looks like the slow probe move does indeed not start, it stays at what looks like 50 mm above the surface.
I tried to find the 50 mm in the code below but could not find it.

How the probe code is used is a bit of a mystery to me, if you need more of the config, I'll gladly provide.
o<toolchange> sub
;(debug, in change tool_in_spindle=#<tool_in_spindle> current_pocket=#<current_pocket>)
;(debug, selected_tool=#<selected_tool> selected_pocket=#<selected_pocket>)

;otherwise after the M6 this information is gone!
#<tool> = #<selected_tool>
#<pocket> = #<selected_pocket>
#<CurrX>=#5420
#<CurrY>=#5421
#<CurrZ>=#5422

; we must execute this only in the milltask interpreter
; or preview will break, so test for '#<_task>' which is 1 for
; the milltask interpreter and 0 in the UI's
o<chktask> if [#<_task> EQ 0]
o<chktask>     return [999]
o<chktask> endif

; Check if the requested tool number is 5000 or above. If it is, do not execute the measurement moves
o<chktoolnum> if [[#<tool> GE 4999.9] OR [#<tool> LT 0.5]]
        M6
        G43 H[ROUND[#<tool>]]
        G0 X[#<CurrX>] Y[#<CurrY>]
        o<change> return [1]
o<chktoolnum> endif
; Save state
M70
G90
;first go up
G53 G0 Z[#<_ini[AXIS_2]MAX_LIMIT>-0.1]

; then move to change position
; BvH: disabled on Sven request
;G53 G0 X[#<_ini[CHANGE_POSITION]X>-0.1] Y[#<_ini[CHANGE_POSITION]Y>-0.1]
;G53 G0 Z[#<_ini[CHANGE_POSITION]Z>-0.1]

; cancel tool offset
G49

; using the code being remapped here means 'use builtin behaviour'.
; In the manual change case, this displays the 'insert 6mm 2-flute endmill' dialog box.
M6

; run a few checks
o<svchk> if [#<_ini[TOOLSENSOR]SEARCHVEL> LE 0]
      M72
      o<change> return [-1] ; indicate searchvel <= 0
o<svchk> endif
o<pvchk> if [#<_ini[TOOLSENSOR]PROBEVEL> LE 0]
      M72
      o<change> return [-2] ; indicate probevel <= 0
o<pvchk> endif

G53 G0 X[#<_ini[TOOLSENSOR]X>] Y[#<_ini[TOOLSENSOR]Y>]
; load compensation parameters
G43 H[ROUND[#<tool>]]
#<toollen> = #5403
;(DEBUG, length from tooltable: #<toollen>)
G49

; Tool length shorter than 10mm is probably an error in the tooltable; the collet nut is already higher
; Adjust working set of variables to accomodate this situation
#<maxprobe> = #<_ini[TOOLSENSOR]MAXPROBE>
o<toollenchk> if [#<toollen> LT 10]
          #<Zstart> = #<_ini[AXIS_2]MAX_LIMIT>
        #<maxprobe> = [[#<_ini[AXIS_2]MAX_LIMIT> - #<_ini[TOOLSENSOR]ZABS_DNMOVE>]*-1.0]
o<toollenchk> else
         #<Zstart> = [#<toollen> + #<_ini[TOOLSENSOR]ZABS_DNMOVE> - #<maxprobe>]
        #<maxprobe> = [#<maxprobe>-[#<toollen>*0.7]]
o<toollenchk> endif
; Adjust extra probe safety distance if we run out of Z travel, then move Z down
o<lenadjust> if [#<Zstart> GT #<_ini[AXIS_2]MAX_LIMIT>]
  #<Zstart> = [#<_ini[AXIS_2]MAX_LIMIT>-0.2]
o<lenadjust> endif
;(DEBUG, Zstart after adjustment: #<Zstart>)
G53 G0 Z[#<Zstart>]

; Probe the toolsensor
F[#<_ini[TOOLSENSOR]SEARCHVEL>]
G91
;M62 P1 (toolsetter on)
G1 Z-1
G38.2 Z[#<maxprobe>] (probe in Z- direction until switch is activated)
o<probefail1> if [#5070 EQ 0]
          (DEBUG, Probing in Z- failed)
          ;M63 P1 (toolsetter off)
          M72
          o<change> return [-3] ; indicate probe contact failure to epilog
o<probefail1> endif
F[#<_ini[TOOLSENSOR]PROBEVEL>]
G38.4 Z2 (probe in Z+ direction for loss of contact)
o<probefail2> if [#5070 EQ 0]
          (DEBUG, Probing in Z+ failed)
          ;M63 P1 (toolsetter off)
          M72
          o<change> return [-3] ; indicate probe contact failure to epilog
o<probefail2> endif
;M63 P1 (toolsetter off)

G90
G53 G0 Z[#<_ini[AXIS_2]MAX_LIMIT>-0.2]

; Calculate toollen
#<toollen> = [#5063 + #[5203+20*#5220] - #<_ini[TOOLSENSOR]ZABS_UPMOVE>]
;(DEBUG, #<toollen>)

; Store new length in tooltable and activate length compensation
M72
G10 L1 P#<tool> Z[#<toollen>]
G43 H[ROUND[#<tool>]]
; move back to XY location before tool change
;(DEBUG, #<CurrX> #<CurrY> #<CurrZ>)
G0 X[#<CurrX>] Y[#<CurrY>]

o<toolchange> endsub [1]
M2

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

More
09 May 2022 23:24 #242424 by andypugh
I don't think this is the problem, but it is slightly wrong:
o<chktask> if [#<_task> EQ 0]
o<chktask>     return [999]
o<chktask> endif

Should be
o<chktask> if [#<_task> EQ 0]
    return [999]
o<chktask> endif

This looks wrong too:
o<chktoolnum> if [[#<tool> GE 4999.9] OR [#<tool> LT 0.5]]
        M6
        G43 H[ROUND[#<tool>]]
        G0 X[#<CurrX>] Y[#<CurrY>]
        o<change> return [1]
o<chktoolnum> endif

The subroutine is called o<toolchange> not o<change>
o<chktoolnum> if [[#<tool> GE 4999.9] OR [#<tool> LT 0.5]]
        M6
        G43 H[ROUND[#<tool>]]
        G0 X[#<CurrX>] Y[#<CurrY>]
        o<toolchange> return [1]
o<chktoolnum> endif


And the same subroutine return error here too:
G38.2 Z[#<maxprobe>] (probe in Z- direction until switch is activated)
o<probefail1> if [#5070 EQ 0]
          (DEBUG, Probing in Z- failed)
          ;M63 P1 (toolsetter off)
          M72
          o<change> return [-3] ; indicate probe contact failure to epilog
o<probefail1> endif
F[#<_ini[TOOLSENSOR]PROBEVEL>]
G38.4 Z2 (probe in Z+ direction for loss of contact)
o<probefail2> if [#5070 EQ 0]
          (DEBUG, Probing in Z+ failed)
          ;M63 P1 (toolsetter off)
          M72
          o<change> return [-3] ; indicate probe contact failure to epilog
o<probefail2> endif
;M63 P1 (toolsetter off)


I don't know if any of these problems is the source of the issue.

What is the last debug message printed when things go wrong?

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

More
10 May 2022 04:38 #242459 by SvenH
Thanks for checking this out Andy! I will report back.

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

Time to create page: 0.069 seconds
Powered by Kunena Forum