0% found this document useful (0 votes)
27 views

ATC-manual

The document discusses the tool changing principle and macro program for CNC machines, focusing on the configuration and operation of various types of tool magazines, including linear, umbrella, and chained magazines. It outlines the complex process of tool changing, detailing the steps involved, types of tool change methods, and the macro programming necessary for efficient operation. Additionally, it provides a flowchart and specific macro code examples to illustrate the tool changing procedure and ensure accuracy in the CNC machine's operations.

Uploaded by

Rafael Rodriguez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

ATC-manual

The document discusses the tool changing principle and macro program for CNC machines, focusing on the configuration and operation of various types of tool magazines, including linear, umbrella, and chained magazines. It outlines the complex process of tool changing, detailing the steps involved, types of tool change methods, and the macro programming necessary for efficient operation. Additionally, it provides a flowchart and specific macro code examples to illustrate the tool changing procedure and ensure accuracy in the CNC machine's operations.

Uploaded by

Rafael Rodriguez
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

Tool changing principle and Macro

program for tool changing details


Introduction in order to improve the efficiency of processing of metal-cutting machine tools,
universally , configurate disc tool magazine in the vertical machining center.this type of tool
magazinelof the way of tool Selection is bi-directional tool selection, method of tool changing is
random. The Process of Tool changing is very complex. Firstly, all of the tools should be
installed on the standard shaft, after size adjustments outside of the machine, tools be stored
according to a certain way in the magazine,.when tool changing,firstly ,select tools in the
magazine ,then tool Exchange device remove tools from spindleand the tool magazine .after that ,
the new tool will be on the spindle ,the old one will be in the magazine. The tool magazine has a
large capacity, it can be installed on the side or top of the headstock, and can also be installed as a
separate part to the outside of the machine

1. Introduction for general tool magazine


Tool magazine is for keeping tools ,it's a main part of the auto tool exchange device .tool
magazine can be designed different types according to the number of keeping tools and the
mode of drawing tools .the normally types of tool magazine showed as follows

1.1 liner tool magazine


The follow picture is the line tool magazine .tools are arranged like a line .the structure is
simple ,and the amount of tools is limited .
1.2 umbrella tool magazine
The picture shows as follow ,the amount of tools may be from 6 to 60.

1.3 chained magazine


the picture shows as follow
This type tool magazine can keep many tools ,normally more than 20 tools ,some even more
than 120 tools .the chain move the tools to the fixed position ,then the robot arm move tools and
fix it to spindle .

2Tool change principle

2.1 introduction for tool changing process and types:


generally ,The type of tool magazine in the CNC machine include tool magazine and machine tool
spindle’s motion to realize tool change or adopt manipulator to realize tool change. The way of tool
changing and the structure of tool magazine effect to machine tool’s productivity and reliability
directly.
Type 1: the tool magazine and spindle relative motion realize tool change. In the process of tool
changing must send the used tool back to tool magazine, and draw a new tool, this two motion can
not be finish at the same time, so this way cost long time.
Type2: use manipulator to realize tool change, this is a popular way, because manipulator tool
changing is more flexibility and save time, at present ,almost of the machining-center center are
used memory random tool changing , in this way , CNC system can remember the tool number and
Blade Guard position corresponding. Not matter which tool is set, it will keep remember their
position and trace accordingly. And the tool magazine installs one position detect device,( generally
installed with the motor), it can detect each position of blade guard,so that the tool can be take out
and send back randomly. And there is mechanical origin at tool magazine, every time select tool, it
will select the closest one, if it is a Disc tool magazine, each time selecting the tool the forward
rotate or inversion will not exceed 180°.

2.2 change procedure


Here we take disc magazine(type 1 ) as an example to explain the process of using macro
program to realise the tool changing . customs can refer it , first of all, according to the magazine's
actual work, making a flowchart of tool changing, it can be used when make the program with
macro .

2.2.1 FLOWCHART
working flowchart:of the Disc tool magazine
2.2.2 YSTEM RESOURCE CONFIGURATION
Output definition
series no. main function pin number
1 spindle stop accurately 9
2 disk cw output 10
3 disk ccw output 11
4 air cylinder push 12
5 spindle air cylinder push 13
6 吹气 blow 14

input definition
series no. main function pin number
1 spindle stop input 5
2 disk air cylinder back input 6
3 disk air cylinder push input 7
4 tool counting input 8
5 disk home signal input 9
6 spindle cut loosen input 10
7 spindle cut clamp input 11
+ configuration chart for tool magazine feature and parameter of macro-variable

