o<T#M6>

More
07 Apr 2014 00:51 #45626 by papaours
o<T#M6> was created by papaours
I am desperate about how to make my ATC spindle working.
I have spend hours reading all discussion on the subject and i am still lost.
I am not able to use linux 2.6 dev for remap M6 and the actual 2.5.3 help file about the subject are very short.
I know there is a lot of different ATC..... Butnsomething is missing for the common computer people like me !

I am able to modify my cam post processor to write the tool change gcode o<t#m6> instead of T#M6

In my machine i simply have one solenoid to open the collet and tow signal for tool ejected and tool locked
In the future i will had a soleinoid and a signal to moove the tool rack away from the table.

So my plan is to write many sub-program for each tool of my rack who contain the XY coordinate of each pocket


o<t1m6>
o<t2m6>
o<t3m6>
o<t4m6>
o<t5m6>
o<t6m6>
o<t7m6>
o<t8m6>

At this point i dont know ho to have the actual tool discharge before taking the new one.

Do i am on a wrong way, should i forgo it.

If someone can give me a help.

Thank you very much.

Mael.


Here is what i found, but this routine force me to press OK after t#m6. So it is not a real ATC....



unitaig.jalling.dk/index.php?id=164&L=0



New ToolShift Routine (use it on your own risk)


Again use it on your own risk.


The toolchanger works independent of emc-2. The routines can be implemented in any cnc-configuration. ( My start was a routine found in the USB-CNC documentation )
How it works? Read the code!


Load this code first in emc-2. Touch off the z-axis. Then run the program.
The program measures the 4 tools in the rack (NB: tools should be present in all places) and stores the length in global variables.

The old version measures tool at every toolshift which takes time. Disadvantage of this new version is if you break a tool you have to start all over again. (I never breaks tools :-)

Measure Tool Start
( This code is executed before running any nc programs. )
( Start by touching off on z with reference tool )
( the reference tool is placed in slot no 4 !! )
( then the procedure selects tools 1 to 4 , measures the length , stores result in variables )
( these variables is then read when running the real nc-program )
( NB every restart of emc-2 requires that this program is executed again )

( 20-oct-2010 minor revisions to initial program )
( 26-nov-2010 measure tool in separate program to minimize time )
( used in toolchange, measure once then read from global variables )

( variables )
( y-values for rack )

#1021 = 5.2 ( slot 1 )
#1022 = 27.2 ( slot 2 )
#1023 = 49.2 ( slot 3 )
#1024 = 71.2 ( slot 4 )
( z-values for pickup )
#1025 = -65 ( drop tool )
#1026 = -67.5 ( pickup and open collet )
#1027 = -70.5 ( pickup and close collet )
#1029 = 0 (top)

( this measures tool 1 to 4 , start with reference tool in 4 )
O<Z_touchoff> sub
g38.2 z0 f100
g43.1 z#5063
O<Z_touchoff> endsub

