8 COORDINATE VALUE AND DIMENSION This chapter contains the following topics.
8.1 ABSOLUTE AND INCREMENTAL PROGRAMMING (G90, G91) 8.2 POLAR COORDINATE COMMAND (G15, G16) 8.3 INCH/METRIC CONVERSION (G20, G21) 8.4 DECIMAL POINT PROGRAMMING
PROGRAMMINGB–64124EN/01 8. COORDINATE VALUE
AND DIMENSION
99
There are two ways to command travels of the tool; the absolute command, and the incremental command. In the absolute command, coordinate value of the end position is programmed; in the incremental command, move distance of the position itself is programmed. G90 and G91 are used to command absolute or incremental command, respectively.
 COORDINATE VALUE AND DIMENSION B–64124EN/01
100
The end point coordinate value can be input in polar coordinates (radius and angle). The plus direction of the angle is counterclockwise of the selected plane first axis + direction, and the minus direction is clockwise. Both radius and angle can be commanded in either absolute or incremental command (G90, G91).
_
G�� G�� G16 ;
_ ;
G15 ;
G16 Polar coordinate command
G15
G��
G��
Starting the polar coordinate command (polar coordinate mode)
Polar coordinate command
Canceling the polar coordinate command (polar coordinate mode)
Polar coordinate command cancel
Plane selection of the polar coordinate command (G17, G18 or G19)
G90 specifies the zero point of the work coordinate system as the origin of the polar coordinate system, from which a radius is measured. G91 specifies the current position as the origin of the polar coordinate system, from which a radius is measured.
Specifying the addresses of axes constituting the plane se- lected for the polar coordinate system, and their values First axis : radius of polar coordinate Second axis : radius of polar coordinate
G�� IP
IP
Specify the radius (the distance between the zero point and the point) to be programmed with an absolute command. The zero point of the work coordinate system is set as the origin of the polar coordinate system. When a local coordinate system (G52) is used, the origin of the local coordinate system becomes the center of the polar coordinates.
Radius Command position
Actual positionAngle
�%'(�
Angle
Command position
Actual position
When the angle is specified with an absolute command
When the angle is specified with an incremental command
8.2 POLAR COORDINATE COMMAND (G15, G16)
��� �
� Setting the zero point of the workpiece coordinate system as the origin of the polar coordinate system
PROGRAMMINGB–64124EN/01 8. COORDINATE VALUE
AND DIMENSION
101
Specify the radius (the distance between the current position and the point) to be programmed with an incremental command. The current position is set as the origin of the polar coordinate system.
Radius
Command position
Actual position
Angle
When the angle is specified with an absolute command
When the angle is specified with an incremental command
Command position
Actual position
Angle Radius
��� )��� �'����
Y
150°
30°
100mm
270° X
– The zero point of the work coordinate system is set as the origin of the polar coordinate system.
– The XY plane is selected.
N1 G17 G90 G16 ; Specifying the polar coordinate command and selecting the XY plane Setting the zero point of the work coordinate system as the origin of the polar coordinate system
N2 G81 X100.0 Y30.0 Z–20.0 R–5.0 F200.0 ; Specifying a distance of 100 mm and an angle of 30 degrees
N3 Y150.0 ; Specifying a distance of 100 mm and an angle of 150 degrees
N4 Y270.0 ; Specifying a distance of 100 mm and an angle of 270 degrees
N5 G15 G80 ; Canceling the polar coordinate command
N1 G17 G90 G16; Specifying the polar coordinate command and selecting the XY plane Setting the zero point of the work coordinate system as the origin of the polar coordinate system
�� �� � ���� ����� ����� ����� ������ �
Specifying a distance of 100 mm and an angle of 30 degrees N3 G91 Y120.0 ;
Specifying a distance of 100 mm and an angle of +120 degrees N4 Y120.0 ;
Specifying a distance of 100 mm and an angle of +120 degrees
� Setting the current position as the origin of the polar coordinate system
� ����
� Specifying angles and a radius with absolute commands
� Specifying angles with incremental commands and a radius with absolute commands
PROGRAMMING 8. COORDINATE VALUE AND DIMENSION B–64124EN/01
102
N5 G15 G80 ; Canceling the polar coordinate command
In the polar coordinate mode, specify a radius for circular interpolation or helical cutting (G02, G03) with R.
Axes specified for the following commands are not considered part of the polar coordinate command:
– Dwell (G04) – Programmable data input (G10) – Setting the local coordinate system (G52) – Converting the workpiece coordinate system (G92) – Selecting the machine coordinate system (G53) – Stored stroke check (G22) – Coordinate system rotation (G68) – Scaling (G51)
Neither optional–angle chamfering nor corner rounding can be commanded in polar coordinate mode.
Limitations
� Specifying a radius in the polar coordinate mode
� Axes that are not considered part of a polar coordinate command in the polar coordinate mode
� Optional–angle chamfering/corner rounding
PROGRAMMINGB–64124EN/01 8. COORDINATE VALUE
AND DIMENSION
103
Either inch or metric input can be selected by G code.
G20 ;
G21 ;
Inch input
mm input
This G code must be specified in an independent block before setting the coordinate system at the beginning of the program. After the G code for inch/metric conversion is specified, the unit of input data is switched to the least inch or metric input increment of increment system IS–B or IS–C (II–2.3). The unit of data input for degrees remains unchanged.The unit systems for the following values are changed after inch/metric conversion:
– Feedrate commanded by F code – Positional command – Work zero point offset value – Tool compensation value – Unit of scale for manual pulse generator – Movement distance in incremental feed – Some parameters When the power is turned on, the G code is the same as that held before the power was turned off.
WARNING 1 G20 and G21 must not be switched during a program. 2 When switching inch input (G20) to metric input (G21) and vice versa, the tool compensation
value must be re–set according to the least input increment. However, when bit 0 (OIM) of parameter 5006 is 1, tool compensation values are automatically converted and need not be re–set.
CAUTION For the first G28 command after switching inch input to metric input or vice versa, operation from the intermediate point is the same as that for manual reference position return. The tool moves from the intermediate point in the direction for reference position return, specified with bit 5 (ZMI) of parameter No. 1006.
NOTE 1 When the least input increment and the least command increment systems are different, the
maximum error is half of the least command increment. This error is not accumulated. 2 The inch and metric input can also be switched using settings. (See III-11.4.3)
8.3 INCH/METRIC CONVERSION (G20,G21)
��� �
PROGRAMMING 8. COORDINATE VALUE AND DIMENSION B–64124EN/01
104
Numerical values can be entered with a decimal point. A decimal point can be used when entering a distance, time, or speed. Decimal points can be specified with the following addresses: X, Y, Z, U, V, W, A, B, C, I, J, K, Q, R, and F.
There are two types of decimal point notation: calculator–type notation and standard notation. When calculator–type decimal notation is used, a value without decimal point is considered to be specified in millimeters inch,or deg. When standard decimal notation is used, such a value is considered to be specified in least input increments.Select either calculator–type or standard decimal notation by using the DPI bit (bit 0 of parameter 3401).Values can be specified both with and without decimal point in a single program.
Program command Pocket calculator type decimal point
programming
Standard type decimal point programming
X1000 Command value without decimal point
1000mm Unit : mm
1mm
Unit : Least input increment (0.001 mm)
X1000.0 Command value with decimal point
1000mm Unit : mm
1000mm Unit : mm
WARNING In a single block, specify a G code before entering a value. The position of decimal point may depend on the command. Examples: G20; Input in inches X1.0 G04; X1.0 is considered to be a distance and processed as X10000. This command
is equivalent to G04 X10000. The tool dwells for 10 seconds. G04 X1.0; Equivalent to G04 X1000. The tool dwells for one second.
NOTE � Fractions less than the least input increment are truncated.
Examples: X1.23456; Truncated to X1.234 when the least input increment is 0.001 mm.
Processed as X1.2345 when the least input increment is 0.0001 inch. � When more than eight digits are specified, an alarm occurs. If a value is entered with a decimal
point, the number of digits is also checked after the value is converted to an integer according to the least input increment. Examples: X1.23456789; P/S alarm 0.003 occurs because more than eight digits are specified. X123456.7; If the least input increment is 0.001 mm, the value is converted to integer
123456700. Because the integer has more than eight digits, an alarm occurs.
8.4 DECIMAL POINT PROGRAMMING
��� � �����
� ����
PROGRAMMINGB–64124EN/01 9. SPINDLE SPEED FUNCTION
(S FUNCTION)
105
9 SPINDLE SPEED FUNCTION (S FUNCTION) The spindle speed can be controlled by specifying a value following address S. This chapter contains the following topics.
9.1 SPECIFYING THE SPINDLE SPEED WITH A CODE 9.2 SPECIFYING THE SPINDLE SPEED VALUE DIRECTLY 9.2 (S5–DIGIT COMMAND) 9.3 CONSTANT SURFACE SPEED CONTROL (G96, G97)
PROGRAMMING 9. SPINDLE SPEED FUNCTION
(S FUNCTION) B–64124EN/01
106
When a value is specified after address S, the code signal and strobe signal are sent to the machine to control the spindle rotation speed. A block can contain only one S code. Refer to the appropriate manual provided by the machine tool builder for details such as the number of digits in an S code or the execution order when a move command and an S code command are in the same block.
The spindle speed can be specified directly by address S followed by a max.five–digit value (min-1). The unit for specifying the spindle speed may vary depending on the machine tool builder. Refer to the appropriate manual provided by the machine tool builder for details.
9.1 SPECIFYING THE SPINDLE SPEED WITH A CODE
9.2 SPECIFYING THE SPINDLE SPEED VALUE DIRECTLY (S5–DIGIT COMMAND)
PROGRAMMINGB–64124EN/01 9. SPINDLE SPEED FUNCTION
(S FUNCTION)
107
Specify the surface speed (relative speed between the tool and workpiece) following S. The spindle is rotated so that the surface speed is constant regardless of the position of the tool.
G96 S����� ;
↑ Surface speed (m/min or feet/min)
Note : This surface speed unit may change according to machine tool builder’s specification.
G97 S����� ;
↑ Spindle speed (min-1)
Note : This surface speed unit may change according to machine tool builder’s specification.
G96 Pα ; P0 : Axis set in the parameter (No. 3770) P1 : X axis, P2 : Y axis, P3 : Z axis, P4 : 4th axis
G92 S_ ; The maximum spindle speed (min-1) follows S.
9.3 CONSTANT SURFACE SPEED CONTROL (G96, G97)
��� �
� Constant surface speed control command
� Constant surface speed control cancel command
� Constant surface speed controlled axis command
� Clamp of maximum spindle speed
PROGRAMMING 9. SPINDLE SPEED FUNCTION
(S FUNCTION) B–64124EN/01
108
G96 (constant surface speed control command) is a modal G code. After a G96 command is specified, the program enters the constant surface speed control mode (G96 mode) and specified S values are assumed as a surface speed. A G96 command must specify the axis along which constant surface speed control is applied. A G97 command cancels the G96 mode.When constant surface speed control is applied, a spindle speed higher than the value specified in G92S_; (maximum spindle speed) is clamped at the maximum spindle speed. When the power is turned on, the maximum spindle speed is not yet set and the speed is not clamped.S (surface speed) commands in the G96 mode are assumed as S = 0 (the surface speed is 0) until M03 (rotating the spindle in the positive direction) or M04 (rotating the spindle in the negative direction) appears in the program.
Fig. 9.3 (a) Relation between workpiece radius, spindle speed and surface speed
The spindle speed (min-1) almost coincides with the surface speed (m/min) at approx. 160 mm (radius).
Surface speed
S is 600 m/min.
radius (mm)
Spindle speed (min-1)
To execute the constant surface speed control, it is necessary to set the work coordinate system , and so the coordinate value at the center of the rotary axis, for example, Z axis, (axis to which the constant surface speed control applies) becomes zero.
X
Z
0
Fig. 9.3 (b) Example of the workpiece coordinate system for constant surface speed control
��� � �����
� Constant surface speed control command (G96)
� Setting the workpiece coordinate system for constant surface speed control
PROGRAMMINGB–64124EN/01 9. SPINDLE SPEED FUNCTION
(S FUNCTION)
109
G96 mode G97 mode
Specify the surface speed in m/min (or feet/min)
G97 command
Store the surface speed in m/min (or feet/min)
Command for the spindle speed
Specified
The specified spindle speed (min-1) is used
Not specified
The surface speed (m/min or feet/min) is converted to the spindle speed (min-1)
Commands other than G96
G96 command
The specified surface speed is used
Command for the surface
speed
The stored surface speed (m/min or feet/min) is used. If no surface speed is stored, 0 is assumed.
Specified
Not specified
The constant surface speed control is also effective during threading. Accordingly, it is recommended that the constant surface speed control be invalidated with G97 command before starting the scroll threading and taper threading, because the response problem in the servo system may not be considered when the spindle speed changes.
In a rapid traverse block specified by G00, the constant surface speed control is not made by calculating the surface speed to a transient change of the tool position, but is made by calculating the surface speed based on the position at the end point of the rapid traverse block, on the condition that cutting is not executed at rapid traverse.
� Surface speed specified in the G96 mode
������������
� Constant surface speed control for threading
� Constant surface speed control for rapid traverse (G00)
PROGRAMMING 10. TOOL FUNCTION
(T FUNCTION) B–64124EN/01
110
10 TOOL FUNCTION (T FUNCTION) Two tool functions are available. One is the tool selection function, and the other is the tool life management function.
General
PROGRAMMINGB–64124EN/01 10. TOOL FUNCTION
(T FUNCTION)
111
By specifying an up to 8–digit numerical value following address T, tools can be selected on the machine. One T code can be commanded in a block. Refer to the machine tool builder’s manual for the number of digits commandable with address T and the correspondence between the T codes and machine operations. When a move command and a T code are specified in the same block, the commands are executed in one of the following two ways:
(i) Simultaneous execution of the move command and T function commands.
(ii)Executing T function commands upon completion of move command execution. The selection of either (i) or (ii) depends on the machine tool builder’s specifications. Refer to the manual issued by the machine tool builder for details.
10.1 TOOL SELECTION FUNCTION
PROGRAMMING 10. TOOL FUNCTION
(T FUNCTION) B–64124EN/01
112
Tools are classified into various groups, with the tool life (time or frequency of use) for each group being specified. The function of accumulating the tool life of each group in use and selecting and using the next tool previously sequenced in the same group, is called the tool life management function.
Tool group number m
Tool lifeTool number
Code specifying tool compensa- tion value
�
The first tool life management data
The nth tool life management data
Fig. 10.2 (a) Tool life management data (number of n tools)
By choosing a tool from a tool group specified by a machining program, the tool life can be managed.
Tool life management data
Tool group number 1
Command for selecting tool group m
Tool change command (M06)
Machining program
Machine CNC
Tool selection
Machine and CNC operations
Tool group number m
Tool group number p
Places a se- lected tool in the wait state
Attaches the tool in the wait state to the spindle (tool change).
Automatically selects, from tool group m, a tool whose life has not expired.
Starts counting the life of the tool attached to the spindle.l
Fig. 10.2 (b) Tool Selection by machining program
10.2 TOOL LIFE MANAGEMENT FUNCTION
PROGRAMMINGB–64124EN/01 10. TOOL FUNCTION
(T FUNCTION)
113
Tool life management data consists of tool group numbers, tool numbers, codes specifying tool compensation values, and tool life value.
The Max. number of groups and the number of tools per group that can be registered are set by parameter (GS1,GS2 No. 6800#0, #1) (Table 10.2.1).
Table 10.2.1 The Max. number of groups and tools that can be registered
GS1 (No. 6800#0)
GS2 (No. 6800#1) Number of group Number of tool
0 0 16 16
0 1 32 8
1 0 64 4
1 1 128 2
WARNING When bits 0 or 1 of parameter GS1,GS2 No.6800 is changed, re–register tool life management data with the G10L3 command (for registering and deleting data for all groups). Otherwise, new data pairs cannot be set.
Specify a four–digit number after T.
Codes specifying tool offset values are classified into H codes (for tool length offset) and D codes (cutter compensation). The maximum number of the tool compensation value specification code which can be registered is 255 when there are 400 tool compensation values.
NOTE When codes specifying tool offset values are not used, registration can be omitted.
Refer to II–10.2.2 and II–10.2.4.
10.2.1 Tool Life Management Data
��� � �����
� Tool group number
� Tool number
� Code specifying tool compensation value
� Tool life value
PROGRAMMING 10. TOOL FUNCTION
(T FUNCTION) B–64124EN/01
114
In a program, tool life management data can be registered in the CNC unit, and registered tool life management data can be changed or deleted.
A different program format is used for each of the four types of operations described below.
After all registered tool life management data is deleted, programmed tool life management data is registered.
Programmed tool life management data for a group can be added or changed.
Programmed tool life management data for a group can be deleted.
Count types (time or frequency can be registered for individual groups.
Whether tool life is to be indicated by time (minutes) or by frequency, it is set by a parameter LTM (No. 6800 #2) . Maximum value of tool life is as follows.
In case of minute:4300(minutes) In case of frequency :9999(times)
10.2.2 Register, Change and Delete of Tool Life Management Data
��� � �����
� Register with deleting all groups
� Addition and change of tool life management data
� Deletion of tool life management data
� Register of tool life count type
� Life value
PROGRAMMINGB–64124EN/01 10. TOOL FUNCTION
(T FUNCTION)
115
G10L3 ; P L ; T H D ; T H D ;
P L ; T H D ; T H D ;
G11 ; M02 (M30) ;
G10L3 :Register with deleting all groups P :Group number L :Life value T :Tool number H :Code specifying tool offset value
(H code) D :Code specifying tool offset value
(D code) G11 :End of registration
Meaning of commandFormat � Register with deleting
all groups
G10L3P1 ; P L ; T H D ; T H D ;
P L ; T H D ; T H D ;
G11 ; M02 (M30) ;
G10L3P1 :Addition and change of group P :Group number L :Life value T :Tool number H :Code specifying tool offset value
(H code) D :Code specifying tool offset value
(D code) G11 :End of addition and change of
group
� Addition and change of tool life management data
Meaning of commandFormat
G10L3P2 ; P ; P ; P ; P ;
G11 ; M02 (M30) ;
G10L3P2 :Deletion of group P :Group number G11 :End of deletion of group
Meaning of commandFormat� Deletion of tool life management data
Format
PROGRAMMING 10. TOOL FUNCTION
(T FUNCTION) B–64124EN/01
116
G10L3 or G10L3P1); P L Q ; T H D ; T H D ;
P L Q ; T H D ; T H D ;
G11 ; M02 (M30) ;
⋅ ⋅
Q_ : Life count type (1:Frequency, 2:Time)
Meaning of commandFormat � Setting a tool life cout
type for groups
CAUTION 1 When the Q command is omitted, the value set in bit 2 (LTM)
of parameter No.6800 is used as the life count type. 2 G10L3P1 and G10L3L2 can be commanded only when the
extended tool life management feature is enabled. (Parameter EXT (No.6801#6) = 1)
PROGRAMMINGB–64124EN/01 10. TOOL FUNCTION
(T FUNCTION)
117
The following command is used for tool life management: T����; Specifies a tool group number.
The tool life management function selects, from a specified group, a tool whose life has not expired, and outputs its T code. In ����, specify a number calculated by adding the tool life management cancel number specified in parameter6810 to a group number. For example, to set tool group 1 when the tool life management cancel number is 100, specify T101;.
NOTE When ���� is less than a tool life management cancel number, the T code is treated as an ordinary T code.
M06; Terminates life management for the previously used tools,
and begins counting the life of the new tools selected with
the T code.
WARNING When an option for speciofying multiple M codes is selected, specify this code by itself or as the first M code.
H99; Selects the H code of tool life management data for the tool
currently being used.
H00; Cancels tool length offset
D99; Selects the D code of tool life management data for the tool
currently being used.
D00; Cancels cutter compensation
WARNING H99 or D99 must be specified after the M06 command. When a code other than H99 or D99 is specified after the M06 command, the H code and D code of tool life management data are not selected.
10.2.3 Tool Life Management Command in a Machining Program
��� � �����
� Command
PROGRAMMING 10. TOOL FUNCTION
(T FUNCTION) B–64124EN/01
118
For tool life management, the four tool change types indicated below are available. The type used varies from one machine to another. For details, refer to the appropriate manual of each machinde tool builder.
Table 10.2.3 Tool Change Type Tool change
type A B C D
Tool group number spe- cified in the same block as the tool change com- mand (M06)
Previously used tools
Tools to be used next
Tool life count timing
Life counting is performed for a tool in the specified tool group when M06 is specified next.
Life counting is performed when a tool in the tool group speci- fied in the same block as M06 is specified.
Remarks Normally, when a tool group number is specified by itself, type B is used. However, no alarm is raised even if the tool group number is speci- fied by itself as type C.
When only M06 is speci- fied, P/S alarm No. 153 is issued.
Parameter No. 6800#7 (M6T)=0
No.6801#7 (M6E)=0
No. 6800#7 (M6T)=1 No. 6801#7 (M6E)=0
No.6801#7 (M6E)=1
NOTE When a tool group number is specified and a new tool is selected, the new tool selection signal is output.
Suppose that the tool life management cancel number is 100.
T101; A tool whose life has not expired is selected from group 1. (Suppose that tool number 010 is selected.)
M06; Tool life counting is performed for the tool in group 1. (The life of tool number 010 is counted.)
T102; A tool whose life has not expired is selected from group 2. (Suppose that tool number 100 is selected.)
M06T101; Tool life counting is performed for the tool in group 2. (The life of tool number 100 is counted.) The number of the tool currently used (in group 1) is
output with a T code signal. (Tool number 010 is output.)
� Types
Examples
� Tool change type A
PROGRAMMINGB–64124EN/01 10. TOOL FUNCTION
(T FUNCTION)
119
Suppose that the tool life management ignore number is 100.
T101; A tool whose life has not expired is selected from group 1. (Suppose that tool number 010 is selected.)
M06T102;Tool life counting is performed for the tool in group 1. (The life of tool number 010 is counted.) A tool whose life has not expired is selected from group 2. (Suppose that toolnumber 100 is selected.
M06T103;Tool life counting is lperformed for the tool in group 2. (The life of tool number 100 is counted.) A tool whose life has not expired is selected from group 3. (Suppose that tool number 200 is selected.)
Suppose that the tool life management ignore number is 100. T101M06;A tool whose life has not expired is selected from group 1. (Suppose that tool number 010 is selected.)
Tool life counting is performed for the tool in group 1.
T102M06;A tool whose life has not expired is selected from group 2. (Suppose that tool number 100 is selected.) Tool life counting is performed for the tool in group 2. (The life of tool number 100 is counted.)
� Tool change type B and C
� Tool change type D
PROGRAMMING 10. TOOL FUNCTION
(T FUNCTION) B–64124EN/01
120
The life of a tool is specified by a usage frequency (count) or usage time (in minutes).
The usage count is incremented by 1 for each tool used in a program. In other words, the usage count is incremented by 1 only when the first tool group number and tool change command are specified after the CNC unit enters the automatic operation state from the reset state.
CAUTION Even if the same tool group number is specified more than once in a program, the usage count is only incremented by 1 and no new tools are selected.
When a tool change is specified (M06), tool life management is started for the tools specified by the tool group number. In tool life management, the time during which a tool is used in the cutting mode is counted in four second increments., If the tool group is changed before the incremental time of four seconds elapses, the time is not counted. The time a tool is used for single block stop, feed hold, rapid traverse, dwell, machine lock, and interlock is not counted.
NOTE 1 When a tool is selected from available tools, tools are
searched starting from the current tool towards the lasttool to find a tool whose life has not expired. When thelast tool is reached during this search, the search restartsfrom the first tool. When it has been determined that there are no tools whose life has not expired, the last tool is selected. When the tool currently being used is changed by tool skip signal, the next new tool is selected using the method described here.
2 When tool life is counted by time, the life counting can be overridden using the tool life count override signal. An override from 0 to 99.9 can be applied. When 0 is specified, time is not counted. Before the override capability can be used, bit 2 of parameter LFV No.6801 must be set.
3 When tool life counting indicates that the life of the last tool in a group has expired, the tool change signal is output. When tool life is managed by time, the signal is output when the life of the last tool in the group has expired. When tool life is managed by usage frequency (count), the signal is output when the CNC unit is reset or the tool life count restart M code is specified.
10.2.4 Tool Life
Explanations
� Usage count
� Usage time
PROGRAMMINGB–64124EN/01 11. AUXILIARY FUNCTION
121
11 AUXILIARY FUNCTION There are two types of auxiliary functions ; miscellaneous function (M code) for specifying spindle start, spindle stop program end, and so on, and secondary auxiliary function (B code) for specifying index table positioning. When a move command and miscellaneous function are specified in the same block, the commands are executed in one of the following two ways:
i) Simultaneous execution of the move command and miscellaneous function commands.
ii) Executing miscellaneous function commands upon completion of move command execution.
The selection of either sequence depends on the machine tool builder’s specification. Refer to the manual issued by the machine tool builder for details.
General
PROGRAMMING11. AUXILIARY FUNCTION B–64124EN/01
122
When a numeral is specified following address M, code signal and a strobe signal are sent to the machine. The machine uses these signals to turn on or off its functions. Usually, only one M code can be specified in one block. In some cases, however, up to three M codes can be specified for some types of machine tools. Which M code corresponds to which machine function is determined by the machine tool builder. The machine processes all operations specified by M codes except those specified by M98, M99,M198 or called subprogram(Parameter No.6071 to 6079), or called custom macro (Parameter No.6080 to 6089). Refer to the machine tool builder’s instruction manual for details.
The following M codes have special meanings.
This indicates the end of the main program Automatic operation is stopped and the CNC unit is reset. This differs with the machine tool builder. After a block specifying the end of the program is executed, control returns to the start of the program. Bit 5 of parameter 3404 (M02) or bit 4 of parameter 3404 (M30) can be used to disable M02, M30 from returning control to the start of the program.
Automatic operation is stopped after a block containing M00 is executed. When the program is stopped, all existing modal information remains unchanged. The automatic operation can be restarted by actuating the cycle operation. This differs with the machine tool builder.
Similarly to M00, automatic operation is stopped after a block containing M01 is executed. This code is only effective when the Optional Stop switch on the machine operator’s panel has been pressed.
This code is used to call a subprogram. The code and strobe signals are not sent. See the subprogram II– 12.3 for details .
This code indicates the end of a subprogram. M99 execution returns control to the main program. The code and strobe signals are not sent. See the subprogram section 12.3 for details.
This code is used to call a subprogram of a file in the external input/output function. See the description of the subprogram call function (III–4.6) for details.
NOTE The block following M00, M01, M02, or M30 is not pre–read (buffered). Similarly, ten M codes which do not buffer can be set by parameters (Nos. 3411 to 3420). Refer to the machine tool builder’s instruction manual for these M codes.
11.1 AUXILIARY FUNCTION (M FUNCTION)
Explanations
� .)&/.)(
� �� �� ���"� �
� .))
�*��"� �����
� .)�
�0����� � �����
� .,'
� ����" �� ���1
���"� )
� .,,
� �� �� ������"� �
� M198 (Calling a subprogram)
PROGRAMMINGB–64124EN/01 11. AUXILIARY FUNCTION
123
In general, only one M code can be specified in a block. However, up to three M codes can be specified at once in a block by setting bit 7 (M3B) of parameter No. 3404 to 1. Up to three M codes specified in a block are simultaneously output to the machine. This means that compared with the conventional method of a single M command in a single block, a shorter cycle time can be realized in machining.
CNC allows up to three M codes to be specified in one block. However, some M codes cannot be specified at the same time due to mechanical operation restrictions. For detailed information about the mechanical operation restrictions on simultaneous specification of multiple M codes in one block, refer to the manual of each machine tool builder. M00, M01, M02, M30, M98, M99, or M198 must not be specified together with another M code. Some M codes other than M00, M01, M02, M30, M98, M99, and M198 cannot be specified together with other M codes; each of those M codes must be specified in a single block. Such M codes include these which direct the CNC to perform internal operations in addition to sending the M codes themselves to the machine. To be specified, such M codes are M codes for calling program numbers 9001 to 9009 and M codes for disabling advance reading (buffering) of subsequent blocks. Meanwhile, multiple of M codes that direct the CNC only to send the M codes themselves (without performing internal operations ) can be specified in a single block.
One M command in a single block
Multiple M commands in a single block
M40 ; M50 ; M60 ; G28G91X0Y0Z0 ;
: : :
M40M50M60 ; G28G91X0Y0Z0 ;
: : : : :
11.2 MULTIPLE M COMMANDS IN A SINGLE BLOCK
Explanations
Examples
PROGRAMMING11. AUXILIARY FUNCTION B–64124EN/01
124
When a value is specified after address B, the code signal and strobe signal are output. The code is retained until a B code is specified next. The functions are used for machine side operations such as indexing for the rotation axis. Each block can contain only one B code. Setting parameter No. 3460 enables the use of one of addresses A, C, V, and W, instead of address B. However, this address must be different from that for the controlled axis. For details, refer to the manual issued by the machine tool builder.
0 to 99999999
1. To enable the use of a decimal point, set bit 0 (AUP) of parameter No.3450 to 1.
Command Output value B10. 10000 B10 10
2. Use bit 0 (DPI) of parameter No. 3401 to specify whether the magnification for B output will be �1000 or �1 when a decimal point is omitted.
Command Output value DPI=1 B1 1000 DPI=0 B1 1
3. Use bit 0 (AUX) of parameter No. 3405 to specify whether the magnification for B output will be �1000 or �10000 when a decimal point is omitted for the inch Input system (only when DPI=1).
Command Output value AUX=1 B1 10000 AUX=0 B1 1000
The address (B or the address specified with parameter No. 3460) used with the second auxiliary functions cannot be used for the controlled axis name (parameter No. 1020).
11.3 THE SECOND AUXILIARY FUNCTIONS (B CODES)
Explanations
� Valid data range
� Specification
Restrictions
PROGRAMMINGB–64124EN/01 12. PROGRAM CONFIGURATION
125
12 PROGRAM CONFIGURATION
There are two program types, main program and subprogram. Normally, the CNC operates according to the main program. However, when a command calling a subprogram is encountered in the main program, control is passed to the subprogram. When a command specifying a return to the main program is encountered in a subprogram, control is returned to the main program.
Follow the direction of the subprogram
Main program �(�&��*��+
Instruction 1
Instruction 2
Instruction n
Instruction 1�
Instruction 2�
Instruction n+1
� (� � )� +�' &��*��+
Fig. 12 (a) Main program and subprogram
The CNC memory can hold up to 400 main programs and subprograms. A main program can be selected from the stored main programs to operate the machine. See III–9.3 or III–10 in OPERATION for the methods of registering and selecting programs.
General
� Main program and subprogram
PROGRAMMING12. PROGRAM CONFIGURATION B–64124EN/01
126
A program consists of the following components:
Table 12 Program components
Components Descriptions
Tape start Symbol indicating the start of a program file
Leader section Used for the title of a program file, etc.
Program start Symbol indicating the start of a program
Program section Commands for machining
Comment section Comments or directions for the operator
Tape end Symbol indicating the end of a program file
Tape start % TITLE ;
O0001 ;
M30 ;
%
(COMMENT)Program section
Leader section
Program start
Comment section
Tape end
Fig. 12 (b) Program configuration
A program section consists of several blocks. A program section starts with a program number and ends with a program end code.
*��"� ������� *��"� �������
�����"�� ����
Program number O0001 ; Block 1 N1 G91 G00 X120.0 Y80.0 ; Block 2 N2 G43 Z–32.0 H01 ; : : Block n Nn Z0 ; Program end M30 ;
A block contains information necessary for machining, such as a move command or coolant on/off command.Specifying a slash (/) at the start of a block disables the execution of some blocks (see “optional block skip” in II–12.2).
� Program components
� Program section configuration
PROGRAMMINGB–64124EN/01 12. PROGRAM CONFIGURATION
127
This section describes program components other than program sections. See II–12.2 for a program section.
Fig. 12.1 (a) Program configuration
The tape start indicates the start of a file that contains NC programs. The mark is not required when programs are entered using SYSTEM P or ordinary personal computers. The mark is not displayed on the screen. However, if the file is output,the mark is automatically output at the start of the file.
Table 12.1 (a) Code of a tape start
Name ISO code
EIA code
Notation in this manual
Tape start % ER %
Data entered before the programs in a file constitutes a leader section. When machining is started, the label skip state is usually set by turning on the power or resetting the system. In the label skip state, all information is ignored until the first end–of–block code is read. When a file is read into the CNC unit from an I/O device, leader sections are skipped by the label skip function. A leader section generally contains information such as a file header. When a leader section is skipped, even a TV parity check is not made. So a leader section can contain any codes except the EOB code.
The program start code is to be entered immediately after a leader section, that is, immediately before a program section. This code indicates the start of a program, and is always required to disable the label skip function. With SYSTEM P or ordinary personal computers, this code can be entered by pressing the return key.
Table 12.1 (b) Code of a program start
Name ISO code
EIA code
Notation in this manual
Program start LF CR ;
12.1 PROGRAM COMPONENTS OTHER THAN PROGRAM SECTIONS
Explanations
� Tape start
� Leader section
� Program start
% TITLE ;
O0001 ;
M30 ;
%
(COMMENT)
Tape start
Program section
Leader section
Program start
Comment section
Tape end
PROGRAMMING12. PROGRAM CONFIGURATION B–64124EN/01
128
NOTE If one file contains multiple programs, the EOB code for label skip operation must not appear before a second or subsequent program number.
Any information enclosed by the control–out and control–in codes is regarded as a comment. The user can enter a header, comments, directions to the operator, etc. in a comment section.
Table 12.1 (c) Codes of a control–in and a control–out
Name ISO code
EIA code
Notation in this manual
Meaning
Control–out ( 2–4–5 ( Start of comment section
Control–in ) 2–4–7 ) End of comment section
When a program is read into memory for memory operation, comment sections, if any, are not ignored but are also read into memory. Note, however, that codes other than those listed in the code table in Appendix A are ignored, and thus are not read into memory. When data in memory is output on external I/O device(See III–8), the comment sections are also output. When a program is displayed on the screen, its comment sections are also displayed. However, those codes that were ignored when read into memory are not output or displayed. During memory operation or DNC operation, all comment sections are ignored. The TV check function can be used for a comment section by setting parameter CTV (bit 1 of No. 0100).
CAUTION If a long comment section appears in the middle of a program section, a move along an axis may be suspended for a long time because of such a comment section. So a comment section should be placed where movement suspension may occur or no movement is involved.
NOTE 1 If only a control–in code is read with no matching
control–out code, the read control–in code is ignored. 2 The EOB code cannot be used in a comment.
� Comment section
PROGRAMMINGB–64124EN/01 12. PROGRAM CONFIGURATION
129
A tape end is to be placed at the end of a file containing NC programs. If programs are entered using the automatic programming system, the mark need not be entered. The mark is not displayed on the screen. However, when a file is output, the mark is automatically output at the end of the file. If an attempt is made to execute % when M02 or M03 is not placed at the end of the program, the P/S alarm (No. 5010) is occurred.
Table 12.1 (d) Code of a tape end
Name ISO code
EIA code
Notation in this manual
Tape end % ER %
� Tape end
PROGRAMMING12. PROGRAM CONFIGURATION B–64124EN/01
130
This section describes elements of a program section. See II–12.1 for program components other than program sections.
%
(COMMENT)
% TITLE;
O0001 ; N1 … ;
M30 ;
Program section Comment section
Program number
Sequence number
Program end
Fig. 12.2 (a) Program configuration
A program number consisting of address O followed by a four–digit number is assigned to each program at the beginning registered in memory to identify the program. In ISO code, the colon ( : ) can be used instead of O. When no program number is specified at the start of a program, the sequence number (N....) at the start of the program is regarded as its program number. If a five–digit sequence number is used, the lower four digits are registered as a program number. If the lower four digits are all 0, the program number registered immediately before added to 1 is registered as a program number. Note, however, that N0 cannot be used for a program number. If there is no program number or sequence number at the start of a program, a program number must be specified using the MDI panel when the program is stored in memory (See III–8.4 or III–10.1)
NOTE Program numbers 8000 to 9999 may be used by machine tool builders, and the user may not be able to use these numbers.
12.2 PROGRAM SECTION CONFIGURATION
� Program number
PROGRAMMINGB–64124EN/01 12. PROGRAM CONFIGURATION
131
A program consists of several commands. One command unit is called a block. One block is separated from another with an EOB of end of block code.
Table 12.2 (a) EOB code
Name ISO code
EIA code
Notation in this manual
End of block (EOB) LF CR ;
At the head of a block, a sequence number consisting of address N followed by a number not longer than five digits (1 to 99999) can be placed. Sequence numbers can be specified in a random order, and any numbers can be skipped. Sequence numbers may be specified for all blocks or only for desired blocks of the program. In general, however, it is convenient to assign sequence numbers in ascending order in phase with the machining steps (for example, when a new tool is used by tool replacement, and machining proceeds to a new surface with table indexing.)
N300 X200.0 Z300.0 ; A sequence number is underlined.
Fig. 12.2 (b) Sequence number and block (example)
NOTE N0 must not be used for the reason of file compatibility with other CNC systems. Program number 0 cannot be used. So 0 must not be used for a sequence number regarded as a program number.
A parity check is made for a block on input tape vertically. If the number of characters in one block (starting with the code immediately after an EOB and ending with the next EOB) is odd, an P/S alarm (No.002) is output. No TV check is made only for those parts that are skipped by the label skip function. Bit 1 (CTV) of parameter No. 0100 is used to specify whether comments enclosed in parentheses are counted as characters during TV check. The TV check function can be enabled or disabled by setting on the MDI unit (See III–11.4.3.).
� Sequence number and block
� TV check (Vertical parity check along tape)
PROGRAMMING12. PROGRAM CONFIGURATION B–64124EN/01
132
A block consists of one or more words. A word consists of an address followed by a number some digits long. (The plus sign (+) or minus sign (–) may be prefixed to a number.) Word = Address + number (Example : X–1000) For an address, one of the letters (A to Z) is used ; an address defines the meaning of a number that follows the address. Table 12.2 (b) indicates the usable addresses and their meanings. The same address may have different meanings, depending on the preparatory function specification.
Table 12.2 (b) Major functions and addresses
Function Address Meaning
Program number O (1) Program number
Sequence number N Sequence number
Preparatory function G Specifies a motion mode (linear, arc, etc.)
Dimension word X, Y, Z, U, V, W, A, B, C
Coordinate axis move command
I, J, K Coordinate of the arc center
R Arc radius
Feed function F Rate of feed per minute, Rate of feed per revolution
Spindle speed function S Spindle speed
Tool function T Tool number
Auxiliary function M On/off control on the machine tool
B Table indexing, etc.
Offset number D, H Offset number
Dwell P, X Dwell time
Program number designation
P Subprogram number
Number of repetitions
P Number of subprogram repetitions
Parameter P, Q Canned cycle parameter
NOTE In ISO code, the colon ( : ) can also be used as the address of a program number.
N_ G_ X_ Y_ F_ S_ T_ M_ ;
Sequence number
Preparatory function
Fig. 12.2 (c) 1 block (example)
Dimension word
Feed– function
Spindle speed function
Tool function
Miscellaneous function
� Block configuration (word and address)
PROGRAMMINGB–64124EN/01 12. PROGRAM CONFIGURATION
133
Major addresses and the ranges of values specified for the addresses are shown below. Note that these figures represent limits on the CNC side, which are totally different from limits on the machine tool side. For example, the CNC allows a tool to traverse up to about 100 m (in millimeter input) along the X axis. However, an actual stroke along the X axis may be limited to 2 m for a specific machine tool. Similarly, the CNC may be able to control a cutting federate of up to 240 m/min, but the machine tool may not allow more than 3 m/min. When developing a program, the user should carefully read the manuals of the machine tool as well as this manual to be familiar with the restrictions on programming.
Table 12.2 (c) Major addresses and ranges of command values
Function Address Input in mm Input in inch
Program number O (1) 1–9999 1–9999
Sequence number N 1–99999 1–99999
Preparatory function G 0–99 0–99
Dimen- sion word
Increment system IS–B
X, Y, Z, U, V, W, A, B, C,
± 99999.999mm ± 9999.9999inch
word Increment system IS–C
A, B, C, I, J, K, R, ± 9999.9999mm ± 999.99999inch
Feed per minute
Increment system IS–B
F 1–240000mm/min 0.01–9600.00 inch/min
minute Increment system IS–C
1–100000mm/min 0.01–4000.00 inch/min
Feed per revolution F 0.001–500.00 mm/rev
0.0001–9.9999 inch/rev
Spindle speed function S 0–20000 0–20000
Tool function T 0–99999999 0–99999999
Auxiliary function M 0–99999999 0–99999999
B 0–99999999 0–99999999
Offset number H, D 0–400 0–400
Dwell Increment system IS–B
X, P 0–99999.999s 0–99999.999s
Increment system IS–C
0–9999.9999s 0–9999.9999s
Designation of a pro- gram number
P 1–9999 1–9999
Number of subprogram repetitions
P 1–999 1–999
NOTE In ISO code, the colon ( : ) can also be used as the address of a program number.
� Major addresses and ranges of command values
PROGRAMMING12. PROGRAM CONFIGURATION B–64124EN/01
134
When a slash followed by a number (/n (n=1 to 9)) is specified at the head of a block, and optional block skip switch n on the machine operator panel is set to on, the information contained in the block for which /n corresponding to switch number n is specified is ignored in DNC operation or memory operation. When optional block skip switch n is set to off, the information contained in the block for which /n is specified is valid. This means that the operator can determine whether to skip the block containing /n. Number 1 for /1 can be omitted. However, when two or more optional block skip switches are used for one block, number 1 for /1 cannot be omitted. Example)
(Incorrect) (Correct) //3 G00X10.0; /1/3 G00X10.0;
This function is ignored when programs are loaded into memory. Blocks containing /n are also stored in memory, regardless of how the optional block skip switch is set. Programs held in memory can be output, regardless of how the optional block skip switches are set. Optional block skip is effective even during sequence number search operation. Depending on the machine tool, all optional block skip switches (1 to 9) may not be usable. Refer to manuals of the machine tool builder to find which switches are usable.
WARNING 1 Position of a slash
A slash (/) must be specified at the head of a block. If a slash is placed elsewhere, the information from the slash to immediately before the EOB code is ignored.
2 Disabling an optional block skip switch Optional block skip operation is processed when blocks are read from memory or tape into a buffer. Even if a switch is set to on after blocks are read into a buffer, the blocks already read are not ignored.
NOTE TV and TH check When an optional block skip switch is on. TH and TV checks are made for the skipped portions in the same way as when the optional block skip switch is off.
� Optional block skip
PROGRAMMINGB–64124EN/01 12. PROGRAM CONFIGURATION
135
The end of a program is indicated by programming one of the following codes at the end of the program:
Table 12.2 (d) Code of a program end
Code Meaning usage
M02 For main program
M30
M99 For subprogram
If one of the program end codes is executed in program execution, the CNC terminates the execution of the program, and the reset state is set. When the subprogram end code is executed, control returns to the program that called the subprogram.
WARNING A block containing an optional block skip code such as /M02 ; , /M30 ; , or /M99 ; is not regarded as the end of a program, if the optional block skip switch on the machine operator’s panel is set to on. (See “Optional block skip”.)
� Program end
PROGRAMMING12. PROGRAM CONFIGURATION B–64124EN/01
136
If a program contains a fixed sequence or frequently repeated pattern, such a sequence or pattern can be stored as a subprogram in memory to simplify the program. A subprogram can be called from the main program. A called subprogram can also call another subprogram.
O ���� ;
M99 ;
Subprogram number (or the colon (:) optionally in the case of ISO)
Program end
One subprogram
M99 need not constitute a separate block as indicated below. Example) X100.0 Y100.0 M99 ;
M98 P ��� ���� ; ↑ Subprogram number
↑ Number of times the subprogram is called repeatedly
When no repetition data is specified, the subprogram is called just once.
When the main program calls a subprogram, it is regarded as a one–level subprogram call. Thus, subprogram calls can be nested up to four levels as shown below.
O0001 ;
M98P1000 ;
M30 ;
Main program
O3000 ;
M99 ;
O1000 ;
M98P2000 ;
M99 ;
O2000 ;
M98P3000 ;
M99 ;
Subprogram
(One–level nesting) (Two–level nesting) (Three–level nesting)
Subprogram Subprogram
O4000 ;
M99 ; (Four–level nesting)
Subprogram
M98P4000 ;
A single call command can repeatedly call a subprogram up to 999 times. For compatibility with automatic programming systems, in the first block, Nxxxx can be used instead of a subprogram number that follows O (or :). A sequence number after N is registered as a subprogram number.
See III–10 for the method of registering a subprogram.
12.3 SUBPROGRAM (M98, M99)
Format
� Subprogram configuration
� Subprogram call
Explanations
� Reference
PROGRAMMINGB–64124EN/01 12. PROGRAM CONFIGURATION
137
NOTE 1 The M98 and M99 code signal and strobe signal are not
output to the machine tool. 2 If the subprogram number specified by address P cannot be
found, an alarm (No. 078) is output.
� M98 P51002 ;
� X1000.0 M98 P1200 ;
� Execution sequence of subprograms called from a main program
A subprogram can call another subprogram in the same way as a main pro- gram calls a subprogram.
This command specifies “Call the subprogram (number 1002) five times in succession.” A subprogram call command (M98P_) can be specified in the same block as a move command.
This example calls the subprogram (number 1200) after an X movement.
1 2 3 Main program
N0010 0 ; N0020 0 ; N0030 M98 P21010 ;
N0040 0 ; N0050 M98 P1010 ;
N0060 0 ;
Subprogram
O1010 0 ; N1020 0 ; N1030 0 ; N1040 0 ; N1050 0 ; N1060 0 M99 ;
Examples
PROGRAMMING12. PROGRAM CONFIGURATION B–64124EN/01
138
If P is used to specify a sequence number when a subprogram is terminated, control does not return to the block after the calling block, but returns to the block with the sequence number specified by P. Note, however, that P is ignored if the main program is operating in a mode other than memory operation mode. This method consumes a much longer time than the normal return method to return to the main program.
Subprogram
O0010 … ; N1020 … ; N1030 … ; N1040 … ; N1050 … ; N1060 M99 P0060 ;
Main program
N0010 … ; N0020 … ; N0030 M98 P1010 ;
N0040 … ; N0050 … ; N0060 … ;
If M99 is executed in a main program, control returns to the start of the main program. For example, M99 can be executed by placing /M99 ; at an appropriate location of the main program and setting the optional block skip function to off when executing the main program. When M99 is executed, control returns to the start of the main program, then execution is repeated starting at the head of the main program. Execution is repeated while the optional block skip function is set to off. If the optional block skip function is set to on, the /M99 ; block is skipped ; control is passed to the next block for continued execution. If/M99Pn ; is specified, control returns not to the start of the main program, but to sequence number n. In this case, a longer time is required to return to sequence number n.
N0010 … ; N0020 … ; N0030 … ; N0040 … ; N0050 … ; N0060 M99 P0030 ;
N0070 … ; N0080 M02 ;
/ Optional block skip ON
Optional block skip OFF
Special Usage
� Specifying the sequence number for the return destination in the main program
� Using M99 in the main program
PROGRAMMINGB–64124EN/01 12. PROGRAM CONFIGURATION
139
A subprogram can be executed just like a main program by searching for the start of the subprogram with the MDI. (See III–9.3 for information about search operation.) In this case, if a block containing M99 is executed, control returns to the start of the subprogram for repeated execution. If a block containing M99Pn is executed, control returns to the block with sequence number n in the subprogram for repeated execution. To terminate this program, a block containing /M02 ; or /M30 ; must be placed at an appropriate location, and the optional block switch must be set to off ; this switch is to be set to on first.
N1010 … ; N1020 … ; N1030 … ; N1040 M02 ;
N1050 M99 P1020 ;
/ Optional block skipON
� Using a subprogram only
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
140
13 FUNCTIONS TO SIMPLIFY PROGRAMMING This chapter explains the following items:
13.1 CANNED CYCLE 13.2 RIGID TAPPING 13.3 CANNED GRINDING CYCLE (FOR GRINDING MACHINE) 13.4 GRINDING–WHEEL WEAR COMPENSATION BY CONTINUOUS
DRESSING (FOR GRINDING MACHINE) 13.5 IN–FEED GRINDING ALONG THE Y AND Z AXES AT THE END
OF TABLE SWING (FOR GRINDING MACHINE) 13.6 OPTIONAL ANGLE CHAMFERING AND CORNER ROUNDING 13.7 EXTERNAL MOTION FUNCTION (G81) 13.8 INDEX TABLE INDEXING FUNCTION
General
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
141
Canned cycles make it easier for the programmer to create programs. With a canned cycle, a frequently–used machining operation can be specified in a single block with a G function; without canned cycles, normally more than one block is required. In addition, the use of canned cycles can shorten the program to save memory. Table 13.1 (a) lists canned cycles.
Table 13.1 (a) Canned cycles
G code Drilling(–Z direction) Operation at thebottom of a hole Retraction(+Z direction) Application
G73 Intermittent feed – Rapid traverse High–speed peck drilling cycle
G74 Feed Dwell→Spindle CW Feed Left–hand tapping cycle
G76 Feed Oriented spindle stop
Rapid traverse Fine boring cycle
G80 – – – Cancel
G81 Feed – Rapid traverse Drilling cycle, spot drilling cycle
G82 Feed Dwell Rapid traverse Drilling cycle, counter boring cycle
G83 Intermittent feed – Rapid traverse Peck drilling cycle
G84 Feed Dwell→Spindle CCW
Feed Tapping cycle
G85 Feed – Feed Boring cycle
G86 Feed Spindle stop Rapid traverse Boring cycle
G87 Feed Spindle CW Rapid traverse Back boring cycle
G88 Feed Dwell→spindle stop Manual Boring cycle
G89 Feed Dwell Feed Boring cycle
13.1 CANNED CYCLE
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
142
A canned cycle consists of a sequence of six operations (Fig. 13.1 (a))
Operation 1 Positioning of axes X and Y (including also another axis)
Operation 2 Rapid traverse up to point R level Operation 3 Hole machining Operation 4 Operation at the bottom of a hole Operation 5 Retraction to point R level Operation 6 Rapid traverse up to the initial point
Operation 1
Operation 2
Operation 3
Operation 4
Operation 5
Operation 6
Rapid traverse Feed
Initial level
Point R level
Fig. 13.1 Canned cycle operation sequence
The positioning plane is determined by plane selection code G17, G18, or G19. The positioning axis is an axis other than the drilling axis.
Although canned cycles include tapping and boring cycles as well as drilling cycles, in this chapter, only the term drilling will be used to refer to operations implemented with canned cycles. The drilling axis is a basic axis (X, Y, or Z) not used to define the positioning plane, or any axis parallel to that basic axis. The axis (basic axis or parallel axis) used as the drilling axis is determined according to the axis address for the drilling axis specified in the same block as G codes G73 to G89. If no axis address is specified for the drilling axis, the basic axis is assumed to be the drilling axis.
Table 13.1 (b) Positioning plane and drilling axis
G code Positioning plane Drilling axis
G17 Xp–Yp plane Zp
G18 Zp–Xp plane Yp
G19 Yp–Zp plane Xp
Xp : X axis or an axis parallel to the X axis Yp : Y axis or an axis parallel to the Y axis Zp : Z axis or an axis parallel to the Z axis
Explanations
� Positioning plane
� �������" ���
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
143
Assume that the U, V and W axes be parallel to the X, Y, and Z axes respectively. This condition is specified by parameter No. 1022.
G17 G81 ………Z _ _ : The Z axis is used for drilling. G17 G81 ………W _ _ : The W axis is used for drilling. G18 G81 ………Y _ _ : The Y axis is used for drilling. G18 G81 ………V _ _ : The V axis is used for drilling. G19 G81 ………X _ _ : The X axis is used for drilling. G19 G81 ………U _ _ : The U axis is used for drilling.
G17 to G19 may be specified in a block in which any of G73 to G89 is not specified.
WARNING Switch the drilling axis after canceling a canned cycle.
NOTE A parameter FXY (No. 5101 #0) can be set to the Z axis always used as the drilling axis. When FXY=0, the Z axis is always the drilling axis.
The travel distance along the drilling axis varies for G90 and G91 as follows:
Z=0
R
Z
G90 (Absolute Command)
R
Z
G91 (Incremental Command)
Point R
Point Z
Point R
Point Z
G73, G74, G76, and G81 to G89 are modal G codes and remain in effect until canceled. When in effect, the current state is the drilling mode. Once drilling data is specified in the drilling mode, the data is retained until modified or canceled. Specify all necessary drilling data at the beginning of canned cycles; when canned cycles are being performed, specify data modifications only.
Examples
� Travel distance along the drilling axis G90/G91
� Drilling mode
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
144
When the tool reaches the bottom of a hole, the tool may be returned to point R or to the initial level. These operations are specified with G98 and G99. The following illustrates how the tool moves when G98 or G99 is specified. Generally, G99 is used for the first drilling operation and G98 is used for the last drilling operation. The initial level does not change even when drilling is performed in the G99 mode.
G98(Return to initial level ) G99(Return to point R level)
Initial level
Point R level
To repeat drilling for equally–spaced holes, specify the number of repeats in K_. K is effective only within the block where it is specified. Specify the first hole position in incremental mode (G91). If it is specified in absolute mode (G90), drilling is repeated at the same position.
Number of repeats K The maximum command value = 9999
If K0 is specified, drilling data is stored, but drilling is not performed.
To cancel a canned cycle, use G80 or a group 01 G code.
Group 01 G codes G00 : Positioning (rapid traverse) G01 : Linear interpolation G02 : Circular interpolation or helical interpolation (CW) G03 : Circular interpolation or helical interpolation (CCW) G60 : Single direction positioning (when the MDL bit (bit 0 of
parameter 5431) is set to 1)
Subsequent sections explain the individual canned cycles. Figures in these explanations use the following symbols:
DwellP
OSS
Positioning (rapid traverse G00)
Cutting feed (linear interpolation G01)
Manual feed
Shift (rapid traverse G00)
Oriented spindle stop (The spindle stops at a fixed rotation position)
� Return point level G98/G99
� Repeat
� Cancel
� Symbols in figures
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
145
This cycle performs high–speed peck drilling. It performs intermittent cutting feed to the bottom of a hole while removing chips from the hole.
G73 (G98) G73 (G99)
G73 X_ Y_ Z_ R_ Q_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level Q_ : Depth of cut for each cutting feed F_ : Cutting feedrate K_ : Number of repeats (if required)
Initial level
q
q
q
d
d
q
q
q
d
d
Point R Point R levelPoint R
Point Z Point Z
13.1.1 High–speed Peck Drilling Cycle (G73)
Format
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
146
The high–speed peck drilling cycle performs intermittent feeding along the Z–axis. When this cycle is used, chips can be removed from the hole easily, and a smaller value can be set for retraction. This allows, drilling to be performed efficiently. Set the clearance, d, in parameter 5114. The tool is retracted in rapid traverse. Before specifying G73, rotate the spindle using a miscellaneous function (M code). When the G73 code and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
 If they are specified in a block that does not perform drilling, they cannot be stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G73 in a single block. Otherwise, G73 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S2000 ; Cause the spindle to start rotating. G90 G99 G73 X300. Y–250. Z–150. R–100. Q15. F120. ;
Position, drill hole 1, then return to point R. Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
��� � �����
Limitations
� Axis switching
� Drilling
� Q/P
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
147
This cycle performs left–handed tapping. In the left–handed tapping cycle, when the bottom of the hole has been reached, the spindle rotates clockwise.
G74 (G98) G74 (G99)
G74 X_ Y_ Z_ R_P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level P_ : Dwell time F_ : Cutting feedrate K_ : Number of repeats (if required)
P
P
P
P
Initial level
Point R
Point Z
Spindle CCW
Spindle CCW
Point R level
Spindle CW Spindle CW
Point Z
Point R
Tapping is performed by turning the spindle counterclockwise. When the bottom of the hole has been reached, the spindle is rotated clockwise for retraction. This creates a reverse thread. Feedrate overrides are ignored during left–handed tapping. A feed hold does not stop the machine until the return operation is completed. Before specifying G74, use a miscellaneous function (M code) to rotate the spindle counterclockwise. When the G74 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
13.1.2 Left–handed Tapping Cycle (G74)
Format
Explanations
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
148
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Specify P in blocks that perform drilling. If it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G74 in a single block. Otherwise, G74 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M4 S100 ; Cause the spindle to start rotating. G90 G99 G74 X300. Y–250. Z–150. R–120. F120. ;
Position, tapping hole 1, then return to point R. Y–550. ; Position, tapping hole 2, then return to point R. Y–750. ; Position, tapping hole 3, then return to point R. X1000. ; Position, tapping hole 4, then return to point R. Y–550. ; Position, tapping hole 5, then return to point R. G98 Y–750. ; Position, tapping hole 6, then return to the
initial level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Limitations
� Axis switching
� Drilling
� P
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
149
The fine boring cycle bores a hole precisely. When the bottom of the hole has been reached, the spindle stops, and the tool is moved away from the machined surface of the workpiece and retracted.
G76 (G98) G76 (G99)
G76 X_ Y_ Z_ R_ Q_ P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level Q_ : Shift amount at the bottom of a hole P_ : Dwell time at the bottom of a hole F_ : Cutting feedrate K_ : Number of repeats (if required)
q q
Shift amount q
Oriented spindle stop
Tool
OSS OSS
Point R level
Point R
Point Z
Spindle CW
Initial level
Point Z
Point R
Spindle CW
PP
WARNING Q (shift at the bottom of a hole) is a modal value retained within canned cycles. It must be specified carefully because it is also used as the depth of cut for G73 and G83.
13.1.3 Fine Boring Cycle (G76)
Format
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
150
When the bottom of the hole has been reached, the spindle is stopped at the fixed rotation position, and the tool is moved in the direction opposite to the tool tip and retracted. This ensures that the machined surface is not damaged and enables precise and efficient boring to be performed. Before specifying G76, use a miscellaneous function (M code) to rotate the spindle. When the G76 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any additional axes, boring is not performed.
Be sure to specify a positive value in Q. If Q is specified with a negative value, the sign is ignored. Set the direction of shift in bits 4 (RD1) and 5 (RD2) of parameter 5101. Specify P and Q in a block that performs boring. If they are specified in a block that does not perform boring, they are not stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G76 in a single block. Otherwise, G76 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S500 ; Cause the spindle to start rotating. G90 G99 G76 X300. Y–250.Position, bore hole 1, then return to point R. Z–150. R–120. Q5. Orient at the bottom of the hole, then shift
by 5 mm. P1000 F120. ; Stop at the bottom of the hole for 1 s. Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Explanations
Limitations
� Axis switching
� Boring
� P/Q
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
151
This cycle is used for normal drilling. Cutting feed is performed to the bottom of the hole. The tool is then retracted from the bottom of the hole in rapid traverse.
G81 (G98) G81 (G99)
G81 X_ Y_ Z_ R_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level F_ : Cutting feedrate K_ : Number of repeats (if required)
Point R
Initial level
Point Z
Point R
Point Z
Point R level
After positioning along the X– and Y–axes, rapid traverse is performed to point R. Drilling is performed from point R to point Z. The tool is then retracted in rapid traverse. Before specifying G81, use a miscellaneous function (M code) to rotate the spindle. When the G81 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is performed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
13.1.4 Drilling Cycle, Spot Drilling (G81)
Format
Explanations
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
152
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G81 in a single block. Otherwise, G81 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S2000 ; Cause the spindle to start rotating. G90 G99 G81 X300. Y–250. Z–150. R–100. F120. ;
Position, drill hole 1, then return to point R. Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Restrictions
� Axis switching
� Drilling
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
153
This cycle is used for normal drilling. Cutting feed is performed to the bottom of the hole. At the bottom, a dwell is performed, then the tool is retracted in rapid traverse. This cycle is used to drill holes more accurately with respect to depth.
G82 (G98) G82 (G99)
G82 X_ Y_ Z_ R_ P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level P_ : Dwell time at the bottom of a hole F_ : Cutting feed rate K_ : Number of repeats (if required)
P P
Point R
Initial level
Point Z
Point R
Point Z
Point R level
After positioning along the X– and Y–axes, rapid traverse is performed to point R. Drilling is then performed from point R to point Z. When the bottom of the hole has been reached, a dwell is performed. The tool is then retracted in rapid traverse. Before specifying G82, use a miscellaneous function (M code) to rotate the spindle. When the G82 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
13.1.5 Drilling Cycle Counter Boring Cycle (G82)
Format
Explanations
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
154
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Specify P in blocks that perform drilling. If it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G83 in a single block. Otherwise, G83 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S2000 ; Cause the spindle to start rotating. G90 G99 G82 X300. Y–250. Z–150. R–100. P1000 F120. ;
Position, drill hole 2, and dwell for 1 s at the bottom of the hole, then return to point R.
Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Restrictions
� Axis switching
� Drilling
� P
� Cancel
� #��� ������
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
155
This cycle performs peck drilling. It performs intermittent cutting feed to the bottom of a hole while removing shavings from the hole.
G83 (G98) G83 (G99)
G83 X_ Y_ Z_ R_ Q_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level Q_ : Depth of cut for each cutting feed F_ : Cutting feedrate K_ : Number of repeats (if required)
dq
dq
q
dq
dq
q
Initial level
Point R
Point Z
Point R levelPoint R
Point Z
Q represents the depth of cut for each cutting feed. It must always be specified as an incremental value. In the second and subsequent cutting feeds, rapid traverse is performed up to a d point just before where the last drilling ended, and cutting feed is performed again. d is set in parameter (No.5115). Be sure to specify a positive value in Q. Negative values are ignored. Before specifying G83, use a miscellaneous function (M code) to rotate the spindle. When the G83 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
13.1.6 Peck Drilling Cycle (G83)
Format
Explanations
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
156
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Specify Q in blocks that perform drilling. If they are specified in a block that does not perform drilling, they cannot be stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G83 in a single block. Otherwise, G83 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S2000 ; Cause the spindle to start rotating. G90 G99 G83 X300. Y–250. Z–150. R–100. Q15. F120. ;
Position, drill hole 1, then return to point R. Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Limitations
� Axis switching
� Drilling
� Q
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
157
An arbor with the overload torque detection function is used to retract the tool when the overload torque detection signal (skip signal) is detected during drilling. Drilling is resumed after the spindle speed and cutting feedrate are changed. These steps are repeated in this peck drilling cycle.
The mode for the small–hole peck drilling cycle is selected when the M code in parameter 5163 is specified. The cycle can be started by specifying G83 in this mode. This mode is canceled when G80 is specified or when a reset occurs.
G83(G98) G83(G99)
G83 X_ Y_ Z_ R_ Q_ F_ I_ K_ P_ ;
X_ Y_: Hole position data Z_ : Distance from point R to the bottom of the hole R_ : Distance from the initial level to point R Q_ : Depth of each cut F_ : Cutting feedrate I_: Forward or backward traveling speed (same format as F above)
(If this is omitted, the values in parameters No.5172 and No.5173 are assumed as defaults.)
K_ : Number of times the operation is repeated (if required) P_ : Dwell time at the bottom of the hole
(If this is omitted, P0 is assumed as the default.)
Q
∆
∆
∆
Q
∆
∆
∆
∆ : Initial clearance when the tool is retracted to point R and the clearance from the bottom of the hole in the second or subsequent drilling (parameter 5174)
Q : Depth of each cut
( )
Initial level
Point R Point R
Overload torque Overload torque Point Z Point Z
Dwell Dwell
Path along which the tool travels at the rapid traverse rate
Path along which the tool travels (forward or backward) at the rapid traverse rate during the cycle specified with parameters
Path along which the tool travels at the programmed cutting feedrate
13.1.7 Small–hole peck drilling cycle (G83)
Format
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
158
*Positioning along the X–axis and Y–axis *Positioning at point R along the Z–axis *Drilling along the Z–axis (first drilling, depth of cut Q, incremental)
Retraction (bottom of the hole → small clearance ∆, incremental) Retraction (bottom of the hole → point R) Advance (point R → point at a height of clearance ∆ from the bottom of the hole) Drilling (second or subsequent drilling, depth of cut Q + ∆ , incremental)
*Dwell *Return to point R (or initial level) along the Z–axis, cycle end
Acceleration/deceleration during advancing and retraction is controlled according to the cutting feed acceleration/deceleration time constant. When retraction is performed, the position is checked at point R.
When the M code in parameter 5163 is specified, the system enters the mode for the small–hole peck drilling cycle. This M code does not wait for FIN. Care must be taken when this M code is specified with another M code in the same block.
(Example) M�� M03 ; → Waits for FIN. M03 M�� ; → Does not wait for FIN.
When G83 is specified in the mode for the small–hole peck drilling cycle, the cycle is started. This continuous–state G code remains unchanged until another canned cycle is specified or until the G code for cancelling the canned cycle is specified. This eliminates the need for specifying drilling data in each block when identical drilling is repeated.
In this cycle, the signal indicating that the small–hole peck drilling cycle is in progress is output after the tool is positioned at the hole position along the axes not used for drilling. Signal output continues during positioning to point R along the drilling axis and terminates upon a return to point R or the initial level. For details, refer to the manual of the machine tool builder.
A skip signal is used as the overload torque detection signal. The skip signal is effective while the tool is advancing or drilling and the tool tip is between points R and Z. (The signal causes a retraction). For details, refer to the manual of the machine tool builder.
Explanations
� Component operations of the cycle
� Specifying an M code
� Specifying a G code
� Signal indicating that the cycle is in progress
� Overload torque detection signal
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
159
In a single G83 cycle, drilling conditions are changed for each drilling operation (advance → drilling → retraction). Bits 1 and 2 of parameter OLS, NOL No. 5160 can be specified to suppress the change in drilling conditions.
1. Changing the cutting feedrate The cutting feedrate programmed with the F code is changed for each of the second and subsequent drilling operations. In parameters No.5166 and No.5167, specify the respective rates of change applied when the skip signal is detected and when it is not detected in the previous drilling operation.
Cutting feedrate =F×α
,-'�� %�'��' *. α���� ,���� % �� �(���/(� %�'��' *. α�α×β ���0 1)��� β '� )� �� � �� �)� *� ��� ���) %�'��' * �&��� '�
2)� )� ��'& �'* �� '� %� �� �% %(�' * )� &��3'�(� %�'��' * �&��� '�
�β���4!parameter No. 5166" 2)� )� ��'& �'* �� '� � %� �� �% %(�' * )� &��3'�(� %�'��' *
�&��� '� �β���4!&���+� �� ��� 5�67"
If the rate of change in cutting feedrate becomes smaller than the rate specified in parameter 5168, the cutting feedrate is not changed. The cutting feedrate can be increased up to the maximum cutting feedrate.
2. Changing the spindle speed The spindle speed programmed with the S code is changed for each of the second and subsequent advances. In parameters 5164 and 5165, specify the rates of change applied when the skip signal is detected and when it is not detected in the previous drilling operation.
Spindle speed =S×γ
,-'�� %�'��' *. γ���� ,���� % �� �(���/(� %�'��' *. γ�γ×δ ���0 1)��� δ '� )� �� � �� �)� *� ��� ���) %�'��' * �&��� '�
2)� )� ��'& �'* �� '� %� �� �% %(�' * )� &��3'�(� %�'��' * �&��� '�
�β���4!parameter No. 5164" 2)� )� ��'& �'* �� '� � %� �� �% %(�' * )� &��3'�(� %�'��' *
�&��� '� �β���4!parameter No. 5165"
When the cutting feedrate reaches the minimum rate, the spindle speed is not changed. The spindle speed can be increased up to a value corresponding to the maximum value of S analog data.
Advancing and retraction of the tool are not executed in the same manner as rapid–traverse positioning. Like cutting feed, the two operations are carried out as interpolated operations. The speed is subjected to exponen– tial acceleration/deceleration. Note that the tool life management func– tion excludes advancing and retraction from the calculation of the tool life.
� Changing the drilling conditions
� Advance and retraction
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
160
The forward or backward traveling speed can be specified with address I in the same format as address F, as shown below:
G83 I1000 ; (without decimal point)
G83 I1000. ; (with decimal point)
Both commands indicate a speed of 1000 mm/min.
Address I specified with G83 in the continuous–state mode continues to be valid until G80 is specified or until a reset occurs.
In this canned cycle mode, the following functions can be specified: ⋅ Hole position on the X–axis, Y–axis, and additional axis ⋅ Operation and branch by custom macro ⋅ Subprogram (hole position group, etc.) calling ⋅ Switching between absolute and incremental modes ⋅ Coordinate system rotation ⋅ Scaling (This command will not affect depth of cut Q or small clearance
d1.) ⋅ Dry run ⋅ Feed hold
When single–block operation is enabled, drilling is stopped after each retraction.
The feedrate override function works during cutting, retraction, and advancing in the cycle.
The number of retractions made during cutting and the number of retractions made in response to the overload signal received during cutting can be output to custom macro common variables (#100 to #149) specified in parameters No.5170 and No.5171. Parameters No.5170 and No.5171 can specify variable numbers within the range of #100 to #149.
Parameter No.5170 : Specifies the number of the common variable to which the number of retractions made during cutting is output.
Parameter No.5171: Specifies the number of the common variable to which the number of retractions made in response to the overload signal received during cutting is output.
� Specifying address I
� Functions that can be specified
� Single block
� Feedrate override
� Custom macro interface
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
161
N01M03 S___ ; N02M�� ; N03G83 X_ Y_ Z_ R_ Q_ F_ I_ K_ P_ ; N04X_ Y_ ;
: :
N10G80 ;
<Description of each block> N01: Specifies forward spindle rotation and spindle speed. N02: Specifies the M code to execute G83 as the small–hole peck drilling cycle.
The M code is specified in parameter No.5163. N03: Specifies the small–hole peck drilling cycle. Drilling data (except K and P)
is stored and drilling is started. N04: Drills a small, deep hole at another position with the same drilling data as
for N03. N10: Cancels the small–hole peck drilling cycle. The M code specified in N02
is also canceled.
This cycle performs tapping. In this tapping cycle, when the bottom of the hole has been reached, the spindle is rotated in the reverse direction.
G84 (G98) G84 (G99)
G84 X_ Y_ Z_ R_P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level P_ : Dwell time F_ : Cutting feedrate K_ : Number of repents (if required)
P
P P
P
Point R
Spindle CW
Initial level
Point R level
Point Z
Point R
Point Z
Spindle CCWSpindle CCW
Spindle CW
Examples
13.1.8 Tapping Cycle (G84)
Format
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
162
Tapping is performed by rotating the spindle clockwise. When the bottom of the hole has been reached, the spindle is rotated in the reverse direction for retraction. This operation creates threads. Feedrate overrides are ignored during tapping. A feed hold does not stop the machine until the return operation is completed. Before specifying G84, use a miscellaneous function (M code) to rotate the spindle. When the G84 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When the K is used to specify number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Specify P in blocks that perform drilling. If it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G84 in a single block. Otherwise, G84 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S100 ; Cause the spindle to start rotating. G90 G99 G84 X300. Y–250. Z–150. R–120. P300 F120. ;
Position, drill hole 1, then return to point R. Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Explanations
Limitations
� Axis switching
� Drilling
� P
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
163
This cycle is used to bore a hole.
G85 (G98) G85 (G99)
G85 X_ Y_ Z_ R_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level F_ : Cutting feed rate K_ : Number of repeats (if required)
Point R
Initial level
Point R level
Point Z Point Z
Point R
After positioning along the X– and Y– axes, rapid traverse is performed to point R. Drilling is performed from point R to point Z. When point Z has been reached, cutting feed is performed to return to point R. Before specifying G85, use a miscellaneous function (M code) to rotate the spindle. When the G85 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
13.1.9 Boring Cycle (G85)
Format
Explanations
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
164
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G85 in a single block. Otherwise, G85 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S100 ; Cause the spindle to start rotating. G90 G99 G85 X300. Y–250. Z–150. R–120. F120. ;
Position, drill hole 1, then return to point R. Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Limitations
� Axis switching
� Drilling
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
165
This cycle is used to bore a hole.
G86 (G98) G86 (G99)
G86 X_ Y_ Z_ R_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level F_ : Cutting feed rate K_ : Number of repeats (if required)
Point R
Initial level
Point R level
Point Z
Spindle stop
Spindle CW
Spindle CW
Point R
Point Z
Spindle stop
After positioning along the X– and Y–axes, rapid traverse is performed to point R. Drilling is performed from point R to point Z. When the spindle is stopped at the bottom of the hole, the tool is retracted in rapid traverse. Before specifying G86, use a miscellaneous function (M code) to rotate the spindle. When the G86 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
13.1.10 Boring Cycle (G86)
Format
Explanations
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
166
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G86 in a single block. Otherwise, G86 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S2000 ; Cause the spindle to start rotating. G90 G99 G86 X300. Y–250. Z–150. R–100. F120. ;
Position, drill hole 1, then return to point R. Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Limitations
� Axis switching
� Drilling
� Cancel
� Tool offset
� ����
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
167
This cycle performs accurate boring.
G87 (G98) G87 (G99)
G87 X_ Y_ Z_ R_ Q_ P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from the bottom of the hole to point Z R_ : The distance from the initial level to point R
(the bottom of the hole) level Q_ : Tool shift amount P_ : Dwell time F_ : Cutting feed rate K_ : Number of repeats (if required)
q
OSS
OSS
P
Point R
Not used
Point Z
Spindle CW
Spindle CW
Oriented spindle stop
Tool
Shift amount q
WARNING Q (shift at the bottom of a hole) is a modal value retained in canned cycles. It must be specified carefully because it is also used as the depth of cut for G73 and G83.
13.1.11 Back Boring Cycle (G87)
Format
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
168
After positioning along the X– and Y–axes, the spindle is stopped at the fixed rotation position. The tool is moved in the direction opposite to the tool tip, positioning (rapid traverse) is performed to the bottom of the hole (point R). The tool is then shifted in the direction of the tool tip and the spindle is rotated clockwise. Boring is performed in the positive direction along the Z–axis until point Z is reached. At point Z, the spindle is stopped at the fixed rotation position again, the tool is shifted in the direction opposite to the tool tip, then the tool is returned to the initial level. The tool is then shifted in the direction of the tool tip and the spindle is rotated clockwise to proceed to the next block operation. Before specifying G87, use a miscellaneous function (M code) to rotate the spindle. When the G87 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any additional axes, boring is not performed.
Be sure to specify a positive value in Q. If Q is specified with a negative value, the sign is ignored. Set the direction of shift in bits 4 (RD1) and 5 (RD2) of parameter No.5101. Specify P and Q in a block that performs boring. If they are specified in a block that does not perform boring, they are not stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G87 in a single block. Otherwise, G87 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S500 ; Cause the spindle to start rotating. G90 G87 X300. Y–250. Position, bore hole 1.
Z–120. R–150. Q5. Orient at the initial level, then shift by 5 mm. P1000 F120. ; Stop at point Z for 1 s. Y–550. ; Position, drill hole 2. Y–750. ; Position, drill hole 3. X1000. ; Position, drill hole 4. Y–550. ; Position, drill hole 5. Y–750. ; Position, drill hole 6 G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Explanations
Restrictions
� Axis switching
� Boring
� P/Q
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
169
This cycle is used to bore a hole.
G88 (G98) G88 (G99)
G88 X_ Y_ Z_ R_ P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level P_ : Dwell time at the bottom of a hole F_ : Cutting feed rate K_ : Number of repeats (if required)
P P
Point R
Initial level
Point R level
Point Z
Spindle stop after dwell
Spindle CW
Spindle CW
Point Z
Point R
Spindle stop after dwell
After positioning along the X– and Y–axes, rapid traverse is performed to point R. Boring is performed from point R to point Z. When boring is completed, a dwell is performed, then the spindle is stopped. The tool is manually retracted from the bottom of the hole (point Z) to point R. At point R, the spindle is rotated clockwise, and rapid traverse is performed to the initial level. Before specifying G88, use a miscellaneous function (M code) to rotate the spindle. When the G88 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
13.1.12 Boring Cycle (G88)
Format
Explanations
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
170
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Specify P in blocks that perform drilling. If it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G88 in a single block. Otherwise, G88 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S2000 ; Cause the spindle to start rotating. G90 G99 G88 X300. Y–250. Z–150. R–100. P1000 F120. ;
Position, drill hole 1, return to point R then stop at the bottom of the hole for 1 s.
Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Limitations
� Axis switching
� Drilling
� P
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
171
This cycle is used to bore a hole.
G89 (G98) G89 (G99)
G89 X_ Y_ Z_ R_ P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole R_ : The distance from the initial level to point R level P_ : Dwell time at the bottom of a hole F_ : Cutting feed rate K_ : Number of repeats (if required)
P P
Point R
Initial level
Point R level
Point Z
Point R
Point Z
This cycle is almost the same as G85. The difference is that this cycle performs a dwell at the bottom of the hole. Before specifying G89, use a miscellaneous function (M code) to rotate the spindle. When the G89 command and an M code are specified in the same block, the M code is executed at the time of the first positioning operation. The system then proceeds to the next drilling operation. When K is used to specify the number of repeats, the M code is executed for the first hole only; for the second and subsequent holes, the M code is not executed. When a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
13.1.13 Boring Cycle (G89)
Format
Explanations
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
172
Before the drilling axis can be changed, the canned cycle must be canceled.
In a block that does not contain X, Y, Z, R, or any other axes, drilling is not performed.
Specify P in blocks that perform drilling. If it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G89 in a single block. Otherwise, G89 will be canceled.
In the canned cycle mode, tool offsets are ignored.
M3 S100 ; Cause the spindle to start rotating. G90 G99 G89 X300. Y–250. Z–150. R–120. P1000 F120. ;
Position, drill hole 1, return to point R then stop at the bottom of the hole for 1 s.
Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial
level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
Limitations
� Axis switching
� Drilling
� P
� Cancel
� Tool offset
Examples
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
173
G80 cancels canned cycles.
G80 ;
All canned cycles are canceled to perform normal operation. Point R and point Z are cleared. This means that R = 0 and Z = 0 in incremental mode. Other drilling data is also canceled (cleared).
M3 S100 ; Cause the spindle to start rotating. G90 G99 G88 X300. Y–250. Z–150. R–120. F120. ;
Position, drill hole 1, then return to point R. Y–550. ; Position, drill hole 2, then return to point R. Y–750. ; Position, drill hole 3, then return to point R. X1000. ; Position, drill hole 4, then return to point R. Y–550. ; Position, drill hole 5, then return to point R. G98 Y–750. ; Position, drill hole 6, then return to the initial level. G80 G28 G91 X0 Y0 Z0 ;
Return to the reference position return, canned cycle cancel
M5 ; Cause the spindle to stop rotating.
13.1.14 Canned Cycle Cancel (G80)
Format
Explanations
Examples
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
174
400 150 250 250 150
Y
X
X
Z
T 11 T 15 T 31
#1 #11
#7
#3
#2
#8
#13
#12
#10
#9
#6
#5
#4
# 11 to 16 Drilling of a 10mm diameter hole # 17 to 10 Drilling of a 20mm diameter hole # 11 to 13 Boring of a 95mm diameter hole(depth 50 mm)
190200 150
250
100
100
100
100
350
200
Reference position
Retract position
Initial level
50 50 30 20
Program example using tool length offset and canned cycles
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
175
Offset value +200.0 is set in offset No.11, +190.0 is set in offset No.15, and +150.0 is set in offset No.31
Program example ; N001 G92X0Y0Z0; Coordinate setting at reference position N002 G90 G00 Z250.0 T11 M6; Tool change N003 G43 Z0 H11; Initial level, tool length offset N004 S30 M3 Spindle start N005 G99 G81X400.0 R Y–350.0
Z–153,0R–97.0 F120; Positioning, then #1 drilling N006 Y–550.0; Positioning, then #2 drilling and point R level return N007 G98Y–750.0; Positioning, then #3 drilling and initial level return N008 G99X1200.0; Positioning, then #4 drilling and point R level return N009 Y–550.0; Positioning, then #5 drilling and point R level return N010 G98Y–350.0; Positioning, then #6 drilling and initial level return N011 G00X0Y0M5; Reference position return, spindle stop N012 G49Z250.0T15M6; Tool length offset cancel, tool change N013 G43Z0H15; Initial level, tool length offset N014 S20M3; Spindle start N015 G99G82X550.0Y–450.0 Positioning, then #7 drilling, point R level return
Z–130.0R–97.0P300F70; N016 G98Y–650.0; Positioning, then #8 drilling, initial level return N017 G99X1050.0; Positioning, then #9 drilling, point R level return N018 G98Y–450.0; Positioning, then #10 drilling, initial level return N019 G00X0Y0M5; Reference position return, spindle stop N020 G49Z250.0T31M6; Tool length offset cancel, tool change N021 G43Z0H31; Initial level, tool length offset N022 S10M3; Spindle start N023 G85G99X800.0Y–350.0 Positioning, then #11 drilling, point R level return
Z–153.0R47.0F50; N024 G91Y–200.0K2; Positioning, then #12, 13 drilling. point R level return N025 G28X0Y0M5; Reference position return, spindle stop N026 G49Z0; Tool length offset cancel N027 M0; Program stop
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
176
The tapping cycle (G84) and left–handed tapping cycle (G74) may be performed in standard mode or rigid tapping mode. In standard mode, the spindle is rotated and stopped along with a movement along the tapping axis using miscellaneous functions M03 (rotating the spindle clockwise), M04 (rotating the spindle counterclockwise), and M05 (stopping the spindle) to perform tapping.In rigid mode, tapping is performed by controlling the spindle motor as if it were a servo motor and by interpolating between the tapping axis and spindle. When tapping is performed in rigid mode, the spindle rotates one turn every time a certain feed (thread lead) which takes place along the tapping axis. This operation does not vary even during acceleration or deceleration. Rigid mode eliminates the need to use a floating tap required in the standard tapping mode, thus allowing faster and more precise tapping.
13.2 RIGID TAPPING
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
177
When the spindle motor is controlled in rigid mode as if it were a servo motor, a tapping cycle can be sped up.
G84(G98) G84(G99)
G84 X_ Y_ Z_ R_ P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole and the
position of the bottom of the hole R_ : The distance from the initial level to point R level P_ : Dwell time at the bottom of the hole and at point R when a
return is made F_ : Cutting feedrate K_ : Number of repeats (Only for necessity of repeat)
P P
Point R level
Point Z
Spindle CW
Point R Point R
Spindle stop
Spindle CCW Spindle CCWSpindle stopSpindle stop
Point Z
Spindle stop
Spindle stop
Initial level
Operation5
Operation4
Operation3
Operation1
Operation2 Operation6
Spindle stop
Spindle CW P P
G84.2 X_ Y_ Z_ R_ P_ F_ L_ ; (FS10/11 format)
L_ : Number of repeats (only for necessity of repeat)
After positioning along the X– and Y–axes, rapid traverse is performed to point R. Tapping is performed from point R to point Z. When tapping is completed, the spindle is stopped and a dwell is performed . The spindle is then rotated in the reverse direction, the tool is retracted to point R, then the spindle is stopped. Rapid traverse to initial level is then performed. While tapping is being performed, the feedrate override and spindle override are assumed to be 100%. However, the speed for extraction (operation 5) can be overridden by up to 2000% depending on the setting at bit 4 (DOV) of parameter No.5200, bit 3 (OVU) of parameter No.5201, and parameter No.5211.
Rigid mode can be specified using any of the following methods: ⋅Specify M29 S***** before a tapping command. ⋅Specify M29 S***** in a block which contains a tapping command. ⋅Specify G84 for rigid tapping (parameter G84 No. 5200 #0 set to 1).
13.2.1 Rigid Tapping (G84)
Format
Explanations
� Rigid mode
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
178
In feed–per–minute mode, the thread lead is obtained from the expression, feedrate × spindle speed. In feed–per–revolution mode, the thread lead equals the feedrate speed.
If a tool length compensation (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
Rigid tapping can be performed using FS10/11–format commands. These commands are used according to the sequence (including data transfer to and from the PMC), limitations, and other rigid tapping conditions for the FS 0i.
Before the drilling axis can be changed, the canned cycle must be canceled. If the drilling axis is changed in rigid mode, P/S alarm (No. 206) is issued.
If a speed higher than the maximum speed for the gear being used is specified, P/S alarm (No. 200) is issued. The S command, which is specified at rigid tapping, is cleared at commanding Rigid Tapping Cancel and the condition is the same that S0 is commanded.
For an analog spindle control circuit: Upon specifying a speed command requiring more than 4096 pulses, in detection units, within 8 ms, a P/S alarm (No.202) is issued because the result of such an operation is unpredictable.
For a serial spindle: Upon specifying a speed command requiring more than 32767 pulses, in detection units, within 8 ms, a P/S alarm (No.202) is issued because the result of such an operation is unpredictable.
If a value exceeding the upper limit of cutting feedrate is specified, P/S alarm (No. 011) is issued.
Metric input Inch input Remarks
G94 1 mm/min 0.01 inch/min Decimal point programming allowed
G95 0.01 mm/rev 0.0001 inch/rev Decimal point programming allowed
If an S command and axis movement are specified between M29 and G84, P/S alarm (No. 203) is issued. If M29 is specified in a tapping cycle, P/S alarm (No. 204) is issued.
Specify P in a block that performs drilling. If R is specified in a non–drilling block, it is not stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G84 in a single block. Otherwise, G84 will be canceled.
In the canned cycle mode, tool offsets are ignored.
� Thread lead
� Tool length compensation
� FS10/11–format command
Limitations
� Axis switching
� S command
� Distribution amount for the spindle
� F command
� Unit of F command
� M29
� P
� Cancel
� Tool offset
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
179
Any program cannot be resumed during rigid tapping.
Z–axis feedrate 1000 mm/min Spindle speed 1000 min-1
Thread lead 1.0 mm <Programming of feed per minute> G94 ; Specify a feed–per–minute command. G00 X120.0 Y100.0 ; Positioning M29 S1000 ; Rigid mode specification G84 Z–100.0 R–20.0 F1000 ; Rigid tapping <Programming of feed per revolution> G95 ; Specify a feed–per–revolution command. G00 X120.0 Y100.0 ; Positioning M29 S1000 ; Rigid mode specification G84 Z–100.0 R–20.0 F1.0 ; Rigid tapping
� Program restart
Examples
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
180
When the spindle motor is controlled in rigid mode as if it were a servo motor, tapping cycles can be sped up.
G74 (G98) G74 (G99)
G74 X_ Y_ Z_ R_ P_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole and
the position of the bottom of the hole R_ : The distance from the initial level to point R level P_ : Dwell time at the bottom of the hole and at point R when
return is made. F_ : Cutting feedrate K_ : Number of repeats (Only for necessity of repeat)
P P Point Z
Point R level
Spindle CCW
Spindle stop
Spindle stop
Initial level
Operation5
Operation4
Operation3
Operation1 Operation2 Operation6
Spindle stop
Spindle CW Spindle stop Spindle CW
Point R level
Point Z
Spindle CCW
Point R Point R
Spindle stop
P P Spindle stop
G84.3 X_ Y_ Z_ R_ P_ F_ L_ ; (FS15 format) L_ : Number of repeats (Only for necessity of repeat)
After positioning along the X– and Y–axes, rapid traverse is performed to point R. Tapping is performed from point R to point Z. When tapping is completed, the spindle is stopped and a dwell is performed. The spindle is then rotated in the normal direction, the tool is retracted to point R, then the spindle is stopped. Rapid traverse to initial level is then performed. While tapping is being performed, the feedrate override and spindle override are assumed to be 100%. However, the speed for extraction (operation 5) can be overridden by up to 2000% depending on the setting at bit 4 (DOV) of parameter 5200, bit 3 (OVU) of parameter No.5201, and parameter 5211.
Rigid mode can be specified using any of the following methods: ⋅ Specify M29 S***** before a tapping command. ⋅ Specify M29 S***** in a block which contains a tapping command. ⋅ Specify G84 for rigid tapping. (parameter G84 No. 5200#0 set to1).
13.2.2 Left–handed Rigid Tapping Cycle (G74)
Format
Explanations
� Rigid mode
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
181
In feed–per–minute mode, the thread lead is obtained from the expression, feedrate × spindle speed. In feed–per–revolution mode, the thread lead equals the feedrate.
If a tool length offset (G43, G44, or G49) is specified in the canned cycle, the offset is applied at the time of positioning to point R.
Rigid tapping can be performed using FS10/11–format commands. These commands are used according to the sequence (including data transfer to and from the PMC), limitations, and other rigid tapping conditions for the FS 0i.
Before the drilling axis can be changed, the canned cycle must be canceled. If the drilling axis is changed in rigid mode,P/S alarm (No. 206) is issued.
Specifying a rotation speed exceeding the maximum speed for the gear used causes P/S alarm (No. 200). The S command, which is specified at rigid tapping, is cleared at commanding Rigid Tapping Cancel and the condition is the same that S0 is commanded.
For an analog spindle control circuit: Upon specifying a speed command requiring more than 4096 pulses, in detection units, within 8 ms, a P/S alarm (No.202) is issued because the result of such an operation is unpredictable.
For a serial spindle: Upon specifying a speed command requiring more than 32767 pulses, in detection units, within 8 ms, a P/S alarm (No.202) is issued because the result of such an operation is unpredictable.
Specifying a value that exceeds the upper limit of cutting feedrate causes P/S alarm (No. 011).
Metric input Inch input Remarks
G94 1 mm/min 0.01 inch/min Decimal point programming allowed
G95 0.01 mm/rev 0.0001 inch/rev Decimal point programming allowed
Specifying an S command or axis movement between M29 and G74 causes P/S alarm (No. 203). Then, specifying M29 in the tapping cycle causes P/S alarm (No. 204).
Specify P in a block that performs drilling. If R is specified in a non–drilling block, it ss not stored as modal data.
Do not specify a G code of the 01 group (G00 to G03 or G60 (when the MDL bit (bit 0 of parameter 5431) is set to 1)) and G74 in a single block. Otherwise, G74 will be canceled.
In the canned cycle mode, tool offsets are ignored.
� Thread lead
� Tool length compensation
� FS10/11–format command
Limitations
� Axis switching
� S command
� Distribution amount for the spindle
� F command
� Unit of F command
� M29
� P
� Cancel
� Tool offset
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
182
Z–axis feedrate 1000 mm/min Spindle speed 1000 min-1
Thread lead 1.0 mm <Programming for feed per minute> G94 ; Specify a feed–per–minute command. G00 X120.0 Y100.0 ; Positioning M29 S1000 ; Rigid mode specification G84 Z–100.0 R–20.0 F1000 ; Rigid tapping <Programming for feed per revolution> G95 ; Specify a feed–per–revolution command. G00 X120.0 Y100.0 ; Positioning M29 S1000 ; Rigid mode specification G74 Z–100.0 R–20.0 F1.0 ; Rigid tapping
� ����
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
183
Tapping a deep hole in rigid tapping mode may be difficult due to chips sticking to the tool or increased cutting resistance. In such cases, the peck rigid tapping cycle is useful. In this cycle, cutting is performed several times until the bottom of the hole is reached. Two peck tapping cycles are available: High–speed peck tapping cycle and standard peck tapping cycle. These cycles are selected using the PCP bit (bit 5) of parameter 5200.
G84, G74 (G98) G84, G74 (G99)
G84 (or G74) X_ Y_ Z_ R_ P_ Q_ F_ K_ ;
X_ Y_: Hole position data Z_ : The distance from point R to the bottom of the hole and the
position of the bottom of the hole R_ : The distance from the initial level to point R level P_ : Dwell time at the bottom of the hole and at point R when a
return is made Q_ : Depth of cut for each cutting feed F_ : The cutting feedrate K_ : Number of repeats
⋅ High–speed peck tapping cycle (Parameter PCP(No.5200#5=0))
d q
q
q
d
(1) (2) d
q
q
q
d
(1) (2)
d q
q
q
d
(1) (2)
⋅ Peck tapping cycle (Parameter PCP(No.5200#5=1))
(3)
d q
q
q
d
(1) (2)
(3)
!�" The tool operates at a normal cutting feedrate. The normal time constant is used.
!�" Retraction can be overridden. The retraction time constant is used.
!�" The tool operates at a normal cutting feedrate. The normal time constant is used.
!�" Retraction can be overridden. The retraction time constant is used.
!�" Retraction can be overridden. The normal time constant is used.
Point Z
Initial level
Point R
Point Z
Point R Point R level
d=retraction distance
Point R level
d=cutting start distance
Initial level
Point R
Point Z Point Z
Point R Point R levelPoint R level
During a rigid tapping cycle, in–position check is performed at the end of each operation of (1) and (2) in the peck tap- ping cycle.
13.2.3 Peck Rigid Tapping Cycle (G84 or G74)
Format
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
184
After positioning along the X– and Y–axes, rapid traverse is performed to point R. From point R, cutting is performed with depth Q (depth of cut for each cutting feed), then the tool is retracted by distance d. The DOV bit (bit 4) of parameter 5200 specifies whether retraction can be overridden or not. When point Z has been reached, the spindle is stopped, then rotated in the reverse direction for retraction. Set the retraction distance, d, in parameter 5213.
After positioning along the X– and Y–axes, rapid traverse is performed to point R level. From point R, cutting is performed with depth Q (depth of cut for each cutting feed), then a return is performed to point R. The DOV bit (bit 4) of parameter 5200 specifies whether the retraction can be overridden or not. The moving of cutting feedrate F is performed from point R to a position distance d from the end point of the last cutting, which is where cutting is restarted. For this moving of cutting feedrate F, the specification of the DOV bit (bit 4) of parameter 5200 is also valid. When point Z has been reached, the spindle is stopped, then rotated in the reverse direction for retraction. Set d (distance to the point at which cutting is started) in parameter 5213.
Before the drilling axis can be changed, the canned cycle must be canceled. If the drilling axis is changed in rigid mode, P/S alarm (No. 206) is issued.
Specifying a rotation speed exceeding the maximum speed for the gear used causes P/S alarm (No. 200). The S command, which is specified at rigid tapping, is cleared at commanding Rigid Tapping Cancel and the condition is the same that S0 is commanded.
For an analog spindle control circuit: Upon specifying a speed command requiring more than 4096 pulses, in detection units, within 8 ms, a P/S alarm (No.202) is issued because the result of such an operation is unpredictable.
For a serial spindle: Upon specifying a speed command requiring more than 32767 pulses, in detection units, within 8 ms, a P/S alarm (No.202) is issued because the result of such an operation is unpredictable.
Specifying a value that exceeds the upper limit of cutting feedrate causes alarm (No. 011).
Metric input Inch input Remarks
G94 1 mm/min 0.01 inch/min Decimal point programming allowed
G95 0.01 mm/rev 0.0001 inch/rev Decimal point programming allowed
Specifying an S command or axis movement between M29 and G84 causes P/S alarm (No. 203). Then, specifying M29 in the tapping cycle causes P/S alarm (No. 204).
 FUNCTIONS TO SIMPLIFY
PROGRAMMING
185
Specify P and Q in a block that performs drilling. If they are specified in a block that does not perform drilling, they are not stored as modal data. When Q0 is specified, the peck rigid tapping cycle is not performed.
Do not specify a group 01 G code (G00 to G03) and G73 in the same block. If they are specified together, G73 is canceled.
In the canned cycle mode, tool offsets are ignored.
The rigid tapping canned cycle is canceled. For how to cancel this cycle, see II–13.1.14.
NOTE When Rigid Tapping Cancel is commanded, the S command, which is used at rigid tapping, is also cleared. (It is the same that S0 is commanded.) Therefore, the S command, which is specified for rigid tapping, can not be used at blocks after Rigid Tapping Cancel. Please re–specify S command after Rigid Tapping Cancel if necessary.
� P/Q
� Cancel
� Tool offset
13.2.4 Canned Cycle Cancel (G80)
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
186
Canned grinding cycles make it easier for the programmer to create programs that include grinding. With a canned grinding cycle, repetitive operation peculiar to grinding can be specified in a single block with a G function; without canned grinding cycles, normally more than one block is required. In addition, the use of canned grinding cycles shortens the program to save memory. The following four canned grinding cycles are available: ⋅Plunge grinding cycle (G75) ⋅Direct constant–dimension plunge grinding cycle (G77) ⋅Continuous–feed surface grinding cycle (G78) ⋅Intermittent–feed surface grinding cycle (G79)
13.3 CANNED GRINDING CYCLE (FOR GRINDING MACHINE)
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
187
A plunge grinding cycle is performed.
��2
G75 I_ J_ K_ X(Z)_ R_ F_ P_ L_ ;
I_: Depth–of–cut 1 (A sign in the command specifies the direction of cutting.)
J_ : Depth–of–cut 2 (A sign in the command specifies the direction of cutting.)
K_ : Total depth of cut (A sign in the command specifies the direction of cutting.)
X(Z)_ : Range of grinding (A sign in the command specifies the direction of grinding.)
R_ : Feedrate for I and J F_ : Feedrate for X (Z) P_ : Dwell time L_ : Grinding–wheel wear compensation (Only for continuous dressing)
I
J
X(Z)
(1) (R)
(2) P
(3) (F)
(5) P
X(Z)
Y
(6) (F)
(4) (R)
The plunge grinding cycle consists of six operation sequences. Operations (1) to (6) are repeated until the depth reaches the total depth of cut specified at address K. In the single block stop mode, operations (1) to (6) are performed every cycle start.
(1)Cutting is performed along the Y–axis in cutting feed mode for the amount specified by I (depth of cut 1). The feedrate is specified by R.
(2)Dwell is performed for the time specified by P.
(3)Cutting feed is performed for the amount specified by X (or Z). The feedrate is specified by F.
(4)Cutting is performed along the Y–axis in cutting feed mode for the amount specified by J (depth of cut 2). The feedrate is specified by R.
(5)Dwell is performed for the time specified by P.
(6)Feeding is performed in the reverse direction for the amount specified by X (or Z) at a feedrate specified by F.
13.3.1 Plunge Grinding Cycle (G75)
Format
Explanations
� Grinding wheel cutting
� Dwell
� Grinding
� Grinding wheel cutting
� �3���
� Grinding (return direction)
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
188
X, (Z), I, J, and K must all be specified in incremental mode.
I, J, X, and Z in canned cycles are modal data common to G75, G77, G78, and G79. They remain valid until new data is specified. They are cleared when a group 00 G code other than G04 or a group 01 G code other than G75, G77, G78, and G79 is specified.
When the total depth of cut is reached during cutting using I or J, the subsequent operation sequences (up to �) are executed, then the cycle terminates. In this case, no further cutting is performed after the total depth of cut is reached.
� Chart of operation in which the total depth of cut is reached by cutting specified by I and J:
I
J K
I K
�
�
�
�
�
�
�
� Chart of operation in which the total depth of cut is reached during cutting specified by I and J:
I
J K
I K
� �
�
�
�
� �
Limitations
� X(Z), I, J, K
� Clear
� Operation performed when the total depth of cut is reached
PROGRAMMINGB–64124EN/01 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
189
A direct constant–dimension plunge grinding cycle is performed.
G77
G77 I_ J_ K_ X(Z)_ R_ F_ P_ L_ ;
I_: Depth–of–cut 1 (A sign in the command specifies the direction of cutting.)
J_ : Depth–of–cut 2 (A sign in the command specifies the direction of cutting.)
K_ : Total depth of cut (A sign in the command specifies the direction of cutting.)
X(Z)_ : Range of grinding (A sign in the command specifies the direction of grinding.)
R_ : Feedrate for I and J F_ : Feedrate for X (Z) P_ : Dwell time L_ : Grinding–wheel wear compensation (Only for continuous
dressing)
I
J
X(Z)
(R)
P
(F)
P
X(Z)
Y
(F)
(R)
�
�
��
The constant–dimension plunge grinding cycle consists of six operation sequences. Operations � to � are repeated until the depth reaches the total depth of cut specified at address K.
� Cutting is performed along the Y–axis in cutting feed mode for the amount specified by I (depth of cut 1). The feedrate is specified by R.
Dwell is performed for the time specified by P.
Cutting feed is performed for the amount specified by X (or Z). The feedrate is specified by F.
� Cutting is performed along the Y–axis in cutting feed mode for the amount specified by J (depth of cut 2). The feedrate is specified by R.
� Dwell is performed for the time specified by P.
� Feeding is performed in the reverse direction for the amount specified by X (or Z) at a feedrate specified by F.
13.3.2 Direct Constant–Dimension Plunge Grinding Cycle (G77)
Format
Explanations
� Grinding wheel cutting
� Dwell
� Grinding
� Grinding wheel cutting
� �3���
� Grinding (return direction)
PROGRAMMING 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING B–64124EN/01
190
When the cycle is performed using G77, a skip signal can be input to terminate the cycle. When a skip signal is input, the current operation sequence is interrupted or completed, then the cycle is terminated. The following shows how the system operates when the skip signal is input during each operation sequence.
� When the skip signal is input during operation sequence 1 or 4 (cutting feed specified by I or J), cutting is stopped immediately and the tool returns to the X (Z) coordinate at which the cycle started.
Skip Signal
Skip Signal(End)
(End)
� When the skip signal is input during operation sequence 2 or 5 (dwell), dwell is stopped immediately and the tool returns to the X (Z) coordinate at which the cycle started.