series no. Defination Macro


address
1 present tool no. #4120
2 target tool no. #200
3 max tool no. #400
4 z offset #4126

series no Defination Macro address


1 System tool amount #400
2 X axis change tool position #401
3 Y axis change tool position #402
4 Z axis change tool position #403
5 Z axis safety height #404
6 Speed of change tools #405
7 XY axis speed of change tools #406
8 Blow delay #407
9 Foreward delay #408
10 Reversal delay #409
11 No.1 Z axis tool setting position #410
12 No.2 Z axis tool setting position #411
13 No.3Z axis tool setting position #412
14 No.4 Z axis tool setting position #413
15 No.5 Z axis tool setting position #414
16 No.6 Z axis tool setting position #415
17 No.7 Z axis tool setting position #416
18 No.8 Z axis tool setting position #417
19 No.9 Z axis tool setting position #418
20 1 No.10 Z axis tool setting position #419
21 No.11 Z axis tool setting position #420
22 No.12 Z axis tool setting position #421
23 No.13 Z axis tool setting position #422
24 No.14 Z axis tool setting position #423
25 No.15 Z axis tool setting position #424
26 No.16 Z axis tool setting position #425
27 No.17 Z axis tool setting position #426
28 No.18 Z axis tool setting position #427
29 No.19 Z axis tool setting position #428
30 No.20 Z axis tool setting position #429
31 No.21 Z axis tool setting position #430
32 .22 Z axis tool setting position #431
33 No.23 Z axis tool setting position #432
34 No.24 Z axis tool setting position #433

3 introduction for Macro-program tool change


