Manual tool change + tool lengh touch off

More
18 Aug 2016 15:05 #79003 by clunc
@OrangeCat

I remember now that I was concerned that the spindle of the new machine has no vertical "stop" for cutters, unlike the router on the old machine, and wondered if that fact was a problem for your code.

I looked at (m6_)tool-change.ngc and believe that it is NOT memorizing Tool-length offsets for individual tools and recalling them later.

But I want to state my understanding:

If (m600_)tool-change-begin.ngc is called, the tool loaded with the very next M6 Tn command will be measured for reference, and successive tools--including the ORIGINAL tool from which the reference was calculated--will have offsets calculated for them, so that their tooltips will match precisely with that of reference.

And again:
If the tool used for reference is again called for and loaded by an M6 Tn, it need not be (re-)loaded at the perfect, reference position because an offset will be calculated to assure that its tip aligns with the reference position.

And finally:
That is to say, the tool used for reference will be treated like any other after its first-use.

Thank you.

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

More
18 Aug 2016 15:23 - 18 Aug 2016 15:25 #79009 by orangecat

If the tool used for reference is again called for and loaded by an M6 Tn, it need not be (re-)loaded at the perfect, reference position because an offset will be calculated to assure that its tip aligns with the reference position.


Yes, that is correct. My machine also doesn't allow the tools to be re-inserted at the same vertical position.
Last edit: 18 Aug 2016 15:25 by orangecat.

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

More
18 Aug 2016 19:18 #79020 by clunc
Possibly the only thing I have in common with you, and your skills.

Still. It's a start...

I'm going to try to insert a (MSG,) before the tool change reminding of the M6/M600 remaps.

Thank you for the re-ply. And for the scripts smarter than me.

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

More
19 Oct 2016 16:48 #81856 by pommen
I'm loving the tool measurements from Orange Cat. I have been using it since this spring and have not run into any trouble that I didn't cause myself.

Has anyone been able to combine this routine together with the tool change dialog of Gmoccapy? I'm thinking it could be changed to fit, but I haven't had any luck with it so far.

/Peter

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

More
22 Oct 2016 20:17 - 22 Oct 2016 20:18 #81939 by auto-mation-assist
I have been playing with this in gmoccapy and it seems to work in simulation as far as preview movement is concerned. One problem I'm having issues with to do further testing is that when the present mounted cutting tool tool has to be removed to manually exchange it with the new desired tool the "resume" dialog never pops up on the screen. There is no problem when there is no tool already mounted . In that case the code movement completes to the end.

So, after this pop up message: "Please remove the mounted tool and press OK when done". It never shows the resume popup dialog and the code appears to stay in pause mode.

I'm thinking that there may be a potential linking issue with the line I copied from the code if this is what should pop up the resume dialog:

(DEBUG, Change to tool #<_current_tool> with diameter #<ToolDiamMM>mm, #<ToolDiamIn>in then click Resume )
Last edit: 22 Oct 2016 20:18 by auto-mation-assist.

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

More
22 Oct 2016 20:31 #81940 by auto-mation-assist
In my sim configuration I have:

RS274NGC_STARTUP_CODE = G17 G20 G40 G43H0 G54 G64P0.005 G80 G90 G94 G97 M5 M9
PARAMETER_FILE = sim.var
FEATURES=30
SUBROUTINE_PATH = /home/john/linuxcnc-dev/configs/sim/gmoccapy/macros:
REMAP=M6 modalgroup=6 ngc=tool-change
REMAP=M600 modalgroup=6 ngc=tool-job-begin

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000
TOOL_CHANGE_AT_G30 = 0


In hal
net tool-prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed

---

Do I have to use prolog= epilog= ??

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

More
23 Oct 2016 00:47 - 23 Oct 2016 00:51 #81944 by auto-mation-assist
I misunderstand the "resume" that it actually is the "pause" button" in gmoccapy when running a gcode program. So when running a program it looks like the tool change function from the code in this thread appears to work ok.

What I was looking for is a dialog box that appears is when a M6 T3 command for example is entered in the midi when a T2 tool is already installed and has to be removed before the T3 tool could be loaded. The tool-change code pauses in such a case and there is now way to get it out of pause mode without a dialog pop up and a "ok" button to proceed after a manual tool change made by entering a tool change cmd from the midi.

These should be in the postgui file since they are also needed.

net tool-change gmoccapy.toolchange-change <= iocontrol.0.tool-change
net tool-changed gmoccapy.toolchange-changed <= iocontrol.0.tool-changed
net tool-prep-number gmoccapy.toolchange-number <= iocontrol.0.tool-prep-number
Last edit: 23 Oct 2016 00:51 by auto-mation-assist.

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

More
23 Oct 2016 01:53 - 23 Oct 2016 01:54 #81946 by auto-mation-assist
Here are some notes I wrote to myself so I wont get to confused in a year or so from now.

For tool change routine by "orangecat" for use in gmoccapy. Alows for automatic tool length measurement and tool changing from inside running gcode file. Can also be used manually.

M600 should near the header of every gcode file as mentioned in the file documentation.

To be Done: Need a dialog when M6 command is manually entered in midi when a existing tool is already installed
during tool change. Perhaps a gui panel for manual use?

Files needed: In /'user-name'/config/macro folder:
tool_change.ngc -- wrtten by "orangecat"

In macro folder open terminal and generate two symlinks
$ ln -s tool_change.ngc tool-job-begin.ngc
$ ln -s tool_change.ngc tool-change.ngc

In my temporary ini file I have:

RS274NGC_STARTUP_CODE = G17 G20 G40 G43H0 G54 G64P0.005 G80 G90 G94 G97 M5 M9
PARAMETER_FILE = sim.var
FEATURES=30
SUBROUTINE_PATH = /home/john/linuxcnc-dev/configs/sim/gmoccapy/macros:
#--- The below two lines are for tool change ---
REMAP=M6 modalgroup=6 ngc=tool-change
REMAP=M600 modalgroup=6 ngc=tool-job-begin

[EMCMOT]
EMCMOT = motmod
COMM_TIMEOUT = 1.0
COMM_WAIT = 0.010
BASE_PERIOD = 100000
SERVO_PERIOD = 1000000
#--- The below line is for tool change ---
TOOL_CHANGE_AT_G30 = 0

In my hal file I have:
net tool-prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed

In my postgui hal file I have:
net tool-change gmoccapy.toolchange-change <= iocontrol.0.tool-change
net tool-changed gmoccapy.toolchange-changed <= iocontrol.0.tool-changed
net tool-prep-number gmoccapy.toolchange-number <= iocontrol.0.tool-prep-number

The hal and the postgui hal files could be combined in postgui.hal
Last edit: 23 Oct 2016 01:54 by auto-mation-assist.
The following user(s) said Thank You: pommen

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

More
12 Nov 2016 16:30 - 12 Nov 2016 17:42 #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


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: 12 Nov 2016 17:42 by eFalegname.

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

More
14 Nov 2016 17:05 #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.

Time to create page: 0.110 seconds
Powered by Kunena Forum