Manual tool change + tool lengh touch off

More
9 years 11 months ago - 9 years 11 months ago #82714 by eFalegname
Hy friends!
I try to optimize my manual tool change subroutine, I have tried changing the place of the M6 command several times but it always gives me error. Look at the video and you will realize that always before starting to mill the router goes to the tool change position resulting tedious and expensive in time matter, please aid me to avoid this unnecessary movement, any advice is welcome. Thanks


Code:
O<tool-change> SUB ( see: http://www.linuxcnc.org/index.php/english/forum/10-advanced-configuration/5596-manual-tool-change--tool-lengh-touch-off?start=30#48235 ) #<Tool>=#<_current_tool> O100 IF [EXISTS[#<_ToolDidFirst>] EQ 0] #<_ToolDidFirst> = 0 O100 ENDIF O105 IF [#<_ToolDidFirst> EQ 0] G49 O105 ENDIF M6 M70 M9 M5 G49 G90 G94 G40 O200 IF [#<_ToolDidFirst> EQ 0] (MSG, Caricare il primo utensile e premere Start) M0 G53 G0 Z0 G53 G0 X#<_ini[TOOLSENSOR]X> Y#<_ini[TOOLSENSOR]Y> G53 G1 F#<_ini[TOOLSENSOR]PROBEFASTFEED> Z#<_ini[TOOLSENSOR]Z> G91 G54 G1 F#<_ini[TOOLSENSOR]PROBEFEED1> O101 IF [#<_ini[TOOLSENSOR]MISTONDURINGPROBE> EQ 1 OR #<_ini[TOOLSENSOR]MISTONDURINGPROBE> EQ 2] M[7 + #<_ini[TOOLSENSOR]MISTONDURINGPROBE> - 1] O101 ENDIF G38.2 Z[#<_ini[TOOLSENSOR]ZSEARCH> - #<_ini[TOOLSENSOR]Z>] F#<_ini[TOOLSENSOR]PROBEFEED1> G0 Z#<_ini[TOOLSENSOR]PROBERETRACT> G38.2 Z[#<_ini[TOOLSENSOR]PROBERETRACT>*-1.25] F#<_ini[TOOLSENSOR]PROBEFEED2> M9 G90 #<_ToolZRef> = #5063 #<_ToolZLast> = #<_ToolZRef> G53 G0 Z0 M72 #<_ToolDidFirst> = 1 O200 ELSEIF [#<_current_tool> EQ #<Tool>] O200 ELSE G53 G0 Z0 #<ToolDiamMM> = #5410 O102 IF [#<_current_tool> EQ 0 AND #<ToolDiamMM> EQ 0] (MSG, Cambiare la fresa e premere Start ) O102 ELSE (DEBUG, Mettere la fresa #<_current_tool> diametro #<ToolDiamMM>mm, poi premere Start ) O102 ENDIF M0 G53 G0 X#<_ini[TOOLSENSOR]X> Y[#<_ini[TOOLSENSOR]Y>] G53 G1 F#<_ini[TOOLSENSOR]PROBEFASTFEED> Z#<_ini[TOOLSENSOR]Z> G91 G54 G1 F#<_ini[TOOLSENSOR]PROBEFEED1> O103 IF [#<_ini[TOOLSENSOR]MISTONDURINGPROBE> EQ 1 OR #<_ini[TOOLSENSOR]MISTONDURINGPROBE> EQ 2] M[7 + #<_ini[TOOLSENSOR]MISTONDURINGPROBE> - 1] O103 ENDIF G38.2 Z[[#<_ini[TOOLSENSOR]ZSEARCH>] - #<_ini[TOOLSENSOR]Z>] F[#<_ini[TOOLSENSOR]PROBEFEED1>] G0 Z#<_ini[TOOLSENSOR]PROBERETRACT> G38.2 Z[#<_ini[TOOLSENSOR]PROBERETRACT>*-1.25] F[#<_ini[TOOLSENSOR]PROBEFEED2>] M9 G90 #<_ToolZ> = #5063 G53 G0 Z0 #<_ToolZLast> = #<_ToolZ> M72 G43.1 Z[#<_ToolZ> - #<_ToolZRef>] O200 ENDIF M101 O<tool-change> ENDSUB M2
Last edit: 9 years 11 months ago by eFalegname.

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

More
9 years 11 months ago #82797 by LukeH
Firstly thanks "orangecat" for producing your sub-routine. It's very useful and I'm grateful for it.

I thought I would share my work in progress modifications to the sub-routine when used with Gmoccapy (another excellent contribution to the community). I have modified the sub-routine so that it works better with Gmoccapy and Fusion360 produced program that has a G43 Hn after every tool change.

This is the procedure;

1. Home all axis
2. MDI > m600 - signals next Tn M6 is reference
3. MDI > T1 M6 - moves to touch sensor and stores offset of T1 as reference tool (T1 for me is a touch probe that lights up when it makes contact)
4. Load program to machine
5. Touch off work piece X Y Z with T1
6. Run program

Each Tn M6 in the program pauses code, pops up message to change tool complete with description of tool. Runs the auto touch-off sub-routine, and then here is my main difference, it updates the tool table with a G10 L1 Pn Zn so that the G43 Hn in the program is used rather than applying the tool offset during the sub routine.

I know that I could have modified my post processor to remove the G43 Hn line that is generated but I wanted to avoid that in case I later change GUI and/or tool touch off routine.

I will happy share the modified files if anyone is interested.

Luke.
The following user(s) said Thank You: maciej.gornicz

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

More
9 years 11 months ago #82846 by maciej.gornicz
Hi,

I also am using Fusion360 and linuxcnc. I struggle with this problem for some time and still could not create the ideal procedure. With gratitude I'll use your files :). Please share if possible.

Maciej

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

More
9 years 11 months ago #82858 by LukeH

eFalegname wrote: Hy friends!
I try to optimize my manual tool change subroutine, I have tried changing the place of the M6 command several times but it always gives me error. Look at the video and you will realize that always before starting to mill the router goes to the tool change position resulting tedious and expensive in time matter, please aid me to avoid this unnecessary movement, any advice is welcome. Thanks


It's not obvious from that video what the complete tool change routine looks like. Besides, it doesn't look like anything in the code you've posted is producing that extra move. I notice you reference _ini[TOOLSENSOR] for a number of variables. It's worth double checking that for extra XY moves.

Also, double check your machine .INI for the following line TOOL_CHANGE_POSITION. You shouldn't have one of these enabled which would cause an extra move.

Does the extra move occur when you do a manual Tn M6 in MDI or is it only when you run a program?

Luke.

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

More
9 years 11 months ago - 9 years 11 months ago #82887 by eFalegname
Hi LukeH, thanks a lot for your answer.
You were right, I solved changing the line TOOL_CHANGE_POSITION=... for the ini section [TOOL
_CHANGE_POSITION]... and modifying the statement: O200 ELSEIF, now I can place my files.
There was some sort of offset in X and Y that was added after the third tool change, by deleting the G49 after M70 in the M6 file "tool-change.ngc" the problem has gone.
I'd be interested in finding additional optimizations for my machine configuration. Let's see if in these days I can make the video to better illustrate the process of my manual tool change.

M600 remap file:
Code:
O<tool-job-begin> SUB ( Filename: tool-job-begin.ngc ) ( LinuxCNC Manual Tool-Change Subroutines for Milling Machines version 1.1: subroutine 2/2 ) ( Intended to be run as a remapped M600 command. Used to indicate that the next tool change, M6, is the first tool of a job. ) #<_ToolDidFirst> = 0 ( new job, we haven't yet called <tool-change> for the first time ) (debug, utensile #<_ToolDidFirst>) G49 ( clear tool height adjustment ) O<tool-job-begin> ENDSUB M2

Z zero touch plate probe file:
Code:
o<tool-zero>sub #<_ToolDidFirst> = 0 ( new job, we haven't yet called <tool-change> for the first time ) (DEBUG, utensile riferimento programma #<_ToolDidFirst>) G49 ( clear tool height adjustment ) M9 M5 G80 G91 G94 G40 G4 P1 G38.2 Z[#<_ini[TOOLSENSOR]ZSEARCH>] F[#<_ini[TOOLSENSOR]PROBEFEED1>] G0 Z#<_ini[TOOLSENSOR]PROBERETRACT> G38.2 Z[#<_ini[TOOLSENSOR]PROBERETRACT>*-1.25] F#<_ini[TOOLSENSOR]PROBEFEED2> G4 P0.05 O102 IF [#<_hal[pyvcp.set_all_zero]>] G10 L20 P1 Z#<_ini[TOOLSENSOR]H> G10 L20 P2 Z#<_ini[TOOLSENSOR]H> G10 L20 P3 Z#<_ini[TOOLSENSOR]H> G10 L20 P4 Z#<_ini[TOOLSENSOR]H> G10 L20 P5 Z#<_ini[TOOLSENSOR]H> G10 L20 P6 Z#<_ini[TOOLSENSOR]H> G10 L20 P7 Z#<_ini[TOOLSENSOR]H> G10 L20 P8 Z#<_ini[TOOLSENSOR]H> G10 L20 P9 Z#<_ini[TOOLSENSOR]H> ( MSG, Zero Z > Tutti Work-Offsets ) O102 ELSE G10 L20 P0 Z#<_ini[TOOLSENSOR]H> O102 ENDIF M9 G90 G53 G0 Z-5 o<tool-zero>endsub M2

M6 remap file:
Code:
O<tool-change> SUB ( see: http://www.linuxcnc.org/index.php/english/forum/10-advanced-configuration/5596-manual-tool-change--tool-lengh-touch-off?start=30#48235 ) #<Tool>=#<_current_tool> O100 IF [EXISTS[#<_ToolDidFirst>] EQ 0] #<_ToolDidFirst> = 0 O100 ENDIF O105 IF [#<_ToolDidFirst> EQ 0] G49 O105 ENDIF G49 M6 M70 M9 M5 G90 G94 G40 O200 IF [#<_ToolDidFirst> EQ 0] G53 G0 Z-5 G53 G0 X#<_ini[TOOLSENSOR]X> Y#<_ini[TOOLSENSOR]Y> G53 G1 F#<_ini[TOOLSENSOR]PROBEFASTFEED> Z#<_ini[TOOLSENSOR]Z> G91 G54 G1 F#<_ini[TOOLSENSOR]PROBEFEED1> G38.2 Z[#<_ini[TOOLSENSOR]ZSEARCH> - #<_ini[TOOLSENSOR]Z>] F#<_ini[TOOLSENSOR]PROBEFEED1> G0 Z#<_ini[TOOLSENSOR]PROBERETRACT> G38.2 Z[#<_ini[TOOLSENSOR]PROBERETRACT>*-1.25] F#<_ini[TOOLSENSOR]PROBEFEED2> M9 G90 #<_ToolZRef> = #5063 #<_ToolZLast> = #<_ToolZRef> G53 G0 Z-5 M72 #<_ToolDidFirst> = 1 O200 ELSEIF [#<_current_tool> EQ #<Tool>] #<_ToolZLast> = #<_ToolZRef> G53 G0 Z-5 M72 #<_ToolDidFirst> = 1 O200 ELSE G53 G0 Z-5 #<ToolDiamMM> = #5410 O102 IF [#<_current_tool> EQ 0 AND #<ToolDiamMM> EQ 0] G53 G0 Z-5 G30 (MSG, Cambiare la fresa e premere Start ) O102 ELSE G53 G0 Z-5 G30 (DEBUG, Mettere la fresa #<_current_tool> diametro #<ToolDiamMM>mm, poi premere Start ) O102 ENDIF M0 G53 G0 X#<_ini[TOOLSENSOR]X> Y[#<_ini[TOOLSENSOR]Y>] G53 G1 F#<_ini[TOOLSENSOR]PROBEFASTFEED> Z#<_ini[TOOLSENSOR]Z> G91 G54 G1 F#<_ini[TOOLSENSOR]PROBEFEED1> G38.2 Z[[#<_ini[TOOLSENSOR]ZSEARCH>] - #<_ini[TOOLSENSOR]Z>] F[#<_ini[TOOLSENSOR]PROBEFEED1>] G0 Z#<_ini[TOOLSENSOR]PROBERETRACT> G38.2 Z[#<_ini[TOOLSENSOR]PROBERETRACT>*-1.25] F[#<_ini[TOOLSENSOR]PROBEFEED2>] M9 G90 #<_ToolZ> = #5063 G53 G0 Z-5 #<_ToolZLast> = #<_ToolZ> M72 G43.1 Z[#<_ToolZ> - #<_ToolZRef>] #<_ToolDidFirst> = 1 O200 ENDIF O<tool-change> ENDSUB M2

Changes in .ini file:
Code:
[RS274NGC] RS274NGC_STARTUP_CODE = M600 FEATURES =30 REMAP=M6 modalgroup=6 ngc=tool-change REMAP=M600 modalgroup=6 ngc=tool-job-begin [TOOLSENSOR] X = 50 Y = 517 Z = -110 H = 11.25 ZSEARCH = -170 PROBEFASTFEED = 1800 PROBEFEED1 = 250 PROBEFEED2 = 25 PROBERETRACT = 0.5 [PARKING_POSITION] X = 10 Y = 600 Z = -5 [TOOL_CHANGE_POSITION] X = 50 Y = 50 Z = -5 [EMCIO] TOOL_CHANGE_QUILL_UP = 1

Additional macros:
Code:
o <g28> sub G90 G0 G53 Z-5 G53 G0 X[#<_ini[PARKING_POSITION]X>] Y[#<_ini[PARKING_POSITION]Y>] G53 G0 Z[#<_ini[PARKING_POSITION]Z>] G28.1 o <g28> endsub M2
Code:
o <g30> sub G90 G53 G0 Z-5 G53 G0 X[#<_ini[TOOL_CHANGE_POSITION]X>] Y[#<_ini[TOOL_CHANGE_POSITION]Y>] G53 G0 Z[#<_ini[TOOL_CHANGE_POSITION]Z>] G30.1 o <g30> endsub M2
Last edit: 9 years 11 months ago by eFalegname.

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

More
9 years 11 months ago - 9 years 11 months ago #82950 by eFalegname
Avoiding unnecessary movements to tool change position: SOLVED!



Last edit: 9 years 11 months ago by eFalegname.
The following user(s) said Thank You: racedirector

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

Time to create page: 0.335 seconds
Powered by Kunena Forum