O<Probe_Init> SUB
G90 ( absolute distance mode )
G21 ( units in mm )
G49 ( clear tool length compensation)
G30 ( to probe switch)
G91 ( relative mode for probing)
G38.2 Z-60 F100 ( trip switch on the way down)
G0 Z1 ( back off the switch)
G38.2 Z-10 F10 ( trip switch slowly)
#1010 = #5063 ( save trip point)
(debug, reference length is #1000)
G90 ( absolute mode)
G30 ( return to safe level)
O<Probe_Init> ENDSUB

o<Set_Tool_Length> sub
g90 ( Absolute Distance mode)
G21 ( units in mm )
G30 ( to probe switch)
G49 ( clear tool length compensation)
G91 ( relative mode for probing)
g0 z-35
G38.2 Z-35 F150 ( trip switch on the way down)
G0 Z1 ( back off the switch)
G38.2 Z-10 F10 ( trip switch slowly)
G43.1 z[#5063 - #1010] ( set new length)
(debug,new length is #5063)
G90 ( absolute mode)
G30 ( return to safe level)
o<Set_Tool_Length> endsub

( ;Pick tool subroutines, next step is to use parameters! )
O<PickTool1> SUB
g53 G0 z0 (safe height)
g53 g0 x0 y[#1021] ( over slot )
g53 g0 z[#1025]
m101
g53 g0 z[#1026]
g4p1
g53 g0 z[#1027]
m102
g53 g0 z[#1029] (up)
#1000 = 1 (; toolchange success )
#1001 = [#5400]
o<Set_Tool_Length> call
#1051 = [#5063 - #1010] ( store length-offset for this tool )
O<PickTool1> endsub

O<PickTool2> Sub ( PickTool2 )
g53 G0 z0 (safe height)
g53 g0 x0 y[#1022] ( over slot )
g53 g0 z[#1025]
m101
g53 g0 z[#1026]
g4p1
g53 g0 z[#1027]
m102
g53 g0 z[#1029] (up)
#1000 = 1 (; Tool change success )
#1001 = [#5400]
o<Set_Tool_Length> call
#1052 = [#5063 - #1010] ( store length-offset for this tool )
O<PickTool2> endsub

O<PickTool3> Sub ( PickTool3 )
g53 G0z0 (safe height)
g53 g0 x0 y[#1023] ( over slot )
g53 g0 z[#1025]
m101
g53 g0 z[#1026]
g4p1
g53 g0 z[#1027]
m102
g53 g0 z[#1029] (up)
#1000 = 1 (; Tool change success )
#1001 = [#5400]
o<Set_Tool_Length> call
#1053 = [#5063 - #1010] ( store length-offset for this tool )
O<PickTool3> endsub

O<PickTool4> Sub ( PickTool4 )
g53 G0z0 (safe height)
g53 g0 x0 y[#1024] ( over slot )
g53 g0 z[#1025]
m101
g53 g0 z[#1026]
g4p1
g53 g0 z[#1027]
m102
g53 g0 z[#1029] (up)
#1000 = 1 (; Tool change success )
#1001 = [#5400]
o<Set_Tool_Length> call
#1054 = [#5063 - #1010] ( store length-offset for this tool )
O<PickTool4> endsub

( ;Drop tool subroutines )

O<DropTool1> Sub ( DropTool1 )
g53 G0 z0 (safe height)
g53 g0 x0 y[#1021] ( over slot )
g53 g0 z[#1025]
m101
g4p1
m102
g53 g0 z[#1029] (up)
O<DropTool1> endsub

O<DropTool2> Sub ( DropTool2 )
g53 G0 z0 (safe height)
g53 g0 x0 y[#1022] ( over slot )
g53 g0 z[#1025]
m101
g4p1
m102
g53 g0 z[#1029] (up)
O<DropTool2> endsub

O<DropTool3> Sub ( DropTool3 )
g53 G0 z0 (safe height)
g53 g0 x0 y[#1023] ( over slot )
g53 g0 z[#1025]
m101
g4p1
m102
g53 g0 z[#1029] (up)
O<DropTool3> endsub

O<DropTool4> Sub ( DropTool4 )
g53 G0 z0 (safe height)
g53 g0 x0 y[#1024] ( over slot )
g53 g0 z[#1025]
m101
g4p1
m102
g53 g0 z[#1029] (up)
O<DropTool4> endsub

O<Change_Tool> sub (change_tool)

( ;Use #1000 to indicate successful toolchange )
( Use #1001 to indicate old tool )
#1000 = 0 ( ; Tool change not performed )
O100 if [ [#5400] eq [#1001] ]
(msg,Tool already in spindle)
o100 endif
( ; check tool in spindle and exit sub )
o101 If [ [#5400] ne [#1001] ]
o102 if [[#5400] ge 5 ]
(msg,Please select a tool from 1 to 4.)
m0 ; stop
o102 else
( ;Drop current tool )
o103 If [[#1001] eq 1]
O<DropTool1> call
o103 endif
o104 If [[#1001] eq 2]
O<DropTool2> call
o104 endif
o105 If [[#1001] eq 3]
O<DropTool3> call
o105 endif
o106 If [[#1001] eq 4]
O<DropTool4> call
o106 endif
( ;Pick new tool )
o107 if [[#5400] eq 1]
O<PickTool1> call
o107 endif
o108 if [[#5400] eq 2]
O<PickTool2> call
o108 endif
o109 if [[#5400] eq 3]
O<PickTool3> call
o109 endif
o110 if [[#5400] eq 4]
O<PickTool4> call
o110 endif
o102 endif
o101 endif
o111 If [[#1000] eq 1]
( m6t[#5400] )
o111 endif

O<Change_Tool> EndSub

O<Probe_Init> call ( measure reference )
m6 t4
o<Change_Tool> call
m6 t1
o<Change_Tool> call
m6 t2
o<Change_Tool> call
m6 t3
o<Change_Tool> call
m6 t4
o<Change_Tool> call
m2
Measure Tool End

Then in your program the code below is inserted at the top and then after each toolshift line this line "o<Change_Tool> call" is inserted.
The above is easily done in sheetcam.

Tool Shift Code Start
( this code is included as the first part of the nc-code in f.ex. sheetcam )

( 26-nov-2010 : Initial version based on my old toolchange routines )
( reason minimize time used for toolchange )
( next : subroutine calls with parameters ? instead of 4 subs )

( y-values for rack )
#1021 = 5.2 ( slot 1 )
#1022 = 27.2 ( slot 2 )
#1023 = 49.2 (slot 3 )
#1024 = 71.2 (slot 4 )
( z-values for pickup )
#1025 = -65 ( drop tool )
#1026 = -67.5 ( pickup and open collet )
#1027 = -70.5 ( pickup and close collet )
#1029 = 0 (top)

( ;Pick tool subroutines )
O<PickTool1> SUB
g53 G0 z0 (safe height)
g53 g0 x0 y[#1021] ( over slot )
g53 g0 z+[#1025] ( down )
m101 ( open collet )
g53 g0 z+[#1026] ( down a little )
g4p1 ( wait )
g53 g0 z+[#1027] ( down a little more )
m102 ( close collet )
g53 g0 z+[#1029] ( up )
#1000 = 1 ( toolchange success )
#1001 = [#5400] ( store tool-number )
G43.1 z[#1051] ( set new length )
O<PickTool1> endsub

O<PickTool2> Sub ( PickTool2 )
g53 G0 z0
g53 g0 x0 y[#1022]
g53 g0 z+[#1025]
m101
g53 g0 z+[#1026]
g4p1
g53 g0 z+[#1027]
m102
g53 g0 z+[#1029]
#1000 = 1
#1001 = [#5400]
G43.1 z[#1052]
O<PickTool2> endsub

O<PickTool3> Sub ( PickTool3 )
g53 G0z0
g53 g0 x0 y[#1023]
g53 g0 z+[#1025]
m101
g53 g0 z+[#1026]
g4p1
g53 g0 z+[#1027]
m102
g53 g0 z+[#1029]
#1000 = 1
#1001 = [#5400]
G43.1 z[#1053]
O<PickTool3> endsub

O<PickTool4> Sub ( PickTool4 )
g53 G0z0
g53 g0 x0 y[#1024]
g53 g0 z+[#1025]
m101
g53 g0 z+[#1026]
g4p1
g53 g0 z+[#1027]
m102
g53 g0 z+[#1029]
#1000 = 1
#1001 = [#5400]
G43.1 z[#1054]
O<PickTool4> endsub

( ;Drop tool subroutines )

O<DropTool1> Sub ( DropTool1 )
g53 G0z-20 (safe height)
g53 g0 x0 y[#1021] ( over slot )
g53 g0 z+[#1025] ( down )
m101 ( open collet )
g4p1 ( wait )
m102 ( close collet )
g53 g0 z+[#1029] ( up )
O<DropTool1> endsub

O<DropTool2> Sub ( DropTool2 )
g53 G0z-20
g53 g0 x0 y[#1022]
g53 g0 z+[#1025]
m101
g4p1
m102
g53 g0 z+[#1029]
O<DropTool2> endsub

O<DropTool3> Sub ( DropTool3 )
g53 G0z-20
g53 g0 x0 y[#1023]
g53 g0 z+[#1025]
m101
g4p1
m102
g53 g0 z+[#1029]
O<DropTool3> endsub

O<DropTool4> Sub ( DropTool4 )
g53 G0z-20
g53 g0 x0 y[#1024]
g53 g0 z+[#1025]
m101
g4p1
m102
g53 g0 z+[#1029]
O<DropTool4> endsub

O<Change_Tool> sub (change_tool)

( ;Use #1000 to indicate successful toolchange )
( Use #1001 to indicate old tool )
#1000 = 0 ( ; Tool change not performed )
O100 if [ [#5400] eq [#1001] ]
(msg,Tool already in spindle)
o100 endif
( ; check tool in spindle and exit sub )
o101 If [ [#5400] ne [#1001] ]
o102 if [[#5400] ge 5 ]
(msg,Please select a tool from 1 to 4.)
m0 ; stop
o102 else
( ;Drop current tool )
o103 If [[#1001] eq 1]
O<DropTool1> call
o103 endif
o104 If [[#1001] eq 2]
O<DropTool2> call
o104 endif
o105 If [[#1001] eq 3]
O<DropTool3> call
o105 endif
o106 If [[#1001] eq 4]
O<DropTool4> call
o106 endif
( ;Pick new tool )
o107 if [[#5400] eq 1]
O<PickTool1> call
o107 endif
o108 if [[#5400] eq 2]
O<PickTool2> call
o108 endif
o109 if [[#5400] eq 3]
O<PickTool3> call
o109 endif
o110 if [[#5400] eq 4]
O<PickTool4> call
o110 endif
o102 endif
o101 endif
o111 If [[#1000] eq 1]
( m6t[#5400] )
o111 endif

O<Change_Tool> EndSub
Tool Shift Code End

Example of toolshift from a piece of sheetcam generated code.
Example Snippet Start
...................F50
Y0.7000 F100
(Operation: Inside Offset, groove, T2: Mill/router, 0.3 mm diameter, 0.2 mm Deep)
G00 Z5.0000
M05
M6 T2 (Mill/router, 0.3 mm diameter)
G43 H2
o<Change_Tool> call
M03 S1000
G00 ..........................
Example Snippet End

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

More
07 Apr 2014 02:55 #45629 by cncbasher
Replied by cncbasher on topic o<T#M6>
please describe what ATC and machine you have and how it is connected to the pc etc , without information it is difficult to suggest or advise

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

More
07 Apr 2014 05:45 #45633 by papaours
Replied by papaours on topic o<T#M6>
The machine is a RYE MG 2420 ( made in England in 1993 )
Useful bed is 2500x1500mm
axis stroke are 2560x2000x180mm
Spindle is HSD es919 iso 30

I have 3 input signal and one output to open the collet already conected to mesa 5i20 7i33 7i37
They have been set to be numerical input and output with pncconf

Tool ejected
Tool locked
Spindle at speed ( from the vfd )
Solenpid pneumatic valve

My rack tool will be parrallel to the X axis and in place of forks i will use some simple basket


So

M5
Speed zero ( spindle stop rotating )
G53 G0 z0 ( safe height )
G53 G0 X# Y# ( pocket# vertical position )
G53 G0 Z-50
Open spindle ( drop tool, literally )
Tool is ejected
G53 G0 Z0

And again to pick up the next tool with " tool locked."



At the begening and to understand how everything is working i am ok to just drop the tool into a round pocket mount on the table. Actually i don't use more then 4 tool inside a job and i don't use all the table area.

So the if i can get something very basic i will be very happy.



In he future i will make the rack slide away ( y ) into an enclosure to clear the machine workspace and stay away from the wood chip projection
With tow pneumatic actuator and tow input signal
Also a dust shoes on pneumatic actuator.

But this is not for tomorrow,

Thanks you very much.

After reading wiki and seeing video of gmoccapy, if there is no way to do it with 2.5.3 i will moove to master, but i will have to make it working with My mesa 5i20 board....... And swim back in hal and ini file.

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

More
07 Apr 2014 21:56 - 07 Apr 2014 21:59 #45653 by cncbasher
Replied by cncbasher on topic o<T#M6>
This type of toolchange has been done using comp , the file is in the wiki , if this is what you are wishing to do
( or similar to ) this does not use remap , and works with 2.5.3 and master .. my setup was using a 5i25 , but a 5i20 can be done

here is a video ( not mine ) to describe the type of toolchange , this is easily changed or modified


the problem comes , that the this ATC toolchanger knows the position of the tools , so some of the guess work is done , as it uses a grey code encoder so it knows what tool is aligned with spindle
this would need to be changed to perhaps fixed locations ( a single toolchange location can be added to the ini file , and on issuing a TxM6 call the table will move to co-ordinates in the ini file
and then you can issue a open / close collet command

if you go and use the developement branch and Gmocappy , this has tool probing . their is also a tool height remap example i believe

the ATC triacchanger comp file is here , along with details . wiki.linuxcnc.org/cgi-bin/wiki.pl?Contri...oolchanger_component

i would also point out that a rack toolchanger may be more appropriate
Last edit: 07 Apr 2014 21:59 by cncbasher.

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

More
07 Apr 2014 22:42 #45661 by andypugh
Replied by andypugh on topic o<T#M6>

This type of toolchange has been done using comp , the file is in the wiki , if this is what you are wishing to do
( or similar to ) this does not use remap , and works with 2.5.3 and master


I suspect that in this case there will need to be axis movements included in the sequence, and that is rather more difficult to achieve from a hal component.

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

More
07 Apr 2014 22:56 #45663 by andypugh
Replied by andypugh on topic o<T#M6>

I am able to modify my cam post processor to write the tool change gcode o<t#m6> instead of T#M6


The correct syntax is O<M6> CALL

You can consider passing the required tool number into the subroutine: O<M6> CALL [4] for example.
However, there is also the option of reading the number in the subroutine itself. Either with a loop through HAL from iocontrol.0.tool-prepare-req or by reading the #5400 parameter (I am not sure at what point that changes, though).

The very simplest example of a tool-change subroutine might look like this:
O<m6> SUB
G53 G0 Z0
G53 G0 X0 Y[#5400 * 75]
G53 G0 Z-75
M64 P0 (operate drawbar)
G53 G0 Z0
O<m6> ENDSUB

A glaring omission from this example is that there is no attempt to put away the currently-loaded tool.
A less obvious problem is that there is no attempt to orient the spindle. Do you need to orient the spindle?

I would need to check, but I think it might be possible to read #5400 to initially find the currently-loaded tool, then toggle iocontrol.0.tool-changed to switch #5400 to return the requested tool.
Unfortunately I am not at a LinuxCNC machine right now, so can't test.

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

Time to create page: 0.078 seconds
Powered by Kunena Forum