Professional Documents
Culture Documents
eMail: mts@mts-cnc.com
All rights reserved, including photomechanical reproduction and storage on electric media
Contents
Contents
5 Cycles............................................................................................................................ 85
5.1 Function and use of cycles on a CNC milling machine....................................................................... 85
5.2 Canned cycles (drilling functions) ....................................................................................................... 87
5.2.1 Definition................................................................................................................................ 87
5.2.2 Survey.................................................................................................................................... 91
5.2.3 Application ............................................................................................................................. 92
5.2.4 high-speed peck drilling cycle G73........................................................................................ 94
5.2.5 left-hand tapping cycle G74................................................................................................... 98
6 Subprogram technology.............................................................................................162
6.1 Purpose, function and use of subprograms of a CNC milling machine............................................ 162
6.1.1 Subprogram Call M98 ......................................................................................................... 162
6.1.2 End of Subprogram M99 ..................................................................................................... 162
6.2 Subprograms with incremental or absolute input value.................................................................... 163
6.3 Nesting several subprograms........................................................................................................... 167
The minimum hardware requirement for a single CNC Simulator workplace is:
• a personal computer with a hard disk and diskette drive,
• a monitor,
• a PC keyboard and additionally
• a mouse.
This can be supplemented by a printer for hardcopies and NC- program listings
Figure 1
The hardware for the CNC Simulator workplace.
The CNC Simulator can be used with the input media keyboard and mouse. A PC keyboard is basically all
you need to use the CNC Simulator. A mouse can be used to activate the function keys. You select all pro-
gram functions with the function keys and enter machine commands and NC program blocks as sequences
of digits and letters.
The function keys displayed on the screen are usually labeled with a short text indicating the subsequent
editing steps.
Figure 2
CNC Turning, Main menu, Function keys with text notes for the processing options available
as an alternative to text labels on the function keys, CNC symbols and other icons can be displayed.
tool moves in Y
Workpiece Zero
Figure 3
Schematic of the machine configuration
In the MAKINO CNC Milling machine the tool moves in Y- and Z-direction and the machine table moves in X-
direction.
Figure 4 Figure 5
jaws modular clamping
The magazine holds may up to 99 tool positions (pockets) in which the tools are inserted from the tool man-
ager. In the actual configuration we use 16 tools.
Shell end mills Corner tool (Type B) Insert tip drills Side milling tools
Figure 6
Menu of MTS programs
It is also possible to generate NC-programs for different CNC-controls by reconfiguring the CNC-simulator.
These can be done in an advanced training phase.
1.1.3 Collision monitoring
Reality-oriented simulation of machining processes is based on the fact that the CNC Simulators function like
the actual machine tools in the workshop :
During work part machining, collision monitoring is performed and the results are displayed as error mes-
sages. The entire machine tool space with work part, fixtures, tool system, etc. is taken into account. During
machining the internal model computes the actually resulting work part contour using the programmed tool
paths during program execution, with a tolerance range of about 0.5 mm. As the simulation can be performed
for different tool qualities and materials etc., the error and collision monitoring function does not check the
programmed feedrate or revolution speed.
Once a machine status has been defined in this way, it can be registered in a “set-up form” which is assigned
to a NC program. Invoking this NC program will then effect the automatic set-up of the appropriate simulated
machine tool.
The procedure of manually setting up the blank and the chuck is carried out with the help of a special interac-
tive menu. Blank dimensions must be specified and the clamping device be selected.
Figure 7
CNC Milling, Setup Mode menu
The Simulator for Milling provides 16 tools in the magazine. Tools from the tool file can be mounted in all tool
positions (from T01 to T16) as default setting, so as to simulate the equipment of an actual machine tool.
This configuration means that the magazine is automatically equipped with this tool selection each time the
simulator system is booted.
Only tools previously defined can be employed for machining in the CNC Simulators. Therefore, as a rule,
after program start or after any change in the allocation of tools the applicable offset values must be speci-
fied, so that the offset can be computed in the control system. A total of 99 offset value storage files are
available.
Figure 8
Simulator for Milling. Set of Tools in the Magazine
As with the set-up of the actual machine tool, the approach of the reference point is indispensable in the CNC
Simulators; it serves to establish the zero position for incremental measuring along the axes. Approach of the
reference point is also a precondition for defining the work part zero and for execution of NC programs in the
Automatic Mode.
Setting the work part zero is possible in any position by “zeroing” the coordinates. Usually this will be effected
by touching the work part.
An Editor is available for direct input of NC blocks. It has a special programming interface for NC blocks and
checks the syntax (the formal structure of the NC block) as the block is being entered.
Figure 9
CNC Simulator, NC Editor
The NC Editor is equipped with a NC-Program Management to delete and print NC programs.
Directory path
Cur. proces. funct.
Input field
File information
Figure 10
CNC Simulator, NC Editor, Program Management
Interactive Programming is a feature in which the Automatic Mode and Editor complement each other to
provide the simplest and most efficient way to get started with NC programming. The simulation follows step
by step the creation of an NC program , including collision monitoring.
A special form of interactive programming is the Teach-In function. As in Setup Mode, the work part is ma-
chined manually and the corresponding linear travel commands complying with ISO6983 are generated and
automatically inserted in the NC program.
To make it easy to program even complex contours, the editor and the interactive programming function have
a dialogue-driven WOP Interface. The inputs are supported by a user guidance system with explanatory
graphics.
Figure 11
WOP Interface, CNC Milling:
You have the choice between different simulation modes, such as a flying change, as well as the option to
add certain supplementary functions, such as zooming (CNC turning), measuring, 3D-view, traverse path
monitoring, and the calculation of machining cycles and downtimes.
Figure 12
Example of an Automatic Mode menu
Since the simulations can be run with different tool qualities and work part materials, etc., the programmed
feed rates and rpm values are not subject to error and collision monitoring. Therefore an individual check
before transferring an NC program to a CNC control system is necessary.
Confirm
Confirm
Figure 13
Example of the DOS commands for starting the CNC Simulator
Once you have launched the program, the menu (see figure) appears with the choice of the MTS-Software
available in your system.
Figure 14
Menu of MTS programs
The highlighted rectangular boxes under "Machine" and "Control" indicate the currently selected configuration
files. Select the desired program by pressing a function key.
F8 The function key F8 starts the exit procedure. Use the key combination
Strg to terminate the program and return to the main MTS program menu.
+
Figure 15
Screen Layout
Work range
The upper part of the screen shows a graphic representation of the working area of the CNC machine tool,
including clamping devices, work part and tool. The milling simulation displays the work part and the cutter in
top view.
This applies to the Main Menu and to Setup and Automatic Mode. In other operating functions this screen
window always contains a graphical representation of the current work situation.
Information Column
The right column contains text information on necessary machining information. In the Main Menu none of
the modes are active, therefore, no information is shown. In Setup Mode and Automatic Mode this column
contains information on the current machine and system status like feedrate, revolution speed
• current tool coordinates,
• spindle speed, feedrate, active tool and compensation register,
• cutting speed,
• coolant and spindle engine status etc.
Function keys
The numbered boxes at the bottom of the screen indicate the program functions that can be selected with the
function keys during processing.
The two lines above the function keys are reserved for the program dialogue. After starting an NC program
the current NC blocks are shown on the upper line. The bottom line is reserved for error messages.
Editor WOP-Surface
Automatic mode
Single block
Traverse Paths
Part / Chuck
Workpiece file
Tool Holder
Tool Adapter
Feedrate / Speed
Spindle / Coolant
Manual Treating
Setup form
Status management
Figure 16
Schematic of the processing options of the CNC Milling Simulator (simplified).
Example: The CNC Simulator has its own tool management function. The program provides almost all ISO
tool types and tools as standard options, and allows all common tools to be defined. Naturally, the tool man-
agement includes options for editing the available tool files, i.e. modification of existing tools and deletion of
those no longer required.
Figure 17
CNC Milling, Define/Delete Tools; Main Menu.
The screen layout of the Define/Delete Tools main menu is divided into two sections: the upper screen area
contains a listing of all available tool types; the field currently in use is highlighted in color. As usual, further
steps for specifying or editing tool data are indicated on the function keys at the bottom of the screen.
Select the desired step only by pressing the function keys rather than with the mouse.
Create Tool/Tool Adapter: To generate a new tool of the current tool type, select
F8 or ESC
Return: Use F8 or ESC
to conclude the current operation
Having started in the main menu by selecting the tool type, and subsequently selecting the Create Tool func-
tion by pressing F1 , the Data Entry menu for defining the tool is loaded.
Figure 18
CNC Milling, Define/Delete Tools; defining a slot cutter.
The screen layout of the Data Entry menu is divided into three areas: the window on the left contains either a
help graphic or a graphic corresponding to the data of the tool being defined (including the tool adapter). The
input fields for the complete data record are located on the right.
You define a tool by manually entering the geometrical data, as well as the tool name and rotation direction.
The desired tool adapter data can be automatically copied by selecting the Select Tool Adapter function. To
save time, it is reasonable to define a new tool by first copying the data record of a similar tool, and then to
modify the data to meet your requirements.
or Use the cursor keys or to move the cursor within the input field.
If you confirm the entry in the input field with the key, the cursor moves auto-
matically to the next input field.
[Tool Name] [Tool Name] Enter the tool name or number in this input field.
[Parameter] The entries required for a tool depend on the tool type. Use the help graphics to obtain in-
formation on the parameters.
F8 Create tool: When the data entry for all tool and tool adapter parameters has been com-
pleted, you save the tool under a certain name by pressing F8 .
ESC ESC
Use to conclude the operation, and to return to the Define/Delete Tools main menu.
1.4.1 3D representation
A function supporting CNC training is given by the option to display, at any time, 3D Views of the work part,
seen from different viewing angles. The program features 3D displays in Milling Simulators. To display ma-
chining inside the work part, any work part quadrants can be cut out.
Figure 19
CNC Milling,3D View, three-quarter view with intersections
Figure 20
CNC Milling, 3D Display, full part with intersections
The programming aids and control information are available in the form of "help screens", and are directly
displayed in the graphic window on the monitor. As a rule, they contain a short informative text, a context-
based graphic display, and an application example referring to the subject.
Based on subject matter, the help screens are divided into groups; for better orientation, each group is pre-
ceded by a table of contents or a schematic function display. In this manner, you have almost the entire set of
programming instructions available, without having to interrupt programming.
Figure 21
CNC Milling, Programming Aid for clockwise circular interpolation
Accessing the Programming Aids is possible from almost all working situations within the CNC Simulator; the
<?> key is used for this purpose during:
• Setup Mode,
• Automatic Mode,
• Interactive Programming, and·
• Teach-In Programming.
Since the "?" (question mark) character may be used in NC programming comment texts, the F6 function
key is used for calling help functions while working with the Editor or Interactive Programming.
Subsequently you enter the name of the help screen (for example „G02“) in the dialogue line. The corre-
sponding program message is displayed, "Help screen: _______“
Confirm the name entry by pressing . If a help screen with that name is avail-
able, it is then loaded. If not, the error message: "Help screen not found" is dis-
played.
To have a machine tool status loaded automatically during the CNC Simulator start, you can specify the Set-
up Sheet describing that status in the configuration.
F4 Automatic Setup: this function is activated by pressing the function key F4 from the main
menu. The CNC Simulator is then set-up automatically.
Figure 22
CNC Milling, Set-up Sheet menu
Figure 23
CNC Milling, example of a Set-up Sheet (excerpt)
F6 Status: the Status Manager is activated by pressing the function key F6 from the main menu
of the CNC Simulator.
Figure 24
CNC Milling, Status Manager
Figure 25
CNC Milling, File Selection window with existing status files
Like the Set-up Sheet, the Status Manager saves time. With the difference, however, that a processing status
usually also includes the work part machining steps stored in an NC program. To keep your system well-
organized, we recommend to save the current status always together with the reference to the NC program.
Y
M X
After turning on the control the machine coordinate system can be activated by moving to the reference point.
The machine coordinate system does not change neither by changing the work part coordinate system nor by
setting a local coordinate system nor by programming other commands or actions at the machine.
Example:
To move to the reference point press the
Another possibility is to first program the command G28 (Automatic Reference Point Return) in your NC pro-
gram (see chapter Going to the reference point G28).
Programming Example:
Z Z Y
Y
P1
50
P2
P3
X
132
50
0
25
X
435
N20 G53 X465. Y280. P2
The command G53 is used for moving to a special declared position in the machine coordinate system, for
example the tool changing position.
Note: Cancel the cutter radius compensation, the tool length compensation and the offset
values before programming the command G53.
Z
Y
W X
The zero point of the coordinate system is preferably placed on the outer edge of the work part. For more
easier calculation of the points needed for programming the outer edges of the upper area or the lower area
are be preferred.
Z
Y
Work part zero point in the left upper outer edge Work part zero point in the left lower outer edge
2. In the CNC control six different work part coordinate systems (G54 - G59) may be predefined. In the
NC program the desired work part coordinate system can be selected by the commands G54 - G59.
2.2.2 Setting the work part coordinate system with the command G92
Command: G92
Work part coordinate system G92
Function: A new work part coordinate system is set with the command G92
NC-Block: G92 [X...] [Y...] [Z...]
Optional Addresses: X X-Coordinate of the Work part coordinate system relative to the tool position
Y Y-Coordinate of the Work part coordinate system relative to the tool position
Z Z-Coordinate of the Work part coordinate system relative to the tool position
The coordinates following the G92 command specify the coordinates of the
momentary tool position in the new work part coordinate system !
The command G92 sets a new work part zero point relative to the momentary tool position in the active
NC-program.
Note: The programming values in the addresses X, Y or Z are not the coordinates of the
new work part coordinate system !
They are the coordinates of the momentary tool position in the new work part coor-
dinate system!
Before moving in the axis specify the G92 command.
If the command G92 is programmed while using G54 - G59, all coordinate systems
are modified by G92.
Command: G92
Work part coordinate system G92
Function: A new work part coordinate system is set with the command G92
NC-Block: G92 [X...] [Y...] [Z...]
Optional Addresses: X X-Coordinate of the Work part coordinate system relative to the tool position
Y Y-Coordinate of the Work part coordinate system relative to the tool position
Z Z-Coordinate of the Work part coordinate system relative to the tool position
The coordinates following the G92 command specify the coordinates of the
momentary tool position in the new work part coordinate system !
Programming Example
50
70
X
W
X
N110 ...
N150 G00 X30. Y40. Z2.
N155 G01 Z10. F100.
N160 ...
2.2.3 Setting the work part coordinate system with the commands G54 - G59
Six different work part coordinate systems can be used, for example, to program complex or repetitive con-
tours. The coordinates of the respective zero point may measured as the distance between the reference
point of the work part and the machine zero point. The value and the direction of this distance may be stored
into the NC control.
Each stored zero point will be activated with the corresponding command (G54 - G59) in the NC program.
Note: Coordinate values of all zero points always relate to the machine zero point.
Exercise:
Create an NC-program for the following plate with respect to the newly defined work part zero points.
CONFIGURATION
MACHINE MAKINO FX 650
CONTROL FANUC 16M FX650
BLANK DIMENSIONS
X+140.000 Y+125.000 Z+025.000
VISE
MAKFX 160
CHUCKED HEIGHT E+031.000
SHIFT V+000.000
ORIENTATION A0°
Solution:
Program
02905
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0
N025 G91 G28 X0 Y0
N030 T1 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H17
N045 G56
N050 G0 X0 Y0 M8
N055 G91
N060 G98 G73 Z-17 R-38 Q6 F80 L0
N065 M98 P905
N070 G55
N075 G0 X0 Y0 M8
N080 G91
N085 G98 G83 Z-17 R-38 Q6 F80 L0
N090 M98 P906
N095 G57
N100 G0 X0 Y0 M8
N105 G91
N110 G98 G82 Z-17 R-38 P2000 F80 L0
N115 M98 P907
N120 G53
N125 G54
N130 G0 Z20 M5
N135 G91 G28 Z0 M9
N140 G91 G28 X0 Y0
N145 G90 G49 G80 G40
N150 M30
Subprograms
0905 0906 0907
N10 G91 G99 X0 Y0 N10 G91 G99 X0 Y0 N010 G91 G99 X20 Y0
N15 X20 N15 Y15 N015 X-20 Y20
N20 X20 N20 Y15 N020 X-20 Y-20
N25 X20 N25 G98 Y15 N025 G98 X20 Y-20
N30 G98 X20 N30 G90 G80 N030 G90 G80
N35 G90 G80 N35 M99 N035 M99
N40 M99
Finished part:
2.3 Specifying the necessary location of the work part zero point
The work part zero point W is the origin of the work part-referenced coordinate system. Its location is speci-
fied by the programmer according to practical criteria. The ideal location of the work part zero point allows the
programmer to take the dimensions directly from the drawing.
The work part zero point is set with reference to the machine zero point M. With the operations described
below the distance is specified between the machine zero point M and the work part zero point W in the three
coordinates X, Y and Z. These values are then entered into the CNC control.
Procedure
Starting situation:
The work part is adjusted and firmly clamped in the machine table. All tools are gauged to each other. The
corresponding correction values were entered into the CNC control. The zero setting tool is clamped and the
spindle rotation is switched on.
1. Resetting Z direction
Resetting in Z
2. Resetting in X direction
Resetting in X
3. Resetting in Y direction
Using the below described operation steps the distance between the machine zero point M and the work part
zero point W in the three coordinates X, Y and Z is defined.
Please note that only the tool moves in the MTS simulator!
Starting situation:
Z Y
• All machining tools are dimensioned and
available in the magazine.
• The work part is adjusted and clamped
on the machine table in the simulator.
• The location of the work part zero point
should be the left top corner of the work
W part.
X
Description Entry
W
X
F2 (increment 0.1)
7 Move the tool in negative Z direction until it Press the arrow key on the numeric keyboard
touches the surface of the work part.
2
Then press
ESC
and
F8 (quit).
8. Set the work part zero point in Z. F4 (tool/ datum)
F4 (set datum)
F3 (set Z coord.)
Type in the data on the keyboard „0“ and
F8 confirm it.
Check Z by setting the zero point and using
the displayed coordinate values.
9. Setting the zero point in X direction Using the numeric keyboard press the arrow
Withdraw the tool in +Z direction.
key together with the shift key:
W
X
11. Move the tool in positive X direction until it Press the arrow key on the numeric keyboard.
touches the surface of the work part. 6
Then press
ESC
and
F8 (return).
12. Set the work part zero point in X. F4 (tool, zero point)
Please note the tool radius!
F4 (set datum)
So, enter for the X coordinate the negative
value of the radius of the applied tool, for in- F1 (set X coordinate)
stance -10.
Type "-10“ using the keyboard and confirm.
F8
Check the X by setting the zero point using
the displayed coordinate values.
13. Setting the zero point in Y direction Using the numeric keyboard press the arrow
Take off the tool in -X direction and then in +Z key together with the shift key:
direction.
+ 4 for rapid speed in -X direction then
1 Y 1) in +X direction
15. Take the tool in positive Y direction until it Press the arrow key on the numeric keyboard.
touches the surface of the work part.
9
Bild Then press
ESC
and
F8 (quit).
F8 key.
Check the Y by setting the zero point using
the displayed coordinate values.
17. Withdraw the tool in -Y and then in +Z direc- use the numeric keyboard and press the arrow
tion. key together with the shift key:
1 for rapid speed in -Y direction, then
+ Ende
Command: G90
Activate Absolute Dimensions
Function: When the command G90 is programmed, all subsequent coordinate values relate
to the work part zero. The target position, to which the tool shall move, is pro-
grammed in absolute coordinates, regardless of the current tool position.
NC-Block: G90
Absolute Dimensioning:
Please note that in the absolute system the target points must be programmed according to their position in
the coordinate system with reference to the origin of that system.
Programming Example
with Absolute Coordinates:
N085 G90
N090 G00 X+30. Y+30. Z+2.
N095 G01 Z-6.
N100 G01 X+110. Y+75.
The absolute coordinate system remains operative until it is deactivated by G91 (activating the incremental
dimensioning).
Command: G91
Activate Incremental Dimensions
Function: When the command G91 is programmed, the programmed coordinates of the tar-
get position relate to the actual tool position; i.e. the values (distances) must be
specified by which the tool shall move in the respective axis from the current posi-
tion.
NC-Block: G91
Incremental Dimensioning:
In the incremental system the coordinate values of the target points must be programmed according to their
position relative to the starting point, with the appropriate positive or negative sign attached.
Programming Example
with Incremental Coordinates:
The incremental coordinate system remains operative until it is deactivated by G90 (activating the absolute
dimensioning).
Command: G00
Rapid traverse
Function: The tool will move at the maximum possible speed to the target position as pro-
grammed by the X- Y- and Z- coordinates. These coordinates may either be pro-
grammed in the absolute system (G90) or in the incremental system (G91).
Note: The FANUC CNC-Control has two possibilities to program values
1) with a decimal point, the input increment is mm, so
X20. represents X20mm or
2) without a decimal point, the input increment is µm, so
X20 represents X0.02mm.
For this reason it is important to program values with a decimal point.
If a tool movement parallel to one or two axes is desired, the respective target coordinate will be identical with
that of the current tool position. It does not have to be programmed separately, since the coordinate address
is self-retentive.
The rapid traverse rate in the G00-command is independently set for each axis by the machine tool manu-
facture. Consequently, the rapid traverse rate cannot be defined in the address F..
Positioning is done separately for each axis. The traveled path is generally not a straight line.
Rapid traverse
The programmed feed adjustment Z, relative to the current tool position, determines the order of tool move-
ments in the axes.
• If the infeed is in the positive Z-direction (from the current tool position), the tool will move first in the
Z-axis and subsequently in the X- and Y- direction.
• If the infeed is in the negative Z-direction (from the current tool position), the tool will move first in
the XY plane and then in the Z-direction.
If a tool change or a change of spindle speed have been programmed within the same NC-block, these func-
tions will be executed prior to moving the tool to the target position.
Command: G00
Rapid traverse
Function: The tool will move at the programmed feedrate to the target position as pro-
grammed by the X- Y- and Z- coordinates. These coordinates may either be pro-
grammed in the absolute system (G90) or in the incremental system (G91).
NC-Block: G00 [X...] [Y...] [Z...] [T...] [M...]
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
T Tool Function
M Additional Function
Programming Example
for Absolute Dimensioning:
Programming Example
for Incremental Dimensioning:
Command: G01
Linear Interpolation
Function: The tool will move at the programmed feedrate to the target position as pro-
grammed by the X- Y- and Z- coordinates. These coordinates may either be pro-
grammed in the absolute system (G90) or in the incremental system (G91).
NC-Block: G [X...] [Y...] [Z...] [F...] [S...] [T...] [M...]
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
F Feedrate
S Speed
T Tool Function
M Additional Function
If a tool movement parallel to one or two axes is desired, the respective target coordinate will be identical with
that of the current tool position. It does not have to be programmed, since the coordinate address is self-
retentive.
If a tool change, a change of the feedrate and/or a change of spindle speed have been programmed within
the same NC-block, these commands will be executed prior to moving the tool to the target position.
Command: G01
Linear Interpolation
Function: The tool will move at the programmed feedrate to the target position as pro-
grammed by the X- Y- and Z- coordinates. These coordinates may either be pro-
grammed in the absolute system (G90) or in the incremental system (G91).
NC-Block: G [X...] [Y...] [Z...] [F...] [S...] [T...] [M...]
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
F Feedrate
S Speed
T Tool Function
M Additional Function
Programming Example
for Absolute Dimensioning:
N085 G90
N090 G00 X+30. Y+30. Z+2.
N095 G01 Z-6.
N100 G01 X+110. Y+75.
Programming Example
for Incremental Dimensioning:
Command: G28
Automatic Reference Point Return
Function: The reference point is a fixed point on the machine. The function Automatic Refer-
ence Point Return enables the tool to move to the reference point.
X, Y and Z are the commands to move to an intermediate point of the reference
point return. These coordinates may either be programmed in the absolute system
(G90) or in the incremental system (G91).
NC-Block: G28 [X...] [Y...] [Z...]
Optional Addresses: X X-Coordinate of the Intermediate Point
Y Y-Coordinate of the Intermediate Point
Z Z-Coordinate of the Intermediate Point
It is possible to simultaneously command by three axes, by two axes or only by one axis. In the G28 block,
the specified axis performs positioning at the intermediate point first and then positioning from the intermedi-
ate point to the reference point. Both positionings are performed at the rapid traverse rate of each axis.
Intermediate point
The cutter moves from Reference point
its present position to
the programmed inter-
mediate point and finally
to the reference point.
Starting point
Generally the command G28 is used for a tool changing. If the Automatic Reference Point Return has been
activated for a program part, the following must be observed:
• Before specifying G28, tool radius compensation must be canceled in principle.
• Cancel tool length compensation in the block which follows the G28 command block.
Command: G29
Automatic Return from the Reference Point
Function: The function Automatic Return from the Reference Point enables the tool to move
from the reference point to the specified position by passing the intermediate point.
X, Y and Z are the commands to move to the target point. These coordinates may
either be programmed in the absolute system (G90) or in the incremental system
(G91). The coordinates of the intermediate point are used from the last G28 Com-
mand.
NC-Block: G28 [X...] [Y...] [Z...]
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
Intermediate point
The cutter moves from Reference point
the reference point to
the intermediate point
(programmed in the last
G28 command) and fi-
nally to the programmed
target position. Target point
Generally the command G29 is used after a tool changing. If the Automatic Return from the Reference Point
has been activated for a program part, the following must be observed:
• When the coordinate system is modified after automatic reference point return, an intermediate
point is created in the new coordinate system.
Command: G04
Dwell
Function: The tool movement is halted for the specified dwell time.
G04
X ...
NC-Block:
P ...
Optional Addresses: X Dwell time in seconds (X0.001 to X99999.999)
P Dwell time in seconds (P1 to P99999999)
It is possible to delay a shift to the next block operation by commanding G04. This command must be pro-
grammed in a separate NC-block. The dwell time ranges from 0.001 sec to 99999.999 sec.
Command: G09
Exact Stop
Function: If G09 is programmed as part of an NC-block, only in this NC-block the feedrate will
be decelerated to zero when the programmed contour point is reached. After the
standstill at precisely the programmed position, the tool motion is resumed and the
next contour point, as programmed in the subsequent NC-block, is approached.
NC-Block: ... G09 ...
Since NC-programs are executed continuously, i.e. without interrupting the feed motion, position errors such
as lags or overshoots may occur. To move the tool with precision to the programmed coordinates, the G09
command must be programmed.
Command: G20
Inch Data Input
Function: This command G20 serves to switch the unit of measurement from millimeters to
inches. All coordinate values must be specified in inches. Accordingly the technol-
ogy data concerning the feedrate will be altered from millimeters per minute
(mm/min) to inches per minute (in/min).
The G20 command must be programmed in a separate NC-block before setting the
coordinate system at the beginning of the program.
NC-Block: G20
Inches will be the active unit of measurement only until the system is switched back to the millimeter unit. At
the end of each program (M30) the control system will automatically return to the millimeter data input.
Command: G21
Millimeter Data Input
Function: This command G21 serves to switch the unit of measurement from inches to milli-
meters. All coordinate values must be specified in millimeters. Accordingly the
technology data concerning the feedrate will be altered from inches per minute
(in/min) to millimeters per minute (mm/min).
The G21 command must be programmed in a separate NC-block before setting the
coordinate system at the beginning of the program.
NC-Block: G21
Inches will be the active unit of measurement only until the system is switched back to the millimeter unit. At
the end of each program (M30) the control system will automatically return to the millimeter data input.
Command: G94
Feedrate F in mm per minute
Function: The command G94 serves to program the feedrate. The unit of measurement is
"Millimeters per Minute".
NC-Block: G94 [F...]
Optional Addresses: F Feedrate in mm per minute.
F must be programmed with a decimal point!
Programming Example: N100 G94 F120.
Note: If the unit of measurement has been switched from millimeters to inches (see NC-
Command G20), the programmed feedrate will be interpreted accordingly in inches
per minute.
Command: G95
Feedrate F in mm per minute
Function: The command G95 serves to program the feedrate per revolution. The measuring
unit is millimeters.
NC-Block: G95 [F...]
Optional Addresses: F Feedrate in mm per revolution.
F must be programmed with a decimal point!
Programming Example: N100 G95 F0.2
Note: If the unit of measurement has been switched from millimeters to inches (see NC-
Command G20), the programmed feedrate will be interpreted accordingly in inches
per minute.
Command: S
Spindle speed
Function: The spindle speed is programmed in revolutions per minute (RPM).
NC-Block: S...
Programming Example: N100 ... S1500 ...
Command: M00
Programmed Stop
Function: After the execution of a block which contains the command M00, the program exe-
cution will be stopped. All operations, for example spindle rotation or coolant, stop
temporarily. The program can restart by pressing the start push-button.
NC-Block: ...M00
This function allows the operator to gauge the work part, remove the chips or to manually change the tool.
Command: M01
Optional Stop
Function: If the Optional Stop Switch on the machine operation panel is turned on, the pro-
gram execution will be stopped in the same way as M00. After the execution of a
block which contains the command M01, all operations, for example spindle rota-
tion or coolant, stop temporarily. The program can restart by pressing the start
push-button.
If the Optional Stop Switch is off, the command M01 is ignored. The operation pro-
ceeds to the next block.
NC-Block: ...M01
This function allows the operator to gauge the work part, remove the chips or to manually change the tool.
Command: M02
Program End
Function: This command informs the control system that the current program run has been
completed. The spindle and the coolant pump will be deactivated and the automatic
program run is terminated.
The command M02 does not preformed the rewind (search of the begin of the pro-
gram).
NC-Block: ...M02
Command: M30
Program End with Resetting
Function: The command M30 has the same function as the command M02. However the
command M30 performs the rewind (search of the begin of the program). This
command informs the control system that the current program run has been com-
pleted. The spindle and the coolant pump will be deactivated and the automatic
program run is terminated.
NC-Block: ...M30
Command: M03
Activate spindle in clockwise rotation
Function: The command M03 activates the spindle rotation in the clockwise direction.
NC-Block: ...M03
Command: M04
Activate spindle in counter - clockwise rotation
Function: The command M04 activates the spindle rotation in the counter - clockwise direc-
tion.
NC-Block: ...M04
Command: M05
Deactivate spindle
Function: The command M05 stops the spindle rotation.
NC-Block: ...M05
Command: M06
Mounting a tool
Function: The command M06 mounts a tool, which is preselected by the tool function T.
NC-Block: ...[T...] M06
Optional Addresses: T Tool Function
The T-command is only for allocating a specified tool to the tool changing position. To mount this tool to the
workspindle the command M06 must be separately programmed.
Command: M07
Activate Coolant 1
Function: The command M07 activate the first coolant pump.
NC-Block: ...M07
Command: M08
Activate Coolant 2
Function: The command M08 activates the second coolant pump.
NC-Block: ...M08
Command: M09
Deactivate Coolant
Function: The command M09 deactivates the coolant pump.
NC-Block: ...M09
Command: M21
Mirror in the X-Axis
Function: The command M21 switches the signs of the coordinates of the X-Axis. It means,
that movements in the X-Axis are opposite to the programmed direction.
NC-Block: ... M21
The modal command M21 is active until M23 (Cancel mirror functions) is specified.
Command: M22
Mirror in the Y-Axis
Function: The command M22 switches the signs of the coordinates of the Y-Axis. It means,
that movements in the Y-Axis are opposite to the programmed direction.
NC-Block: ... M22
The modal command M22 is active until M23 (Cancel mirror functions) is specified.
Command: M23
Cancel mirror functions
Function: The command M23 cancels the mirror functions M21 and M22. It means, that all
moves are in the same direction as the programmed direction.
NC-Block: ... M23
Command: M48
Activate Feedrate Override dial
Function: The command M48 activates the feedrate override dial on the operation panel on
the machine. The feedrate override can be mounted every 10% from 0% to 200%.
NC-Block: ...M49
Command: M49
Cancel Feedrate Override dial
Function: The command M49 deactivates the feedrate override dial on the operation panel on
the machine. The feedrate override fixes to 100%.
NC-Block: ...M49
Command: M98
Subprogram Call
Function: A subprogram called by the command M98 is executed by the control system. After
this, the execution of the main program will be continued from the position in the
program line, where the subprogram has been invocated.
NC-Block: M98 [P...] [L...]
Optional Addresses: P Number of the subprogram
L Number of repeated callings
Programming Example: N100 M98 P400 L5 (Call the subprogram O400 five times)
N100 M98 P400 (Call the subprogram O400 fonce)
Command: M99
End of Subprogram
Function: The command M99 marks the end of a subprogram.
NC-Block: M99
At the end of each defined subprogram, the command M99 must be programmed to cause the control sys-
tem to return to the main program, resp. to the subprogram from which the current subprogram has been
called.
For a 3-axis milling machine with vertical spindle position the standard machining plane is the XY-plane. In
the below table the G-commands are listed with their corresponding machining planes and downfeed axes.
G18 ZX - Plane Y
G19 YZ - Plane X
Command: G17
Selecting the machining plane G17
Function: The G-commands G17 serve to select the XY machining plane.
NC-Block: ... G17 ...
Command: G18
Selecting the machining plane G18
Function: The G-commands G18 serve to select the ZX machining plane.
NC-Block: ... G18 ...
Command: G19
Selecting the machining plane G19
Function: The G-commands G19 serve to select the YZ machining plane.
NC-Block: ... G19 ...
Y G02 G03
X
Directions for Circular Interpolations.
Command: G02
Circular Interpolation Clockwise G02
Function: The tool will move clockwise on a circular arc to the target position.
NC-Block: G02 [X...] [Y...] [Z...] [I...] [J...] [K...] [F...]...
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
I Circle Center Incremental (distance between the starting position and the
circle center in the X-direction).
J Circle Center Incremental (distance between the starting position and the
circle center in the Y-direction).
K Circle Center Incremental (distance between the starting position and the
circle center in the Z-direction).
Note: The addresses I, J and K are always programmed in the incremental system, re-
gardless of the selected value command system (G90 or G91).
F Feedrate
Command: G02
Circular Interpolation Clockwise G02
Function: The tool will move clockwise on a circular arc to the target position.
NC-Block: G02 [X...] [Y...] [Z...] [I...] [J...] [K...] [F...]...
Programming Example
with Absolute Coordinates:
N085 G90
N090 G00 X+55. Y+35. Z+2.
N095 G01 Z-5.
N100 G02 X+95. Y+75. I+30. J+10.
Please note that in the absolute system the target points must be programmed according to their position in
the coordinate system with reference to the origin of that system.
Programming Example
with Incremental Coordinates:
Command: G03
Circular Interpolation Counter-Clockwise G03
Function: The tool will move counter-clockwise on a circular arc to the target position.
NC-Block: G03 [X...] [Y...] [Z...] [I...] [J...] [K...] [F...]...
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
I Circle Center Incremental (distance between the starting position and the
circle center in the X-direction).
J Circle Center Incremental (distance between the starting position and the
circle center in the Y-direction).
K Circle Center Incremental (distance between the starting position and the
circle center in the Z-direction).
Note: The addresses I, J and K are always programmed in the incremental system, re-
gardless of the selected value command system (G90 or G91).
F Feedrate
X
The coordinates for the target position may either be programmed in the absolute system (G90) or in the
incremental system (G91).
Command: G03
Circular Interpolation Counter-Clockwise G03
Function: The tool will move counter-clockwise on a circular arc to the target position.
NC-Block: G03 [X...] [Y...] [Z...] [I...] [J...] [K...] [F...]...
Programming Example
with Absolute Coordinates:
N085 G90
N090 G00 X+55. Y+25. Z+2.
N095 G01 Z-5.
N100 G03 X+100. Y+70. I+15. J+30.
Please note that in the absolute system the target points must be programmed according to their position in
the coordinate system with reference to the origin of that system.
Programming Example
with Incremental Coordinates:
For example:
In the ZX-plane the X- and the Z-coordinates are used for the target point. The addresses I and K
which correspond to the X- and the Z-coordinates are used for the circle center.
G 02 R...
G18 [X...] [Z...] [F...]
G 03 I... K...
An overview of the circular interpolations in the possible machining planes is given in the following table.
G03 counter-clockwise
4 Distance between the starting posi- 2 Axis Distance between the starting position and the
tion and the circle center from I,J,K circle center with an algebraic sign
G 02 R...
NC-Block: G17 [X...] [Y...] [F...]
G 03 I... J...
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
R Radius of the circular arc (optional statement)
I Circle Center Incremental (distance between the starting position and the
circle center in the X-direction).
J Circle Center Incremental (distance between the starting position and the
circle center in the Y-direction).
Note: The addresses I and J are always programmed in the incremental system, regard-
less of the selected value command system (G90 or G91).
F Feedrate
Z G17 Z G17
Y Y
G02 G03
X X
G02 clockwise interpolation in the XY-plane G03 counter-clockwise interpolation in the XY-plane
G 02 R...
NC-Block: G18 [X...] [Z...] [F...]
G 03 I... K...
Optional Addresses: X X-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
R Radius of the circular arc (optional statement)
I Circle Center Incremental (distance between the starting position and the
circle center in the X-direction).
K Circle Center Incremental (distance between the starting position and the
circle center in the Z-direction).
Note: The addresses I and K are always programmed in the incremental system, regard-
less of the selected value command system (G90 or G91).
F Feedrate
Y G18 Y G18
-Z -Z
G02 G03
X X
G02 clockwise interpolation in the XZ-plane G03 counter-clockwise interpolation in the XZ-plane
G 02 R...
NC-Block: G19 [Y...] [Z...] [F...]
G 03 J... K...
Optional Addresses: Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
R Radius of the circular arc (optional statement)
J Circle Center Incremental (distance between the starting position and the
circle center in the Y-direction).
K Circle Center Incremental (distance between the starting position and the
circle center in the Z-direction).
Note: The addresses J and K are always programmed in the incremental system, re-
gardless of the selected value command system (G90 or G91).
F Feedrate
X G19 X G19
Y Y
G02 G03
-Z -Z
G02 clockwise interpolation in the YZ-plane G03 counter-clockwise interpolation in the YZ-plane
G17
NC-Block: G18 G 02 [X...] [Y...] [Y...] [R...] [F...]
G 03
G19
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
R Radius of the circular arc
F Feedrate
A circular arc can specify the starting point, the target point and the circle center. Another possibility is to pro-
gram the circular arc without the circle center however with the radius R.
α < 180°
R4
0
Target Point β > 180°
β
R4
0 α
X
Starting Point
Circular Interpolations with Radius Input
Programming Example:
Absolute
G54 G90 G17 G02 X40. Y40. R40. F120. G54 G90 G17 G02 X40. Y40. R-40. F120.
Dimensions
Incremental
G91 G17 G02 X40. Y40. R40. F120. G91 G17 G02 X40. Y40. R-40. F120.
Dimensions
The next two NC programs describe the following contour. In the first program the addresses I and J are
used for the circular interpolations. In the second program the circular interpolations are programmed by us-
ing the radius with the address R.
Y
100
R80
Circle 2
Circle 1 Circle 3
R20 X
-80 R40 40 45
-20
-40
To enable the tool to generate the programmed contour with high precision the tool center point has to travel
on a path running parallel to the programmed path. This tool center point path is called equidisant.
One equidisant is the tool center point path running in constant distance to the programmed path (contour) of
the work part. In discontinuous path transitions, i.e. in the inner and outer corners, the transitions become
equidisants, for instance, through insertion of arcs, in accordance with the control-specific rules.
a) In case of inner corners an arc corresponding to the radius of the milling machine is created.
b) In case of outer corner the tool makes a compensating arc.
1 2 1
Since machining can be done in two ways the NC control has to be informed if machining is to take place on
the left (command G41) or right (command G42) of the programmed contour.
3 programmed contours
Command: G41
Compensation to the left of the contour (in the cutting direction)
Function: When the cutter radius compensation (CRC) is operative, only the work part con-
tour points are programmed and the control system must be informed whether the
cutter shall move left or right of the programmed contour. The qualifications left or
right apply to the direction in which the tool travels along the contour
G17
NC-Block: G18 G41 G01 [X...] [Y...] [Z...] [D...] [F...]
G19
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
D Offset number
F Feedrate
Depending on the selected machining plane there are three possibilities for the necessary coordinates:
G17: G41 G01 [X...] [Y...] [D...] [F...]
G18: G41 G01 [X...] [Z...] [D...] [F...]
G19: G41 G01 [Y...] [Z...] [D...] [F...]
Note: The command of the block which specifies G41 should be G00 or G01. When G41
is specified by the commands G02 or G03 an alarm goes off.
The machining plane (G17, G18 or G19) must be specified before starting the cut-
ter radius compensation.
As long as the cutter radius compensation is operative, no zero shifts can be ef-
fected.
No tool changing functions can be programmed.
Machining cycles cannot be defined or invoked.
Radii of inner corner roundings must be greater than the cutter radius.
Two consecutive movements in Z cannot be programmed.
The following figures demonstrate the milling radius correction by the command G41 which depends on the
position of the tool with reference to the contour to be machined in outside and inside machining.
G41 G41
Milling radius correction in outside machining Milling radius correction in inside machining
Command: G42
Compensation to the right of the contour (in the cutting direction)
Function: When the cutter radius compensation (CRC) is operative, only the work part con-
tour points are programmed and the control system must be informed whether the
cutter shall move left or right of the programmed contour. The qualifications left or
right apply to the direction in which the tool travels along the contour
G17
NC-Block: G18 G42 G01 [X...] [Y...] [Z...] [D...] [F...]
G19
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
D Offset number
F Feedrate
Depending on the selected machining plane there are three possibilities for the necessary coordinates:
G17: G42 G01 [X...] [Y...] [D...] [F...]
G18: G42 G01 [X...] [Z...] [D...] [F...]
G19: G42 G01 [Y...] [Z...] [D...] [F...]
Note: The command of the block which specifies G42 should be G00 or G01. When G42
is specified by the commands G02 or G03 an alarm goes off.
The machining plane (G17, G18 or G19) must be specified before starting the cut-
ter radius compensation.
As long as the cutter radius compensation is operative, no zero shifts can be ef-
fected.
No tool changing functions can be programmed.
Machining cycles cannot be defined or invoked.
Radii of inner corner roundings must be greater than the cutter radius.
Two consecutive movements in Z cannot be programmed.
The following figures demonstrate the milling radius correction by the command G42 which depends on the
position of the tool with reference to the contour to be machined in outside and inside machining.
G42 G42
Milling radius correction in outside machining Milling radius correction in inside machining
Command: G40
Cancel the cutter radius compensation
Function: The command G40 cancels the cutter radius compensation activated by the com-
mands G41 or G42.
NC-Block: G40 G01 [X...] [Y...] [Z...] [F...]
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
F Feedrate
Depending on the selected machining plane there are three possibilities for the necessary coordinates:
G17: G40 G01 [X...] [Y...] [F...]
G18: G40 G01 [X...] [Z...] [F...]
G19: G40 G01 [Y...] [Z...] [F...]
Note: The command of the block which specifies G40 should be G00 or G01. When G40
is specified by the command G02 or G03 an alarm goes off.
No tool changing functions can be programmed.
At the end of the program the cutter radius compensation must be canceled, since
the center of the tool cannot be positioned at the end point, and remains deviated
by the cutter radius compensation value.
When the cutter radius compensation is applied, the following three steps must be considered:
1. Start-up the cutter radius compensation
2. Offset mode
3. Cancel the cutter radius compensation
If an infeed is subsequently programmed in two steps (see block 12 and 13), then for the next block the same
distance must be programmed in the machining plane as in the block before the infeed (see block 11 and
12).
Offset mode
In the offset mode, the cutter radius is considered for all movements (G00-G03). The CNC-control reads the
respective next two NC-blocks in order to calculate the basis for the travel movements. In these NC-blocks it
is therefore necessary to also program movements in the machining plane.
Example a Example b
$G54 X388 Y270 Z135 $G54 X388 Y270 Z135
03000 04000
N002 G54 N002 G54
N003 G90 G49 G80 G40 G17 G21 N003 G90 G49 G80 G40 G17 G21
N004 G91 G28 Z0 M9 N004 G91 G28 Z0 M9
N005 T1 M6 N005 T1 M6
N006 G90 S1500 M3 N006 G90 S1500 M3
N007 G0 G43 Z20 H17 N007 G0 G43 Z20 H17
N008 X0 Y0 M8 N008 G0 X0 Y0 M8
N009 G91 N009 G91
N010 G41 G0 X15 Y10 D1 N010 G41 G0 X15 Y9 D1
N011 N011 Y10
N012 Z-38 N012 Z-38
N013 G1 Z-12 F150 N013 G1 Z-12 F150
N014 Y40 F250 N014 Y40 F250
The cutter radius compensation is activated within a block. This means that the cutter radius compensation
must at the latest be selected when the first contour point is approached.
The cutter radius compensation can only be deactivated after the last contour point has been reached.
Hence, the cutter radius compensation is canceled after this travel motion.
As for approach motions, contour-parallel or tangential movements are also programmed for tool withdrawal.
Programming Example
CONFIGURATION MACHINE MAKINO FX 650
CONTROL FANUC 16M FX650
BLANK DIMENSIONS X+150.000 Y+150.000 Z+025.000
PART POSITION X+400.000 Y+230.000
Top front left corner of the part X+400.000 Y+230.000 Z+135.000
MATERIAL AlMg 1::Aluminium
VISE MAKFX 160
CHUCKED HEIGHT E+031.000
SHIFT V+000.000
ORIENTATION A0°
CURRENT TOOL T01
TOOLS T01 SLOT MILLING TOOL MS-10.0/045L HSS ISO 1641
TOOL COMPENSATION D01 R005.000 Z+138.000
Using the tool compensation values it is easy to program a work part without directly considering the applica-
ble tool lengths or tool radii. The available work part drawing data can be directly used for programming. The
tool data, lengths as well as radii of the milling machines or indexable inserts are automatically considered by
the CNC control.
L1 L3
L2
When programming an NC-program in absolute dimensioning, the control requires a coordinate system as
well as information on the lengths of all employed tools. For this it is necessary to measure the length L, i.e.
the distance between the tool setup point B and the cutting tip, and to enter it into the control.
R
Tool compensation values
A tool length compensation with reference to the reference point enables the adjustment between the set and
actual tool length, as in the case of finishing the tool. This tool length value has to be available to the control.
It is possible to offset the movement command in the Z-direction on the plus or minus side with the compen-
sation value by commanding:
G43 plus side offset
G44 minus side offset
To use the tool length compensation, the required compensation storage is usually specified with the com-
mand G43.
Command: G43
Tool length compensation in plus side offset
Function: For the programmed movement in the Z-direction, the command G43 considers the
compensation value in the selected compensation storage on the plus side.
NC-Block: G43 [Z...] [H...]
Optional Addresses: Z Z-Coordinate of the Target Point
H offset number
Note: An offset number for the compensation value of the tool is specified by the H ad-
dress. In the FANUC control 32 codes are available (from H01 to H32).
H00 deactivates the tool length compensation!
with G43
H03
2
Command: G44
Tool length compensation in minus side offset
Function: For the programmed movement in the Z-direction, the command G43 considers the
compensation value in the selected compensation storage on the minus side.
NC-Block: G44 [Z...] [H...]
Optional Addresses: Z Z-Coordinate of the Target Point
H offset number
Command: G49
Cancel tool length compensation
Function: Immediately cancels the tool length compensation activated by the commands G43
and G44.
NC-Block: ... G49 ...
Note: The tool length compensation also can be canceled by programming the command
G43 or G44 with the parameter H00
Command: G68
Coordinate rotation
Function: With the command G68 the current coordinate system is rotated by a certain angle.
All coordinates entered hereafter refer to the rotated coordinate axes.
G17
NC-Block: G18 G68 [α...] [β...] [R...]
G19
Optional Addresses: α Coordinate of the center of rotation in the selected machining plane
β Coordinate of the center of rotation in the selected machining plane
R Rotation angle
center of rotation
α
rotation angle
X
β
1 2
W
Programming Example:
Depending on the selected machining plane there are three possibilities of the coordinates:
G17 X Y - plane G17 G68 [X...] [Y...] [R...] ;
G18 Z X - plane G18 G68 [Z...] [X...] [R...] or
G19 Y Z - plane. G19 G68 [Y...] [Z...] [R...]
Note: The coordinates of the center of the rotation are always in absolute values.
The machining plane (G17, G18 or G19) need not be specified in the same block
with the command G68.
If no values for α and β are specified the actual position becomes the center of
rotation !
Command: G69
Cancel coordinate rotation
Function: With the command G69, the rotated coordinate system is turned back to its original
position. All coordinates entered hereafter refer to the original coordinate axes.
Note: The command G69 can be specified in the same block with other commands.
Exercise:
The aluminum plate outlined in the drawing with the blank dimensions of 100x90x25 is to be machined on a
vertical milling machine (machining plane G17).
pocket depth 15 mm
R
center of rotation
2 rotation angle
3 4
5 Cycles
5.1 Function and use of cycles on a CNC milling machine
In CNC-controls, predefined machining cycles are available which can be invoked with specific commands.
Similar to subprograms, they contain prevalent command sequences. These machining cycles can be divided
into three different types:
• drilling cycles
• milling cycles
• special cycles
Drilling cycles
For drilling cycles, also called canned
cycles in the FANUC-control, specific
drilling, reaming or threading tasks are
Z programmed by a command in conjunc-
tion with information on the required pa-
initial point rameter. The CNC-control then executes
all operations, e.g. for threading.
safety plane
depth
Milling cycles
For milling cycles, also called macro in
the FANUC-control, specific milling op-
erations, e.g. circular or rectangular
pockets, are executed. For these cycles,
the CNC-control must perform extensive
calculations, e.g. to generate the individ-
ual travel motions for a rectangular
pocket.
Z initial point
safety plane
depth
Special cycles
Belonging to the special cycles are e.g.
various drill patterns. Combined with
drilling cycles, e.g. holes on a circle or in
a row can thus be easily programmed.
Safety planes
Multiple repetition of these cycles is common e.g. with drilling holes on a divided circle or on a straight line.
depth
Please make sure that the Z-coordinate of this initial point (i.e. the position of the retracted tool) is sufficiently
defined above the work part contour. After the cycle is invoked, the tool must be positioned to the
Z-coordinate of this initial point. Subsequently the tool will be moved in the rapid traverse mode from this Z-
position down to the safety plane.
After completion of the cycle the tool is retracted in a rapid motion to the Z-coordinate of the initial point.
1
initial point
2 6
3 5
Z
4
A canned cycle is programmed with the corresponding G-command and optional addresses.
G91 G98
G... X... Y... Z... R... P... Q... F... L...
G90 G99
optional addresses
G90 / G91 select the dimensioning type for the coordinates of the depth and the safety plane
G98 / G99 select the return point level
G specifies the canned cycle mode
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
P dwell time at the bottom of the hole
Q cutting amount by programming G73 or G83
shift amount by programming G76 or G87
F feedrate
L number of repeats
If L is not specified, the canned cycle is only executed once.
If L0 is specified, then the data for the cycle is only stored, but the cycle is not performed!
A canned cycle is defined by the previously described command and executed according to L.
The canned cycle data remains stored until it is deactivated with the command G80. Therefore, following the
definition for canned cycle, it is executed for every programmed travel movement until it is deleted by the
command G80.
Note: These subsequent travel movements are programmed by the coordinate specifica-
tions, not by G00, G01, G02!
Otherwise the canned cycle is deleted!
Command: G80
cancel the canned cycle
Function: The selected canned cycle and its data is deleted.
NC-Block: G80 [X...] [Y...] [Z...] [F...] [S...] [T...] [M...]
Optional Addresses: X X-Coordinate of the Target Point
Y Y-Coordinate of the Target Point
Z Z-Coordinate of the Target Point
F Feedrate
S Speed
T Tool Change
M Additional Function
Note: The data for safety plane and depth is also deleted.
The feedrate F remains even after the canned cycle is deactivated.
For programming canned cycles, the applied dimensioning systems must be particularly considered!
According to whether an absolute (G90) or incremental (G91) dimensioning system was selected, the input
for depth (Z-position of the bottom of the hole) and for the Z-position of the safety plane must be changed
(see following examples).
G90
initial point
R= 2
Z=-10
Z = 0 (work part
R 2mm coordinate system)
10mm
Z
G91
initial point
R=-98
100 mm Z=-12
Z = 0 (work part
R 2mm coordinate system)
10mm
Z
Tool withdrawal after machining is controlled by the G-commands G98 and G99.
For G98, the tool returns in rapid traverse to the initial point after the drilling depth Z has been reached. The
Z-coordinate for the initial point is the last Z-position of the tool before the cycle was defined!
G98
initial point
For G99, the tool returns in rapid traverse to the safety plane (R) after the drilling depth Z has been reached.
G99
initial point
5.2.2 Survey
Subsequently, the canned cycles for the control FANUC 16 M are listed. The availability of the cycles varies
according to machine.
G76 cutting feed spindle orientation rapid traverse fine boring cycle
The defined canned cycles are deactivated with the command G80.
G80 - - - cancel
5.2.3 Application
The simulator is to be set-up according to the following set-up sheet for all subsequent program examples.
Set-up-sheet
CONFIGURATION MACHINE MAKINO FX 650
CONTROL FANUC 16M FX650
Drilling positions
The program examples are designed so that a master program defines the respective cycle. The individual
drilling positions are specified in a subprogram (O7300.FNC) and can be applied by all cycles
Note: The individual positions are only programmed with the coordinates, i.e. without the
commands G00, G01, G02 or G03!
O7300.FNC
N10 G90 X18 Y18 M8 first position
N15 Y82 second position
N20 X82 third position
N25 G98 Y18 fourth position
N30 G80
N35 M99
Command: G73
high-speed peck drilling cycle
Function: The fixed cycle G73 is used for high-speed peck drilling with chip breaking. After
infeed, the tool is withdrawn by the value d for chip breaking. This value can be set
in the CNC-control. After the complete infeed depth has been reached, the tool is
returned in rapid traverse to the initial point.
NC-Block: G98 G73 X... Y... Z... R... Q... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
Q cutting amount
F feedrate
G98 G73
initial point
Q d
Programming Example for the canned cycle: G73 high-speed peck drilling with G98
O 7398
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G49 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M3
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
Command: G73
high-speed peck drilling cycle
Function: The fixed cycle G73 is used for high-speed peck drilling with chip breaking. After
infeed, the tool is withdrawn by the value d for chip breaking. This value can be set
in the CNC-control. After the complete infeed depth has been reached, the tool is
returned in rapid traverse to the safety plane.
NC-Block: G99 G73 X... Y... Z... R... Q... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
Q cutting amount
F feedrate
G99 G73
initial point
Q d
Programming Example for the canned cycle: G73 high-speed peck drilling with G99
O 73
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G49 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
Command: G74
left-hand tapping cycle
Function: The fixed cycle G74 is for manufacturing left-hand threads. Speed S and the spin-
dle rotation direction M04 is programmed before the tapping cycle is defined. After
the thread depth has been reached, the control automatically switches to M03 for
withdrawal. The rotation direction is switched back to M04 after the safety plane has
been reached. For the fixed cycle G74, the safety plane should be at least 7mm
above the surface of the work part. The parameter P (dwell time) is only effective in
programming if it has also been set in the control. The value resulting from the mul-
tiplication of the spindle speed (1/min) and pitch of the thread to be manufactured
must be programmed in the address F.
G98 G74
initial point
M04
R
>7mm M04
tapping Z
M03
Programming Example for the canned cycle: G74 left-hand tapping cycle G98
O 7498
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
predrilling
N065 T04 M06
N070 G90 S2200 M03
N075 G0 G43 Z20 H20
N080 G98 G73 Z-35 R2 Q15 F80 L0 predrilling
N085 M98 P7300 subprogram call (4 positions for predrilling)
N090 G0 G80 G90 X120 Y120 cancel the canned cycle for predrilling
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
Command: G74
left-hand tapping cycle
Function: The fixed cycle G74 is for manufacturing left-hand threads. Speed S and the spin-
dle rotation direction M04 is programmed before the tapping cycle is defined. After
the thread depth has been reached, the control automatically switches to M03 for
withdrawal. The rotation direction is switched back to M04 after the safety plane has
been reached. For the fixed cycle G74, the safety plane should be at least 7mm
above the surface of the work part. The parameter P (dwell time) is only effective in
programming if it has also been set in the control. The value resulting from the mul-
tiplication of the spindle speed (1/min) and pitch of the thread to be manufactured
must be programmed in the address F.
F = spindle speed (1/min) • thread pitch (mm)
G99 G74
initial point
M04
R
>7mm M04
tapping Z
M03
Programming Example for the canned cycle: G74 left-hand tapping cycle G99
O 74
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
predrilling
N065 T04 M06
N070 G90 S2200 M03
N075 G0 G43 Z20 H20
N080 G98 G73 Z-35 R2 Q15 F80 L0 predrilling
N085 M98 P7300 subprogram call (4 positions for predrilling)
N090 G0 G80 G90 X120 Y120 cancel the canned cycle for predrilling
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
Command: G76
fine boring cycle
Function: The fine boring cycle G76 is used for finishing, whereby a boring bar is used. Addi-
tionally, after an oriented spindle stop the tool can be shifted to and removed
through the center of the hole. Shift Q is incrementally defined in mm. Alternatively,
it can be programmed with the parameter I for the X-direction and with the pa-
rameter J for the Y-direction. On the backside of the hole, the tool is again posi-
tioned in the center so that this side can be machined (e.g. counter-boring). Fol-
lowing the boring operation, an oriented spindle stop is again activated and the tool
is shifted, so that it can be removed from the bore hole.
Q. . . F. . .
NC-Block: G98 G76 X... Y... Z... R...
I. . . J. . . F. . .
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
Q shift amount I X- coordinate of the shift amount
J Y- coordinate of the shift amount
F feedrate
G98 G76
initial point
Q
Q Z
oriented
spindle stop
- - - - : rapid traverse R : safety plane
: cutting feed Z : depth
Q : shift amount
Command: G76
fine boring cycle
Function: The fine boring cycle G76 is used for finishing, whereby a boring bar is used. Addi-
tionally, after an oriented spindle stop the tool can be shifted to and removed
through the center of the hole. Shift Q is incrementally defined in mm. Alternatively,
it can be programmed with the parameter I for the X-direction and with the pa-
rameter J for the Y-direction. On the backside of the hole, the tool is again posi-
tioned in the center so that this side can be machined (e.g. counter-boring). Fol-
lowing the boring operation, an oriented spindle stop is again activated and the tool
is shifted, so that it can be removed from the bore hole.
Q. . . F. . .
NC-Block: G99 G76 X... Y... Z... R...
I. . . J. . . F. . .
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
Q shift amount I X- coordinate of the shift amount
J Y- coordinate of the shift amount
F feedrate
G99 G76
initial point
R Q
Q
Q Z
oriented
spindle stop
- - - - : rapid traverse R : safety plane
: cutting feed Z : depth
Q : shift amount
Command: G81
drilling cycle, spot drilling cycle
Function: The drilling cycle G81 is used for centering and for drilling minimal depths. The tool
travels to the safety plane R in rapid traverse with respect to the current tool posi-
tion and feeds at the programmed rate F.
NC-Block: G98 G81 X... Y... Z... R... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
F feedrate
G98 G81
initial point
Programming Example for the canned cycle: G81 drilling cycle, spot drilling cycle with G98
O 8198
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
Command: G81
drilling cycle, spot drilling cycle
Function: The drilling cycle G81 is used for centering and for drilling minimal depths. The tool
travels to the safety plane R in rapid traverse with respect to the current tool posi-
tion and feeds at the programmed rate F.
NC-Block: G99 G81 X... Y... Z... R... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
F feedrate
G99 G81
initial point
Programming Example for the canned cycle: G81 drilling cycle, spot drilling cycle with G99
O 81
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
Command: G82
drilling cycle, counterboring cycle
Function: The fixed cycle G82 is specifically used for drilling blind holes. By programming a
dwell time, high accuracy for the programmed drilling depth is guaranteed. The tool
travels to the safety plane R in rapid traverse with respect to the current tool posi-
tion and feeds at the programmed rate F. Once the programmed depth is attained
and after a possible dwell time, the tool returns in rapid traverse to the initial point.
NC-Block: G98 G82 X... Y... Z... R... P... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
P dwell time at the bottom of the hole
F feedrate
G98 G82
initial point
dwell time
Programming Example for the canned cycle: G82 drilling cycle, counterboring cycle with G98
O 8298
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
Command: G82
drilling cycle, counterboring cycle
Function: The fixed cycle G82 is specifically used for drilling blind holes. By programming a
dwell time, high accuracy for the programmed drilling depth is guaranteed. The tool
travels to the safety plane R in rapid traverse with respect to the current tool posi-
tion and feeds at the programmed rate F. Once the programmed depth is attained
and after a possible dwell time, the tool moves in rapid traverse to the safety plane
R.
NC-Block: G99 G82 X... Y... Z... R... P... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
P dwell time at the bottom of the hole
F feedrate
G99 G82
initial point
dwell time
Programming Example for the canned cycle: G82 drilling cycle, counterboring cycle with G99
O 82
N005 G54
N010 G90 G49 G80 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
Command: G83
peck drilling cycle
Function: The fixed cycle G83 is used for deep hole drilling. Since the tool is moved in rapid
traverse to the safety plane R after every feed, a thorough chip removal is guaran-
teed. Therefore overheating of the tool because of chip accumulation is avoided.
The feed of Q is at feedrate and incremental with respect to the safety plane R and
it is always positively programmed. After chip removal in rapid traverse, the tool is
positioned in rapid traverse for the next feed. The control-specific value d defines
the distance of the positioning point for the next infeed Q with respect to the current
drilling depth. Usually the parameter d is preset to 0,1mm on the CNC-control. After
this position has been reached, the next infeed is activated at feedrate.
NC-Block: G98 G83 X... Y... Z... R... Q... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
Q cutting amount
F feedrate
G98 G83
initial point
Q d
Q
d
Q
Z
Programming Example for the canned cycle: G83 peck drilling with G98
O 8398
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
Command: G83
peck drilling cycle
Function: The fixed cycle G83 is used for deep hole drilling. Since the tool is moved in rapid
traverse to the safety plane R after every feed, a thorough chip removal is guaran-
teed. Therefore overheating of the tool because of chip accumulation is avoided.
The feed of Q is at feedrate and incremental with respect to the safety plane R and
it is always positively programmed. After chip removal in rapid traverse, the tool is
positioned in rapid traverse for the next feed. The control-specific value d defines
the distance of the positioning point for the next infeed Q with respect to the current
drilling depth. Usually the parameter d is preset to 0,1mm on the CNC-control. After
this position has been reached, the next infeed is activated at feedrate.
NC-Block: G99 G83 X... Y... Z... R... Q... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
Q cutting amount
F feedrate
G99 G83
initial point
Q d
Q
d
Q
Z
Programming Example for the canned cycle: G83 peck drilling with G99
O 83
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
Command: G84
tapping cycle
Function: The fixed cycle G84 is for cutting metric and Withworth right-hand threads. The
spindle rotation direction M03 as well as the spindle speed S must be programmed
before defining the tapping cycle. After the thread depth has been reached, the
spindle is automatically switched to rotation direction M04 and moved back to the
safety plane. For this cycle, the safety plane should be programmed at least 7mm
above the work part surface. Dwell time P is only effective for programming if it is
also set in the CNC-control. The value to be programmed for feedrate F is the mul-
tiplication of spindle speed and thread pitch.
G98 G84
initial point
M03
R
>7mm M03
tapping Z
M04
Programming Example for the canned cycle: G84 tapping cycle with G98
O 8498
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
predrilling
N065 T04 M06
N070 G90 S2200 M03
N075 G0 G43 Z20 H04
N080 G98 G83 Z-35 R2 Q15 F80 L0 predrilling
N085 M98 P7300 subprogram call (4 positions for predrilling)
N090 G0 G80 G90 X120 Y120 cancel the canned cycle for predrilling
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
Command: G84
tapping cycle
Function: The fixed cycle G84 is for cutting metric and Withworth right-hand threads. The
spindle rotation direction M03 as well as the spindle speed S must be programmed
before defining the tapping cycle. After the thread depth has been reached, the
spindle is automatically switched to rotation direction M04 and moved back to the
safety plane. For this cycle, the safety plane should be programmed at least 7mm
above the work part surface. Dwell time P is only effective for programming if it is
also set in the CNC-control. The value to be programmed for feedrate F is the mul-
tiplication of spindle speed and thread pitch.
G99 G84
initial point
M03
R
>7mm M03
tapping Z
M04
Programming Example for the canned cycle: G84 tapping cycle with G99
O 84
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
predrilling
N065 T04 M06
N070 G90 S2200 M03
N075 G0 G43 Z20 H20
N080 G98 G83 Z-35 R2 Q15 F80 L0 predrilling
N085 M98 P7300 subprogram call (4 positions for predrilling)
N090 G0 G80 G90 X120 Y120 cancel the canned cycle for predrilling
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
tapping with G84
N105 T05 M05
N110 G90 S1000 M03
N115 G0 G43 Z20 H21
N120 G99 G84 Z-30 R7 P1000 F1000 L0 G99 return to the safety plane R
G84 tapping cycle
Z-30 thread depth
R7 Z-position of the safety plane
P1000 dwell time at the bottom of the hole (1 sec)
F1000 feedrate
L0 The data for the cycle only stored,
but the cycle is not performed!
Command: G85
boring cycle (reaming)
Function: The fixed cycle G85 is for reaming. The speed for reaming as well as the spindle
rotation direction must be programmed before this cycle is defined. The tool moves
in rapid traverse from the initial position to the safety plane R and reams the hole to
the programmed depth at feedrate. The tool then returns to the initial point at feed
rate, while maintaining rotation direction.
NC-Block: G98 G85 X... Y... Z... R... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
F feedrate
G98 G85
initial point
M03
R
M03
reaming Z
M03
Programming Example for the canned cycle: G85 boring cycle (reaming) with G98
O 8598
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G90 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
predrilling
N065 T04 M06
N070 G90 S2200 M03
N075 G0 G43 Z20 H20
N080 G99 G83 Z-35 R2 Q15 F80 L0 predrilling
N085 M98 P7300 subprogram call (4 positions for predrilling)
N090 G0 G80 G90 X120 Y120 cancel the canned cycle for predrilling
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
Command: G85
boring cycle (reaming)
Function: The fixed cycle G85 is for reaming. The speed for reaming as well as the spindle
rotation direction must be programmed before this cycle is defined. The tool moves
in rapid traverse from the initial position to the safety plane R and reams the hole to
the programmed depth at feedrate. The tool then moves to the safety plane R at
feed rate and while maintaining rotation direction.
NC-Block: G99 G85 X... Y... Z... R... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
F feedrate
G99 G85
initial point
M03
R
M03
reaming Z
M03
Programming Example for the canned cycle: G85 boring cycle (reaming) with G99
O 85
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G90 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
predrilling
N065 T04 M06
N070 G90 S2200 M03
N075 G0 G43 Z20 H20
N080 G99 G83 Z-35 R2 Q15 F80 L0 predrilling
N085 M98 P7300 subprogram call (4 positions for predrilling)
N090 G0 G80 G90 X120 Y120 cancel the canned cycle for predrilling
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
Command: G86
boring cycle with retraction in rapid traverse
Function: The fixed cycle G86 is used for boring holes in a single operation. The tool moves
in rapid traverse to the safety plane and then feeds at the programmed rate to the
specified hole depths. A spindle stop is activated at the bottom of the hole. The tool
is then removed in rapid traverse to the initial point.
NC-Block: G98 G86 X... Y... Z... R... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
F feedrate
G98 G86
G8G861
initial point
Z
spindle stop
Programming Example for the canned cycle: G86 boring with retraction in rapid traverse with G98
O 8698
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
Command: G86
boring cycle with retraction in rapid traverse
Function: The fixed cycle G86 is used for boring holes in a single operation. The tool moves
in rapid traverse to the safety plane and then feeds at the programmed rate to the
specified hole depths. A spindle stop is activated at the bottom of the hole. The tool
is then removed in rapid traverse to the safety plane R.
NC-Block: G99 G86 X... Y... Z... R... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
F feedrate
G99 G86
initial point
Z
spindle stop
Programming Example for the canned cycle: G86 boring with retraction in rapid traverse with G99
O 86
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
Command: G87
boring cycle / back boring cycle
Function: The fixed cycle G87 can be used as a normal boring cycle or as a back boring cy-
cle. Programming shift Q specifies a back boring cycle. The cycle behavior during
execution varies depending on this parameter.
NC-Block: G98 G86 X... Y... Z... R... F... (Q...)
Parameter: (Q) shift amount
Command: G87
boring cycle
Function: If Q is not programmed, G87 is interpreted as a normal boring cycle. After the tool
is moved in rapid traverse to the safety plane, the infeed to the programmed depth
is achieved in one machining operation. A spindle stop is activated at the bottom of
the hole. The tool must then be manually moved back to the safety plane R. Then
the control returns the tool in rapid traverse to the initial point.
NC-Block: G98 G87 X... Y... Z... R... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
F feedrate
G98 G87
initial point
manual
Z
spindle stop
Command: G87
boring cycle
Function: If Q is not programmed, G87 is interpreted as a normal boring cycle. After the tool
is moved in rapid traverse to the safety plane, the infeed to the programmed depth
is achieved in one machining operation. A spindle stop is activated at the bottom of
the hole. The tool must then be minimally lifted from the bottom by hand before the
control moves to the safety plane in rapid traverse.
NC-Block: G99 G87 X... Y... Z... R... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
F feedrate
G99 G87
initial point
manual
Z
spindle stop
Command: G88
boring cycle
Function: The fixed cycle G88 is for boring holes in a single infeed. After the tool is moved in
rapid traverse to the safety plane, the infeed to the programmed depth is achieved
in one machining operation. A spindle stop is activated at the bottom of the hole
after a programmed dwell time. The tool must then be manually moved back to the
safety plane R. The control then returns the tool in rapid traverse to the initial point.
NC-Block: G98 G88 X... Y... Z... R... P... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
P dwell time at the bottom of the hole
F feedrate
G98 G88
initial point
manual
Z
spindle stop
after dwell
Command: G88
boring cycle
Function: The fixed cycle G88 is for boring holes in a single infeed. After the tool is moved in
rapid traverse to the safety plane, the infeed to the programmed depth is achieved
in one machining operation. A spindle stop is activated at the bottom of the hole
after a programmed dwell time. The tool must then be minimally lifted from the
bottom by hand before the control moves to the safety plane in rapid traverse.
NC-Block: G99 G88 X... Y... Z... R... P... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
P dwell time at the bottom of the hole
F feedrate
G99 G88
initial point
manual
Z
spindle stop
after dwell
Command: G89
boring cycle with dwell time (reaming)
Function: The fixed cycle G89 is for reaming drilled holes. It guarantees a clean wipe of the
hole bottom. The reaming speed as well as the spindle rotation direction must be
programmed before the cycle is defined. The tool travels from the initial position to
the safety plane R in rapid traverse and reams the hole at feedrate to the pro-
grammed depth. The tool dwells there at the programmed dwell time P and returns
then to the safety plane R at feedrate while maintaining rotation direction. It then
moves in rapid traverse to the initial point.
NC-Block: G98 G89 X... Y... Z... R... P... F...
Optional Addresses: G98 return to the initial point
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
P dwell time at the bottom of the hole
F feedrate
G98 G89
initial point
reaming Z
dwell time
Programming Example for the canned cycle: G89 boring cycle with dwell time(reaming) with G98
O 8998
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
predrilling
N065 T04 M06
N070 G90 S2200 M03
N075 G0 G43 Z20 H20
N080 G99 G83 Z-35 R2 Q15 F80 L0 predrilling
N085 M98 P7300 subprogram call (4 positions for predrilling)
N090 G0 G80 G90 X120 Y120 cancel the canned cycle for predrilling
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
Command: G89
boring cycle with dwell time (reaming)
Function: The fixed cycle G89 is for reaming drilled holes. It guarantees a clean wipe of the
hole bottom. The reaming speed as well as the spindle rotation direction must be
programmed before the cycle is defined. The tool travels from the initial position to
the safety plane R in rapid traverse and reams the hole at feedrate to the pro-
grammed depth. The tool dwells there at the programmed dwell time P and moves
then to the safety plane R at feedrate while maintaining rotation direction.
NC-Block: G99 G89 X... Y... Z... R... P... F...
Optional Addresses: G99 return to the safety plane R
X, Y coordinates of the hole position
Z depth (Z-position of the bottom of the hole)
R Z-position of the safety plane
P dwell time at the bottom of the hole
F feedrate
G99 G89
initial point
reaming Z
dwell time
Programming Example for the canned cycle: G89 boring cycle with dwell time(reaming) with G99
O 89
N005 G54
N010 G90 G49 G80 G40 G17 G21
N015 G91 G28 Z0 M9
N020 G91 G28 X0 Y0
centering
N025 T03 M06
N030 G90 S2200 M03
N035 G0 G43 Z20 H19
N040 G99 G81 Z-3 R2 F80 L0 centering
N045 M98 P7300 subprogram call (4 positions for centering)
N050 G0 G80 G90 X120 Y120 cancel the canned cycle for centering
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
predrilling
N065 T04 M06
N070 G90 S2200 M03
N075 G0 G43 Z20 H20
N080 G99 G83 Z-35 R2 Q15 F80 L0 predrilling
N085 M98 P7300 subprogram call (4 positions for predrilling)
N090 G0 G80 G90 X120 Y120 cancel the canned cycle for predrilling
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
5.3 Macros
Similar to canned cycles, macros are standard programs which are installed in the control and can be used
for easier programming.
5.3.1 Definition
In milling cycles, also called macros in the FANUC-control, specific milling operations are executed, e.g. cir-
cular pockets. For these macros, the CNC- control must perform extensive calculations, e.g. to generate the
individual travel motions for a circular pocket.
Sequence of a macro
The basic sequence of a macro is subsequently illustrated.
initial point
R
4
2
3
Z
A macro is programmed with the command G65, the macro number (P....) and the optional addresses.
optional addresses
B pitch angle
F feedrate
S approach feedrate
subprogram number by 9180, 9190
5.3.2 Survey
Subsequently, the macros for the control FANUC 16 M are listed. The availability of the cycles varies ac-
cording to machine.
5.3.3 Application
The simulator is to be set-up according to the following set-up sheet for all subsequent program examples.
Set-up-sheet
CONFIGURATION MACHINE MAKINO FX 650
CONTROL FANUC 16M FX650
Note: The offset value must be less than the approach circle radius.
The cutter radius compensation is used.
Specify Q1. for counterwise cutting direction and omit Q for counter-clockwise cut-
ting direction.
Specify M1. for incremental values of R and Z.
Omit M for absolute values of R and Z.
Programming Example for the macro: G65 P9110 finishing inside of circle
O 110
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T02 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H18
N045 X50 Y50 M8
N050 G65 P9120 I30 D22 H15 Z-20 R2 Q6 F90 S45 deep cutting of circular pocket
Note: the cutter radius offset number D22 is used for the roughing of the pocket !
N055 G90 S2200 M3
N060 G65 P9110 I30 D2 R-18 Z-20 F60 C12 S100 Q1 P9110 finishing inside of circle
I30 cutting circle radius
D2 cutter radius offset number
R-18 Z-position of the safety plane
Z-20 Z-position of the bottom of the pocket
F60 feedrate
C12 approach circle radius
S100 approach feedrate
Q1 counterwise cutting direction
N065 G0 Z20 M9
N070 G91 G28 Z0 M5
N075 G90 G49 G80 G40
N080 M30
nitial point
Q
Q
Z
Programming Example for the macro: G65 P9120 deep cutting of circular pocket
O 120
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T02 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H18
N045 X50 Y50 M8
N050 G65 P9120 I30 D2 H15 Z-20 R2 Q6 F60 S30 P9120 deep cutting of circular pocket
I30 cutting circle radius
D2 cutter radius offset number
H15 cutting width per pass
Z-20 Z-position of the bottom of the pocket
R2 Z-position of the safety plane
Q6 infeed per pass
F60 feedrate
S30 approach feedrate
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
N065 G90 G49 G80 G40
N070 M30
Programming Example for the macro: G65 P9130 finish cutting inside of square
O 130
N010 G54
N020 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T2 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H18
N045 X50 Y50 M8
N050 G65 P9140 U80 V70 D22 R2 Z-20 Q6 F90 S40 H15
Note: the cutter radius offset number D22 is used for the roughing of the pocket !
N055 S2200 M3
N060 G65 P9130 U80 V70 C20 D2 R2 Z-20 F60 S100 I15 Q1 P9130 finish cutting inside
of square pocket
U80 lateral side length
V70 longitudinal side length
C20 approach circle radiusv
D2 cutter radius offset number
R2 Z-position of the safety plane
Z-20 Z-position of the bottom
of the pocket
F60 feedrate
S100 approach feedrate
I15 radius of corner arc
Q1 counterwise cutting direction
N065 G0 Z20 M9
N070 G91 G28 Z0 M5
N075 G90 G49 G80 G40
N080 M30
Programming Example for the macro: G65 P9140 deep cutting of square pocket
O 140
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T2 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H18
N045 X50 Y50 M8
N050 G65 P9140 U80 V70 D2 R2 Z-20 Q6 F90 S40 H15 P9140 deep cutting of square pocket
U80 lateral side length
V70 longitudinal side length
D2 cutter radius offset number
R2 Z-position of the safety plane
Z-20 Z-position of the bottom of the pocket
Q6 infeed per pass
F90 feedrate
S40 approach feedrate
H15 cutting width per pass
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
N065 G90 G49 G80 G40
N070 M30
Programming Example for the macro: G65 P9140 deep cutting of square pocket
O 140
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T2 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H18
N045 X50 Y50 M8
N050 G65 P9140 U80 V70 D2 R2 Z-20 Q6 F90 S40 H15 P9140 deep cutting of square pocket
U80 lateral side length
V70 longitudinal side length
D2 cutter radius offset number
R2 Z-position of the safety plane
Z-20 Z-position of the bottom of the pocket
Q6 infeed per pass
F90 feedrate
S40 approach feedrate
H15 cutting width per pass
N055 G0 Z20 M9
N060 G91 G28 Z0 M5
N065 G90 G49 G80 G40
N070 M30
initial point
hole position 5
hole position
A
R
X
(X,Y)
Programming Example for the macro: G65 P9180 bolt hole circle for drilling
O 180
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T03 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H19 M8
N045 G98 G83 Z-20 R2 Q6 F80 L0 definition of a peck drilling cycle
N050 G65 P9180 X50 Y50 I30 D6 A0 P9180 bolt hole circle
X50 X coordinate of circular center
Y50 Y coordinate of circular center
I30 radius of circle
D6 number of holes equally spaced
A0 starting angle of the first hole
N055 G80
N060 G0 Z20 M9
N065 G91 G28 Z0 M5
N070 G90 G49 G40
N075 M30
Programming Example for the macro: G65 P9180 bolt hole circle for multi-block machining
O 180
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T03 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H19
N045 Z2 M8
N055 G65 P9180 X50 Y50 I30 D6 A0 S9180 P9180 bolt hole circle
X50 X coordinate of circular center
Y50 Y coordinate of circular center
I30 radius of circle
D6 number of holes equally spaced
A0 starting angle of the first hole
S9180 subprogram number called
N060 G80
N065 G0 Z20 M9
N070 G91 G28 Z0 M5
N075 G90 G49 G40
N080 M30
Subprogram 9180
N10 G91
N15 G1 Z-7 F80
N20 G0 Z7
N25 G90
N40 M99
initial point
hole position 5
hole position
A
R
X Q d
(X,Y)
Q
d
Q
Z
Programming Example for the macro: G65 P9190 positioning on arc for drilling
O 190
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T03 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H19 M8
N045 G98 G83 Z-20 R2 Q6 F80 L0 definition of a peck drilling cycle
N055 G65 P9190 X50 Y50 I30 B25 D6 A60 P9190 positioning on arc
X50 X coordinate of circular center
Y50 Y coordinate of circular center
I30 radius of circle
B25 pitch angle
D6 number of holes
A60 starting angle of the first hole
N060 G80
N065 G0 Z20 M9
N070 G91 G28 Z0 M5
N075 G90 G49 G40
N080 M30
Programming Example for the macro: G65 P9190 positioning on arc for multi-block machining
O 190
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T03 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H19
N045 Z2 M8
N055 G65 P9190 X50 Y50 I30 B25 D6 A60 S9180 P9190 positioning on arc
X50 X coordinate of circular center
Y50 Y coordinate of circular center
I30 radius of circle
B25 pitch angle
D6 number of holes
A60 starting angle of the first hole
S9180 subprogram number called
N060 G80
N065 G0 Z20 M9
N070 G91 G28 Z0 M5
N075 G90 G49 G40
N080 M30
Subprogram 9180
N10 G91
N15 G1 Z-7 F80
N20 G0 Z7
N25 G90
N40 M99
U U
initial point
V
U+ U- M03
V- V-
2 3
V
R
H pieces
>7mm M03
1 4
U+ U- tapping Z
V- V+
M04
D pieces
for example tapping cycle G84
Programming Example for the macro: G65 P9200 matrix machining for drilling
O 200
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T03 M6
N035 G90 S1800 M3
N040 G0 G43 Z20 H19 M8
N045 G99 G83 Z-20 R2 Q6 F80 L0 definition of a peck drilling cycle
N050 G65 P9200 X10 Y10 U20 D5 V20 H5 P9200 matrix machining
X10 X coordinate of the first hole
Y10 Y coordinate of the first hole
U20 pitch in X-direction
D5 number of holes in X-direction
V20 pitch in Y-direction
H5 number of holes in Y-direction
N055 G80
N060 G0 Z20 M9
N065 G91 G28 Z0 M5
N070 G90 G49 G40
N075 M30
Programming Example for the macro: G65 P9200 matrix machining for multi-block machining
N010 O 200
N015 G54
N020 G90 G49 G80 G40 G17 G21
N025 G91 G28 Z0 M9
N030 G91 G28 X0 Y0
N035 T03 M6
N040 G90 S1800 M3
N045 G0 G43 Z20 H19
N050 Z2 M8
N055 G65 P9200 X10 Y10 U20 D5 V20 H5 S9180 P9200 matrix machining
X10 X coordinate of the first hole
Y10 Y coordinate of the first hole
U20 pitch in X-direction
D5 number of holes in X-direction
V20 pitch in Y-direction
H5 number of holes in Y-direction
S9180 subprogram number called
N060 G80
N065 G0 Z20 M9
N070 G91 G28 Z0 M5
N075 G90 G49 G40
N080 M30
6 Subprogram technology
A subprogram is a program that is called from an NC-program. All commands in this subprogram are exe-
cuted after it is invoked. The CNC-control then returns to the main program and executes the subsequent
commands.
It is practical to use subprograms when specific program sections need to be repeatedly executed. For ex-
ample, if a contour operation is to be executed in multiple infeeds or after one or more zero point shifts, then
the contour can be programmed only once in a subprogram. This subprogram is then invoked for machining.
These subprograms can be invoked from any NC-program, thereby allowing program elements for recurrent
machining operations to be programmed. As a result, the programming work is considerably minimized. This
is applied for machining identical contours as well as for boring drills.
Command: M98
Subprogram Call
Function: A subprogram called by the command M98 is executed by the control system. After
this, the execution of the main program will be continued from the position in the
program line, where the subprogram has been invoked.
NC-Block: M98 [P...] [L...]
Optional Addresses: P Number of the subprogram
L Number of repeated callings
Programming Example: N100 M98 P400 L5 (Call the subprogram O400 five times)
N100 M98 P400 (Call the subprogram O400 once)
Command: M99
End of Subprogram
Function: The command M99 marks the end of a subprogram.
NC-Block: M99
At the end of each defined subprogram, the command M99 must be programmed to cause the control sys-
tem to return to the main program, resp. to the subprogram, from which the current subprogram has been
called.
When using subprograms it is necessary to consider the programming type, i.e. with incremental or absolute
input value. If programming with absolute input value is selected, then the programmed machining will always
be executed at the same point in the work part coordinate system. For changing the machining position it is
necessary to program a corresponding zero point shift before each subprogram call.
The advantage of incremental values is that a zero point shift must not be programmed. Similar to canned
cycles, the tool is moved to the target starting position before the subprogram is called. The incremental input
value programming (G91) is selected in the subprogram and the travel movements are then incrementally
programmed. Before the subprogram has ended, the absolute input value programming (G90) must again be
selected.
Note: When using incremental input value programming, switching between incremental
and absolute input value programming should only take place in the subprogram.
Programming Example
Main NC-program UNTERCC.FNC
$G54 X400 Y250 Z135
O2000
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T02 M6
N035 G97 S2500 M03 F150
N040 G90 G0 X20 Y40 absolute input value G90
N045 G43 Z20 H18
N050 Z2
N055 M98 P2001 L3 subprogram call number 2001 execute three times
N060 G0 Z2
N065 X50 Y40
N070 M98 P2001 L3 subprogram call number 2001 execute three times
N075 G0 Z2
N080 X80 Y40
N085 M98 P2001 L3 subprogram call number 2001 execute three times
N090 G0 Z20 M9
N100 G91 G28 Z0 M5
N105 G91 G28 X0 Y0
N110 G90 G49 G80 G40
N115 M30
Subsequently, the program sequence with the individual subprogram calls is shown.
main program
O2000
N010 G54
N015 G90 G49 G80 G40 G17 G21
N020 G91 G28 Z0 M9
N025 G91 G28 X0 Y0
N030 T02 M6
N035 G97 S2500 M03 F150
N040 G90 G0 X20 Y40 first start position
N045 G43 Z20 H18
N050 Z2 subprogram
N055 M98 P2001 L3 N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
2. execution N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
3. execution N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
N060 G0 Z2
N065 X50 Y40 second start position
subprogram
N070 M98 P2001 L3 N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
2. execution N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
3. execution N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
N075 G0 Z2
N075 G0 Z2
N080 X80 Y40 third start position
subprogram
N085 M98 P2001 L3 N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
2. execution N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
3. execution N010 G91 M8
N015 G1 Z-3 F150
N020 G2 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
N090 G0 Z20 M9
N095 G91 G28 Z0 M5
N100 G91 G28 X0 Y0
N105 G90 G49 G80 G40
N110 M30
Programming Example
Main NC-program UNTERPR.FNC
Programming will be with incremental input value (G91) and the depth of 7 mm should be reached with three
program repetitions by using the subprogram technique.
N010 O1000
N015 G54
N020 G90 G49 G80 G40 G17 G21
N025 G91 G28 Z0 M9
N030 G91 G28 X0 Y0
N035 T02 M6
N040 G97 S2500 M03 F150
N045 G90 G0 X15 Y40
N050 G43 Z20 H18
N055 Z2
N060 M98 P1001 L3
N065 G0 Z2
N070 X45 Y40
N075 M98 P1001 L3
N080 G0 Z2
N085 X75 Y40
N090 M98 P1001 L3
N095 G0 Z20 M9
N100 G91 G28 Z0 M5
N105 G91 G28 X0 Y0
N115 G90 G49 G80 G40
N120 M30
N010 G91 M8
N015 G1 Z-3 F150
N020 G3 Y25 I0 J12.5
N025 G1 Y-25
N030 G90 M9
N035 M99
Subprograms are usually invoked by the main program. However, it is also possible for a subprogram to call
another subprogram. This process is called nesting subprograms. The FANUC control allows a maximum of
4 subprograms to be nested.
Programming will be with incremental input value (G91) and the depth of 7 mm should be reached with three
program repetitions.
7 Workshop-Oriented Programming
7.1 Introduction
According to the Standard ISO 6983, a workpart contour is programmed with the commands "G01" (linear
interpolation), "G02" (circular interpolation, clockwise) or "G03" (circular interpolation, counter-clockwise), and
by defining the coordinates of the target point or center of a circle, respectively. Considering this, the defini-
tion of contours which cannot be measured according to NC standards might require extensive calculation.
Modern CNC control systems as well as the CNC Simulator feature additional commands for segment con-
tour programming allowing the integration of data with reference to length, angles and radii, as well as tan-
gential transition conditions. Consequently it is possible to program many contours without additional calcula-
tions.
The "Workshop Oriented Programming", abbreviated "WOP" stands for a programming interface for CNC
technologies worked out (even if not standardized) by the German Federal Ministry of Research and Tech-
nology within the framework of one of its projects. With this method, data entry takes place with function keys
only, and with the help of a program dialogue. Parallel to the data entry, the workpart geometry is graphically
displayed in a fashion similar to a CAD program and, if several solutions are possible, all solution options are
presented for selection.
Blank
Programmed contour
Figure 26
WOP Interface for CNC Milling
Frequently, the entered parameter values result in several possible variants of the contour segment being
programmed. In such cases the WOP Interface switchs to the Alternative Selections menu to enable you for
the selection of the desired contour alternative.
The change into the Alternative Selections takes place automatically, and you cannot continue programming
until after having selected one contour variant, or until after canceled the current programming session.
Please note that the Alternative Selection menu displays solutions that are mathematically possible, irrespec-
tive of the fact that the solution might not be feasible from the technical or logical point of view.
7.2 Example:
The bowl of the drawing is to be manufactured as individual workpart on a CNC vertical milling machine.
Use the WOP (Workshop Oriented Programming) for programming the contour.
The starting point of the contour is on the intersection of the middleline and of the right circular arc.
material AlMg1
bowl
WORK PLAN
bowl
After starting, the MTS-simulator is automatically set-up with blank, clamping and turret allocation. If the fol-
lowing set-up data does not conform with the current set-up data, then it must be changed in the set-up op-
eration.
set-up sheet
CONFIGURATION
MACHINE MAKINO FX 650
CONTROL FANUC 16M FX650
BLANK DIMENSIONS
X+200.000 Y+100.000 Z+020.000
PART POSITION
X+400.000 Y+250.000
LEFT FRONT UPPER CORNER OF THE WORKPART
X+400.000 Y+250.000 Z+132.000
MATERIAL
AlMg 1:Aluminium
VISE
MAKFX 160
CHUCKED HEIGHT E+033.000
SHIFT V+000.000
ORIENTATION A90°
CURRENT TOOL
T08
TOOLS
T01 SLOT MILLING TOOL MS-06.0/0820 HSS ISO 1641
T02 SLOT MILLING TOOL MS-20.0/075L HSS ISO 1641
T03 DRILL DR-05.00/087 HSS ISO 235
T04 DRILL DR-05.00/087 HSS ISO 235
T05 SLOT MILLING TOOL MS-10.0/045L HSS ISO 1641
T06 TAP TA-M06.0/1.00 HSS ISO 2857
T07 SLOT MILLING TOOL MS-05.0/0820 HSS ISO 1641
T08 SHELL END MILL MW-040/032 HSS ISO 2586
TOOL COMPENSATION
D01 R003.000 Z+110.000
D02 R010.000 Z+147.000
D03 R000.000 Z+176.500
D04 R000.000 Z+176.500
D05 R005.000 Z+138.000
D06 R000.000 Z+132.500
D07 R002.500 Z+110.000
D08 R020.000 Z+098.000
NC programming
Before using the WOP programming create a new NC program named SCHALE, set up the simulator and
program with the editor the first NC blocks.
Description Entry
O100
N010 G54
N030 T08 M6
N050 Z2
N055 Z-6
2. Select the contour entity „tangential right arc“. F4 (arc right tangentl.) enter the following value:
B 113 confirm with
F8 (term. input)
NC block: G72 B+113 O000
3. Select the contour entity „tangential right arc“. F4 (arc right tangentl.), enter the following values:
B 15
I 35
J 65 change between the two solutions with
F1 (alternative), select the desired solution with
F8 (term. input)
NC block: G72 I+35 J+65 O070 B+15 O000
4. Select the contour entity „tangential left arc“. F6 (arc left tangentl.) enter the following value:
B 80 confirm with
F8 (term. input)
NC block: G73 B+80 O000
5. Select the contour entity „tangential right arc“. F4 (arc right tangentl.), enter the following values:
Xe 180
Ye 50
I 140
J 50 change between the two solutions with
F1 (alternative), select the desired solution with
F8 (term. input)
NC block: G72 X+180 Y+50 I+140 J+50 O70 O000
After leaving the WOP system NC blocks with G02 or G03 commands are generated:
Complete the NC program with the retreat movement and the lasts NC blocks.
N100 G40
N105 G0 Z20 M9
N125 M30
Solution:
O100
N010 G54
N030 T08 M6
N050 Z2
N055 Z-6
N100 G40
N105 G0 Z20 M9
N125 M30
The counter-form of the drawing is to be manufactured as individual workpart on a CNC vertical milling ma-
chine.
Use the WOP (Workshop Oriented Programming) for programming the contour.
The starting point of the contour is the starting point of the circular arc on the right side.
material AlMg1
counter-form
WORK PLAN
counter-form
Solution:
BLANK DIMENSIONS X+130.000 Y+100.000 Z+020.000
PART POSITION X+400.000 Y+250.000
Top front left corner of the part X+400.000 Y+250.000 Z+137.000
MATERIAL AlMg 1::Aluminium
VISE MAKFX 160
CHUCKED HEIGHT E+038.000
SHIFT V+000.000
ORIENTATION A0ø
CURRENT TOOL T01
TOOLS
T01 SLOT MILLING TOOL MS-06.0/0820 HSS ISO 1641
The stamping of the drawing is to be manufactured as individual workpart on a CNC vertical milling machine.
Use the WOP (Workshop Oriented Programming) for programming the contour.
The starting point of the contour is the starting point of the circular arc on the right side.
material AlMg1
stamping
WORK PLAN
stamping
Solution:
BLANK DIMENSIONS X+100.000 Y+100.000 Z+025.000
PART POSITION X+400.000 Y+250.000
Top front left corner of the part X+400.000 Y+250.000 Z+135.000
MATERIAL AlMg 1::Aluminium
VISE MAKFX 160
CHUCKED HEIGHT E+031.000
SHIFT V+000.000
ORIENTATION A0ø
CURRENT TOOL T01
TOOLS
T01 SHELL END MILL MW-040/032 HSS ISO 2586