Control
SINUMERIK 840D sl / 840DE sl
SINUMERIK 828D
Software Version
CNC software 4.5 SP2
03/2013
6FC5398-1BP40-3BA1
Legal information
Warning notice system
This manual contains notices you have to observe in order to ensure your personal safety, as well as to prevent
damage to property. The notices referring to your personal safety are highlighted in the manual by a safety alert
symbol, notices referring only to property damage have no safety alert symbol. These notices shown below are
graded according to the degree of danger.
DANGER
indicates that death or severe personal injury will result if proper precautions are not taken.
WARNING
indicates that death or severe personal injury may result if proper precautions are not taken.
CAUTION
indicates that minor personal injury can result if proper precautions are not taken.
NOTICE
indicates that property damage can result if proper precautions are not taken.
If more than one degree of danger is present, the warning notice representing the highest degree of danger will
be used. A notice warning of injury to persons with a safety alert symbol may also include a warning relating to
property damage.
Qualified Personnel
The product/system described in this documentation may be operated only by personnel qualified for the specific
task in accordance with the relevant documentation, in particular its warning notices and safety instructions.
Qualified personnel are those who, based on their training and experience, are capable of identifying risks and
avoiding potential hazards when working with these products/systems.
Proper use of Siemens products
Note the following:
WARNING
Siemens products may only be used for the applications described in the catalog and in the relevant technical
documentation. If products and components from other manufacturers are used, these must be recommended
or approved by Siemens. Proper transport, storage, installation, assembly, commissioning, operation and
maintenance are required to ensure that the products operate safely and without any problems. The permissible
ambient conditions must be complied with. The information in the relevant documentation must be observed.
Trademarks
All names identified by ® are registered trademarks of Siemens AG. The remaining trademarks in this publication
may be trademarks whose use by third parties for their own purposes could violate the rights of the owner.
Disclaimer of Liability
We have reviewed the contents of this publication to ensure consistency with the hardware and software
described. Since variance cannot be precluded entirely, we cannot guarantee full consistency. However, the
information in this publication is reviewed regularly and any necessary corrections are included in subsequent
editions.
Siemens AG
Industry Sector
Postfach 48 48
90026 NÜRNBERG
GERMANY
Order number: 6FC5398-1BP40-3BA1
Ⓟ 04/2013 Technical data subject to change
You can find Frequently Asked Questions in the Service&Support pages under Product
Support. http://support.automation.siemens.com
SINUMERIK
You can find information on SINUMERIK under the following link:
www.siemens.com/sinumerik
Target group
This publication is intended for:
● Programmers
● Project engineers
Benefits
With the programming manual, the target group can develop, write, test, and debug
programs and software user interfaces.
Standard scope
This Programming Manual describes the functionality afforded by standard functions.
Extensions or changes made by the machine tool manufacturer are documented by the
machine tool manufacturer.
Other functions not described in this documentation might be executable in the control. This
does not, however, represent an obligation to supply such functions with a new control or
when servicing.
Further, for the sake of simplicity, this documentation does not contain all detailed
information about all types of the product and cannot cover every conceivable case of
installation, operation or maintenance.
Technical Support
You will find telephone numbers for other countries for technical support in the Internet under
http://www.siemens.com/automation/service&support
Fundamentals
4Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Preface
Information on structure and contents
"Fundamentals" and "Job planning" Programming Manual
The description of the NC programming is divided into two manuals:
1. Fundamentals
This "Fundamentals" Programming Manual is intended for use by skilled machine
operators with the appropriate expertise in drilling, milling and turning operations. Simple
programming examples are used to explain the commands and statements which are
also defined according to DIN 66025.
2. Job planning
The "Job planning" Programming Manual is intended for use by technicians with in-depth,
comprehensive programming knowledge. By virtue of a special programming language,
the SINUMERIK control enables the user to program complex workpiece programs (e.g.
for free-form surfaces, channel coordination, ...) and makes programming of complicated
operations easy for technologists.
Availability of the described NC language elements
All NC language elements described in the manual are available for the SINUMERIK
840D sl. The availability regarding SINUMERIK 828D can be found in table "Operations:
Availability for SINUMER
A Appendix................................................................................................................................................ 551
A.1 List of abbreviations .................................................................................................................. 551
sary ................................................................................................................................................ 561
In order that the machine or the controller can work with the positions specified in the NC
program, these specifications have to be made in a reference system that can be transferred
to the directions of motion of the machine axes. A coordinate system with the axes X, Y and
Z is used for this purpose.
DIN 66217 stipulates that machine tools must use clockwise, right-angled (Cartesian)
coordinate systems.
<
=;
r
1
=
;<
r
r
r:
;
<
Workpiece coordinate system for turning
The workpiece zero (W) is the origin of the workpiece coordinate system.
Sometimes it is advisable or even necessary to work with negative position specifications.
For this reason, positions that are to the left of the zero point are assigned a negative sign ("-").
The axes in the coordinate system are assigned dimensions. In this way, it is possible to
clearly describe every point in the coordinate system and therefore every workpiece position
through the direction (X, Y and Z) and three numerical values The workpiece zero always
has the coordinates X0, Y0, and Z0.
Position specifications in the form of Cartesian coordinates
To simplify things, we will only consider one plane of the coordinate system in the following
example, the X/Y plane:
Polar coordinates can be used instead of Cartesian coordinates to describe workpiece
positions. This is useful when a workpiece or part of a workpiece has been dimensioned with
radius and angle. The point from which the dimensioning starts is called the "pole".
Position specifications in the form of polar coordinates
Polar coordinates are made up of the polar radius and the polar angle.
The polar radius is the distance between the pole and the position.
The polar angle is the angle between the polar radius and the horizontal axis of the working
plane. Negative polar angles are in the clockwise direction, positive polar angles in the
counterclockwise direction.
Example
<
3
3
r
3ROH
r
;
Points P1 and P2 can then be described – with reference to the pole – as follows:
In production drawings, the dimensions often do not refer to a zero point, but to another
workpiece point. So that these dimensions do not have to be converted, they can be
specified in incremental dimensions. In this method of dimensional notation, a position
specification refers to the previous point.
Applied to tool movement this means:
The incremental dimensions describe the distance the tool is to travel.
Example: Turning
;
3
33
3
=
In incremental dimensions, the following position specifications result for points P2 to P4:
Position Position specification in incremental dimensions The specification refers to:
P2 X15 Z-7.5 P1
P3 Z-10 P2
P4 X20 Z-10 P3
Note
With
DIAMOF or DIAM90 active, the set distance in incremental dimensions (G91) is
programmed as a radius dimension.
Fundamentals
20Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Fundamental Geometrical Principles
1.2 Working planes
Example: Milling
The position specifications for points P1 to P3 in incremental dimensions are:
<
3
3
In incremental dimensions, the following position specifications result for points P1 to P3:
Position Position specification in incremental
dimensions
P1 X20 Y35 Zero point
P2 X30 Y20 P1
P3 X20 Y -35 P2
1.2 Working planes
An NC program must contain information about the plane in which the work is to be
performed. Only then can the control unit calculate the correct tool offsets during the
execution of the NC program. The specification of the working plane is also relevant for
certain types of circular-path programming and polar coordinates.
3
;
The specification refers to:
Two coordinate axes define a working plane. The third coordinate axis is perpendicular to
this plane and determines the infeed direction of the tool (e.g. for 2D machining).
A distinction is made between the following coordinate systems:
● Machine coordinate system (MCS) (Page 24) with the machine zero M
● Basic coordinate system (BCS) (Page 27)
● Basic zero system (BZS) (Page 29)
● Settable zero system (SZS) (Page 30)
● Workpiece coordinate system (WCS) (Page 31) with the workpiece zero W
1.4.1 Machine coordinate system (MCS)
The machine coordinate system comprises all the physically existing machine axes.
Reference points and tool and pallet changing points (fixed machine points) are defined in
the machine coordinate system.
=P
0
<P
;P
If programming is performed directly in the machine coordinate system (possible with some
G functions), the physical axes of the machine respond directly. Any workpiece clamping that
is present is not taken into account.
Note
If there are various machine coordinate systems (e.g. 5-axis transformation), then an internal
transformation is used to map the machine kinematics on the coordinate system in which the
programming is performed.
Fundamentals
24Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Fundamental Geometrical Principles
1.4 Coordinate systems
Three-finger rule
The orientation of the coordinate system relative to the machine depends on the machine
type. The axis directions follow the so-called "three-finger rule" of the right hand (according
to DIN 66217).
Seen from in front of the machine, the middle finger of the right hand points in the opposite
direction to the infeed of the main spindle. Therefore:
● the thumb points in the +X direction
● the index finger points in the +Y direction
● the middle finger points in the +Z direction
=
<
;
Figure 1-1 "Three-finger rule"
Rotary motions around the coordinate axes X, Y and Z are designated A, B and C. If the
rotary motion is in a clockwise direction when looking in the positive direction of the
coordinate axis, the direction of rotation is positive:
Position of the coordinate system in different machine types
The position of the coordinate system resulting from the "three-finger rule" can have a
different orientation for different machine types. Here are a few examples:
=
&
&
%
<
<
;
;
<
=
=
;
%
=
;
%
&
&
<
Fundamentals
26Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Fundamental Geometrical Principles
1.4 Coordinate systems
1.4.2 Basic coordinate system (BCS)
The basic coordinate system (BCS) consists of three mutually perpendicular axes (geometry
axes) as well as other special axes, which are not interrelated geometrically.
Machine tools without kinematic transformation
BCS and MCS always coincide when the BCS can be mapped onto the MCS without
kinematic transformation (e.g. 5-axis transformation, TRANSMIT/TRACYL/TRAANG).
On such machines, machine axes and geometry axes can have the same names.
<
0DFKLQH
FRRUGLQDWH
V\VWHP %&6
=
Figure 1-2 MCS = BCS without kinematic transformation
0DFKLQH]HURSRLQW
Machine tools with kinematic transformation
BCS and MCS do not coincide when the BCS is mapped onto the MCS with kinematic
transformation (e.g. 5-axis transformation, TRANSMIT/TRACYL/TRAANG).
On such machines the machine axes and geometry axes must have different names.
Figure 1-3 Kinematic transformation between the MCS and BCS
Machine kinematics
The workpiece is always programmed in a two or three dimensional, right-angled coordinate
system (WCS). However, such workpieces are being programmed ever more frequently on
machine tools with rotary axes or linear axes not perpendicular to one another. Kinematic
transformation is used to represent coordinates programmed in the workpiece coordinate
system (rectangular) in real machine movements.
References
Function Manual Expansion Functions; M1: Kinematic transformation
=
%&6
;
0&6
%DVLFFRRUGLQDWHV\VWHP%&6
0DFKLQHFRRUGLQDWHV\VWHP0&6
=
0&6
Function Manual, Special Functions; F2: Multi-axis transformations
Fundamentals
28Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Fundamental Geometrical Principles
1.4 Coordinate systems
1.4.3 Basic zero system (BZS)
The basic zero system (BZS) is the basic coordinate system with a basic offset.
<
%DVLFRIIVHW
<
;
%DVLF]HURV\VWHP%=6
=
;
%DVLFFRRUGLQDWHV\VWHP%&6
=
Basic offset
References
The basic offset describes the coordinate transformation between BCS and BZS. It can be
used, for example, to define the palette window zero.
The basic offset comprises:
● External zero offset
● DRF offset
● Overlaid movement
● Chained system frames
● Chained basic frames
Function Manual, Basic Functions; Axes, Coordinate Systems, Frames (K2)
The "settable zero system" (SZS) results from the basic zero system (BZS) through the
settable zero offset.
Settable zero offsets are activated in the NC program with the G commands
G505...G599 as follows:
<
**
<
;
=
;
%DVLF]HURV\VWHP%=6
=
6HWWDEOH
]HURV\VWHP6=6
G54...G57 and
If no programmable coordinate transformations (frames) are active, then the "settable zero
system" is the workpiece coordinate system (WCS).
Programmable coordinate transformations (frames)
Sometimes it is useful or necessary within an NC program, to move the originally selected
workpiece coordinate system (or the "settable zero system") to another position and, if
required, to rotate it, mirror it and/or scale it. This is performed using programmable
coordinate transformations (frames).
See Section: "Coordinate transformations (frames)"
Fundamentals
30Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Note
Programmable coordinate transformations (frames) always refer to the "settable zero
system".
Fundamental Geometrical Principles
1.4 Coordinate systems
1.4.5 Workpiece coordinate system (WCS)
The geometry of a workpiece is described in the workpiece coordinate system (WCS). In
other words, the data in the NC program refers to the workpiece coordinate system.
The workpiece coordinate system is always a Cartesian coordinate system and assigned to
a specific workpiece.
1.4.6 What is the relationship between the various coordinate systems?
The example in the following figure should help clarify the relationships between the various
coordinate systems:
3URJUDPPDEOH
FRRUGLQDWHWUDQVIRUPDWLRQ
]
6=6
]
]
\
:&6
[
\
[
]
\
:&6
[
\
:RUNSLHFH
[
3DOOHW
:RUNSLHFH
]
0&6
%&6
%DVLFRIIVHW
]
6HWWDEOHZRUNRIIVHW
%=6
6HWWDEOH
ZRUNRIIVHW
\
*
\
*
6=6
[
[
3URJUDPPDEOH
FRRUGLQDWHWUDQVIRUPDWLRQ
①A kinematic transformation is not active, i.e. the machine coordinate system and the basic
coordinate system coincide.
②The basic zero system (BZS) with the pallet zero result from the basic offset.
③The "settable zero system" (SZS) for Workpiece 1 or Workpiece 2 is specified by the settable
zero offset G54 or G55.
④The workpiece coordinate system (WCS) results from programmable coordinate
Each NC program has a different name; the name can be chosen freely during program
creation, taking the following conditions into account:
● The name should not have more than 24 characters as only the first 24 characters of a
program name are displayed on the NC.
● Permissible characters are:
– Letters: A...Z, a...z
2
– Numbers: 0...9
– Underscores: _
● The first two characters should be:
– Two letters
Or
– An underscore and a letter
If this condition is satisfied, then an NC program can be called as subprogram from
another program just by specifying the program name. However, if the program name
starts with a number then the subprogram call is only possible via the
For further restrictions on the program names, see "Identifier (Page 402)".
Files in punch tape format
Externally created program files that are read into the NC via the V.24 interface must be
present in punch tape format.
The following additional rules apply for the name of a file in punch tape format:
● The program name must begin with "%":
References
%<Name>
● The program name must have a 3-character identifier:
%<Name>_xxx
Examples:
● %_N_SHAFT123_MPF
● %Flange3_MPF
Note
The name of a file stored internally in the NC memory starts with "_N_".
For further information on transferring, creating and saving part programs, see the Operating
Manual.
Fundamentals
34Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Fundamental Principles of NC Programming
2.2 Structure and contents of an NC program
2.2 Structure and contents of an NC program
2.2.1 Blocks and block components
Blocks
An NC program consists of a sequence of NC blocks. Each block contains the data for the
execution of a step in the workpiece machining.
Block components
NC blocks consist of the following components:
● Commands (statements) according to DIN 66025
● Elements of the NC high-level language
Commands according to DIN 66025
The commands according to DIN 66025 consist of an address character and a digit or
sequence of digits representing an arithmetic value.
Address character (address)
The address character (generally a letter) defines the meaning of the command.
Examples:
Address character Meaning
G G function (preparatory function)
X Position data for the X axis
S Spindle speed
Digit sequence
The digit sequence is the value assigned to the address character. The sequence of digits
can contain a sign and decimal point. The sign always appears between the address letter
and the sequence of digits. Positive signs (+) and leading zeroes (0) do not have to be
specified.
As the command set according to DIN 66025 is no longer adequate for the programming of
complex machining sequences in modern machine tools, it has been extended by the
elements of the NC high-level language.
These include, for example:
● Commands of the NC high-level language
In contrast to the commands according to DIN 66025, the commands of the NC high-level
language consist of several address letters, e.g.
–
OVR for speed override
–
SPOS for spindle positioning
● Identifiers (defined names) for:
– System variables
– User-defined variables
– Subprograms
– Keywords
– Jump markers
– Macros
Note
An identifier must be unique and cannot be used for different objects.
Modal commands retain their validity with the programmed value (in all following blocks)
until:
– A new value is programmed under the same command
– A command is programmed that revokes the effect of the previously valid command
● Non-modal
Non-modal commands only apply for the block in which they were programmed.
Fundamentals
36Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Fundamental Principles of NC Programming
2.2 Structure and contents of an NC program
End of program
The last block in the execution sequence contains a special word for the end of program: M2,
M17 or M30.
2.2.2 Block rules
Start of block
NC blocks can be identified at the start of the block by block numbers. These consist of the
character "N" and a positive integer, e.g.
N40 ...
The order of the block numbers is arbitrary, however, block numbers in rising order are
recommended.
Note
Block numbers must be unique within a program in order to achieve an unambiguous result
when searching.
End of block
Block length
A block ends with the character LF (LINE FEED = new line).
Note
The LF character does not have to be written. It is generated automatically by the line
change.
A block can contain a maximum of 512 characters (including the comment and end-of-block
character LF).
Note
Three blocks of up to 66 characters each are normally displayed in the current block display
on the screen. Comments are also displayed. Messages are displayed in a separate
message window.
In order to keep the block structure as clear as possible, the statements in a block should be
arranged in the following order:
N… G… X… Y… Z… F… S… T… D… M… H…
Address Meaning
N
G
X,Y,Z
F
S
T
D
M
H
Note
Address of block number
Preparatory function
Positional data
Feedrate
Spindle speed
Tool
Tool offset number
Additional function
Auxiliary function
Certain addresses can be used repeatedly within a block, e.g.
G…, M…, H…
2.2.3 Value assignments
Values can be assigned to the addresses. The following rules apply:
● An "=" sign must be inserted between the address and the value if:
– The address comprises more than one letter
– The value includes more than one constant.
The "="-sign can be omitted if the address is a single letter and the value consists of only
one constant.
● Signs are permitted.
● Separators are permitted after the address letter.
Examples:
X10
X1=10
X=10*(5+SIN(37.5))
Note
Value assignment (10) to address X, "=" not required
Value assignment (10) to address (X) with numeric extension (1),
"=" required
Value assignment by means of a numeric expression, "=" required
A numeric extension must always be followed by one of the special characters "=", "(", "[",
")", "]", ",", or an operator, in order to distinguish an address with numeric extension from an
address letter with a value.
Fundamentals
38Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Fundamental Principles of NC Programming
2.2 Structure and contents of an NC program
2.2.4 Comments
To make an NC program easier to understand, comments can be added to the NC blocks.
A comment is at the end of a block and is separated from the program section of the NC
block by a semicolon (";").
Example 1:
Program code Comments
N10 G1 F100 X10 Y20 ; Comment to explain the NC block
Example 2:
Program code Comment
N10 ; Company G&S, order no. 12A71
N20 ; Program written by H. Smith, Dept. TV 4 ;on November
21, 1994
N50 ; Section no. 12, housing for submersible pump type TP23A
Note
Comments are stored and appear in the current block display when the program is running.
2.2.5 Skipping blocks
NC blocks, which are not to be executed in every program pass (e.g. execute a trial program
run), can be skipped.
Programming
Blocks, which are to be skipped are marked with an oblique "/" in front of the block number.
Several consecutive blocks can also be skipped. The statements in the skipped blocks are
not executed; the program continues with the next block, which is not skipped.
The programming of the individual operation steps in the NC language generally represents
only a small proportion of the work in the development of an NC program.
Programming of the actual instructions should be preceded by the planning and preparation
of the operation steps. The more accurately you plan in advance how the NC program is to
be structured and organized, the faster and easier it will be to produce a complete program,
which is clear and free of errors. Clearly structured programs are especially advantageous
when changes have to be made later.
As every part is not identical, it does not make sense to create every program in the same
way. However, the following procedure has shown itself to be suitable in the most cases.
Procedure
1. Prepare the workpiece drawing
– Define the workpiece zero
– Draw the coordinate system
3
– Calculate any missing coordinates
2. Define the machining sequence
– Which tools are used when and for the machining of which contours?
– In which order will the individual elements of the workpiece be machined?
– Which individual elements are repeated (possibly also rotated) and should be stored in
a subroutine?
– Are there contour sections in other part programs or subroutines that could be used
for the current workpiece?
– Where are zero offsets, rotating, mirroring and scaling useful or necessary (frame
Define all machining operations step-by-step, e.g.
– Rapid traverse movements for positioning
– Tool change
– Define the machining plane
– Retraction for checking
– Switch spindle, coolant on/off
– Call up tool data
– Feed
– Path correction
– Approaching the contour
– Retraction from the contour
– etc.
4. Compile machining steps in the programming language
– Write each individual step as an NC block (or NC blocks).
5. Combine the individual steps into a program
3.2 Available characters
The following characters are available for writing NC programs:
● Upper-case characters:
A, B, C, D, E, F, G, H, I, J, K, L, M, N,(O),P, Q, R, S, T, U, V, W, X, Y, Z
● Lower-case characters:
a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z
● Numbers:
0, 1, 2, 3, 4, 5, 6, 7, 8, 9
● Special characters:
See the table below.
Special characters Meaning
% Program start character (used only for writing programs on an external PC)
( For bracketing parameters or expressions
) For bracketing parameters or expressions
[ For bracketing addresses or indexes
] For bracketing addresses or indexes
< Less than
Fundamentals
44Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Creating an NC program
3.3 Program header
Special characters Meaning
> Greater than
: Main block, end of label, chain operator
= Assignment, part of equation
/ Division, block suppression
* Multiplication
+ Addition
- Subtraction, minus sign
" Double quotation marks, identifier for character string
' Single quotation marks, identifier for special numerical values: hexadecimal,
binary
$ System variable identifiers
s_ Underscore, belonging to letters
? Reserved
! Reserved
. Decimal point
, Comma, parameter separator
; Comment start
& Format character, same effect as space character
LF End of block
Tab character Separator
Blank Separator (blank)
Note
Take care to differentiate between the letter "O" and the digit "0".
Note
No distinction is made between upper- and lower-case characters (exception: Tool call).
Note
Non-printable special characters are treated like blanks.
3.3 Program header
The NC blocks that are placed in front of the actual motion blocks for the machining of the
workpiece contour, are called the program header.
The program header contains information/statements regarding:
Program example 3 is intended for the machining of a workpiece on a vertical milling
machine. It contains surface and side milling as well as drilling.
Dimension drawing of the workpiece
Note
In order that the program can run on the machine, the machine data must have been set
appropriately (→ machine manufacturer!).
ෘෘ
Figure 3-2 Side view
[r
5
r
5
Figure 3-3 Top view
Fundamentals
50Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Creating an NC program
3.4 Program examples
Program example 3
Program code Comment
N10 T="PF60" ; Preselection of the tool with
name PF60.
N20 M6 ; Load the tool into the spindle.
N30 S2000 M3 M8 ; Speed, direction of rotation,
cooling on.
N40 G90 G64 G54 G17 G0 X-72 Y-72 ; Basic settings of the
geometry and approach
starting point.
N50 G0 Z2 ; Z axis at safety clearance.
N60 G450 CFTCP ; Behavior with active G41/G42.
N70 G1 Z-10 F3000 ; Milling tool at working depth
with feedrate = 3000 mm/min.
N80 G1 G41 X-40 ; Activation of the milling
tool radius compensation.
N90 G1 X-40 Y30 RND=10 F1200 ; Travel to the contour with
feedrate = 1200 mm/min.
N100 G1 X40 Y30 CHR=10
N110 G1 X40 Y-30
N120 G1 X-41 Y-30
N130 G1 G40 Y-72 F3000 ; Deselection of the milling
tool radius compensation.
N140 G0 Z200 M5 M9 ; Retraction of the milling
tool, spindle + cooling off.
N150 T="SF10" ; Preselection of the tool with
name SF10.
N160 M6 ; Load the tool into the
spindle.
N170 S2800 M3 M8 ; Speed, direction of rotation,
cooling on.
N180 G90 G64 G54 G17 G0 X0 Y0 ; Basic settings of the
geometry and approach
starting point.
N190 G0 Z2
N200 POCKET4(2,0,1,-5,15,0,0,0,0,0,800,1300,0,21,5,,,2,0.5) ; Call of the pocket milling
N270 MCALL CYCLE82(2,0,1,-2.6,,0) ; Modal call of the drilling
cycle.
N280 POSITION: ; Jump mark for repetition.
N290 HOLES2(0,0,25,0,45,6) ; Position pattern for
drilling.
N300 ENDLABEL: ; End identifier for
repetition.
N310 MCALL ; Resetting of the modal call.
N320 G0 Z200 M5 M9
N330 T="SPB5" ; Call twist drill D 5 mm.
N340 M6
N350 S2600 M3 M8
N360 G90 G60 G54 G17 X25 Y0
N370 MCALL CYCLE82(2,0,1,-13.5,,0) ; Modal call of the drilling
cycle.
N380 REPEAT POSITION ; Repetition of the position
description from centering.
N390 MCALL ; Resetting of the drilling
cycle
N400 G0 Z200 M5 M9
N410 M30 ; End of program.
Fundamentals
52Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool change
Tool change method
In chain, rotary-plate and box magazines, a tool change normally takes place in two stages:
1. The tool is sought in the magazine with the T command.
2. The tool is then loaded into the spindle with the M command.
In circular magazines on turning machines, the T command carries out the entire tool
change, that is, locates and inserts the tool.
Conditions
Note
The tool change method is set via a machine data (→ machine manufacturer).
Together with the tool change:
● The tool offset values stored under a D number have to be activated.
4
● The appropriate working plane has to be programmed (basic setting: G18). This ensures
that the tool length compensation is assigned to the correct axis.
Tool management (option)
The programming of the tool change is performed differently for machines with active tool
management (option) than for machines without active tool management. The two options
are therefore described separately.
4.1 Tool change without tool management
4.1.1 Tool change with T command
Function
There is a direct tool change when the T command is programmed.
T: Command for tool selection including tool change and activation of the tool
offset
<n>: Spindle number as address extension
Note:
The possibility of programming a spindle number as address extension
depends on the configuration of the machine;
→ see machine manufacturer's specifications.
<number>:
T0: Command for deselection of the active tool
Number of the tool
Range of values: 0 - 32000
Example
Program code Comment
N10 T1 D1 ; Loading of tool T1 and activation of the tool offset D1.
...
N70 T0 ; Deselect tool T1.
...
4.1.2 Tool change with M6
Function
The tool is selected when the T command is programmed. The tool only becomes active with
M6 (including tool offset).
Application
For milling machines with chain, rotary-plate or box magazines.
Fundamentals
54Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool change
4.1 Tool change without tool management
Syntax
Tool selection:
T<number>
T=<number>
T<n>=<number>
Tool change:
M6
Tool deselection:
T0
T0=<number>
Meaning
T: Command for the tool selection
<n>: Spindle number as address extension
Note:
The possibility of programming a spindle number as address extension
depends on the configuration of the machine;
→ see machine manufacturer's specifications.
<number>:
M6: M function for the tool change (according to DIN 66025)
T0: Command for deselection of the active tool
Number of the tool
Range of values: 0 - 32000
M6 activates the selected tool (T…) and the tool offset (D...).
The optional "Tool management" function ensures that at any given time the correct tool is in
the correct location and that the data assigned to the tool are up to date. It also allows fast
tool changes and avoids both scrap by monitoring the tool service life and machine
downtimes by using spare tools.
Tool name
On a machine tool with active tool management, the tools must be assigned a name and
number for clear identification (e.g. "Drill", "3").
The tool call can then be via the tool name, e.g.
T="Drill"
Note
The tool name may not contain any special characters.
4.2.1 Tool change with T command with active tool management (option)
Function
There is a direct tool change when the T command is programmed.
Application
For turning machines with circular magazine.
Syntax
Tool selection:
T=<location>
T=<name>
T<n>=<location>
T<n>=<name>
Tool deselection:
T0
Fundamentals
56Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool change
4.2 Tool change with tool management (option)
Significance
T=:
<n>: Spindle number as address extension
T0: Command for the tool deselection (magazine location not occupied)
Note
If the selected magazine location is not occupied in a tool magazine, the command acts as
for
T0. The selection of the next occupied magazine location can be used to position the
empty location.
Command for tool change and activation of the tool offset
The following specifications are possible:
<location>: Number of the magazine location
<name>: Name of tool
Note:
The correct notation (upper/lower case) must be observed when
programming a tool name.
Note:
The possibility of programming a spindle number as address extension depends
on the configuration of the machine; → see machine manufacturer's
specifications)
Example
A circular magazine has locations 1 to 20 with the following tool assignment:
Location Tool Tool group State
1 Drill, duplo no. = 1 T15 Blocked
2 Not occupied
3 Drill, duplo no. = 2 T10 Enabled
4 Drill, duplo no. = 3 T1 Active
5 ... 20 Not occupied
The following tool call is programmed in the NC program:
N10 T=1
The call is processed as follows:
1. Magazine location 1 is considered and the tool identifier determined.
2. The tool management recognizes that this tool is blocked and therefore cannot be used.
3. A tool search for T="drill" is initiated in accordance with the search method set:
"Find the active tool; or else, select the one with the next highest duplo number."
4. The following usable tool is then found:
"Drill", duplo no. 3 (at magazine location 4)
This completes the tool selection process and the tool change is initiated.
Note
If the "Select the first available tool from the group" search method is employed, the
sequence must first be defined within the tool group being loaded. In this case group T10
is loaded, as T15 is blocked.
When the strategy "Take the first tool with "active" status from the group" is applied, T1 is
loaded.
4.2.2 Tool change with M6 with active tool management (option)
Function
The tool is selected when the T command is programmed. The tool only becomes active with
M6 (including tool offset).
Application
For milling machines with chain, rotary-plate or box magazines.
Syntax
Tool selection:
T=<location>
T=<name>
T<n>=<location>
T<n>=<name>
Tool change:
M6
Tool deselection:
T0
Fundamentals
58Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool change
4.2 Tool change with tool management (option)
Significance
T=:
<n>: Spindle number as address extension
M6: M function for the tool change (according to DIN 66025)
T0: Command for tool deselection (magazine location not occupied)
Note
Command for the tool selection
The following specifications are possible:
<location>: Number of the magazine location
<name>: Name of tool
Note:
The correct notation (upper/lower case) must be used when
programming a tool name.
Note:
The possibility of programming a spindle number as an address extension
depends on the configuration of the machine; → see machine manufacturer's
specifications.
M6 activates the selected tool (T…) and the tool offset (D...).
Example
If the selected magazine location is not occupied in a tool magazine, the command acts as
for
T0. The selection of the next occupied magazine location can be used to position the
empty location.
Program code Comment
N10 T=1 M6 ; Loading of the tool from magazine location 1.
N20 D1 ; Selection of tool length compensation.
N30 G1 X10 ... ; Machining with tool T=1.
...
N70 T="Drill" ; Preselection of the tool with name "Drill".
The behavior with faulty T programming depends on the configuration of the machine:
MD22562 TOOL_CHANGE_ERROR_MODE
Bit Value Meaning
0 Basic setting!
7
With the T programming, a check is made immediately as to whether the NCK
recognizes the T number. If not, an alarm is triggered.
1 The programmed T number will only be checked following D selection. If the NCK
does not recognize the tool number, an alarm is issued during D selection.
This response is desirable if, for example, tool programming is also intended to
achieve positioning and the tool data is not necessarily available (circular magazine).
Fundamentals
60Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool offsets
5.1 General information about the tool offsets
Workpiece dimensions are programmed directly (e.g. according to the production drawing).
Therefore, tool data such as milling tool diameter, cutting edge position of the turning tool
(counterclockwise/clockwise turning tool) and tool length does not have to be taken into
consideration when creating the program.
The control corrects the travel path
When machining a workpiece, the tool paths are controlled according to the tool geometry
such that the programmed contour can be machined using any tool.
In order that the control can calculate the tool paths, the tool data must be entered in the tool
compensation memory of the control. Only the required tool (
data record (
While the program is being processed, the control fetches the offset data it requires from the
tool compensation memory and corrects the tool path individually for different tools:
The tool length compensation compensates for the differences in length between the tools
used.
The tool length is the distance between the toolholder reference point and the tool tip:
F
F
F
F
This length is measured and entered in the tool compensation memory of the control
together with definable wear values. From this data, the control calculates the traversing
movements in the infeed direction.
Note
The offset value for the tool length is dependent upon the spatial orientation of the tool.
Fundamentals
62Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool offsets
5.3 Tool radius compensation
5.3 Tool radius compensation
The contour and tool path are not identical. The milling tool or cutting edge center must
travel along a path that is equidistant from the contour. To do this, the control requires data
about the tool form (radius) from the tool compensation memory.
Depending on the radius and the machining direction, the programmed tool center point path
is offset during the program processing in such a way that the tool edge travels exactly along
the programmed contour:
(TXLGLVWDQW
(TXLGLVWDQW
References
Note
Tool radius compensation is applied according to the default CUT2D or CUT2DF (see "2D
tool compensation (CUT2D, CUT2DF) (Page 296)").
The various options for the tool radius compensation are described in detail in Section "Tool
radius compensations".
The following data must be available in the tool compensation memory of the controller for
each tool edge:
● Tool type
● Cutting edge position
● Tool geometry variables (length, radius)
This data is entered as tool parameters (max. 25). Which parameters are required for a tool
depends on the tool type. Any tool parameters that are not required must be set to "zero"
(corresponds to the default setting of the system).
Note
Values that have been entered once in the compensation memory are included in the
processing at each tool call.
Tool type
The tool type (drill, milling or turning tool) determines which geometry data is necessary and
how this is taken into account.
Cutting edge position
The cutting edge position describes the position of the tool tip P in relation to the cutting
edge center point S.
The cutting edge position is required together with the cutting edge radius for the calculation
of the tool radius compensation for turning tools (tool type 5xx).
3 WRROWLS
5 UDGLXV
6 FXWWLQJHGJH
FHQWHUSRLQW
)
/
5
6
3
/
Fundamentals
64Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool offsets
5.5 Tool types
Tool geometry variables (length, radius)
)
/HQJWK
5DGLXV
The tool geometry variables consist of several components (geometry, wear). The controller
computes the components to a certain dimension (e.g. overall length 1, total radius). The
respective overall dimension becomes effective when the compensation memory is
activated.
How these values are calculated in the axes is determined by the tool type and the current
plane (
G17/G18/G19).
References
Function Manual, Basic Functions; Tool Offsets (W1); Section "Tool edge"
5.5 Tool types
5.5.1 General information about the tool types
Tools are divided into tool types. Each tool type is assigned a 3-digit number. The first digit
assigns the tool type to one of the following groups depending on the technology used:
Tool type Tool group
1xy Milling tools (Page 66)
2xy Drills (Page 68)
3xy Reserved
4xy Grinding tools (Page 69)
5xy Turning tools (Page 70)
6xy Reserved
7xy Special tools (Page 71) such as a slotting saw
The following tool types are available in the "Drills" group:
200 Twist drill
205 Drill
210 Boring bar
220 Center drill
230 Countersink
231 Counterbore
240 Tap regular thread
241 Tap fine thread
242 Tap Whitworth thread
250 Reamer
Tool parameters
The following figure provides an overview of which tool parameters (DP...) for drills are
entered in the compensation memory:
(QWULHVLQ
WRROSDUDPHWHUV
'3
'3
:HDUYDOXHV
DVUHTXLUHG
6HWUHPDLQLQJ
YDOXHVWR
Note
[\
/HQJWK
(IIHFW
*
*
*
/HQJWK
/HQJWKLQ=
/HQJWKLQ<
/HQJWKLQ;
)
)7RROKROGHU
UHIHUHQFHSRLQW
Brief description of the tool parameters can be found on the user interface.
For further information, see:
References:
Function Manual, Basic Functions; Tool Offset (W1)
Fundamentals
68Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool offsets
5.5 Tool types
5.5.4 Grinding tools
The following tool types are available in the "Grinding tools" group:
400 Surface grinding wheel
401 Surface grinding wheel with monitoring
402 Surface grinding wheel without monitoring without base dimension (TOOLMAN)
403 Surface grinding wheel with monitoring without base dimension for grinding wheel
peripheral speed GWPS
410 Facing wheel
411 Facing wheel (TOOLMAN) with monitoring
412 Facing wheel (TOOLMAN) without monitoring
413 Facing wheel with monitoring without base dimension for grinding wheel peripheral
speed GWPS
490 Dresser
Tool parameters
The following figure provides an overview of which tool parameters (DP...) for grinding tools
are entered in the compensation memory:
(QWULHVLQWKHWRRO
SDUDPHWHUV
'3
'3
'3
'3
'3
7RROQRVHSRVLWLRQ
:HDUYDOXHV
FRUUHVSRQGWRWKH
UHTXLUHPHQW
2WKHUYDOXHVVKRXOG
EHVHWWR
(IIHFW
*
*
*
Note
3RVLWLRQ
/HQJWK
/HQJWK
5DGLXV
/HQJWKLQ<
/HQJWKLQ;
5DGLXVLQ;<
/HQJWKLQ;
/HQJWKLQ=
5DGLXVLQ=;
/HQJWKLQ=
/HQJWKLQ<
5DGLXVLQ<=
6SLQGOHQXPEHU
73*
&KDLQLQJUXOH
73*
0LQLPXPZKHHOUDGLXV
73*
0LQZKHHOZLGWK
73*
$FWXDOZKHHOZLGWK
73*
0D[LPXPVSHHG
73*
73*
0D[SHULSKHUDOVSHHG
$QJOHRIWKHLQFOLQHGZKHHO
73*
3DUDPHWHU1RIRUUDGLXVFDOFXODWLRQ
73*
)7RROFDUULHUUHIHUHQFHSRLQW
)
5DGLXV
)
*HRPHWU\
/HQJWK
%DVLV
%DVLVOHQJWK
/HQJWK
*HRPHWU\
/HQJWK
Brief description of the tool parameters can be found on the user interface.
For further information, see:
References:
Function Manual, Basic Functions; Tool Offset (W1)
Brief description of the tool parameters can be found on the user interface.
For further information, see:
References:
Function Manual, Basic Functions; Tool Offset (W1)
5.5.7 Chaining rule
The geometry tool length compensations, wear and base dimension can be chained for both
the left and the right tool nose radius compensation, i.e. if the tool length compensations are
changed for the left cutting edge, then the values are also automatically entered for the right
cutting edge and vice versa.
References
Function Manual, Extended Functions; Grinding (W4)
Fundamentals
72Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool offsets
5.6 Tool offset call (D)
5.6 Tool offset call (D)
Function
Cutting edges 1 to 8 (with active TOOLMAN 12) of a tool can be assigned different tool offset
data records (e.g. different offset values for the left and right cutting edge of a grooving tool).
Activation of the offset data (including the data for the tool length compensation) of a special
cutting edge is performed by calling the D number. When
tool have no effect.
D0 is programmed, offsets for the
Syntax
Meaning
A tool radius compensation must also be activated via
Note
G41/G42.
Tool length offsets take immediate effect when the D number is programmed. If no D number
is programmed, the default setting defined via the machine data is active for a tool change
(→ see machine manufacturer's specifications).
Activation of a tool offset data record:
D<number>
Activate the tool radius compensation:
G41 ...
G42 ...
Deactivation of the tool offsets:
D0
G40
D: Command for the activation of an offset data record for the active tool
The tool length compensation is applied with the first programmed traverse
of the associated length compensation axis.
Notice:
A tool length compensation can also take effect without D programming,
when the automatic activation of a tool edge has been configured for the tool
change (→ see machine manufacturer's specifications).
<number>:
The tool offset data record to be activated is specified via the <number>
parameter.
The type of D programming depends on the configuration of the machine
(see paragraph "Type of D programming").
Range of values: 0 - 32000
D0: Command for the deactivation of the offset data record for the active tool
: Command for the activation of the tool radius compensation with machining
direction left of the contour
G42: Command for the activation of the tool radius compensation with machining
direction right of the contour
G40: Command for the deactivation of the tool radius compensation
Note
The tool radius compensation is described in detail in the section "Tool radius compensation"
section.
Type of D programming
The type of D programming is defined via machine data.
This can be done as follows:
● D number = cutting edge number
Examples
D numbers ranging from 1 to max. 12 are available for every tool T<number> or
T="Name" (with TOOLMAN). These D numbers are assigned directly to the tool cutting
edges. A compensation data record ($TC_DPx[t,d]) belongs to each D number (= cutting
edge number).
● Free selection of D numbers
The D numbers can be freely assigned to the cutting edge numbers of a tool. The upper
limit for the D numbers that can be used is limited by a machine data.
● Absolute D number without reference to the T number
Independence between D number and T number can be selected in systems without tool
management. The reference of T number, cutting edge and offset by the D number is
defined by the user. The range of D numbers is between 1 and 32000.
References:
Function Manual, Basic Functions; Tool Offset (W1),
Function Manual, Tool Management, Section: "Variants of D-number assignments"
Example 1: Tool change with T command (turning)
Program code Comment
N10 T1 D1 ; Load tool T1 and activate tool offset data record D1 of T1.
N11 G0 X... Z... ; The tool length compensations are applied.
N50 T4 D2 ; Load tool T4 and activate tool offset data record D2 of T4.
...
N70 G0 Z... D1 ; Activate other cutting edge D1 for tool T4.
Fundamentals
74Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool offsets
5.7 Change in the tool offset data
Example 2: Different offset values for the left and right cutting edge of a grooving tool
N10 T2
N20 G0
N30 G1
X35 Z-20
D1 X10
N40...
-20
D6 Z-5
-5
5.7 Change in the tool offset data
Effectiveness
X
10
Z
A change in the tool offset data takes effect the next time the T or D number is programmed.
Set tool offset data to be active immediately
The following machine data can be used to specify that entered tool offset data takes effect
immediately:
MD9440 $MM_ACTIVATE_SEL_USER
WARNING
Risk of collision
If MD9440 is set, tool offsets resulting from changes in tool offset data during the part
program stop, are applied when the part program is continued.
The user can use the commands TOFFL/TOFF and TOFFR to modify the effective tool length or
the effective tool radius in the NC program, without changing the tool offset data stored in the
compensation memory.
These programmed offsets are deleted again at the end of the program.
Tool length offset
Depending on the type of programming, programmed tool length offsets are assigned either
to the tool length components L1, L2 and L3 (
to the geometry axes (
change (
G17/G18/G19 ↔ G17/G18/G19):
TOFF). The programmed offsets are treated accordingly for a plane
● If the offset values are assigned to the tool length components, the directions in which the
programmed offsets apply, are replaced accordingly.
● If the offset values are assigned to the geometry axes, a plane change does not effect the
assignment in relation to the coordinate axes.
TOFFL) stored in the compensation memory or
Syntax
Tool radius offset
The command
TOFFR is available for the programming of a tool radius offset.
TOFFL: Command for the compensation of the effective tool length
TOFFL can be programmed with or without index:
Without index:
The programmed offset value is applied in the same direction
as the tool length component L1 stored in the compensation
memory.
With index:
The programmed offset value is applied in the same direction
as the tool length component L1, L2 or L3 stored in the offset
memory.
The commands
Note:
How these tool length offset values are calculated in the axes is
determined by the tool type and the current working plane
G17/G18/G19).
(
TOFF: Command for the compensation of the tool length in the
component parallel to the specified geometry axis
TOFF is applied in the direction of the tool length component, which
is effective with non-rotated tool (orientable toolholder or
orientation transformation) parallel to the
specified in the index.
Note:
A frame does not influence the assignment of the programmed
values to the tool length components, i.e. the workpiece
coordinate system (WCS) is not used for the assignment of the
tool length components to the geometry axes, but the tool in the
basic tool position.
<geometry axis>: Identifier of the geometry axis
TOFFR: Command for the compensation of the effective tool radius
TOFFR changes the effective tool radius with active tool radius
compensation by the programmed offset value.
<value>:
Offset value for the tool length or radius
Type: REAL
Note
TOFFL=
TOFFL[1]=, TOFFL[2]= or TOFFL[3]=
TOFFL and TOFFL[1] have an identical effect.
<geometry axis>
The
TOFFR command has almost the same effect as the OFFN command (see "Tool radius
compensation (Page 257)"). There is only a difference with active periph
transformation (TRACYL) and active slot side compensation. In this case, the tool radius is
affected by
OFFN and TOFFR can be effective simultaneously. They then generally have an additive effect
OFFN with a negative sign, but by TOFFR with a positive sign.
● The tool length can be changed simultaneously in all three components. However,
commands of the
TOFFL/TOFFL[1..3] group and commands of the TOFF[<geometry axis>]
may not be used simultaneously in one block.
TOFFL and TOFFL[1] may also not be written simultaneously in one block.
● If all three tool length components are not programmed in a block, the components not
programmed remain unchanged. In this way, it is possible to build up offsets for several
components block-by-block. However, this only applies as long as the tool components
have been modified either only with
type from
TOFFL to TOFF or vice versa deletes any previously programmed tool length
TOFFL or only with TOFF. Changing the programming
offsets (see example 3).
Supplementary conditions
● Evaluation of setting data
The following setting data is evaluated when assigning the programmed offset values to
the tool length components:
Examples
SD42940 $SC_TOOL_LENGTH_CONST (change of tool length components on change
of planes).
SD42950 $SC_TOOL_LENGTH_TYPE (assignment of the tool length compensation
independent of tool type)
If this setting data has valid values not equal to 0, then these take preference over the
contents of G code group 6 (plane selection
G17 - G19) or the tool type ($TC_DP1[<T no.>,
<D no.>]) contained in the tool data, i.e. this setting data influences the evaluation of the
offsets in the same way as the tool length components L1 to L3.
● Tool change
All offset values are retained during a tool change (cutting edge change), e.g. they are
also effective for the new tool (new cutting edge).
Example 1: Positive tool length offset
The active tool is a drill with length L1 = 100 mm.
The active plane is
G17, i.e. the drill points in the Z direction.
The effective drill length is to be increased by 1 mm. The following variants are available for
the programming of this tool length offset:
TOFFL=1
or
TOFFL[1]=1
or
TOFF[Z]=1
Fundamentals
78Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Tool offsets
5.8 Programmable tool offset (TOFFL, TOFF, TOFFR)
Example 2: Negative tool length offset
The active tool is a drill with length L1 = 100 mm.
The active plane is
G18, i.e. the drill points in the Y direction.
The effective drill length is to be decreased by 1 mm. The following variants are available for
the programming of this tool length offset:
TOFFL=-1
or
TOFFL[1]=-1
or
TOFF[Y]=1
Example 3: Changing the programming type from TOFFL to TOFF
The active tool is a milling tool. The active plane is
The "Programmable tool offset" function is especially interesting for ball mills and milling
tools with corner radii as these are often calculated in the CAM system to the ball center
instead of the ball tip. However, generally the tool tip is measured when measuring the tool
and stored as tool length in the compensation memory.
System variables for reading the current offset values
The currently effective offsets can be read with the following system variables:
System variables Meaning
$P_TOFFL [<n>] with 0 ≤ n ≤ 3 Reads the current offset value of TOFFL (for
n = 0) or TOFFL[1...3] (for n = 1, 2, 3) in the
preprocessing context.
$P_TOFF [<geometry axis>] Reads the current offset value of
TOFF[<geometry axis>] in the preprocessing
context.
$P_TOFFR Reads the current offset value of TOFFR in the
preprocessing context.
$AC_TOFFL[<n>] with 0 ≤ n ≤ 3 Reads the current offset value of TOFFL (for
n = 0) or TOFFL[1...3] (for n = 1, 2, 3) in the
main run context (synchronized actions).
$AC_TOFF[<geometry axis>] Reads the current offset value of
TOFF[<geometry axis>] in the main run
context (synchronized actions).
$AC_TOFFR Reads the current offset value of TOFFR in the
main run context (synchronized actions).
Note
The system variables $AC_TOFFL, $AC_TOFF and AC_TOFFR trigger an automatic
preprocessing stop when reading from the preprocessing context (NC program).
Fundamentals
80Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Spindle motion
6.1 Spindle speed (S), spindle direction of rotation (M3, M4, M5)
Function
The spindle speed and direction of rotation values set the spindle in rotary motion and
provide the conditions for chip removal.
;; ;
6
Syntax
=
Figure 6-1 Spindle motion during turning
Other spindles may be available in addition to the main spindle (e.g. the counterspindle or an
actuated tool on turning machines). As a rule, the main spindle is declared the master
spindle in the machine data. This assignment can be changed using an NC command.
6.1 Spindle speed (S), spindle direction of rotation (M3, M4, M5)
Meaning
S…: Spindle speed in rpm for the master spindle
S<n>=... : Spindle speed in rpm for spindle <n>
Note:
The speed specified with
M3: Direction of spindle rotation clockwise for master spindle
M<n>=3: Spindle direction of rotation clockwise for spindle <n>
M4: Direction of spindle rotation counter-clockwise for master spindle
M<n>=4: Spindle direction of rotation counter-clockwise for spindle <n>
M5: Spindle stop for master spindle
M<n>=5: Spindle stop for spindle <n>
SETMS(<n>): Set spindle <n> as master spindle
SETMS: If SETMS is programmed without a spindle name, the configured master
spindle is used instead.
Note
S0=… applies to the master spindle.
Example
Up to three S-values can be programmed per NC block, e.g.:
S... S2=... S3=...
Note
SETMS must be in a separate block.
S1 is the master spindle, S2 is the second spindle. The part is to be machined from two
sides. To do this, it is necessary to divide the operations into steps. After the cut-off point,
the synchronizing device (S2) takes over machining of the workpiece after the cut off. To do
this, this spindle S2 is defined as the master spindle to which G95 then applies.
6
6
Fundamentals
82Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Spindle motion
6.1 Spindle speed (S), spindle direction of rotation (M3, M4, M5)
Program code Comment
N10 S300 M3 ; Speed and direction of rotation for drive spindle =
preset master spindle
... ; Machining of the right-hand workpiece side
N100 SETMS(2) ; S2 is now the master spindle
N110 S400 G95 F… ; Speed for new master spindle
... ; Machining of the left-hand workpiece side
N160 SETMS ; Switching back to master spindle S1
Further information
Interpretation of the S-value for the master spindle
If function G331 or G332 is active in G function group 1 (modally valid motion commands),
the programmed S-value will always be interpreted as the speed in rpm. Otherwise, the
interpretation of the S-value will depend upon G function group 15 (feedrate type): If G96,
G961 or G962 is active, the S-value is interpreted as a constant cutting rate in m/min;
otherwise, it is interpreted as a speed in rpm.
Changing from G96/G961/G962 to G331/G332 sets the value of the constant cutting rate to
zero; changing from G331/G332 to a function within the G function group other than
G331/G332 sets the speed value to zero. The corresponding S-values have to be
reprogrammed if required.
Preset M commands M3, M4, M5
In a block with axis commands, functions M3, M4, M5 are activated before the axis
movements commence (basic setting on the control).
Example:
Program code Comment
N10 G1 F500 X70 Y20 S270 M3 ; The spindle ramps up to 270 rpm, then the
movements are executed in X and Y.
N100 G0 Z150 M5 ; Spindle stop before the retraction movement
in Z.
Note
Machine data can be used to set when axis movements should be executed; either once the
spindle has powered up to the setpoint speed, or immediately after the programmed
switching operations have been traversed.
6.1 Spindle speed (S), spindle direction of rotation (M3, M4, M5)
Working with multiple spindles
5 spindles (master spindle plus 4 additional spindles) can be available in one channel at the
same time.
One of the spindles is defined in machine data as the master spindle. Special functions such
as thread cutting, tapping, revolutional feedrate, and dwell time apply to this spindle. For the
remaining spindles (e.g. a second spindle and an actuated tool) the numbers corresponding
to the speed and the direction of rotation/spindle stop must be specified.
SETMS(<n>) command can be used in the NC program to define any spindle as the
master spindle.
SETMS must be in a separate block.
Example:
Program code Comment
N10 SETMS (2) ; Spindle 2 is now the master spindle.
Note
The speed specified with
S..., along with the functions programmed with M3, M4, M5, now
apply to the newly declared master spindle.
If SETMS is programmed without a spindle name, the master spindle programmed in the
machine data is used instead.
Fundamentals
84Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Spindle motion
6.2 Cutting rate (SVC)
6.2 Cutting rate (SVC)
Function
As an alternative to the spindle speed, the tool cutting rate, which is more commonly used in
practice, can be programmed for milling operations.
7RROUDGLXV
6SHHG
&XWWLQJUDWH
The controller uses the radius of the active tool to calculate the effective spindle speed from
the programmed tool cutting rate:
S = (SVC * 1000) / (R
with:
S: Spindle speed in rpm
* 2π)
T
SVC: Cutting rate in m/min or ft/min
: Radius of the active tool in mm
R
T
The tool type ($TC_DP1) of the active tool is not taken into account.
The programmed cutting rate is independent of the path feedrate
The direction of rotation and the spindle start are programmed using
and the spindle stop using
M5.
F and G function group 15.
M3 and M4 respectively
A change to the tool radius data in the offset memory will be applied the next time a tool
offset is selected or the next time the active offset data is updated.
Changing the tool or selecting/deselecting a tool offset data record generates a recalculation
of the effective spindle speed.
Requirements
The programming of the cutting speed requires:
● The geometric ratios of a rotating tool (milling cutter or drilling tool)
SVC, the tool radius must be known; in other words, a corresponding tool
including a tool offset data record must be active or selected in the block. There is no fixed
sequence for
SVC:
SVC and T/D selection during programming in the same block.
Cutting rate
[<n>]: Number of spindle
This address extension specifies which spindle the programmed
cutting rate is to be applied for. In the absence of an address
extension, the rate is always applied to the master spindle.
Note:
A separate cutting rate can be preset for each spindle.
Note:
Programming
SVC without an address extension requires that the
master spindle has the active tool. If the master spindle changes,
the user will need to select a tool accordingly.
Unit: m/min or ft/min (dependent upon G700/G710)
Note
Changing between SVC and S
Changing between
SVC and S programming is possible at will, even while the spindle is
turning. In each case, the value that is not active is deleted.
Note
Maximum tool speed
System variable $TC_TP_MAX_VELO[<tool number>] can be used to preset a maximum
tool speed (spindle speed).
If no speed limit has been defined, there will be no monitoring.
Fundamentals
86Programming Manual, 03/2013, 6FC5398-1BP40-3BA1
Spindle motion
6.2 Cutting rate (SVC)
Examples
Note
SVC programming is not possible if the following are active:
G96/G961/G962
GWPS
SPOS/SPOSA/M19
M70
Conversely, programming one of these commands will lead to the deselection of
SVC.
Note
The tool paths of "standard tools" generated, e.g. using CAD systems which already take the
tool radius into account and only contain the deviation from the standard tool in the tool nose
radius are not supported in conjunction with
SVC programming.
The following shall apply to all examples: Toolholder = spindle (for standard milling)
Example 1: Milling cutter 6 mm radius
Program code Comment
N10 G0 X10 T1 D1 ; Selection of milling cutter with, e.g.
$TC_DP6[1,1] = 6 (tool radius = 6 mm)
N20 SVC=100 M3 ; Cutting rate = 100 m/min
⇒ Resulting spindle speed:
S = (100 m/min * 1000) / (6.0 mm * 2 * 3.14) =
2653.93 rpm
N30 G1 X50 G95 FZ=0.03 ; SVC and tooth feedrate
...
Example 2: Tool selection and SVC in the same block
Program code Comment
N10 G0 X20
N20 T1 D1 SVC=100 ; Tool and offset data record selection together with
N30 X30 M3 ; Spindle start with CW direction of rotation,
N40 G1 X20 F0.3 G95 ; SVC and revolutional feedrate
When the "Constant cutting rate" function is active, the spindle speed is modified as a
function of the respective workpiece diameter so that the cutting rate S in m/min or ft/min
remains constant at the tool edge.
6SLQGOHVSHHG
UHGXFHG
&XWWLQJUDWH
FRQVWDQW
Syntax
6SLQGOHVSHHG
LQFUHDVHG
This results in the following advantages:
● Uniformity and consequently improved surface quality of turned parts
● Machining with less wear on tools
Activating/deactivating constant cutting rate for the master spindle:
G96/G961/G962 S...
...
G97/G971/G972/G973
Speed limitation for the master spindle:
LIMS=<value>
LIMS[<spindle>]=<value>
Other reference axis for G96/G961/G962:
SCC[<axis>]
Note
SCC[<axis>] can be programmed together with G96/G961/G962 or in isolation.
G96: Constant cutting rate with feedrate type G95: ON
G95 is activated automatically with G96. If G95 has not been activated
previously, a new feedrate value
called.
G961: Constant cutting rate with feedrate type G94: ON
G962:
Constant cutting rate with feedrate type G94 or G95: ON
Note:
See "Feedrate (G93, G94, G95, F, FGROUP, FL, FGREF) (Page 101)" for
information about G94 and G95.
S... :
In conjunction with
G96, G961 or G962, S... is not interpreted as a spindle speed
but as a cutting rate. The cutting rate is always applied to the master spindle.
Unit: m/min (for G71/G710) or ft/min (for G70/G700)
Range of values: 0.1 m/min to 9999 9999.9 m/min
G97: Deactivate constant cutting rate with feedrate type G95
G97 (or G971), S... is again interpreted as a spindle speed in rpm. In the
After
absence of a new spindle speed being specified, the last speed set with
G961) is retained.
(or
G971: Deactivate constant cutting rate with feedrate type G94
G972: Deactivate constant cutting rate with feedrate type G94 or G95
G973: Deactivate constant cutting rate without activating spindle speed limitation
LIMS:
Speed limitation for the master spindle (only applied if G96/G961/G97 active)
On machines with selectable master spindles, limitations of differing values
can be programmed for up to four spindles within one block.
<spindle>: Number of spindle
<value>: Spindle speed upper limit in rpm
SCC: If any of the G96/G961/G962 functions are active, SCC[<axis>] can be used to
assign any geometry axis as a reference axis.
Note
F... will have to be specified when G96 is
G96
When
G96/G961/G962 is selected for the first time, a constant cutting rate S... must be
entered; when
Note
G96/G961/G962 is selected again, the entry is optional.
N150 G01 F1.2 Y=27 ; Grooving in Y, feedrate F = 1.2 mm/revolution.
N160 G97 ; Constant cutting rate off.
N170 G0 Y100
Further information
Calculation of the spindle speed
The ENS position of the face axis (radius) is the basis for calculating the spindle speed from
the programmed cutting rate.
Note
Frames between WCS and SZS (e.g. programmable frames such as SCALE, TRANS or
ROT) are taken into account in the calculation of the spindle speed and can bring about a
change in speed (for example, if there is a change in the effective diameter in the case of
SCALE).
Speed limitation LIMS
If a workpiece that varies greatly in diameter needs to be machined, it is advisable to specify
a speed limit for the spindle with
high speeds with small diameters.
LIMS is not applied when G971is selected. On loading the block into the main run, all
LIMS (maximum spindle speed). This prevents excessively
LIMS is only applied when G96, G961, and G97 are active.
programmed values are transferred into the setting data.
Note
The speed limits changed with
LIMS in the part program are taken into the setting data and
therefore remain saved after the end of program.
However, if the speed limits changed with
LIMS are no longer to apply after the end of
program, the following definition must be inserted in the GUD block of the machine
manufacturer:
REDEF $SA_SPIND_MAX_VELO_LIMS PRLOC
Deactivating the constant cutting rate (G97/G971/G973)
After
G97/G971, the control interprets an S value as a spindle speed in rpm again. If you do
not specify a new spindle speed, the last speed set with
The
G96/G961 function can also be deactivated with G94 or G95. In this case, the last speed
programmed
S... is used for subsequent machining operations.
G96/G961 is retained.
G97 can be programmed without G96 beforehand. The function then has the same effect as
G95; LIMS can also be programmed.
Using G973, the constant cutting rate can be deactivated without activating a spindle speed
limitation.
Note
The transverse axis must be defined in machine data.
Rapid traverse G0
With rapid traverse
G0, there is no change in speed.
Exception:
If the contour is approached in rapid traverse and the next NC block contains a
path command, the speed is adjusted in the
G0 approach block for the next path command.
G1/G2/G3/etc.
Other reference axis for G96/G961/G962
If any of the G96/G961/G962 functions are active,
SCC[<axis>] can be used to assign any
geometry axis as a reference axis. If the reference axis changes, which will in turn affect the
TCP (tool center point) reference position for the constant cutting rate, the resulting spindle
speed will be reached via the set braking or acceleration ramp.
Axis replacement of the assigned channel axis
The reference axis property for G96/G961/G962 is always assigned to a geometry axis. In
the event of an axis exchange involving the assigned channel axis, the reference axis
property for G96/G961/G962 is retained in the old channel.
A geometry axis exchange will not affect how the geometry axis is assigned to the constant
cutting rate. If the TCP reference position for G96/G961/G962 is affected by a geometry axis
exchange, the spindle will reach the new speed via a ramp.
If no new channel axis is assigned as a result of a geometry axis exchange (e.g.
the spindle speed will be frozen in accordance with
G97.
GEOAX(0,X)),
Examples for geometry axis exchange with assignments of the reference axis:
Program code Comment
N05 G95 F0.1
N10 GEOAX(1, X1) ;Channel axis X1 becomes the first geometry axis.
N20 SCC[X] ;First geometry axis (X) becomes the reference axis
;for G96/G961/G962.
N30 GEOAX(1, X2) ;Channel axis X2 becomes the first geometry axis.
N40 G96 M3 S20 ;Reference axis for G96 is channel axis X2.
The "Constant grinding wheel peripheral speed (GWPS)" function is used to set the grinding
wheel speed so that, taking account of the current radius, the grinding wheel peripheral
speed remains constant.
GWPSON: Select constant grinding wheel peripheral speed
GWPSOF: Deselect constant grinding wheel peripheral speed
<t no.>: It is only necessary to specify the T number if the tool with this T number
is not active
S…: Peripheral speed in m/s or ft/s for the master spindle
S<n>=…: Peripheral speed in m/s or ft/s for spindle <n>
Note:
The peripheral speed specified with
Note
A grinding wheel peripheral speed can only be programmed for grinding tools (types 400 to
499).
S0=… applies to the master spindle.
Example
A constant grinding wheel peripheral speed is to be used for grinding tools T1 and T5.
T1 is the active tool.
Program code Comment
N20 T1 D1 ; Select T1 and D1.
N25 S1=1000 M1=3 ; 1000 rpm for spindle 1.
N30 S2=1500 M2=3 ; 1500 rpm for spindle 2.
…
N40 GWPSON ; Selection of GWPS for active tool.
N45 S1=60 ; Set GWPS to 60 m/s for active tool.
…
N50 GWPSON(5) ; GWPS selection for tool 5 (spindle 2).
N55 S2=40 ; Set GWPS to 40 m/s for spindle 2.
…
N60 GWPSOF ; Deactivate GWPS for active tool.
N65 GWPSOF(5) ; Deactivate GWPS for tool 5 (spindle 2).
In order to activate the function "Constant peripheral speed", the tool-specific grinding data
$TC_TPG1, $TC_TPG8 and $TC_TPG9 must be set accordingly. When the GWPS function
is active, even online offset values (= wear parameters; cf. "Grinding-specific tool monitoring
in the part program TMON, TMOF" or PUTFTOC, PUTFTOCF) must be taken into account
when changing speed.
Select GWPS: GWPSON, programming GWPS
After selecting the GWPS with GWPSON, each subsequent S value for this spindle is
interpreted as a grinding wheel peripheral speed.
Selection of grinding wheel peripheral speed with GWPSON does not cause the automatic
activation of tool length compensation or tool monitoring.
The GWPS can be active for several spindles on a channel with different tool numbers.
If GWPS is to be selected for a new tool on a spindle where GWPS is already active, the
active GWPS must first be deselected with GWPSOF.
Deactivate GWPS: GWPSOF
When GWPS is deselected with GWPSOF, the last speed to be calculated remains valid as
the setpoint.
GWPS programming is reset at the end of the part program or on RESET.
Query active GWPS: $P_GWPS[<spindle no.>]
This system variable can be used to query from the part program whether the GWPS is
active for a specific spindle.