ATC Function&Macro Program
ATC Function&Macro Program
Introduction In order to improve the processing efficiency of metal cutting machine tools,
vertical machining centers are generally equipped with disc-type tool magazines. The specific
method of tool selection in the disc-type tool magazine is two-way nearest tool selection, and the
tool change method is random tool change. The tool changing process is more complicated. First,
install all the tools that need to be used in the machining process on the standard tool holders.
After pre-adjusting the size outside the machine, put them into the tool magazine in a certain way.
When changing the tool, put them in the tool magazine first. The tool is selected in the middle,
and the tool is taken out from the tool magazine and the spindle by the tool exchange device. After
a tool exchange, load the new tool into the spindle and put the old tool back into the magazine.
The tool magazine for storing tools has a large capacity and can be installed either on the side or
above the headstock, or as a separate component outside the machine.
The characteristic of the chain-type tool magazine is that it can store a large number of tools,
generally more than 20, and some can store more than 120. It transmits the tool to be replaced to the
designated position through the chain, and the tool is mounted on the spindle by the manipulator.
2. ATC Principle
The tool exchange method of CNC machine tools is usually divided into two categories:
tool exchange realized by the relative movement of the tool magazine and the machine tool
spindle, and tool exchange by manipulator. The way the tools are exchanged and their specific
structure has a direct impact on the productivity and reliability of the machine tool.
Tool exchange method 1: The tool exchange device is realized by the relative movement of
the tool magazine and the machine tool spindle. When changing the tool, the used tool must be
returned to the tool magazine, and then the new tool is taken out from the tool magazine. These
two actions Simultaneous operations are not possible, resulting in long tool change times.
Tool exchange method 2: The method of tool exchange using a manipulator is the most
widely used, because the manipulator has great flexibility in tool change and can reduce the tool
change time. At present, most of the machining centers use the memory-type optional tool change
method. In this way, the tool number and the position (address) of the tool pocket in the tool
magazine can be correspondingly stored in the CNC system, and no matter which tool pocket the
tool is placed in, its trace is always memorized. The tool magazine is equipped with a position
detection device (usually installed with the motor), which can detect the position of each tool
pocket, so that the tool can be taken out and returned arbitrarily. There is also a mechanical origin
on the tool magazine, so that each time a tool is selected, the nearest tool is selected. For example,
for a disc-type tool magazine, the forward or reverse rotation of each tool selection will not exceed
180º.
Here we take the disc tool magazine and the principle of nearest tool selection in "tool
exchange mode 1" as an example to explain the process of implementing macro programs in detail.
Taking this example as a reference for the user to write such a tool magazine, firstly, according to
the actual working principle of the tool magazine, formulate a tool change flow chart to clarify the
process for the use of macro code programming.
2.3 Create a flow chart
Tool change flow chart of umbrella tool magazine
OUTPUT
Seq. Function Pin
1 Spindle Orientation 9
2 CW ration of tool magazine 10
3 CCW rotation of tool magazine 11
4 Forward magazine 12
5 Spindle chuck loosen 13
6 Blower 14
INPUT
Seq. Function Pin
1 Orientation End 5
2 In-Position of Backward magazine 6
3 In-position of forward magazine 7
4 Counting Tool Input 8
5 Home of magazine input 9
6 Spindle Loose Tool In position 10
7 Spindle Tighten tool in position 11
检查是否合法
当前刀号与目标刀具号
than max tool number, alarm)
(11){
(12)#3000=1(Warn:Setting tool number is over max allow tool number!) P3001 on System
parameter /alarm message can be altered)
(13)}
(14)IF[#201==0] (current tool number is 0,& alarm)
(15){
(16)#3000=1(Current tool number is 0 & alarm!)
(17)}
This macro program corresponds to the "tool change T code" in the flowchart. The function
detects whether there is a tool change command in the system and checks the tool number. "(2)
G90 G599" enters the tool change program, first switch to the G599 machine coordinate system
and With absolute programming, the tool relative to each axis of the machine tool is based on the
machine tool coordinate system, so the configurable parameters of each tool are also set with the
machine tool coordinate as a reference, "(3 )#201=#4120" reads the current tool number into the
#201 variable for comparison with "(5 )IF[[#200] == #201]GOTO 100", the value in the #200
variable is the target tool number passed in by the code, the target tool number and the current If
the tool number is the same, it will jump to N100 without executing the tool change action. If it is
different, execute the following statement. "(6 )IF[#400 > 24]" is used to check whether the
maximum tool value set by the user exceeds the actual capacity of the tool magazine. 24 tools, if it
exceeds, set the alarm flag "(8 )#3000=1" and alarm to terminate the tool change. 10-17 is the tool
inspection, and there is no problem to execute the subsequent code.
The current tool number is greater than the target tool number or the target tool is in the second
half of the tool magazine, such as the maximum number of tools is 24, the current tool number 1,
the target tool number 16 The nearest path: 1->24-23... No. 16
When the code condition corresponding to (49) is established, jump to N4 for reverse tool
selection, otherwise, execute the following forward rotation tool selection in sequence, and the
establishment diagram is as follows:
(When the code condition corresponding to (49) is established, jump to N4 for reverse tool
selection, otherwise, execute the following forward rotation tool selection in sequence, and the
establishment diagram is as follows:)
(49)M89 P9 L1 (Forward rotation of cutterhead P9 Forward rotation signal
of cutterhead)
(50)#1=0 (remark is 0,CW rotation for choose tool)
(51)GOTO 3 Skip to part for choose tool
(64)N7
(65)#2 = #2-1 (Variable -1 each time when CW rotation)
(66)IF[#2<=0] #2=#400 (when counting <0, renew count from max tool number)
(67)N8
(68)END1 (special code for end of loop)
The function of the codes from (55) to (68) is to select the tool according to the previously
calculated tool selection direction. The principle is that the current tool number is accumulated or
decremented, and the tool selection is completed when the value reaches the target tool number.
(73)N5
(74)G04 P#409 (turn off CCW rotation after this delay)
(75)M89 P10 L0 (turn off CCW rotation)
The function of the codes from (69) to (75) is to close the corresponding port according to the tool
selection direction calculated earlier.
2.5.6 Spindle take tool from tool magazine
(76)N6
(77)M89 P11 L1 (Output that forward magazine)
(78)M88 P6 L0 (Waiting for forward in position)
(79)M89 P13 L1 (Turn on spindle blower)
Spindle take tool
(80)G04 X#407 (Delay for blower)
from magazine,and
(81)M89 P13 L0 (Turn off spindle blower)
return magazine
(82)M89 P12 L1 (Output that spindle loosen tool)
backward
(83)M88 P9 L0 (Waiting for loosen tool in position)
(84)G01 Z[#403+2.5] F#405 (Z-axis lift up 2.5mm)
(85)M89 P12 L0 (Spindle get tool)
(86)G01 Z#403 F6000 (Move Z-axis to reference point,avoid collision)
(87)M88 P10 L0 (waiting for Spindle clamp tool in position)
(88)M89 P11 L0 (Output that backward tool magazine)
(89)M88 P5 L0 (Waiting for backward in position)
(90)M89 P8 L0 (Reset spindle orientation )
(91)G01 Z[#403+#404] F#405 (Z-axis lift up to safe position)
Mike
2022-2-16