(1 )O0123 program No.
(2 )G90 G599 shift tool change use absolute programme,use G599
coordinate system,can't use in working file) )
(3 )#201=#4120 (read present tool number to #201
(4 )IF[[#200] == 0]GOTO 100 (##200is the ready change tool's number,the change
tool number is 0 and then quit changing tool
(5 )IF[[#200] == #201]GOTO 100 if present tool is the tool want to be changed
then quit
(6 )IF[#400 > 24] (it will alarm if the system tool number exceed
24 )
(7 ){
(8 )#3000=1(warm :the setting tool exceed the max!) (system parameter no 3001 alarm,the
content can be revise)
(9 )}
(10)IF[[[#200] > [#400]] || [[#201] > [#400]]] if the current tool NO. Or aim tool NO. Is
bigger than system max tool NO., then show alarm )
(11){
(12)#3000=1 (alert: the setting tool number exceed maximum tool number!)( NO.3001 alarm appear,
can modify alarm contain)
(13)}
(14)IF[#201==0] if the current tool no. Was 0 ,then show alarm )
(15){
(16)#3000=1 ( present tool number is 0, error)
(17)}
This macro program corresponding to the flowchart “ tool change T code” , diagnose function that
when system not sending tool change instruction, and detect tool number, “(2) G90 G599” ,when
enter tool changing procedure, it will shift to G599 machine tool coordinate system and the values
are absolutely in the program, each axis refer the machine coordinate system. so the match
parameter of the tools are refer to machine coordinate , “(3 )#201=#4120” read present tool
number to #201 variable, use for compare with“(5 )IF[[#200] == #201]GOTO 100”, #200’s variable
value is transmit by target tool number of code, if the target tool number as same as present tool
number, it will jump to N100 and not make tool change motion, if different, it will execute
“(6 )IF[#400 > 24]”to detect if the setting of max tool value by user exceed the max tool contain
24. over setting it will alarm: “(8 )#3000=1” and stop changing tool, 10-17 is tool detect, if it is no
problem it will execute the coming code.

3.1 z axis back to tool changing reference point


(18)G01 Z[#403+#404] F#405 (z axis rise to safe position)
This code is used for X and Y axis to avoid colliding when tool is at the position of tool changing
“(19)M09”, close cooling liquid to prevent cool liquid splashing to tool head or blade guard in case
of effecting tool changing precision.

3.2 Spindle stop accurately


Since tool installed on the spindle, cutting torque transmited can’t only by bole-hole’s
friction, so there are one bolt at ahead of the spindle, when tool installed to spindle, the keyway of
tool head must match with the bolt of spindle, and then can finish tool change, so spindle require
stopping accurately at a fix angle, this is the purpose of spindle stop accurately.

(20)M89 P8 L1 start spindle stop accurately spindle blow use for blow
(21)M89 P13 L1 (blow) off cooling liquid or piece
(22)G04 X#407 (blow delay) produce by process
(23)M89 P13 L0 (close blow)
(24)M88 P4 L0 (spindle stop accurately) (wait for spindle stop accurately position)
This code is corresponding to the flow chart “spindle accuracy stop” and make sure the spindle stop
accurately.
3.3 X、Y AXIS POSITION TO TOOL CHANGING POINT
(25)G01 X[#401] Y[#402] F#406
Above program is for machine move to X and Y axis tool changing point , ready for tools back
to tool magazine, this is corresponding to work flow chart “Spindle at the point of X/Y axis tool
change”
(26)IF[[#201]!=0] (judge if present tool no. is o or not)
(27){ (if the value is not 0, then execute next codes 码)
(28)G01 Z[#403] F#405 (machine move to Z axis tool chaning point
(29)M89 P11 L1 (air cylinder push )
(30)M88 P6 L0 (wait for disk air cylinder back input)
(31)M89 P12 L1 (spindle air cylinder push)
(32)G04 P300 (delay 300 millisecond)
(33)G01 Z[#403+2.5] F1000 (Z axis rise up 2.5+#403mm to prevent withhold tool disc when
loose tool )
(34)M88 P9 L0 (wait for spindle cut loosen input)
(35)G01 Z[#403+#404] F#405 (Z axis rise up to safe position)
(36)}
Above program is simple and clear, for judge the return tool number is 0 or not , Z axis
position to tool changing point , and then push out tool disc, next step is checking and waiting for
r disk air cylinder back input signal, when get this signal means handle on the spindle was block in
tool disc already, and then output spindle air cylinder push signal to loose tool handle, G04 P300
delay is make sure that there is enough time to loose the tool, “G01 Z[#403+2.5] F1000”, this
code is add base on customer’s tool magazine, not necessary for all tool magazine. After getting the
spindle air cylinder push signal , Z axis back to safe height, ready for next tool changing.
3.4 CHOOSE TOOL NEARBY
choose a tool nearby for disc tool magazine, for each selection ,the +or – direction rotate will not
exceed 180°, short time and high efficiency.
(37)#1=0 (symbol for tool disc +or- rotate, #=1 is +, and #=0 is -) the default
value is #=1
(38)IF[#201 > [#400/2]] GOTO 1
(if the present tool NO. is in lower half of tool magazine,the program will jump to N1)???
(39)IF[[#201 >= #200] || [#200 > [#201+[#400/2]]]] GOTO 2
(39) code is use for below type of tool magazine)

The present tool NO. is bigger than target tool number or target tool located at lower half of tool
magazine, for example, the max tool number is 24, present tool NO. is 1, target tool NO.is 16, the
nearest path is: No 1—>No 24 Æ-No 23...No 16
forward rotate choose tool
(40)M89 P9 L1
(disc CW output : P9 is disc CW output signal..nearby tool changing : if present tool NO. is 3
and target toolNO. is 4, disc CW)
(41)#1=0 (symbol is 0, tool selection of disc CW)
(42)GOTO 3 jump to N3
(43)N2 tool seletion of ccw
(44)M89 P10 L1 ( disc ccw output )
(45)#1=1 (symbol is 1, tool selection of disc CCW)
(46)GOTO 3 jump to N3

(47)N1
(48)IF[[#201 >= #200 && #200 <= #400] && [#200 > [#201+#400/2]MOD#400]] GOTO 4
if the condition of program NO. (49) is established, then JUMP to N4,or execute the coming
program tool selection of cw, dragram show as follow

(the present tool NO.is bigger or same as target tool NO., target tool NO. IS smaller or same as
system max tool NO. and both present tool N and target NO. both locat at lower half of tool
magazine, for example: present tool NO. is 22 and target toolNO. is 12, it will be ccw)
(49)M89 P9 L1 (disc cw, P9 is the signal of the disc cw )
(50)#1=0 (symbol is 0, tool selection of cw)
(51)GOTO 3 jump to N3
(52)N4 (tool selection of CCW)
(53)M89 P10 L1
(54)#1=1 (symbol is 1, tool selection of ccw)

3.5 tool selection counting


(55)N3
(56)#2=#201 (present tool NO.saved into temporary variable)
(57)WHILE[#2!=#200] DO1 (judge whether it is target tool or not )
(58)M88 P7 L0 (wait for tool counting input signal is low level )
(59)M88 P7 L1 (wait for tool counting input signal is high level)
(60)IF[#1==1] GOTO 7 jump to ccw counting
(61)#2 = #2+1 (cw add 1 each time)
(62)IF[#2>#400] #2=1 (if it is bigger than system tool NO. then it
will recount from 1)
(63)GOTO 8
(64)N7
(65)#2 = #2-1 (ccw reduce 1 each time)
(66)IF[#2<=0] #2=#400 (if counting NO. is smaller than 0, then
recount from max tool number)

(67)N8
(68)END1 (ending )
The programs From No (55) to (68) are for counting base on previous tool selection direction to
select tool, principle is accumulation or decrease by present tool number , tool selection is finished
when present tool NO. is same as target tool NO.. Finish tool
selcetion
(69)IF[#1==1] GOTO 5 (JUMP to N5)
(70)G04 P#408 (dealy)
(71)M89 P9 L0 close disc cw output signal after delay )
(72)GOTO 6

(73)N5
(74)G04 P#409 (delay)
(75)M89 P10 L0 (close disc ccw output signa after delay )
The programs From (69) to (75) are for closing corresponding port according to previous tool
selection direction.

tool installed to spindle


(76)N6
(77)M89 P11 L1 (output air cylinder push signal)
(78)M88 P6 L0 (waiting for disk air cylinder back input
(79)M89 P13 L1 (output blow signa)
(80)G04 X#407 (dealy)
(81)M89 P13 L0 (close blow signal) install the
(82)M89 P12 L1 (output spindle air cylinder push) chose tool
(83)M88 P9 L0 (spindle cut loosen input ) into spindle
(84)G01 Z[#403+2.5] F#405 (Z axis move to above the position of tool changing point ‘s taper suite,
2.5mm ) tool disc
(85)M89 P12 L0 (spindle grab tool) return
(86)G01 Z#403 F6000 (z axis move to position of the tool changing point
(87)M88 P10 L0 (spindle tool clamp input)
(88)M89 P11 L0 output air cylinder push signal
(89)M88 P5 L0 (disk air cylinder back input)
(90)M89 P8 L0 (spindle accuracy stop signal invalid)
(91)G01 Z[#403+#404] F#405 (Z axis rise to safe position)
计算长度偏移量 count length excursion
(92)#2=#[409+#200] (obtain present tool’s setting value) calculate the
(93)#3=#[409+#201] (obtain previous tool’s setting value) D-value
between target
(94)#1=#2-#3 calculate two tools’ length excursion) tool and
(95)#1=#4126-#1 (calculate length compensation) present tool
(96)#4126=#1 (setting length compensation)
(97)N100 (program jump )
(98)M30 (program ending)
(99)%

4 Tool change macroprogram source code


(1 )O0123 (program no.)
(2 )G90 G599 (shift tool change use absolute
programme,use G599 coordinate system,can't use in working file)
(3 )#201=#4120 (read present tool number#201)
(4 )IF[[#200] == 0]GOTO 100 (#200is the ready change tool's
number,the change tool number is 0 and then quit and change the tool)
(5 )IF[[#200] == #201]GOTO 100 (if present tool is the tool want
to be change so quit and change)
(6 )IF[#400 > 24] (it will alarm if the system tool
number exceed 24)
(7 ){
(8 )#3000=1(warm :the setting tool exceed the max!) (system parameter no. 3001
alarm,the content can be revise)
(9 )}
(10)IF[[[#200] > [#400]] || [[#201] > [#400]]](the changing tool number and system
present tool number exceed the biggest tool number it will alarm)
(11){
(12)#3000=1(warm:the setting tool exceed the max !) (3001 alarm ,the content can
be revise))
(13)}
(14)IF[#201==0] (it will alarm if the system tool
number is 0)
(15){
(16)#3000=1(present tool number is 0, error!)
(17)}
(18)G01 Z[#403+#404] F#405 (Z axis raise up to safe position)
(19)M09 (close cooling)
(20)M89 P8 L1 (output spindle accurately stop signal)
(21)M89 P13 L1 (blowing)
(22)G04 X#407 (blowing delay)
(23)M89 P13 L0 (close blowing)
(24)M88 P4 L0 (waiting spindle spindle stop input)
(25)G01 X[#401] Y[#402] F#406 (the machine move to X、Y axis tool changing
point)
(26)IF[[#201]!=0] (judge present tool number is 0
or not)
(27){ (it will operate the below code
if it is not 0)
(28)G01 Z[#403] F#405 (the machine move to X、Y axis tool
changing point)
(29)M89 P11 L1 (output air cylinder push signal)
(30)M88 P6 L0 (waiting for disk air cylinder push input signal)
(31)M89 P12 L1 (output spindle air cylinder push signal)

(32)G04 P300 (delay 0.3 second)


(33)G01 Z[#403+2.5] F1000 (Z axis raise 2.5Mm
(34)M88 P9 L0 (waiting spindle tool loosen input )
(35)G01 Z[#403+#404] F#405 (Z axis raise to safe position)
(36)}
(37)#1=0 (tool disk cw symbol)
(38)IF[#201 > [#400/2]] GOTO 1
(39)IF[[#201 >= #200] || [#200 > [#201+[#400/2]]]] GOTO 2
(40)M89 P9 L1 (tool disk cw )
(41)#1=0 (symbol is 0)
(42)GOTO 3
(43)N2
(44)M89 P10 L1 (tool disk ccw output )
(45)#1=1 (symbol is 1)
(46)GOTO 3
(47)N1
(48)IF[[#201 >= #200 && #200 <= #400] && [#200 > [#201+#400/2]MOD#400]] GOTO 4
(49)M89 P9 L1
(50)#1=0
(51)GOTO 3
(52)N4
(53)M89 P10 L1
(54)#1=1
(55)N3
(56)#2=#201 (present tool number save a
interim variable)
(57)WHILE[#2!=#200] DO1 (judge present tool is same as the target
tool number)
(58)M88 P7 L0 (waiting count signal turn low)
(59)M88 P7 L1 (waiting tool count signal turn
high)
(60)IF[#1==1] GOTO 7 (judge it is ccw or not )
(61)#2 = #2+1 (variable add1 each time)
(62)IF[#2>#400] #2=1 (turn back to 1 if the tool number
exceed system's tool number)
(63)GOTO 8
(64)N7
(65)#2 = #2-1 ( variable reduce 1 each time)
(66)IF[#2<=0] #2=#400 (count less than 0 and restart from
the biggest tool number)
(67)N8
(68)END1 (loop end key word)
(69)IF[#1==1] GOTO 5
(70)G04 P#408 (delay)
(71)M89 P9 L0 (close disk cw signal)
(72)GOTO 6
(73)N5
(74)G04 P#409 (delay)
(75)M89 P10 L0 (close disk ccw signal)
(76)N6
(77)M89 P11 L1 (output air cylinder push signal)
(78)M88 P6 L0 (wait disk air cylinder push input
(79)M89 P13 L1 (spindle blow open)
(80)G04 X#407 (spindle blow delay)
(81)M89 P13 L0 (close blow)
(82)M89 P12 L1 (spindle spindle air cylinder push signal )
(83)M88 P9 L0 (tool spindle tool loosen input position)
(84)G01 Z[#403+2.5] F#405 (Z axis move to tool chaning point
(85)M89 P12 L0 (spindle catch the tool)
(86)G01 Z#403 F6000 (move to Z axis base point at the same time,prevent
spindle hold on to cutter when grabing the tool)
(87)M88 P10 L0 (spindle tool clamp input )
(88)M89 P11 L0 (disk ccw output back)
(89)M88 P5 L0 (disk air cylinder back input)
(90)M89 P8 L0 (spindle spindle stop accurately output signal invalid)
(91)G01 Z[#403+#404] F#405 (Z axis raise to safe position)
(92)#2=#[409+#200] (get the present tool 's setting value)
(93)#3=#[409+#201] (get the previous tool 's setting value)
(94)#1=#2-#3 (count these two tool's length excursion )
(95)#1=#4126-#1 (count length compensation
dosage)
(96)#4126=#1 (setting length compensation
dosage)
(97)N100 (program skip tab)
(98)M30 (program end)
(99)%

5 load tool changing macro program


After making macro program ,you need to change parameters then make the program
active,,change the manage parameter 023,set it to be User-Def. after changing ,pls restart controller
COPY PROGRAM TO CONTROLLER
copy the program into Macro file

Lead in CSV system configuration table


When show this ,select parameter 013,and press EOB,then will show that

Then press EOB,the controller will restart

You might also like