– Dwell (G04) – Changing an offset value with a program (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)
� Specifying angles with incremental commands and a radius with absolute commands
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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 8. COORDINATE VALUE
AND DIMENSION
98
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 (Section 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.
CAUTION Reference position return is performed at a low speed for the first G28 command after the inch input is switched to the metric input or vice versa.
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.
8.3 INCH/METRIC CONVERSION (G20, G21)
������
ww w.
cn cc
en ter
.co m
B–61404E/08 8. COORDINATE VALUE
AND DIMENSIONPROGRAMMING
99
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 mm, 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 parameter No. 051#7. 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 with- out 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 1 Fractions less than the least input increment are truncated.
Examples: X1.2345; 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. 2 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; Alarm 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
�� ��������
���� ��
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 9. SPINDLE SPEED FUNCTION
(S FUNCTION)
100
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 BINARY CODE 9.2 SPECIFYING THE SPINDLE SPEED VALUE DIRECTLY
(S5–DIGIT COMMAND) 9.3 CONSTANT SURFACE SPEED CONTROL (G96, G97)
ww w.
cn cc
en ter
.co m
B–61404E/08 9. SPINDLE SPEED FUNCTION
(S FUNCTION)PROGRAMMING
101
A 2–digit S code can be specified in a block. For a description of the use of S codes, such as their execution sequence in a block in which a spindle speed, move command, and S code are specified, see the manual provided by the machine tool builder.
The spindle speed can be specified directly by address S followed by a five–digit value (rpm). 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 BINARY CODE
9.2 SPECIFYING THE SPINDLE SPEED VALUE DIRECTLY (S5–DIGIT COMMAND)
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 9. SPINDLE SPEED FUNCTION
(S FUNCTION)
102
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 Pα S����� ; ↑Surface speed (m/min or feet/min)
Note : This surface speed unit may change according to machine tool builder’s specification. If a surface speed is omitted, the S value specified in the previous G96 is used.
P0 : Axis set in the parameter (No. 041#4, #5) P1 : X axis, P2 : Y axis, P3 : Z axis, P4 : 4th axis
G97 S����� ; ↑� ����� � ��� ( �)
Note : This surface speed unit may change according to machine tool builder’s specification. If a spindle speed is omitted, the last speed specified in G96 remains valid.
G92 S����� ; ↑Maximum spindle speed (rpm) used during constant surface speed control
Note : The measurement unit of this maximum spindle speed may vary from one machine builder to another.
9.3 CONSTANT SURFACE SPEED CONTROL (G96, G97)
Format
� Constant surface speed control command
� Constant surface speed control cancel command
� Clamp of maximum spindle speed
ww w.
cn cc
en ter
.co m
B–61404E/08 9. SPINDLE SPEED FUNCTION
(S FUNCTION)PROGRAMMING
103
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. If address P is omitted, P0 is assumed. A G97 command cancels the G96 mode. If an S value is omitted in a G97 block, the last speed specified in the G96 mode remains valid. 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.
The spindle speed (rpm) almost coin- cides with the surface speed (m/min) at approx. 160 mm (radius).
Radius of work
0 20 40 60 80 100 120 140 160 180 200 220 240 260 280 300
(n)
3000
2800
2600
2400
2200
2000
1800
1600
1400
1200
1000
800
600
400
200
0
Spindle speed (rpm)
��
��� ���
���
���
������ �
Fig. 9.3 (a) Relation between workpiece radius, spindle speed and surface speed
� ����� ����
� Constant surface speed control command (G96)
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 9. SPINDLE SPEED FUNCTION
(S FUNCTION)
104
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
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 (rpm) is used
Not specified
The surface speed (m/min or feet/min) is converted to the spindle speed (rpm)
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
� ���� �� � � ����� ���
����� ���� ����� ���
�������� ������� �����
�������
� Surface speed specified in the G96 mode
ww w.
cn cc
en ter
.co m
B–61404E/08 9. SPINDLE SPEED FUNCTION
(S FUNCTION)PROGRAMMING
105
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.
��� ��� ����
� Constant surface speed control for threading
� Constant surface speed control for rapid traverse (G00)
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0810. TOOL FUNCTION (T FUNCTION)
106
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
ww w.
cn cc
en ter
.co m
B–61404E/08 10. TOOL FUNCTION (T FUNCTION)PROGRAMMING
107
By specifying two or four–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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0810. TOOL FUNCTION (T FUNCTION)
108
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 life value
Tool number
Code specifying tool compensa- tion value
1
n
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
ww w.
cn cc
en ter
.co m
B–61404E/08 10. TOOL FUNCTION (T FUNCTION)PROGRAMMING
109
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 (No. 039#0, #1) (Table 10.2.1).
Table 10.2.1 The max. number of groups and tools that can be registered
The Max. number of groups and tools without optional function
of 512 tool pairs
The Max. number of groups and tools with optional function
of 512 tool pairs
Number of group
Number of tool Number of group
Number of tool
16 16 64 32
32 8 128 16
64 4 256 8
128 2 512 4
NOTE When bits 0 or 1 of parameter 039 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 two or 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 code numbers that can be registered to specify a tool offset value are 200. Code number 99, however, cannot be used.
NOTE When codes specifying tool offset values are not used, registration can be omitted.
Refer to subsections 10.2.2 and 10.2.4.
10.2.1 Tool Life Management Data
� ����� ����
� Tool group number
� Tool number
� Code specifying tool compensation value
� Tool life value ww
w. cn
cc en
ter .co
m
PROGRAMMING B–61404E/0810. TOOL FUNCTION (T FUNCTION)
110
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.
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 deleted. (MDI operation)
Tool life counters can be preset for each group. (MDI operation)
Whether tool life is to be indicated by time (minutes) or by frequency, it is set by a parameter (No. 039 #2) . Maximum value of tool life is as follows.
In case of minute :4300(minutes) In case of frequency :9999(times)
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
10.2.2 Register, Change and Delete of Tool Life Management Data
� ����� ����
� Register with deleting all groups
� Deletion of tool life management data
� Register of tool life count type
� Life value
Format
ww w.
cn cc
en ter
.co m
B–61404E/08 10. TOOL FUNCTION (T FUNCTION)PROGRAMMING
111
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 parameter 599 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 usedtools, 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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0810. TOOL FUNCTION (T FUNCTION)
112
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 speci- fied tool group when M06 is specified next.
Life counting is performed when a tool in the tool group specified 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 specified by itself as type C.
Parameter 039#7=0 041#7=0
039#7=1 041#7=0
041#7=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
ww w.
cn cc
en ter
.co m
B–61404E/08 10. TOOL FUNCTION (T FUNCTION)PROGRAMMING
113
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.) Note)
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.)
NOTE Specify M06T101; for tool change method C.
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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0810. TOOL FUNCTION (T FUNCTION)
114
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.
2 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
ww w.
cn cc
en ter
.co m
B–61404E/08 11. AUXILIARY FUNCTIONPROGRAMMING
115
11 ������� ���� ��� 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.
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0811. AUXILIARY FUNCTION
116
When a three–digid 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 or M99. 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 019 (M02) can be used to disable M02 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 section 13.3 for details .
This code indicates the end of a subprogram. M99 execution returns control to the main program. See the subprogram section 12.3 for details.
This code is used to call a file on the floppy cassette as a subprogram.
NOTE The block following M00, M01, M02 and M30, is not read into the input buffer register, if present. Similarly, two M codes which do not buffer can be set by parameters (Nos. 111 to 112). Refer to the machine tool builder’s instruction manual for these M codes.
11.1 AUXILIARY FUNCTION (M FUNCTION)
Explanations
� ������
� �� �� ��������
� ���
�������� �����
� ���
��������� �����
� ��
�������� ��
�����������)
� ���
� �� �� �����������
� M198 (subprogram calling)ww
w. cn
cc en
ter .co
m
B–61404E/08 11. AUXILIARY FUNCTIONPROGRAMMING
117
So far, one block has been able to contain only one M code. However, this function allows up to three M codes to be contained in one block. 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. To use this function, set bit 7 of parameter No. 065 to 1.
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. 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 ;
: : : : :
Indexing of the table is performed by address B and a following 3 or 6–digit number. The relationship between B codes and the corresponding indexing differs between machine tool builders. Refer to the manual issued by the machine tool builder for details.
When this functions is used, the B address specifying an axis movement disabled.
11.2 MULTIPLE M COMMANDS IN A SINGLE BLOCK
Explanations
Examples
11.3 THE SECOND AUXILIARY FUNCTIONS (B CODES)
Restrictionsww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0812. PROGRAM CONFIGURATION
118
12 � ���� � ���� ���� �
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 Subprogram
Instruction 1
Instruction 2
Instruction n
Instruction 1′
Instruction 2′
Instruction n+1
Return to the main program
Fig. 12 (a) Main program and subprogram
The CNC memory can hold up to 200 main programs and subprograms (63 as standard). A main program can be selected from the stored main programs to operate the machine. See Chapter 10 in OPERATION for the methods of registering and selecting programs.
General
� Main program and subprogram
ww w.
cn cc
en ter
.co m
B–61404E/08 12. PROGRAM CONFIGURATIONPROGRAMMING
119
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 section Program section configuration Program number O0001 ; Block 1 N1 G91 G00 X120.0 Y80.0 ; Block 2 N2 G43 Z–32.0 H01 ;
: : Block n Nn M20 ; Program end M30 ;
A block contains information necessary for machining, such as a move command or coolant on/off command.Specifying a value following a slash (/) at the start of a block disables the execution of some blocks (see “optional block skip” in Section 12.2).
� Program components
� Program section configuration
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0812. PROGRAM CONFIGURATION
120
This section describes program components other than program sections. See Section 12.2 for a program section.
% TITLE ;
O0001 ;
M30 ;
%
(COMMENT)
Tape start
Program section
Leader section
Program start
Comment section
Tape end
Fig. 12.1 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 CRT display 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 ISOcode 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 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.
Table 12.1(b) Code of a program start
Name ISOcode EIA
code Notation in this manual
Program start LF CR ;
12.1 PROGRAM COMPONENTS OTHER THAN PROGRAM SECTIONS
Explanations
� Tape start
� Leader section
� Program startww w.
cn cc
en ter
.co m
B–61404E/08 12. PROGRAM CONFIGURATIONPROGRAMMING
121
NOTE If one file contains multiple programs, the EOB code for label skip operation must not appear before a second or subsequent program number. However, an program start is required at the start of a program if the preceding program ends with %.
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. There is no limit on the length of a comment section.
Table 12.1 (c) Codes of a control–in and a control–out
Name ISOcode 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 command tape 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 9 are ignored, and thus are not read into memory. When data in memory is punched out on paper tape with the punch function, the comment sections are also punched out. 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 punched out or displayed. During memory operation, all comment sections are ignored. The TV check function can be used for a comment section by setting parameter (No. 018 #6).
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 If only a control–in code is read with no matching control–out code, the read control–in code is ignored.
� Comment section
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0812. PROGRAM CONFIGURATION
122
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. 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 alarm (No. 008) is occurred.
Table 12.1 (d) Code of a tape end
Name ISOcode EIA
code Notation in this manual
Tape end % ER %
� Tape end
ww w.
cn cc
en ter
.co m
B–61404E/08 12. PROGRAM CONFIGURATIONPROGRAMMING
123
This section describes elements of a program section. See Section 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. 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 CRT/MDI panel when the program is stored in memory (See Section 9.3 in Part III.).
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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0812. PROGRAM CONFIGURATION
124
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 ISOcode 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 four digits (1 to 9999) 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 horizontally. 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 alarm (No.002) is output. No TV check is made only for those parts that are skipped by the label skip function. A comment section enclosed in parentheses is also subject to TV check to count the number of characters. The TV check function can be enabled or disabled by setting on the MDI unit (See Subsec. 11.5.3 in Part III.).
� Sequence number and block
� TV check (Vertical parity check along tape)
ww w.
cn cc
en ter
.co m
B–61404E/08 12. PROGRAM CONFIGURATIONPROGRAMMING
125
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
Dimension word
Feed– function
Spindle speed function
Tool function
Miscellaneous function
Fig. 12.2 (c) 1 block (example)
� Block configuration (word and address)
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0812. PROGRAM CONFIGURATION
126
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 100 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–9999 1–9999
Preparatory function G 0–255 0–255
Dimen- sion word
Increment system IS–B
X, Y, Z, U, V, W, A, B C I J
�99999.999mm �9999.9999inch
word Increment system IS–C
B, C, I, J, K, R, �9999.9999mm �999.99999inch
Feed per minute
Increment system IS–B
F 1–100000mm/min 0.01–4000 inch/min
minute Increment system IS–C
1–24000mm/min 0.01–480.00 inch/min
Feed per revolution F 0.01–500.00 mm/rev
0.0001–9.9999 inch/rev
Spindle speed function S 0–20000 0–20000
Tool function T 0–9999 0–9999
Auxiliary function M 0–999 0–9999
B 0–999999 0–999999
Offset number H, D 0–200 0–200
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 program number
P 1–9999 1–9999
Number of repetitions P 1–999 1–999
� Major addresses and ranges of command values
ww w.
cn cc
en ter
.co m
B–61404E/08 12. PROGRAM CONFIGURATIONPROGRAMMING
127
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 tape 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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0812. PROGRAM CONFIGURATION
128
The end of a program is indicated by commanding 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 For main rogram
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.
NOTE 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 item “� Optional block skip”.)
� Program end
ww w.
cn cc
en ter
.co m
B–61404E/08 12. PROGRAM CONFIGURATIONPROGRAMMING
129
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 two levels as shown below.
O0001 ;
M98P1000 ;
M30 ;
Main program
O1000 ;
M98P2000 ;
M99 ;
O2000 ;
M99 ;
Subprogram
(One–level nesting) (Two–level nesting)
Subprogram
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.
12.3 SUBPROGRAM
Format
� Subprogram configuration
� Subprogram call
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0812. PROGRAM CONFIGURATION
130
See Chapter 10 in Part III for the method of registering a subprogram.
NOTE 1 The M98 and M99 signals 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 pro- gram
A subprogram can call another subprogram in the same way as a main program calls a subprogram.
This command specifies “Call the subprogram (number 1002) five times in succession.” A subprogram call com- mand (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 ;
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 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 … ;
Reference
Examples
Special Usage
� Specifying the sequence number for the return destination in the main program
ww w.
cn cc
en ter
.co m
B–61404E/08 12. PROGRAM CONFIGURATIONPROGRAMMING
131
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
A subprogram can be executed just like a main program by searching for the start of the subprogram with the MDI. (See Section 9.4 in Part III 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 skip must be set to off ; this switch is to be set to on first.
N1010 … ; N1020 … ; N1030 … ; N1040 M02 ;
N1050 M99 P1020 ;
/ Optional block skip ON
� Using M99 in the main program
� Using a subprogram only
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
132
13 FUNCTIONS TO SIMPLIFY PROGRAMMING This chapter explains the following items:
13.1 CANNED CYCLE 13.2 RIGID TAPPING 13.3 CANNED GRINDING CYCLE (0–GSC, 0–GSD/II) 13.4 GRINDING–WHEEL WEAR COMPENSATION BY
CONTINUOUS DRESSING (0–GSC, 0–GSD/II) 13.5 AUTOMATIC GRINDING WHEEL DIAMETER
COMPENSATION AFTER DRESSING 13.6 IN–FEED GRINDING ALONG THE Y AND Z AXES AT THE
END OF TABLE SWING (0–GSC, 0–GSD/II) 13.7 OPTIONAL ANGLE CHAMFERING AND CORNER
ROUNDING 13.8 EXTERNAL MOTION FUNCTION (G81) 13.9 SMALL–DIAMETER PECK DRILLING CYCLE
General
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
133
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 Spindle orientation 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
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
13.1 CANNED CYCLE
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
134
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.
Table 13.1 (b) Positioning plane and drilling axis
G code Positioning plane Drilling axis
G17 Xp–Yp plane Z axis
G18 Zp–Xp plane Y axis
G19 Yp–Zp plane X axis
G17 to G19 may be specified in a block in which any of G73 to G89 is not specified.
CAUTION Switch the drilling axis after canceling a canned cycle.
NOTE A parameter (No. 057 #6) can be set to the Z axis always used as the drilling axis. When FXY=0, the Z axis is always the drilling axis.
� Positioning plane
� �������� � �
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
135
The travel distance along the drilling axis varies for G90 and G91 as follows:
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.
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
� Travel distance along the drilling axis G90/G91
� Drilling mode
� Return point level G98/G99
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
136
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.
� �� �� G �����
G00 : Positioning (rapid traverse) G01 : Linear interpolation G02 : Circular interpolation or helical interpolation (CW) G03 : Circular interpolation or helical interpolation (CCW)
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)
Spindle orientation (The spindle stops at a fixed rotation position)
� Repeat
� Cancel
� Symbols in figures
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
137
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
Initial level
q
q
q
d
d
d
d
Point R Point R levelPoint R
Point Z Point Z
q
q
q
13.1.1 High–speed Peck Drilling Cycle (G73)
Format
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
138
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 531. 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 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.
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 ini–tial level. G80 G28 G91 X0 Y0 Z0 ; Return to the reference position return M5 ; Cause the spindle to stop rotating.
� ����� ����
Restrictions
� Axis switching
� Drilling
� Q/R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
139
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
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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
140
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 it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a group 01 G code (G00 to G03) and G74 in the same block. If they are specified together, G74 is 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.
Restrictions
� Axis switching
� Drilling
� R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
141
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
q q
Shift amount q
Spindle orientation
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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
142
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 and 5 of parameter 002. Specify Q and R 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 group 01 G code (G00 to G03) and G76 in the same block. If they are specified together, G76 is 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
Restrictions
� Axis switching
� Boring
� Q/R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
143
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
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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
144
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 it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a group 01 G code (G00 to G03) and G81 in the same block. If they are specified together, G81 is 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
� R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
145
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
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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
146
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 it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a group 01 G code (G00 to G03) and G82 in the same block. If they are specified together, G82 is 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
� R
� Cancel
� ���� ������
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
147
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
dq
dq
q
Initial level
Point R
Point Z
Point R level
Point Z
dq
dq
q
Point R
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 point just before where the last drilling ended, and cutting feed is performed again. Specify the amount of retraction in parameter No. 532. 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
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
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.
 If they are specified in a block that does not perform drilling, they cannot be stored as modal data.
Do not specify a group 01 G code (G00 to G03) and G83 in the same block. If they are specified together, G83 is 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.
Restrictions
� Axis switching
� Drilling
� Q/R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
149
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
P
P
Point R
Initial level
Point R level
Point Z
Spindle CCW
Spindle CW P
P
Point R
Initial level
Point Z
Spindle CCW
Spindle CW
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.
13.1.7 Tapping Cycle (G84)
Format
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
150
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 it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a group 01 G code (G00 to G03) and G84 in the same block. If they are specified together, G84 is 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.
Restrictions
� Axis switching
� Drilling
� R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
151
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
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.8 Boring Cycle (G85)
Format
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
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.
 If it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a group 01 G code (G00 to G03) and G85 in the same block. If they are specified together, G85 is 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.
Restrictions
� Axis switching
� Drilling
� R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
153
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
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.9 Boring Cycle (G86)
Format
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
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.
 If it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a group 01 G code (G00 to G03) and G86 in the same block. If they are specified together, G86 is 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.
Restrictions
� Axis switching
� Drilling
� R
� Cancel
� Tool offset
��������
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
155
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
q OSS
OSS
P
Point R
Not used
Point Z
Spindle CW
Spindle CW
Spindle orientation
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.10 Boring Cycle Back Boring Cycle (G87)
Format
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
156
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 and 5 of parameter 002. Specify Q and R 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 group 01 G code (G00 to G03) and G76 in the same block. If they are specified together, G76 is 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.
Z120. 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
� Q/R
� Cancel
� Tool offset
Examplesww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
157
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
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.11 Boring Cycle (G88)
Format
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
158
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 it is specified in a block that does not perform drilling, it cannot be stored as modal data.
Do not specify a group 01 G code (G00 to G03) and G88 in the same block. If they are specified together, G88 is 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.
Restrictions
� Axis switching
� Drilling
� R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
159
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
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.12 Boring Cycle (G89)
Format
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
160
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 it is specified in a block that does not perform drilling, it cannot be stored as modal data.
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.
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.
Restrictions
� Axis switching
� Drilling
� R
� Cancel
� Tool offset
Examples
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
161
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.13 Canned Cycle Cancel (G80)
Format
Explanations
Examples
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
162
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
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
163
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 G92X0Y0Z500.0; 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 G49Z500.0; Tool length offset cancel N027 M0; Program stop
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
164
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
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
165
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 or 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
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
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, a dwell is performed and the spindle is stopped. 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 200% depending on the setting at bit 4 of parameter and parameter 063 and parameter 258.
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 No. 076 #3 = 1).
13.2.1 Rigid Tapping (G84)
Format
Explanations
� Rigid mode ww
w. cn
cc en
ter .co
m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
166
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 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. If the drilling axis is changed in rigid mode, alarm (No. 206) is issued.
If a speed higher than the maximum speed for the gear being used is specified, alarm (No. 200) is issued.
If a value exceeding the upper limit of cutting feedrate is specified, alarm (No. 011) is issued.
If an S command and axis movement are specified between M29 and G84, alarm (No. 203) is issued. If M29 is specified in a tapping cycle, alarm (No. 204) is issued.
Specify R 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 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.
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
Z–axis feedrate 1000 mm/min Spindle speed 1000 rpm 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.  FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
167
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 or
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
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 CW Spindle CW
Point R level
Point Z
Spindle CCW
Point R Point R
Spindle stop
P P Spindle stop
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, a dwell is performed and the spindle is stopped. 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 200% depending on the setting at bit 4 of parameter 063 and parameter 258.
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 No. 076#3 = 1) .
13.2.2 Left–handed Rigid Tapping Cycle (G74)
Format
Explanations
� Rigid mode
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
168
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.
Before the drilling axis can be changed, the canned cycle must be canceled. If the drilling axis is changed in rigid mode, alarm (No. 206) is issued.
Specifying a rotation speed exceeding the maximum speed for the gear used causes alarm (No. 200).
Specifying a value that exceeds the upper limit of cutting feedrate causes alarm (No. 011).
Specifying an S command or axis movement between M29 and G84 causes alarm (No. 203). Then, specifying M29 in the tapping cycle causes alarm (No. 204).
Specify R 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 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.
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
Z–axis feedrate 1000 mm/min Spindle speed 1000 rpm 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.  FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
169
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 bit (bit 0) of parameter 388.
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 or 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 No.388#0=0)
d q
q
q
d
� �
� Peck tapping cycle (Parameter No.388#0=1)
�
� 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
d=retraction distance
Point R level
d=cutting start distance
Initial level
During a rigid tapping cycle, CNC checks whether the pulse distribution is per- formed or not and start the next operation at the end of each operation of � and � in the peck tapping cycle.
d q
q
q
d
Point Z
Point R Point R level
� �
d q
q
q
d
� �
Point Z
Point R Point R level �
d q
q
q
d
� �
Point Z
Point R Point R level
13.2.3 Peck Rigid Tapping Cycle (G84 or G74)
Format
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
170
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 bit (bit 4) of parameter 063 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 403.
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 bit (bit 4) of parameter 063 specifies whether the retraction can be overridden or not. Traverse 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 traverse, the specification of the bit (bit 4) of parameter 063 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 403.
Before the drilling axis can be changed, the canned cycle must be canceled. If the drilling axis is changed in rigid mode, alarm (No. 206) is issued.
Specifying a rotation speed exceeding the maximum speed for the gear used causes alarm (No. 200).
Specifying a value that exceeds the upper limit of cutting feedrate causes alarm (No. 011).
Specifying an S command or axis movement between M29 and G84 causes alarm (No. 203). Then, specifying M29 in the tapping cycle causes alarm (No. 204).
Specify Q and R 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.
 FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
171
The rigid tapping canned cycle is canceled. For how to cancel this cycle, see Section 13.1.13.
13.2.4 Canned Cycle Cancel (G80)
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
172
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 (0–GSC, 0–GSD/II)
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
173
A plunge grinding cycle is performed.
G75
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 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 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. In the single block stop mode, operations � to � are performed every cycle start.
� 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.1 Plunge Grinding Cycle (G75)
Format
Explanations
� Grinding wheel cutting
� Dwell
� Grinding
� Grinding wheel cutting
� �����
� Grinding (return direction)
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
174
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 6) 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
�� �
�
�
Restrictions
� X(Z), I, J, K
� Clear
� Operation performed when the total depth of cut is reached
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
175
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 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
� �����
� Grinding (return direction)
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
176
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.
� When the skip signal is input during operation sequence 3 or 6 (movement), the tool returns to the X (Z) coordinate at which the cycle started after the movement specified by X (Z) is completed.
Skip Signal (End)
(End)
Skip Signal
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.
� ��� �����
Restrictions
� X(Z), I, J, K
� Clear
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
177
A continuous–feed surface grinding cycle is performed.
G78
G78 I_ (J_) K_ X_ F_ P_ L_ ;
I
J
X
� P(Dwell) � (F)
� P(Dwell)� (F)
X
Z
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 X(Z)_ : Range of grinding (A sign in the command specifies the
direction of grinding.) R_ : Feedrate for I and J F_ : Feed rate P_ : Dwell time L_ : Grinding–wheel wear compensation (Only for continuous
dressing)
The continuous–feed surface grinding cycle consists of four operation sequences. Operations � to � are repeated until the depth reaches the total depth of cut specified in address K. In the single block stop mode, operations � to � are performed every cycle start.
� Dwell � Grinding � Dwell � Grinding (in reverse direction)
13.3.3 Continuous–feed Surface Grinding Cycle (G78)
Format
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
178
When J is omitted, it is assumed to be 1. J is valid only in the block where it is specified.
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 6) 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
J
K �
�
�
�
⋅ Chart of operation in which the total depth of cut is reached during cutting specified by I and J:
I
J
� �
�
�
K
I
J
K �
�
�
�
Restrictions
� �
� I, J, K, X
� �����
� Operation performed when the total depth of cut is reached
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
179
An intermittent–feed surface grinding cycle is performed.
G79
G79 I_ J_ K_ X_ 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 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
� (R)
� P
� (F)
� P
X
Z
� (F)
� (R)
The intermittent–feed surface grinding cycle consists of six operation sequences. Operations � to � are repeated until the depth reaches the total depth of cut specified at address K. In the single block stop mode, operations � to � are performed every cycle start.
� Cutting is performed along the Z–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 Z–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 at a feedrate specified by F.
13.3.4 Intermittent–feed Surface Grinding Cycle (G79)
Format
Explanations
� Grinding wheel cutting
� Dwell � Grinding
� Grinding wheel cutting
� �����
� Grinding (return direction)
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
180
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.
������ �����
� �� �� �� �
� � � �
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
181
This function enables continuous dressing. When G75, G77, G78, or G79 is specified, grinding wheel cutting and dresser cutting are compensated continuously according to the amount of continuous dressing during grinding.
Specify an offset number (grinding–wheel wear compensation number) at address L in the block containing G75, G77, G78, or G79. The compensation amount set in the offset memory area corresponding to the specified number is used as the amount of dressing. Up to 200 offset numbers (L1 to L200) can be specified. Compensation amounts must be set beforehand in offset memory corresponding to offset numbers from the CRT/MDI panel. When L is omitted or L0 is specified in a surface grinding canned cycle block, compensation is not performed.
Compensation is performed for every grinding operation (every movement along the X–axis) in the operation sequences of a canned grinding cycle. While the tool moves along the X–axis, compensation is performed along the Y–axis (grinding wheel cutting) and the V–axis (dresser cutting) for simultaneous three–axis interpolation. The travel distance (compensation amount) along the Y–axis is the same as specified dressing amount, and the travel distance along the V–axis is twice as long (diameter).
X
Workpiece
2a
a X
YV
Dresser
Grinding wheel
a : Amount of dressing
13.4 GRINDING–WHEEL WEAR COMPENSATION BY CONTINUOUS DRESSING (0–GSC, 0–GSD/II)
Explanations
� Specification
� Compensation
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
182
Compensation amounts set in offset memory can be modified by using the external tool compensation function or programming (by changing offsets using custom macro variables). With these functions, the compensation amount for the diameter of the dressed grinding wheel can be changed. If the compensation amount associated with the offset number specified in the H code is smaller than the minimum grinding wheel diameter specified in parameter 838 when programmed compensation (using G43 or G44) is performed, a signal is output to the PMC.
X
Workpiece
2a
a X
YV
Dresser
Grinding wheel
a : Amount of dressing
13.5 AUTOMATIC GRINDING WHEEL DIAMETER COMPENSATION AFTER DRESSING
13.5.1 Checking the Minimum Grinding Wheel Diameter (0–GSC, 0–GSD/II)
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
183
Every time an external signal is input, cutting is performed by a fixed amount according to the programmed profile in the specified Y–Z plane.
G161 R_ ;
G160 ;
profile program
Specify the start of an operation mode and profile program. Also specify the depth of cut in R.
Program a workpiece figure in the Y–Z plane using linear interpolation (G01) and/or circular interpolation (G02 or G03). One or more blocks can be specified.
Cancel the operation mode (end of the profile program).
Do not specify codes other than G01, G02, and G03 within the profile program.
70.0 70.080.0
N1
N2
N3
R=67.000
α
Z
Y
O0001 ; : N0 G161 R10.0 ; N1 G91 G01 Z–70.0 F100 ; N2 G19 G02 Z–80.0 R67.0 ; N3 G01 Z–70.0 ; N4 G160 ; :
In the above program, every time the in–feed cutting start signal is input, the tool is moved by 10.000 along the machining profile shown above. α= Travel distance for each in–feed control cutting start signal input The feedrate is programmed with an F code.
13.6 IN–FEED GRINDING ALONG THE Y AND Z AXES AT THE END OF TABLE SWING (0–GSC, 0–GSD/II) Format
Explanations
� G161 R_
� Profile program
� G160
Restrictions
� Profile program
Examples
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
184
Chamfering and corner rounding blocks can be inserted automatically between linear interpolation and linear interpolation blocks
, C_
, R_
Chamfering
Corner R
When the above specification is added to the end of a block that specifies linear interpolation (G01), a chamfering or corner rounding block is inserted. Blocks specifying chamfering and corner rounding can be specified consecutively.
After C, specify the distance from the virtual corner point to the start and end points. The virtual corner point is the corner point that would exist if chamfering were not performed.
Hypothetical corner intersection
Inserted chamfering block
� G91 G01 X100.0 ,C10.0 ; � X100.0 Y100.0 ;
C
C
After R, specify the radius for corner rounding.
� G91 G01 X100.0 ,R10.0 ; � X100.0 Y100.0 ;
Center of a circle with radius R
R
Hypothetical corner intersection
13.7 OPTIONAL ANGLE CHAMFERING AND CORNER ROUNDING
Format
Explanations
� Chamfering
� Corner R
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
185
Chamfering and corner rounding can be performed only in the plane specified by plane selection (G17, G18, or G19). These functions cannot be performed for parallel axes.
A block specifying chamfering or corner rounding must be followed by a block that specifies a move command using linear interpolation (G01). If the next block does not contain these specifications, alarm 052 is issued.
A chamfering or corner rounding block can be inserted only for move commands which are performed in the same plane. In a block that comes immediately after plane switching (G17, G18, or G19 is specified), neither chamfering nor corner rounding can be specified.
If the inserted chamfering or corner rounding block causes the tool to go beyond the original interpolation move range, alarm 055 is issued.
In a block that comes immediately after the coordinate system is changed (G92, or G52 to G59) or a return to the reference position (G28 to G30) is specified, neither chamfering nor corner rounding can be specified.
The chamfering or corner rounding block is regarded as having a travel distance of zero if the angle between the two straight lines is within +1°.
The following G codes cannot be used in a block that specifies chamfering or corner rounding. They also cannot be used between chamfering and corner rounding blocks that define a continuous figure. ⋅G codes of group 00 (except G04) ⋅G68 of group 16
Corner rounding cannot be specified in a threading block.
Restrictions
� Plane selection
� Next block
� Plane switching
� Exceeding the move range
� Coordinate system
� Travel distance 0
� Unavailable G codes
� �� ������
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
186
Upon completion of positioning in each block in the program, an external operation function signal can be output to allow the machine to perform specific operation. Concerning this operation, refer to the manual supplied by the machine tool builder.
G81 _ ; ( ��_ Axis move command )��
Every time positioning for the IP_ move command is completed, the CNC sends a external operation function signal to the machine. An external operation signal is output for each positioning operation until canceled by G80 or a group 01 G code.
No external operation signals are output during execution of a block that contains neither X nor Y.
13.8 EXTERNAL MOTION FUNCTION (G81)
Format
Explanations
Restrictions
� A block without X or Y axis
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
187
When drilling is performed using a tool with an overload torque detection function, this function allows the small–diameter peck drilling cycle to be performed by entering an overload torque detection signal as a skip signal to change the spindle speed and cutting feedrate. The machining sequence for small–diameter peck drilling is shown below.
Tool �
�
Overload torque
Overload torque �Dwell
Point R
Point Z
�
�
Q
∆
∆ : Initial minimal clearance for retraction to point R, and clearance for the start point (previous end point) in second and subsequent cuttings
Q : Depth of each cut
: Movement at the rapid traverse rate
: Movement at a parameter–set or programmed feedrate
: Movement at a programmed cutting feedrate
Fig. 13.9
The machining sequence of the small–diameter peck drilling cycle is as follows:
� Positioning along the X–axis and Y–axis
� Positioning at point R along the Z–axis
� Drilling along the Z–axis (maximum depth of cut Q)
� Repetition of the following operations along the Z–axis until the bottom is reached
� Retract (→ Minimal clearance ∆) � Retract (→ Point R) � Advance (Point R→ Start point + Clearance ∆) � Cut (Depth of cut Q + ∆)
� Dwell at the hole bottom
� Return to point R along the Z–axis (or to the initial point)
13.9 SMALL–DIAMETER PECK DRILLING CYCLE
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
188
M�� ; G83 X_ Y_ Z_ R_ Q_ F_ I_ K_ P_ ; X_ Y_ ; X_ Y_ ;
G80 ;
Specification Code Description
Specification of small–diameter peck drilling cycle
M�� Specify an M code for the small–diameter peck drilling cycle set in parameter No. 304. G83, specified below, is regarded as being the small–diameter peck drilling cycle.
Specification of the peck drilling cycle
G83 G83 is modal. Once this code is specified, the code remains valid until another canned cycle is specified or a G code for canceling the canned cycle is specified.
Specification of a hole position
X_ Y_
Specify a hole position by using either an in- cremental or absolute value. The path and feedrate specification is the same as for positioning using G00.
Hole machining data
Z_ Specify the distance from point R to the hole bottom by using an incremental value, or specify the position of the hole bottom by us- ing an absolute value.
Q_ Depth of each cut
R_ Specify the distance from the initial level to point R by using an incremental value, or specify the position of point R by using an absolute value.
F_ Cutting feedrate
I_ Advance or retract feedrate (The default is the parameter–set value.)
K_ Number of repeats (The default is 1.)
P_ Dwell time at the hole bottom (The default is 0 seconds.)
Cancellation of small–diameter peck drilling cycle
G80 This code cancels the small–diameter peck drilling cycle. This code also cancels the M code for small–diameter peck drilling cycle specification.
NOTE The hole machining data is modal. When identical hole machining is repeated, the hole machining data need not be specified in each of the subsequent blocks.
Format
ww w.
cn cc
en ter
.co m
B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMINGPROGRAMMING
189
(1)The small–diameter peck drilling cycle is executed by specifying G83 after specifying an M code for the small–diameter peck drilling cycle. During the execution of this cycle, the small–diameter peck drilling cycle in–progress signal is output during the period between point R positioning of the drilling axis and the return to point R/initial level.
(2)As an overload torque detection signal, the skip signal (X008#7) is used. The skip signal is enabled only while the drilling axis is placed between point R and point Z, and an advance or cutting operation is being performed. When the skip signal is entered while an advance or cutting operation is being performed, a retract operation is started immediately.
(3) In one G83 cycle, the cutting condition is changed for each peck drilling operation (advance→ cut→ retract). � Cutting feedrate change
The cutting feedrate programmed using an F code is changed for each of the second and subsequent cutting operations. In parameter Nos. 307 and 308, specify the change ratios applicable when the skip signal is received and when the skip signal is not received, respectively, in the previous cutting operation.
Cutting feedrate = F� α
(First operation) α = 1.0 (Second and subsequent operations) α = α�β�100 β represents the change ratio for one operation. If the skip signal was entered during the previous cutting:
β = Parameter No. 307 When the skip signal was not entered during the previous cutting:
β = Parameter No. 308 If the cutting feedrate change ratio α becomes smaller than the value set in parameter No. 309, no further cutting feedrate changes are made.
� Spindle speed change The spindle speed programmed using an S code is changed for each of second and subsequent advance operations. In parameter Nos. 305 and 306, specify the change ratios applicable when the skip signal is received and when the skip signal is not received, respectively, in the previous cutting operation.
Spindle speed = �� γ
(First operation) γ = 1.0 (Second and subsequent operations) γ = γ�δ�100 δ represents the change ratio of one operation. If the skip signal was entered during the previous cutting:
δ = Parameter No. 305 When the skip signal was not entered during the previous cutting:
δ = Parameter No. 306 If the spindle speed is clamped to the lower limit, no spindle speed change is made.
Explanations
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/08 13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
190
(4)Advance and retract operations during peck drilling are performed not as positioning by rapid traverse but as cutting feed.
(5)When an advance/retract feedrate during peck drilling is to be specified using an I code, the same format as that for an F code is used. An I code specified in G83 remains valid until the specification of G80 or the input of a reset signal.
NOTE 1 An M code for the small–diameter peck drilling cycle must
be specified before the specification of G83. Furthermore, the block containing the M code must not include any other codes. The M code is subjected to internal processing, but is not output.
2 Retract and advance operations are controlled by the cutting feedrate acceleration/deceleration function. An in–position check is made at point R during a retract operation.
3 When the skip signal is received during advance operation, a retract operation is started.
4 To change the spindle speed during peck drilling in the small–diameter peck drilling cycle, a 4– or 5–digit S command is required.
5 Point R must be positioned away from the workpiece surface by an amount equal to clearance � or more.
ww w.
cn cc
en ter
.co m
B–61404E/08 14.  AUTOMATIC TOOL LENGTH MEASUREMENT (G37) Sec.14.2. . . . .         NORMAL DIRECTION CONTROL (G150, G151, G152) Sec.14.11. . . .
�������
ww w.
cn cc
en ter
.co m
PROGRAMMING B–61404E/0814. COMPENSATION FUNCTION
192
This function can be used by setting the difference between the tool length assumed during programming and the actual tool length of the tool used into the offset memory. It is possible to compensate the difference without changing the program. Specify the direction of offset with G43 or G44. Select a tool length offset value from the offset memory by entering the corresponding address and number (H code).
ÇÇ ÇÇ ÇÇ
ÇÇ ÇÇ ÇÇ
Tool assumed dur- ing programming
Actual tool
Specify this distance as the value of tool length offset.
Fig14.1 Tool length offset
The following three methods of tool length offset can be used, depending on the axis along which tool length offset can be made. ⋅Tool length offset A
Compensates for the difference in tool length along the Z–axis. ⋅Tool length offset B
Compensates for the difference in tool length along the X–,Y–,or Z–axis.
⋅Tool length offset C Compensates for the difference in tool length along a specified axis.
G43 Z_ H_ ;
G44 Z_ H_ ;
Tool length offset A
G17 G43 Z_ H_ ;
G17 G44 Z_ H_ ;
G18 G43 Y_ H_ ;
G18 G44 Y_ H_ ;
G19 G43 X_ H_ ;
Tool length offset B
G43 α_ H_ ; G44 α_ H_ ;
Tool length offset C
G49 ; or H0 ;Tool length offset cancel
G43 : Positive offset G44 : Negative offset G17 : XY plane selection G18 : ZX plane selection G19 : YZ plane selection α : Address of a specified
axis H : Code for specifying the
tool length offset value
Explanation of each address
G19 G44 X_ H_ ;
14.1 TOOL LENGTH OFFSET (G43, G44, G49)
Format
ww w.
cn cc
en ter
.co m
B–61404E/08 14. COMPENSATION FUNCTIONPROGRAMMING
193
Select tool length offset A, B, or C, by setting bit 6 of parameter 003 and bit 3 of parameter No. 019.