0% found this document useful (0 votes)
44 views150 pages

EN - 840D - Complete DIN Milling 01 2008

Uploaded by

Franco Wilber
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views150 pages

EN - 840D - Complete DIN Milling 01 2008

Uploaded by

Franco Wilber
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

SINUMERIK 810/840D

DIN Programming for Milling

Training Manual Edition 2008.01

Training Documentation
SINUMERIK 810/840D

Operating and Programming


DIN - Milling

Valid for:

Control
SINUMERIK 810/840D

This document was produced for training purposes.


Siemens assumes no responsibility for its contents.

Edition 01.2008
Module content

Operating and Programming - Milling

Technoloy Basics A301


Geometry Basics A302
Simple Contour elements A303
Mathematical Principles A304
Zero offset and reference points A305
Program structure A309
Contour milling A310
Programming of Subroutines - Milling A311
Jumps - Repeats - Milling A312
Circular and square pockets A313
Mirror - Offsets - Rotation - Scale - Milling A314
Working with Cycles A315
Milling Cycles A316
Drilling Cycles - Milling A317
Operation_840D A340
A301 General technological aspects

1 Brief description
Objective of the module:

Having worked through this module you will be familiar with the most important technological aspects
and machine functions.

Description of the module:

This module shows the general layout of a program with respect to the technological commands as
per DIN 66025-2 for Turning and Milling.

Content of the module:

 Layout of a CNC-program
 Programming of the technological data
 Switching commands
 Programmable pre-settings
 Summary

Layout of a CNC-
program Section 1

Programming of the Section 2


technological data

Switching commands Section 3

Programmable pre- Section 4


settings

Section 5
Summary

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A301
Section 1 Layout of a CNC-program
Notes
A CNC-program, also known as Part program, consists of a logical se-
quence of commands, which are executed step-by-step by the control unit
after the program has been started.
The manufacturers of control units recognize and apply the guidelines as
per DIN 66025-2.

Each program is compiled and stored under a program name in the con-
trol unit. The name can contain letters as well as numbers.

A block starts with a block number followed by the commands.

Each command consists of command words, which in turn consist of an


address letter (A-Z) and an associated numerical value. (Both upper or
lower case characters are permissible)

Program layout:

Departure information Switching information

Block
Auxil-
Nr.. Misc.
iary Interpolation para-
Co-ordinate axes Feed Speed Tool func-
com- meter tion
mand

N G X Y Z I J K F S T M

Geometrical data Technological data


The block number is a program-technical assignment, which is not evalu-
ated by the control unit as a command. It is usually programmed to go up
in steps of 10 and serves only the user for better oversight. It has no effect
on the program execution.

The geometrical data include all instructions that clearly define mathemati-
cally the motion of the tool or the axes.

The technological data are used for instance to activate the required tool
and to pre-select the necessary cutting parameters feed rate and spindle
speed. Miscellaneous functions can control for example such things as di-
rection of rotation and auxiliary appliances.

Programming example:
….
N80 T1; Roughing tool
N90 M6
N100 G54 F0.2 S180 M4
N110 G00 X20 Y0 Z2 D1
N120 …… …..

In order to improve the oversight within a program, commentaries can be


optionally added at the end of a block. These must be preceded by a semi-
colon; Any characters that follow thereafter will not be taken account of by
the control unit..

SINUMERIK 840D/810D Training and Programming Page 2 A301


Section 2 Programming of the technological data
Notes
Before every technological working step in a CNC-Program the respective
tool must be selected by means of the addresses T and D.

The address T is followed by the name of the tool, which may be stated
either with numbers or letters. (Here only the variant using numbers will be
dealt with.)

All applicable tool data (e.g. tool type, length, radius etc.) are activated in
the program with the address D.
Here a complete set of data D is referred to as „Cutting edge“.

Several cutting edge numbers (D1 … D9) may be generated for each tool.

Programming example: Explanation:

N10 T17 ; Drill Block 10, call-up of tool 17,


Commentary to the tool
N20 M6 Tool change,
N30 … D1 The cutting edge D... must be activated
in the block with the first departure com--
mand

After the call-up of the tool follows the infinitely variable selection of the
optimum cutting values with the addresses F and S.

The feed rate with the address F can be entered either as feed per min vf
(in mm/min) or as feed per revolution f (in mm).

Generally speaking the following starting status for the machines applies:

 Milling machines with feed rate vf in mm/min


 Code G94

 Turning machines with feed per revolution f in mm


 Code G95

Programming example 1: Explanation:

N10 T20 ; Endmill


N20 M6
N30 G94 F200 S1000 M3 D1 vf = 200m/min, n = 1000 min-1
N40 ….

Programming example 2: Explanation:

N10 T2; Turning tool, finishing


N20 G96 F0.1 S200 M4 D1 f = 0,1mm, vc = 200 m/min
N30 ….

SINUMERIK 840D/810D Training and Programming Page 3 A301


Section 3 Switching commands
Notes
The preset motion of the work spindle in the respective direction of rotation
is started with the respective switching commands.
Further additional functions can control, for instance, cooling circuits,
clamping means, auxiliary functions and the running of the program.

Since the number of additional functions depends entirely on the construc-


tive and technological equipment of the machine, the following list should
be seen only as an extract of possible instructions.

Instruction Meaning

M00 Programmed Halt


M03 Work spindle ON, clockwise
M04 Work spindle ON, anti-clockwise
M05 Work spindle Halt (however, the program continues)
M06 Tool change
M08 Coolant ON
M09 Coolant OFF
M30 End of program; jump back to the start of the program

Programming example: Explanation:

N10 T1; Face mill


N20 M6 Tool change
N30 G94 G97 F600 S2500 D1 vf = 600m/min, n = 2500 min-1
N40 M3 M8 Spindle ON clockwise, coolant ON
…..
N90 M30 End of program
(Further functions will be found in the annex to this manual)

Effect of the switching commands M3 and M4

Example Milling Example Turning

M3

M4
M3
Direction of viewing

M4

SINUMERIK 840D/810D Training and Programming Page 4 A301


Section 4 Programmable pre-settings
Notes
When starting a part program the basic settings as defined by the manufac-
turer will be activated. These depend on the individual machine specification
and apply thereafter for the whole of the program run (modal) unless they are
changed by the operator by programming.

This section describes just a few of the multitude of possible selections for
turning and milling machines that deserve highlighting.
(Codes that have already been dealt with are no longer included)

Continuous path behaviour:

Exact stop Code G9 block-by-block Code G60 * modal

In order to reach the final position precisely the path velocity is reduced at
the end of the block towards zero. This is useful, for instance, to obtain rela-
tively sharp edges when machining around contour corners.
However, it must be borne in mind that, if there are too many positioning se-
quences, the additional machining time required in consequence cannot be
altogether disregarded.

Continuous control operation Code G64

In this case the tool moves as much as possible with constant velocity with-
out deceleration at the end of a block. Hence the machining time is less than
under the continuous path status „Exact stop“.

The corners of contours are machined without any relief and therefore the
corners are not so sharply defined.
With this function the control works with a speed control taking into account
several blocks ahead (Look Ahead).

The even speed in this instance results in better cutting conditions and also a
better surface quality.

The following image compares the frequent braking and accelerating se-
quences between the individual blocks in case of G60 and the constant
speed in case of G64.

Feed rate
G64 Continuous operation
with Look Ahead
Programmed feed rate

G60 Exact stop

Block path

*
Usual preset starting status

SINUMERIK 840D/810D Training and Programming Page 5 A301


Section 4 Programmable pre-settings
Notes

The continuous path behaviour „Exact stop“ with the Codes G9 or G60
respectively does not entirely ensure dimension-wise as to how precisely
a corner point between two positioning blocks is attained.

If an exact stop has been activated in a program, the codes described be-
low can be used to specify a very precise braking behaviour at the end of
blocks. By this it is possible to determine as to how precisely the pro-
grammed corner point will be attained.

Change-over when the positioning window ‚fine‘ is reached


Code G601

The tool motion changes to the next block when the tool has reached the
fine positioning window.
Sharp contour corners result at the programmed destination points.

Change-over when the positioning window ‚coarse‘ is reached


Code G602

This code can be used to obtain a defined rounding of the programmed


contour corners. The block change-over occurs already at the coarse po-
sitioning window.

Block change-over

Destination point of the pro-


grammed path
G60

Actual tool paths depending on


G60
the positioning window

Tool

A dimensional definition of the positioning windows ‘coarse’ and ‘fine’ is


pre-set by means of machine datum.

Please find out the values pre-set on your machine by the machine manu-
facturer from his Operation Manual if you are going to use the described
codes.

SINUMERIK 840D/810D Training and Programming Page 6 A301


Section 4 Programmable pre-settings
Notes

There is yet another means of influencing the continuous path behaviour by


changing-over to the next positioning block depending on the programmed
path velocity of the tool.

Change-over when the command position‘ is reached Code G603

The block change-over is initiated as soon as the control has evaluated the
command speed for all axes to be equal to zero.

Since the physical tool position lags behind the calculated value by a certain
amount, the effect in this case is that the axis changes direction before the
end of the interpolation is reached.

The greater the feed rate, the greater is also the lag of the tool behind the
evaluated value and therefore the rounding radius.

This permits the contour corners to be formed in dependence on the path


velocity.

Destination point of the pro-


grammed path (Interpolation ends)

Actual tool path with smaller feed


rates

Actual tool path with greater feed


Work piece rates

Hint: The rounding radius depends on the programmed path velocity as well
as the drive mechanics of the machine.

The codes G601, G602 and G603 are modal.

They can be activated only in conjunction with Exact stop and with G9
or G60 respectively.

SINUMERIK 840D/810D Training and Programming Page 7 A301


Section 5 Summary

Notes
Address Meaning

T Tool number
D Cutting edge (Tool data)

F Feed / Feed rate


S Speed / Cutting speed

Path information / departure commands

Instruction Meaning

G9 Exact stop, operative block-by-block


G60 Exact stop, modal function * **
G64 Continuous path control
G601 Change-over when positioning window fine is reached
G602 Change-over when positioning window coarse is reached
G603 Change-over when the interpolation end is reached
G70 Input system in inches
G71 Input system metrical

G94 Linear feed in mm/min *


G95 Feed per revolution in mm **

G96 Constant cutting speed in m/min **


G97 Spindle speed in min-1 *

* Switching-ON status for milling machines


** Switching-ON status for turning machines

Switching information

Instruction Meaning

M00 Programmed Halt

M03 Work spindle ON, clockwise


M04 Work spindle ON, anti-clockwise
M05 Work spindle Stop

M06 Tool change

M08 Coolant ON
M09 Coolant OFF

M17 End of sub-program


M30 End of program, jump back to the beginning of program

All instructions (except G9) mentioned above are modal, i.e. they remain
operative until the program calls for an opposed instruction.

Furthermore there are instructions that are operative only block-by-block,


e.g. G9. These are automatically reset by the control unit with the suc-
ceeding block.

SINUMERIK 840D/810D Training and Programming Page 8 A301


A302 General geometrical aspects

1 Brief description
Objective of the module:

Having worked through this module you will be able to understand the programming planes and also
to specify points in a DIN conforming co-ordinate system.

Description of the module:

This module explains the assignment of the axis and plane descriptions to the co-ordinate system of
the machine and also trains the determination of points in relation to the work space.

Content of the module:

 Right hand rule


 Attribution of the axis denominations
 Points and distances in the work space
 Programming planes

Right hand rule


Section 1

Attribution of the axis


denominations Section 2

Points and distances in


Section 3
the work space

Programming planes
Section 4

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A302
Section 1 2 Right hand rule
Notes
Explanation:

The various axes of motion of machine tools are referred to within the work
space of CNC-machines by means of address letters. Here the denomina-
tion of the axes is according to the DIN-standard, the rules of which specify
the attribution of axis denominations.

The machine co-ordinate system that derives from this is imperative for the
geometrical description of work pieces, since this then permits the un-
equivocal determination of points in a plane and in space.

The Cartesian (rectangular) spatial co-ordinate system can be best de-


scribed with the „Right hand rule“. Here the fingers of the right hand rep-
resent the axes; X (thumb), Y (first finger) and Z (middle finger). The finger
tips point in the positive direction.

The position of the machine co-ordinate system is specified by the ma-


chine manufacturer keeping the following in mind:

Vertical turning machine Horizontal milling machine

Attribution of the axis denominations:

 Z-Axis: This is parallel to the working spindle or coincides with it. The
positive direction is away from the work piece. In case there is more than
one spindle, one of them will be declared as the main spindle.
 X-Axis: This is parallel to the setting-up plane or coincides with it. If the
Z-axis is vertical, the positive X-axis is directed towards the right. If the Z-
axis is horizontal, the positive X-axis is directed towards the left.
 Y-Axis: This is at right angles to both the X and Z-axis, such that a
spatial Cartesian co-ordinate system results.

The direction „FROM“ the work piece „TO“ the tool is „PLUS“

A mobile tool must „ALWAYS“ be programmed!

SINUMERIK 840D/810D Training and Programming Page 2 A302


Section 2 Attribution of the axis denominations
Notes

Explanation as per DIN 6025:


The denomination of just three axes is, however, not enough in conjunc-
tion with modern machine tools. If for instance the milling head of a milling
machine is to be swivelled by a certain angle or the quill of a tailstock is to
be moved, a further denomination of these axes is required.

The DIN standard provides the following variants for such cases.

Here the rotational axes ABC are


associated with the XYZ axes.

Looking in the positive direction


of the axis, the positive direction
of the rotation is deemed to be
clockwise.

The axes UVW are parallel to the


axes XYZ .

V The positive direction is that of


the related main axis.

Y
B

SINUMERIK 840D/810D Training and Programming Page 3 A302


Section 3 Points and distances within the work space
Notes

Explanation:
For the determination of all points within the work space, the control unit
requires a zero point of the co-ordinate system. This has been determined
by the machine manufacturer. All other points have either fixed distances
from the machine zero point or else the distance must be defined.

The machine zero point (M) is determined by the


machine manufacturer and cannot be altered. On mill-
ing machines it usually lies on the work table, while on
turning machines it is on the spindle flange.

The work piece zero point (W) is the origin of the work
piece co-ordinate system. This can be specified by the
programmer and should always be chosen such that the
least calculation work is required to determine points on
the contour given the dimensioning of the drawing. For
turning work it lies mostly on the turning axis and the
right hand planar face.

The reference point (R) is approached for initializing the


path measuring system, which means that at this point
all axes are set to zero. This is necessary since gener-
ally speaking the machine zero point cannot be ap-
proached.

The tool carrier reference point (F) is of prime impor-


tance for the adjustment of preset tools. The lengths L
(XPF) and offset O (ZPF) shown in the image below are
used as tool calculation values for instance for the tool
radius correction and must be entered into the tool mem-
ory of the control unit.

ZMR

ZMF
XPF

XMR

ZMW
XMF

ZPF

SINUMERIK 840D/810D Training and Programming Page 4 A302


Section 3 Points and distances within the work space

Notes

ZPF

ZMR
ZMW

XMR
XMW
YMR
YMW

XMR = Distances from the reference point to the machine zero point. These are
YMR = set by the manufacturer during commissioning and are transferred to the
ZMR = control unit when the reference point is reached.
XMW = These represent distances from the machine zero point to the work piece
YMW = zero point. The work piece zero point must be determined by the opera-
ZMW = tor by scratching or probing and entered into the tool correction memory.
XPF = Distances from the tool carrier reference point to the tool point on the
ZPF = cutting edge or the front face of the milling cutter.
XMF = Distances from the machine zero point to the tool carrier reference point.
ZMF = The distance is determined by the manufacturer and entered into the
control unit.

SINUMERIK 840D/810D Training and Programming Page 5 A302


Section 4 Programming planes

Notes

Continuous path control units can control slides and tool carriers simulta-
neously along 2 or more axes at a programmed feed rate. For this the
speed of the individual drives must be matched to one another. This job
is taken over by the interpolator of the CNC-control unit. This is a soft-
ware program for the evaluation of intermediate positions and speed
conditions of the individual axes such that the slides can follow the pro-
grammed path. As from the 2 ½ D Continuous path control unit the inter-
polation can be switched between the three different planes.

The selection of the plane is effected by means of suitably programmed


instructions.

+Z

G18
G19

G17
-Y
+X

XY – Plane – programming command G17

XZ – Plane – programming command G18

YZ – Plane – programming command G19

The standard plane being used for working with CNC-Turning ma-
chines is G18. With CNC-Milling machines the plane G17 is nor-
mally taken to be the usual programming plane.

SINUMERIK 840D/810D Training and Programming Page 6 A302


A303 Simple geometrical path conditions

1 Brief description
Objective of the module:

Working through this module will enable you to program linear and circular departure commands both
with absolute and incremental dimensions.

Description of the module:

This module explains the use of absolute, incremental and mixed co-ordinate points. It also explains
the programming of simple geometrical path conditions.

Content of the module:

 Absolute and incremental dimensioning,


Mixed programming
 Rapid traverse motion
 Straight line interpolation
 Circular interpolation

Absolute and
incremental Section 1
dimensioning, Mixed

Rapid traverse motion Section 2

Straight line Section 3


interpolation

Circular interpolation Section 4

Summary Section 5

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A303
Section 1 Absolute dimensioning
Notes
When writing CNC-Programs a fundamental differentiation must be made
between absolute and incremental co-ordinates.
Depending on the usage of the program and the dimensioning on the
drawing the programmer decides himself as to which of the two possibili-
ties he is going to employ.

Absolute dimensioning, Code G90

All dimensions always refer to the active work piece zero point.

The absolute co-ordinates in a departure command describe the position,


to which the tool is to traverse.

Co-ordinates
An example for milling :

G90 X Y
P1 20 35

P2 50 60

P3 70 20

Co-ordinates
An example for turning:

(All X values are diameters,


(DIAMON)

G90 X Z
P1 25 -7.5

P2 40 -15

P3 40 -25

P4 60 -35

SINUMERIK 840D/810D Training and Programming Page 2 A303


Section 1 Incremental dimensioning
Notes
Incremental dimensioning, Code G91
(also known as chain dimensioning)

All position statements refer to the current starting position of the tool.

The programmed value states the co-ordinate distance, by which the tool
is to traverse during the ensuing machining step

Co-ordinates
An example for milling:

G91 X Y

P1 20 35

P2 30 20

P3 20 -35

Co-ordinates
An example for turning:

(All dimensions for X are ra-


dius values DIAMOF)

G91 X Z

P1 12.5 -7.5

P2 7.5 -7.5

P3 0 -10

P4 10 -10

Code G91 is modally active for all axes simultaneously and can be re-set
to absolute dimensioning with G90.

SINUMERIK 840D/810D Training and Programming Page 3 A303


Section 1 Mixed programming
Notes

As already mentioned, the destination point co-ordinates can be stated in


the program for all types of interpolation as absolute or incremental values
respectively.

Depending on the presently activated status (G90 or G91), all further co-
ordinate values will also be in this sort of dimensioning.

In practice, however, it is often sensible to mix the two possibilities within a


program block. The control unit provides a comfortable means of instruc-
tion to utilize this additional possibility.

Mixed programming Codes AC(…) and IC(…)


A dimension value will also be taken as an absolute dimension under G91
if the following syntax is used: AC(numerical value)

If a dimension value is to be taken to be an incremental value under G90,


it must be written as follows: IC(numerical value)

Clarification of mixed programming with an example for milling:

G90 X Y
P1 20 35

P2 IC(30) IC(25)

P3 70 IC(-40)

G91 X Y
P1 AC(20) AC(35)

P2 30 AC(60)

P3 20 -40

A great number of various possibilities are available to the operator in


dealing with a mixture of the two types of dimensioning:

Hint: The above example describes only a small selection of mixed co-
ordinate inputs.

A further selection of examples can be found in the description of


interpolation types in this Manual.

SINUMERIK 840D/810D Training and Programming Page 4 A303


Section 2 Rapid traverse motion
Notes
Rapid traverse Code G00

Rapid traverse is used for the quickest possible re-positioning of the tool
to the contour element or, for instance, for moving the tool to the tool
changing position. .

The highest possible speed along a straight line that the machine is ca-
pable of attaining is used for this, however, no machining is possible
here. Hence the control unit does not required a value input under the
address F.

Re-positioning with rapid traverse can be programmed to take place in


several axes simultaneously.

Programming example: Explanation:

N10 T1 ; End mill


N20 M6
N30 G0 X200 Y80 Z2 D1 Motion at rapid traverse to the desti
nation point X200, Y80, Z2 (taking
into account the tool length)

N90 M30 End of program

straight line

The above programming example re-positions the tool from point P1 to


the point P2.

SINUMERIK 840D/810D Training and Programming Page 5 A303


Section 3 Straight line interpolation
Notes
Straight line interpolation, Code G01

The straight line interpolation is used to move the tool with an exactly
defined speed along a straight line from the current position to the pro-
grammeed destination point.

All axes can be traversed simultaneously, in which case the resulting line
of motion can lie anywhere at an angle within the working space. For this
the control unit requires a specified feed rate which at the latest must be
defined under the address F in the block containing the Code G1.

The following example describes the milling of a slot with absolute di-
mensioning as per the drawing A shown below..

Programming example: Explanation:

N10 T1 ; End mill Tool call-up T1


N20 M6
N30 G94 F300 S2000 M3 D1 Technology block for the tool T1
with the cutting edge D1,
N40 G90 G0 X40 Y48 Z2 M8 With rapid traverse to the starting po-
sition P1 on the safety plane (absolute
dimensions),
N50 G1 Z-12 Plunging with feed rate,
N60 X20 Y18 Z-10 Milling the slot in 3 axes (G1 is
modally active),
N70 Z2 F1000 Retraction with increased feed rate
N80 G0 Z200
N90 M30

The following program extract shows the milling of the same slot using
incremental dimensioning: (up to N40 see above.)

……
N50 G91 G1 Z-14 Infeed along Z by –14mm,
N60 G1 X-20 Y-30 Z2 Incremental traversing of the axes
N70 G90 Z2 F1000 Retraction with absolute dimensions
N80 G0 Z200
N90 M30

SINUMERIK 840D/810D Training and Programming Page 6 A303


Section 3 Straight line interpolation
Notes
Straight line interpolation with mixed programming

The example shown below describes the milling of the slot with mixed
co-ordinates input.
Program blocks such as the call-up of the tool etc., which have already
been dealt with, will not be repeated.

Important: If any address letter X, Y, Z is not followed immediately by a


numerical value, an equal-sign must be written instead.

Syntax: X=IC(…), Y=AC(…), Z...

Programming example under G90: Explanation:

….
N40 G90 G0 X40 Y48 Z2 M8 To the starting position P1 ab
solute,
N50 G1 Z=IC(-14) Incremental co-ordinate Z,
N60 X20 Y=IC(-30) Z-10 Incremental co-ordinate Y,
N70 Z2 F1000
….

Programming example under G91: Explanation:

N10 G91 Incremental dimensioning,


….
N40 G0 X=AC(40) Y=AC(48) Z=AC(2) To starting position P1 absolute,
N50 G1 Z-14 Incremental co-ordinate Z,
N60 X=AC(20) Y-30 Z2 Absolute co-ordinate X ,
N70 Z=AC(2) F1000 Absolute co-ordinate Z
….

SINUMERIK 840D/810D Training and Programming Page 7 A303


Section 4 Circular interpolation
Notes

The circular interpolation, Code G02 (clockwise)


Code G03 (anti-clockwise)

A circular interpolation permits the traversing of the tool with a defined


speed along a circular path from the present Start-point to the pro-
grammed destination point.

Apart from the destination point co-ordinates, the control unit here also
needs statements about the sense of rotation and the centre of the circle.
The centre is entered with I, J and K with incremental dimensions with
the centre point as origin.
The following assignment applies:

I for the X – axis

J for the Y – axis

K for the Z – axis

Programming example with G2: Explanation:


…..
N40 G0 X30 Y40 Z2 With rapid traverse to the start point
N50 G1 Z-5 Grooving with Z,
N60 G2 X50 Y40 I10 J-7 Circular interpolation clockwise
N70 G1 Z2 F1000
…..

start point
destination point

centre point

The following example describes an anti-clockwise circular interpolation


as shown in the sketch above.

Please note: The end-point in the sketch is now the starting point
for the circular interpolation.

Programming example with G3: Explanation:


…..
N40 G0 X50 Y40 Z2 With rapid traverse to the start point
N50 G1 Z-5
N60 G3 X40 Y40 I-10 J-7 Circular interpolation anti-clockwise
N70 G1 Z2 F1000
…..

SINUMERIK 840D/810D Training and Programming Page 8 A303


Section 4 Circular interpolation
Notes
Circular interpolation with mixed programming

Particularly the incremental statement of the centre of the circle usually


represents some difficulties to the operator in practice, since it must often
be evaluated using triangle calculations.

This is a prime example of where the mixed co-ordinate programming of


the interpolation parameters in absolute dimensions comes in useful.

Programming example: Explanation:


…..
N40 G0 X30 Y40 Z2
N50 G1 Z-5
N60 G2 X50 Y40 I=AC(40) J=AC(33) Circle centre absolute,
N70 G1 Z2 F1000
…..

start point
destination point

centre point

SINUMERIK 840D/810D Training and Programming Page 9 A303


Section 4 Circular interpolation
Notes

Circular interpolations before and behind the turning axis

The sketch below shows once again the principle of direction


programming of circular interpolations.

Code G02: Circular arc clockwise


Code G03: Circular arc anti-clockwise

The following sketch shows the circular arc orientation on turning


machines with different tool arrangements due to the machine layout..

Tool arrangement behind the turning axis

G2

G3

G2

G3
Tool arrangement in front of the turning axis

Please note:

No matter which tool arrangement is applicable to the particular machine,


the program as per DIN ISO always describes the contour of the
workpiece behind the turning axis.

SINUMERIK 840D/810D Training and Programming Page 10 A303


Section 5 Summary

Notes

Path information

Instruction Meaning

G90 Co-ordinate input with absolute dimensions


G91 Co-ordinate input with incremental dimensions,

G00 Linear motion with rapid traverse

G01 Straight line interpolation with defined speed

G02 Circular interpolation clockwise


G03 Circular interpolation anti-clockwise

All the above departure commands are modal.

Interpolation
parameter Meaning

I Circle centre co-ordinate in X,


incremental from starting point
J Circle centre co-ordinate in Y,
incremental from starting point
K Circle centre co-ordinate in Z,
incremental from starting point

The interpolation parameters are operative block-by-block.

Mixed programming for co-ordinate input

IC(…) Incremental dimension input


AC(…) Absolute dimension input

The statements IC(…) and AC(…) are valid only for the address preceeding
them.

Example:

Instruction Meaning

X=IC(10) Traverse by 10mm in X


Y=AC(20) Traverse to 20mm in Y

SINUMERIK 840D/810D Training and Programming Page 11 A303


Notes

SINUMERIK 840D/810D Training and Programming Page 12 A303


A304 General mathematical principles

1 Brief description
Objective of the module:

Having worked through the module you will be able to understand the mathematical connections nec-
essary for the programming and to calculate missing contour points.

Description of the module:

In this module contour points will be calculated using the Pythagoras principle and trigonometrical
functions (Sine, Cosine and Tangent).

Content of the module:

 The Pythagoras principle


 Angles in the triangle
 Trigonometrical functions
 Exemplary functions

Types of angles
Section 1

The Pythagoras princi-


ple Section 2

Trigonometrical func-
Section 3
tions

Exemplary functions
Section 4

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A304
Section 1 Types of angles
Notes

Basic principles of co-ordinate evaluation

Almost all of the contours encountered with the machining of metals


can be reduced to a combination of straights and circular arcs.

For programming the respective endpoint of the contour element


must be known.

In most cases these contour points can be taken directly from the
drawing provided it has been dimensioned properly for use with NC‘s.
In some cases, however, the an evaluation of co-ordinates may be
necessary. For these calculations a basic knowledge of the types of
angles, trigonometrical functions and the Pythagoras principle is re-
quired.

Types of angles

In the case of oblique work piece contours angles with a definite rela-
tionship to one another result between the contour sections. Depend-
ing on their relative position a differentiation is made between com-
plementary angles, step angles and side angles.

Complementary angles Step angles


add up to 180° have always the same value

       

If a transition is at right angles to the radius centre point it always a tan-


gential transition. This does not show a corner on a technical drawing. If a
corner line is shown, it is not a tangential transition.

SINUMERIK 840D/810D Training and Programming Page 2 A304


Section 2 The Pythagoras principle
Notes
The right angled triangle has a special meaning in Geometry, since the
sides of such a triangle exhibit a definite relationship to one another.

The various sides of the right angled triangle are named specifically.

The longest line opposite the right angle is called the


Hypotenuse

The two other lines, which form the right angle, are called
Sides

The side opposite an angle is called the opposite side

The bounding side of the angle is called the adjacent side

The Pythagoras principle

In case of a right angled triangle the missing length of a side can be calcu-
lated if the length of the other two sides is known. For this the Pythagoras
principle is used.

The square on the hypotenuse is equal to the sum of the


squares on the other two sides.

c²= a² + b²

5x5=25

3x3=9
16+9=25

4x4=16
c = a2  b2

b = c 2  a2

By suitable re-arrangement of a = c 2  b2
the equations the respective
sides can be calculated

SINUMERIK 840D/810D Training and Programming Page 3 A304


Section 3 Trigonometrical functions
Notes

The trigonometrical ratios describe the relationships between the angles


and the sides in a right angled triangle. With the aid of these trigonometri-
cal functions it is possible to calculate both angles and sides in a right an-
gled triangle. For this one side and an angle or two sides must be known.
The selection of the suitable trigonometrical function, i.e. the sine, cosine
or tangent, depends on which sides and angles are known and which side
or angle is to be found.

1 Adjacent side

2 Hypotenuse

3 Opposite side β
2
α Angle

3
β Angle

By the use of the various trigonometrical functions all pages and sides can
be determined.

Sine function
GK GK
sin   H GK  sin  * H
H sin 

Cosine function
AK AK
cos   H AK  cos  * H
H cos 
Tangent function
GK GK
tan   AK  GK  tan  * AK
AK tan 

SINUMERIK 840D/810D Training and Programming Page 4 A304


Section 3 Exemplary functions

Notes

P1 M1 P2 P3 P4 M2

X 25 35 40 30

Z -20 -20

Evaluate the missing co-ordinates of the points P1 to P4, as well as


M1 and M2

Enter the co-ordinate values in the table.

The values for the spaces shown with a dark background are di-
mensions that can be taken directly from the drawing.

SINUMERIK 840D/810D Training and Programming Page 5 A304


Section 3 Solution for the exemplary functions

Notes

P1 M1 P2 P3 P4 M2

X 25 35 27,929 37,071 40 30

Z -20 -20 -23,536 -28,107 -31,642 -31,642

Evaluate the missing co-ordinates of the points P1 to P4, as well as


M1 and M2

Enter the co-ordinate values in the table.

The values for the spaces shown with a dark background are di-
mensions that can be taken directly from the drawing.

For the solution manner see the following side

SINUMERIK 840D/810D Training and Programming Page 6 A304


Section 3 Solution for the exemplary functions

Notes

Since the two sides are equal, all values can be found using the Py-
thagoras principle.

xp 2  5  5² / 2  3,5355
zp2  xp 2  3,5355
zp4  zp2 * (1)   3,5355
xp3  zp3   3,5355
P2x  25  (2 * (5  xp 2))  25  (2 * (5  3,5355 ))  27,929
P2z  P1z  zp2  20  zp2  20  5² / 2  20  3,5355   23,5355
P3x  40  2 * (5  3,5355)  37,071
a  (P3x  p2x) / 2  (37,071  27,929 ) / 2  4,571
zp3  a  4,571
P3z  P1z  zp2  zp3  20  3,535  4,571   28,1065
P4z  P3z  zp2  28,1065  3,5355   31,642

SINUMERIK 840D/810D Training and Programming Page 7 A304


Notes

SINUMERIK 840D/810D Training and Programming Page 8 A304


A305 Reference- and zero point offsets when
turning

1 Brief description
Objective of the module:

Having worked through this module you will be enabled to use the various zero points within the
working space of a turning machine.

Description of the module:

This module describes the call-up of individual work piece zero points on the work piece with
reference to various outset conditions.

Content of the module:

 Position of the machine zero point


 Zero point offset G54
 Further zero point offsets
 Tool changing point
 Summary

Position of the Section 1


machine zero point

Zero point offset G54 Section 2

Further zero point Section 3


offsets

Tool changing point Section 4

Summary Section 5

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A305
Section 1 Position of the machine zero point

Notes
All axis motions on a CNC-machine tool are referred to the right-hand Car-
tesian co-ordinate system.

The entire path measuring system is initialized by approaching the refer-


ence point with all axes.

At the same time the control unit activates the co-ordinate system at the
machine zero point.

M Machine zero point

This fixed co-ordinate point (origin) is determined by the manufacturer and


cannot be altered by the operator.

It serves as a reference point for the machine co-ordinate system (MCS) of


the machine tool.

X Axis denominations:

Planar axis X
(Ordinate)

Z
M
Longitudinal axis Z
(Abscissa)

For reasons of design this machine zero point on turning machines is lo-
cated exactly on the rotational axis on the right hand planar face of the
spindle flange (see image).

Hence this point is not usually employed when machining a work piece.

However, it may be employed in the machining program for the approach


of fixed points that are independent of the work piece.
(see Section 4)

SINUMERIK 840D/810D Training and Programming Page 2 A305


Section 2 Zero point offset G54

Notes
For machining the work piece the work piece co-ordinate system (WCS) is
available on the machine.

This can be freely chosen by the operator depending on the manufacturing


conditions or according to the usual workshop practice.

By this the machine zero point is offset by a defined distance, thus obtain-
ing a work piece zero point that is directly referred to the item to be ma-
chined.

W Work piece zero point

Zero point offset Code G54 (modally operative)

With this code the work piece zero point can be defined on the machine.

The following image shows how by programming G54 the position of the
work piece zero point has been shifted to the right hand planar face of the
turned item.

Finished planar face of the


work piece.

(Work piece co-ordinates


along the longitudinal axis are
W negative)

The zero point set on the machine in the jogging mode is activated in the
program with the same code (G54).

By this the co-ordinate origin for the program and the machine zero point
co-ordinate are now identical.

Programming example: Explanation:

N10 G18 G54 ... Plane selection, call-up of the


zero point offset G54
N20 G0 X200 Z300 Approach of the tool changing point

N30 T1; Roughing tool Call-up of the tool T1


...

SINUMERIK 840D/810D Training and Programming Page 3 A305


Section 3 Further zero point offsets

Notes
For the efficient production of parts it is often sensible to provide several
work piece zero points.

The control unit manufacturer provides for up to 99 selectable zero point


offsets.

Hint: Depending on the machine parameters this number can be


set differently. Please refer to the machine manual regarding
the exact number of available zero points.

Further zero point offsets Codes G55, G56 and G57

Codes G505 bis G599


(all stated codes are
modally operative)

The application example indicates the use of yet another zero point lo-
cated on the setting plane of the chuck.

In the picture below the work piece zero point has been transferred with
G55 exactly to the setting plane of the chuck jaws.
In the program this must be activated by means of the code G55.

Setting face of the chuck jaws.


The left hand planar face of the
work piece is already machined.

(All work piece co-ordinates of the


W longitudinal axis must be pro-
grammed in the positive direction)

The use of several zero point offsets can substantially reduce the setting
times particularly in cases of one-off or small series machining.

For example: You could define just once a specific setting point for each
one of your clamping fixtures or else a specific work piece zero point for
various work pieces.
In the program the respective zero point offset depending on the clamping
fixture or the work piece can then be selected.

If an identical work piece is to be machined at a later time, the respective


zero point is immediately available under the same code.

Important: Any zero point offset once defined remains stored in the control
unit until such time as it is newly defined under the same code.

SINUMERIK 840D/810D Training and Programming Page 4 A305


Section 4 Tool changing point

Notes
The indexing of the tool turret must always take place at a collision-proof
point within the work space of the turning machine.

For this the tool carrier is generally retracted well back into the positive
range of the work space.
(Please take into account the real traverse ranges of your machine; the
values used in the example are only exemplary!)

Programming example 1: Explanation:

N10 G18 G54 ...


N20 G0 X300 Z150 Approach of the tool changing point,
N30 T1; Roughing tool Indexing the turret to position T1
...

On this basis the tool carrier will traverse to various positions depending
on the active tool length (in X and Z) and the position of the work piece
zero point. (It is always the tool tip that is being positioned.)

Pos. X

Pos. Z

In case the next tool is going to be for instance a long boring bar, the tool
carrier must be re-positioned along the longitudinal axis further away from
the work piece.

Otherwise there might be a danger of collision during the tool change!

On the next page a suggestion for the programming of an independent tool


changing point will be found.

SINUMERIK 840D/810D Training and Programming Page 5 A305


Section 4 Tool changing point

Notes
In order to approach a tool changing point that is independent of the length
of the tool and the presently active zero point offset, the following condi-
tions must be programmed.:

Switching OFF of all the active offsets


or manipulations of the co-ordinate system Code SUPA
(operative block-by-
block))

Deactivation of the tool lengths in X and Z Code D0


(modally operative)

Programming example 2: Explanation:

N10 G18 G54 ...


N20 G0 X400 Z500 SUPA D0 Approach of tool changing point in the
MCS, without tool data,
N30 T1; Roughing tool Indexing the turret to position T1,
N40 D1 Call-up of the tool data for T1

Pos. X

M W

Pos. Z

Since by using the code SUPA any manipulations of the co-ordinate sys-
tem have been de-activated only for the programmed block, they do not
need to be re-activated.

But care must be taken that after each tool change the required cutting
edge must be called up.

Hint: The extent of programming for the approach of the tool


changing point can be reduced if for this purpose a sub-
program is written (see Section 5).

SINUMERIK 840D/810D Training and Programming Page 6 A305


Section 5 Summary

Notes
Suggestion of a sub-program for tool changing:

Sub-program name: [Link]

N10 G18 G0 X300 Z500 SUPA G40 D0; Approach of tool changing point
in the turning plane,
zero point offsets OFF,
all tool corrections OFF,

N20 RET; Return to the main pro-


gram, without interruption of the
feed motion

Explanation of the symbols

M Machine zero point

W Work piece zero point

MCS Machine co-ordinate system

WCS Work piece co-ordinate system

Instruction Meaning

G54 to G57 Call-up of a selectable zero point offset *

G505 to G599 Call-up of further zero point offsets *


(conditionally available)

D0 De-activation of the tool dimensions *

D1– D9 Re-activation of the tool dimensions after the


tool change *

SUPA Switching-OFF of programmable, selectable and


external offsets **

RET End of sub-program, return jump

* Modally operative instruction


** Instruction operative block-by-block

SINUMERIK 840D/810D Training and Programming Page 7 A305


Notes

SINUMERIK 840D/810D Training and Programming Page 8 A305


A309 Program structure

1 Brief description
Objective of the module:

This module explains how to construct a part program clearly and functionally correct.

Description of the module:

This module describes a suggestion for a sensible structure of NC-programs.

Content of the module:

 Basic pinciples of programming


 Program structure of a part program
 Program structure of a machining sequence
 Settings at the start of a program
 Dimensioning for the X-axis

Basic pinciples of Section 1


programming

Program structure of a Section 2


part program

Program structure of
Section 3
a machining sequence

Settings at the start of Section 4


a program

Dimensioning for the X Section 5


-axis

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A309
Section 1 Basic pinciples of programming

Notes

Certain principles should be upheld when part programs are being


produced.

 The program must ensure that an unlimited number of work pieces


can be produced with the quality (tolerances, surface quality, form
and position deviation etc.) as required on the drawing in a minimum
of production time and the least possible material wastage..

 It is always the motion of the tool along the drawn ideal contour of
the work piece.

 If tolerances are shown, the programming is always referred to the


middle of the tolerance.
Example: 20+0,1 — programmed value = 20,05.
Precise dimension corrections can be carried out on the machine by
means of the wear correction feature for the tool.

 The program should exhibit a clear and concise structure and should
contain commentaries wherever possible to ensure that other users
can comprehend the layout easily at later stages.

SINUMERIK 840D/810D Training and Programming Page 2 A309


Section 2 Program structure of a part program

Notes
The following flow chart represents a possible suggestion for a suitable
structure of the main program.

Program heading

Tool call-up 1

Technology
block

Approaching the
safety level with
the tool

Machining
sequence 1

Retraction of the
tool

no yes
Workpiece finished

Tool call-up 2 End of program

Technology
block

Approaching the
safety level with
the tool

Machining
sequence 2

SINUMERIK 840D/810D Training and Programming Page 3 A309


Section 3 Program structure of a machining sequence

Notes
The programming of the machining sequence can be achieved by means
of description of the individual steps using departure commands (e.g. G0,
G1, G2 etc.) or by means of machining cycles.

The following representation refers to the flow chart in Section 2 of this


manual and describes a possible machining sequence.

Programming with G-Codes Programming using cycles

Activation of radius cor-


Input of the individual
rection
parameters using the
input mask and graphical
support
Interpolation to the first
destination point

Interpolation to the next


destination point

Interpolation to the last


destination point

De-activation of the ra-


dius correction

The following criteria should be kept in mind when selecting between the
two described possibilities:

 Availability of the cycles on the respective machine,


 Machining time required with cycles or with G-codes,
 The relation of the number of work pieces to the required program-
ming extent.

SINUMERIK 840D/810D Training and Programming Page 4 A309


Section 4 Settings at the start of a program

Notes
For the user it may be advantageous to switch on certain settings, that are
to be activated in the part program, already in the program heading. .

If necessary, these modally operative commands can always be re-set by


other commands at any stage during the program .

Programming example: Explanation:

N10 G17 G54 G64 G71 G90 G94 X/Y-plane, 1st ZP-offset,
continuous control, metrical
system, absolute dimensions,
linear feed rate F in mm/min,
N20 ….
….

Suggestion of a program heading for a turning application:

Programming example: Explanation:

N10 G18 G54 G64 G71 G90 G96 Z/X-plane, 1st ZP-offset,
continuous control, metrical
system, absolute dimensions,
constant cutting speed S in m/min,

N20 DIAMON LIMS=3000 Diameter input*, speed limitation


nmax=3000min-1
N30 ….
….

Hint for the speed limitation:

As the tool progresses towards the centre during facing, the spindle speed
evaluated internally in the control unit increases steadily until eventually the
maximum possible spindle speed would be attained.

Depending on the clamping conditions and the size of the work piece a
speed limitation should always be selected for reasons of safety.

* The explanation of the diameter input will be found in Section 5 of this manual.

SINUMERIK 840D/810D Training and Programming Page 5 A309


Section 5 Dimensioning for the X-axis

Notes

The following 3 commands determine the co-ordinate statements for the


destination points of the address X when programming departure com-
mands:

Diameter programming ON Code DIAMON

Diameter programming OFF Code DIAMOF

Diameter programming for G90,


Radius programming for G91 Code DIAM90

These commands are modally operative.

They remain valid for the program until a block is reached where an op-
posing command is programmed or terminated automatically by the end of
the program.

Hint: For turning machines the code DIAMON is normally set as a


switching-ON condition. (Please refer to the machine
manual as to which condition has been implemented by the manu-
facturer in case of your machine.)

Representation of the commands for the dimension inputs absolute (G90)


and incremental (G91):

Destination point of the X co-ordinate


Command

under G90 under G91

DIAMON * Diameter Diameter

DIAMOF** Radius Radius

DIAM90 Diameter Radius

* Switching-ON condition for turning machines


** Switching-ON condition for milling machines

On the following pages the effects of the described codes are shown
graphically.
Only the motion of the X-axis is taken is into account for this.

The roughing of the shown work piece is not part of this example.

SINUMERIK 840D/810D Training and Programming Page 6 A309


Section 5 Dimensioning for the X-axis

Notes
Effect of the command DIAMON under G90:

Programming example : Explanation:

N70 ….
N80 G90 DIAMON; Absolute dimension, diameter progr. ON
N90 G1 X0 Z0; Starting position on diameter 0
N100 X30; Motion to diameter 30
N110 Z-10; Motion in Z
N120 X60; Motion to diameter 60
N130 ...

N120 Motion to the diameter 60

N100 Motion to the diameter 30

N90 Original position of the tool

Effect of the command DIAMON under G91:

Programming example : Explanation:

N70 ….
N80 G90 DIAMON; Absolute dimension, diameter progr. ON
N90 G1 X0 Z0; Original position to diameter 0
N100 G91; Incremental dimension
N110 X30; Motion by diameter 30
N120 Z-10
N130 X30; Motion by diameter 30
N140 G90; Switching back to absolute dimensions
N150 ….

N130 Motion by the diameter 30

N110 Motion by the diameter 30

N90 Original position of the tool

SINUMERIK 840D/810D Training and Programming Page 7 A309


Section 5 Dimensioning for the X-axis

Notes
Effect of the command DIAMOF under G90:

Programming example : Explanation:

N70 ….
N80 G90 DIAMOF; Absolute dimensions, diameter progr. OFF
N90 G1 X0 Z0; Original position to the radius 0
N100 X15; Motion to the radius 15
N110 Z-10
N120 X30; Motion to the radius 30
N130 DIAMON; Diameter programming ON
N140 ….

N120 Motion to the radius 30

N100 Motion to the radius 15

N90 Original position des Werkzeuges

Effect of the command DIAMOF under G91:

Programming example : Explanation:

N70 ….
N80 G90 DIAMOF; Absolute dimensions, diameter progr. OFF
N90 G1 X0 Z0; Original position to the radius 0
N100 G91; Incremental dimension
N110 X15; Motion by radius 15
N120 Z-10
N130 X15; Motion by radius 15
N140 G90 DIAMON; Absolute dimensions, diameter progr. ON
N150 ….

N120 Motion by radius 15

N100 Motion by radius 15

N90 Original position of the tool

SINUMERIK 840D/810D Training and Programming Page 8 A309


Section 5 Dimensioning for the X-axis

Notes
Effect of the command DIAM90 under G90:
Programming example : Explanation:

N70 ….
N80 G90 DIAM90; Absolute dimensions, diameter progr. for G90
N90 G1 X0 Z0; Original position to diameter 0
N100 X30; Motion to diameter 30
N110 Z-10
N120 X60; Motion to diameter 60
N130 ….

N120 Motion to diameter 60

N100 Motion to diameter 30

N90 Original position of the tool

Effect of the command DIAM90 under G91:

Programming example : Explanation:

N70 ….
N80 G90 DIAM90; Absolute dimensions, diameter progr. for G90
N90 G1 X0 Z0; Original position auf Diameter 0
N100 G91; Incremental dimension, DIAM90 radius
programming!!!
N110 X15; Motion by radius 15
N120 Z-10;
N130 X15; Motion by radius 15
N140 G90; Absolute dimensions, DIAM90 diameter
programming!!!
N150 ….

N130 Motion by radius 15

N110 Motion by radius 15

N90 Original position of the tool

SINUMERIK 840D/810D Training and Programming Page 9 A309


Notes

SINUMERIK 840D/810D Training and Programming Page 10 A309


A310 Contour machining when milling

1 Brief description
Objective of the module:

Having worked through this module you will be able to write a simple milling program taking into ac-
count the radius correction.

Description of the module:

This module describes the commands for radius correction, the rounding and the chamfering of
edges. These you will use for the writing a simple CNC-program and provide explanations.

Content of the module:

 Cutting edge radius correction


 Rounding and chamfering of edges
 mixed incremental and absolute programming
 Example
 Summary

Cutter radius
compensation
Section 1

Rounding and
chamfering of edges Section 2

Mixed incremental and


Section 3
absolute programming

Summary
Section 4

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A310
Section 1 Cutter radius compensation
Notes
The path programmed with G1,G2 and G3 represents the path taken by
the centre of the milling cutter. In this case the radius of the milling cutter
must be taken into account.

Exercise 1
Open the editor

Write the following program heading into the editor. Explain the blocks in
the table. While doing this make yourself familiar with the editor. Mark the
zero point on the drawing

N10 G54 G64 G17


SOFT
N20 T1 Select tool Nr. 1 (PF60 with tool tips)
N30 M6
N40 S1000 F200 M3
M8 D1

N50 G0 x115 y65 z2 Approach of starting point and safety level (P1)
N60 G1 z0
N70 x-35
N80 G0 z2
N90 x115 y15
N100 G1 z0
N110 x-35
N120 G0 z150
N130 x150 y150 M9

Solution see page 12

N70 N50

N110 N90

Motion at feed rate


Motion with rapid traverse

SINUMERIK 840D/810D Training and Programming Page 2 A310


Section 1 Cutter radius compensation
Notes

The instructions G41 or G42 are necessary for the programming of con-
tours. With this the contour shown on the drawing can be described di-
rectly. The value for the milling cutter entered in the tool management is
taken into account. The equidistant path for the cutter centre evaluated by
the control unit is such that the required contour results on the cutter cir-
cumference.

To enable the control unit to evaluate the correct equidistant path it must
know whether the milling cutter is on the right or the left of the contour.
This is determined by looking in the direction of feed.

Dimensional errors can then be rectified later on by compensation for the


cutter radius.

Before activating the radius compensation a starting point should be cho-


sen that is sufficiently far from the contour. If possible this distance should
be greater than the cutter radius. The starting and end point must be cho-
sen such that no damage to the contour occurs.

S=starting point E=end point Px=programmed contour points


Equidistant path with feed direction

Solution 1: Solution 2:
Approach and leaving the Approach and leaving into fresh
contour air. The points P0 and P9 do not lie
on the contour

SINUMERIK 840D/810D Training and Programming Page 3 A310


Section 1 Cutter radius compensation
Notes
The work piece shown alongside is to
be machined in the course of this mod-
ule.

First of all the edge of the contour is to


be roughed out. For this the instruction
G0, G1, G2, G41 and G40 will be used.

In the editor supplement the program commenced on page 2 by the follow-


ing blocks. Specify the contour In the missing blocks.

N140 T=„SF14“ ;Endmill 14mm HSS


N150 M6
N160 F280 S1400 M3 M8 D1
N170 G0 x-10 y3 z2 S
N180 G1 z-5
N190 G...
N200 1
N210 2
N220 3
N230 4
N240 5
N250 6
N260 7
N270 8
N280 9
N290 10
N300 11
N310 12
N320 13
N330 14
N340 G...
N350 G1 x-10 y12 E
N360 G0 z150
N370 x150 y150 M8

Solution see page 13

SINUMERIK 840D/810D Training and Programming Page 4 A310


Section 1 Cutter radius compensation
Notes
The activation of the cutting edge radius correction can be supported by
means of the commands G247/G248 and G347/G348. By their use the
contour can be approached along a circular arc. This is termed a soft ap-
proach that prevents any contour damage at the point of contact.

The function ‘soft approach and leaving’ is the tangential approach at the
point of contact independently of the starting point.

The function is used predominantly in conjunction with the tool radius cor-
rection, however, this is not compulsory.

G247/ G248

N40 G0 x=P0 y=P0 Positioning for activation of the radius compensation


N50 G41 G247 DISR=2 x=P1 y=P1 Radius compensation activation. Approach with a
quarter circle with radius 2 to position P1. The values
for DISCL, FAD F have not been programmed.
N60 G1 x=P2 Machining the contour.

N110 G1 x=Pn-1 y=Pn-1 Approach of the last contour point
N120 G40 D248 DISR=2 x=Pn y=Pn Radius compensation de-activation by leaving with a
quarter circle of radius 2 to position P0/Pn

G347/ G348

N40 G0 x=P0 y=P0 Positioning for activation of the radius compensation


N50 G41 G347 DISR=2 x=P1 y=P1 Radius compensation activation. Approach with a
quarter circle with radius 2 to position P1. The values
for DISCL, FAD F have not been programmed.
N60 G1 x=P2 Machining the contour..

N110 G1 x=Pn-1 y=Pn-1 Approach of the last contour point
N120 G40 D348 DISR=2 x=Pn y=Pn Radius compensation de-activation by leaving with a
quarter circle of radius 2 to position P0/Pn

DISR
progr. contour

is the radius of the tool centre path.


If the tool radius correction is acti-
vated, an arc is generated with a ra-
dius such that also in this case the
tool centre path results with the pro-
grammed radius.

SINUMERIK 840D/810D Training and Programming Page 5 A310


Section 1 Cutter radius compensation
Notes

Possible approach possibilities

G140 Approach and leaving direction depending on the current


correction side (basic position value)

G141 Approach from the left and leaving to the left

G142 Approach from the right and leaving to the right

G143 Approach and leaving direction depends on the position of the


starting and end point relative to the tangential direction

G147 Approach with a straight motion

G148 Leaving with a straight motion

G247 Approach with a quarter circle

G248 Leaving with a quarter circle

G347 Approach with a quarter circle

G348 Leaving with a quarter circle

G340 Approach and leaving in space

G341 Approach and leaving in a plane

Associated parameter values

DISR Approach and leaving with straights (G147/G148) Distance of


the cutter edge from the starting point on the contour
Approach and leaving with arcs (G247, G347/G248, G348)
Radius of the cutter centre path
Caution: In case of REPOS with a semi circle
DISR states the circle diameter

DISCL DISCL=... Distance of the end point of the rapid approach


motion from the machining plane
DISCL=AC (...) Statement of the absolute position of the end
point of the rapid approach motion

FAD Geschwindigkeit der langsamen Zustellbewegung


FAD=... der programmierte Wert wirkt entsprechend dem
G-Code der Gruppe 15 (Vorschub; G93, G94 usw.)
FAD=PM (...) der programmierte Wert wird unabhängig vom
aktiven G-Code der Gruppe 15 als Linearvorschub (wie
G94) interpretiert
Das weiche An– and Abfahren wird im Modul Unterprogrammtechnik beim
Fräsen Examplehaft angewendet.

SINUMERIK 840D/810D Training and Programming Page 6 A310


Section 2 Rounding and chamfering of edges
Notes

For the machining of the finished contour the instructions RND, CHR, CHF are to
be used for the radii and the chamfers.

RND :
At the programmed intersection be-
tween two straights a radius is
added. The size of this is defined by
RND=7.

CHF :
At the programmed intersection
between two straights a chamfer is
added. The length of the chamfer
is defined by CHF=9.

CHR :
At the programmed intersection
between two straights a chamfer is
added. CHR=5 defines the length
of the legs of this chamfer.

SINUMERIK 840D/810D Training and Programming Page 7 A310


Section 2 Rounding and chamfering of edges

Notes
Describe the contour using the instructions referred to so far. A milling cut-
ter with a diameter of 8mm is to be used (Name SF8). Start describing the
contour at the point x13; y5.

N380 T=„SF8“ ;End mill 8mm HSS


N390 M6
N400 F280 S1400 M3 M8 D1
N410 G0 x6 y-7
N420 G1 z-5
N430 G... Activation of the radius compensation
N440 G1 x13 y3 Traverse close to the contour
N450 y… 1st contour point
N460 G3 x… y… I … j... Milling the radius 8 mm
N470 G… y… ... Approach of top left contour point and rounding with 2mm to
the subsequent element
N480 x… ... Milling the contour corner at the chamfer 4mm
N490 y... Approach of the stating point for the radius 20mm
N500 G ... x… y… i… j… Milling the radius 20mm
N510 G… x… y… ... Approach of the starting point of the pocket and chamfer
N520 x… y… ... Approach of the top pocket corner and rounding 4mm
N530 x… y… ... Approach of the bottom pocket corner and rounding 4mm
N540 x… y… … Approach end point of the pocket and chamfer
N550 y… Approach of starting point with radius7mm
N560 G… x… y… i… j… Milling the radius 7mm
N570 G… x10 Leaving the contour
N580 G… De-activation of the radius compensation
N590 x… y… Retraction of the cutter
N600 G … z… M... Retraction to the tool changing point, coolant OFF
N610 x150 y150 Traverse to the tool changing point

Solution see page 14

SINUMERIK 840D/810D Training and Programming Page 8 A310


Section 3 Mixed incremental and absolute programming

Notes

Angle ANG=

If for a straight only one end point co-ordinate of the plane is known, or in
the case of contours the final end point via several blocks, an angular
statement can be used to completely define the straight path section. The
angle is always referred to the abscissa of the current plane G17 to G19;
e.g.: in case of G17 to the X-axis. Positive angles are taken to be anti-
clockwise.

20
15

23
G1 x15
G1 x20 ang=-36
G1 x23 ang=-72

Mixed programming:

Absolute and incremental dimensions (G90/G91) you know already for the
programming of contours . These two types can be programmed together
in one block. For this the instructions ‘ic’ (incremental) and ‘ac’ (absolute)
can be used. In this way ‘ic’ can be used to program incremental dimen-
sions within G90. The instruction G90 is modal.

X=ic(10) The cutter moves along the x-axis by 10 mm in the


positive direction.
y=ac(12) The cutter will be positioned on point 12 of the y-axis.

20
12 4

G90 G91
G1 x12 y25 G1 x=ac(12) y=ac(25)
25

G1 x=ic(4) y22 G1 x4 y=ac(22)


22

G1 x20 y=ic(-3) G1 x=ac(20) y-3


3

SINUMERIK 840D/810D Training and Programming Page 9 A310


Section 3 Mixed incremental and absolute programming

Notes

Describe the contour using the instructions referred to so far. A milling cut-
ter with a diameter of 8mm is to be used (Name SF8).

N620 G0 x17.5 y60.5 z2 Positioning above the centre of left upper pocket
N630 G... z… M... Plunging into the pocket and coolant ON
N640 G... Activation of cutter radius compensation
(climb milling)
N650 G1 x12 y60.5 Approach of contour
N660 G1 y... RND=... 1st corner point with rounding to the next element
N670 G1 x=ic(...) Approach of starting point for 55° chamfer
N680 G1 x... ang=… Oblique 55°
N690 G1 y... RND=... 2nd corner point with rounding to the next element
N700 G1 x=...(10) RND=... 3rd corner point with rounding to the next element
N710 G... Switching to incremental dimensions
N720 G1 y... RND=... 4th corner point with rounding to the next element
N730 G1 x=ac(...) CHR=... 5th corner point with chamfering to the next element
N740 G1 y=...(...) RND=... 6th corner point with rounding to the next element
N750 G1 x... RND=... 7th corner point with rounding to the next element
N760 G... Switching to absolute dimensions
N770 G1 x... Y... Closing of contour
N780 G... De-activation of cutter radius compensation
N790 G1 x17.5 y60.5 Retraction of the cutter
N800 G0 z150 M9 Leaving the contour and coolant OFF
N810 G0 x... Y... Traverse to tool changing position
N820 M... End of program

Solution see page 15

SINUMERIK 840D/810D Training and Programming Page 10 A310


Section 4 Summary

Notes

Path information / Departure commands

Instruction Meaning

G40 Cutter radius compensation de-activated * **


G41 Cutter radius compensation to left of contour
G42 Cutter radius compensation to right of contour

CHR Chamfering the contour corner by statement of leg


length
CHF Chamfering the contour corner by statement of
the length of chamfer
RND Rounding the contour corner (radius statement)
ANG Straight with an angle

X=ic(…) Statement of the co-ordinates with incremental


dimensions
Y=ac(…) Statement of the co-ordinates with absolute
dimensions

* Switching-ON status of milling machines


** Switching-ON status of turning machines

SINUMERIK 840D/810D Training and Programming Page 11 A310


Section 1 Solution for Cutter radius compensation
Notes
The path programmed with G1,G2 and G3 represents the path of the
cutter centre. In ths case the cutter radius must be taken into account by
yourself.

Exercise 1
Open the editor

Write the following program heading into the editor. Explain the blocks in
the table. While doing this make yourself familiar with the editor. Mark the
zero point on the drawing.
N10 G54 G64 G17 Zero point offset, continuous control ON, plane selec-
SOFT tion xy, soft control
N20 T1 Select tool Nr. 1 (PF60 with tool tips)
N30 M6 Load the selected tool
N40 S1000 F200 M3 Speed (rpm), feed (mm/min), rotation clockwise, coolant
M8 D1 ON, activation of first cutting edge

N50 G0 x115 y65 z2 Approach of starting point and safety level (P1)
N60 G1 z0 Infeed to command dimension
N70 x-35 Milling (P2)
N80 G0 z2 Lift-off to safety level
N90 x115 y15 Approach of starting point for 2nd pass (P3)
N100 G1 z0 Infeed to command dimension
N110 x-35 Milling (P4)
N120 G0 z150 Lift-off to tool changing level
N130 x150 y150 M9 Approach tool changing position, coolant OFF

N70 N50

N110 N90

Motion at feed rate


Motion with rapid traverse

SINUMERIK 840D/810D Training and Programming Page 12 A310


Section 1 Solution for Cutter radius compensation
Notes

The work piece shown alongside is to


be machined in the course of this mod-
ule.

First of all the edge of the contour is to


be roughed out. For this the instruction
G0, G1, G2, G41 and G40 will be used.

In the editor supplement the program commenced on page 2 by the follow-


ing blocks. Specify the contour In the missing blocks.

N140 T=„SF14“ ;End mill 14mm HSS


N150 M6
N160 F280 S1400 M3 M8 D1
N170 G0 x-10 y3 z2 S
N180 G1 z-4
N190 G41
N200 G1 x4 y10 1
N210 y74 2
N220 G2 x6 y76 i2 y0 3
N230 G1 x68 4
N240 y63.5 5
N250 x76 y50 6
N260 y42 7
N270 x64 8
N280 y26 9
N290 x76 10
N300 y12 11
N310 x68 y4 12
N320 x12 13
N330 x0 y16 14
N340 G40
N350 G1 x-10 y12 E
N360 G0 z150
N370 x150 y150 M8

SINUMERIK 840D/810D Training and Programming Page 13 A310


Section 2 Solution for Rounding and chamfering of edges

Notes

Describe the contour using the instructions referred to so far. A milling cut-
ter with a diameter of 8mm is to be used (Name SF8). Start describing the
contour at the point x13; y5.

N380 T=„SF8“ ;End mill 8mm HSS


N390 M6
N400 F280 S1400 M3 M8 D1
N410 G0 x6 y-7 z2 S
N420 G1 z-5
N430 G41 Activation of radius compensation
N440 G1 x13 y3 Approach the contour
N450 y5 1st contour point
N460 G3 x5 y13 i–8 j0 Milling of radius 8
N470 G1 y75 RND=2 Approach upper left contour point and rounding 2mm to the
next element
N480 x67 CHF=4 Milling of corner of contour at chamfer 4mm
N490 y65 Approach starting point for the radius 20mm
N500 G3 x75 y49 i20 j0 Milling of radius 20mm
N510 G1 x75 y43 CHR=1.5 Approach of starting point of pocket and chamfering
N520 x61 y43 RND=4 Approach upper corner of pocket and rounding 4mm
N530 x61 y25 RND=4 Approach lower corner of pocket and rounding 4mm
N540 x75 y25 CHR=1.5 Approach end point of pocket and chamfering
N550 y12 Approach starting point of radius 7mm
N560 G3 x68 y5 i0 j-7 Milling of radius 7mm
N570 G1 x10 Leaving the contour
N580 G40 rDe-activation of radius compensation
N590 x6 y-7 Retraction of cutter
N600 G0 z150 M9 Retraction to tool changing level, coolant OFF
N610 x150 y150 Traverse to tool changing position

SINUMERIK 840D/810D Training and Programming Page 14 A310


Section 3 Solution for Mixed incremental and absolute programming

Notes

Describe the contour using the instructions referred to so far. A milling cut-
ter with a diameter of 8mm is to be used (Name SF8). Start describing the
contour at the point x13; y5.

N620 G0 x17.5 y60.5 z2 Positioning above the centre of left upper pocket
N630 G1 z-3 M8 Plunging into the pocket and coolant ON
N640 G41 Activation of Cutter radius compensation
(climb milling)
N650 G1 x12 y60.5 Approach of the contour
N660 G1 y52 RND=4 1st corner point with rounding to the next element
N670 G1 x=ic(7.8) Approach of starting point for 55° chamfer
N680 G1 x23.8 ang=-55 Oblique 55°
N690 G1 y41 RND=4 2nd corner point with rounding to the next element
N700 G1 x=ic(10) RND=4 3rd corner point with rounding to the next element
N710 G91 Switching to incremental dimensions
N720 G1 y18 RND=4 4th corner point with rounding to the next element
N730 G1 x=ac(23) CHR=1.5 5th corner point with chamfering to the next element
N740 G1 y=ac(69) RND=4 6th corner point with rounding to the next element
N750 G1 x-11 RND=4 7th corner point with rounding to the next element
N760 G90 Switching to absolute dimensions
N770 G1 x12 y60.5 Closing the contour
N780 G40 De-activation of Cutter radius compensation
N790 G1 x17.5 y60.5 Retraction of the cutter
N800 G0 z150 M9 Leaving the contour
N810 G0 x150 y150 Traverse to tool changing position
N820 M30 End of program

SINUMERIK 840D/810D Training and Programming Page 15 A310


Notes

SINUMERIK 840D/810D Training and Programming Page 16 A310


A311 Sub-routine techniques for milling

1 Brief description
Objective of the module:

Having worked through this module you will be able to judge the necessity for sub-routines, to write
sub-routines for contours with soft approach and leaving the contour with cutter radius compensation
and to call these up in a simple milling program.

Description of the module:

This module explains the programming with sub-routines. The soft approach and leaving of the con-
tour will be used for contour machining.
Content of the module:

 The use and necessity of sub-routines


 Dimensioning ways in sub-routines
 Programming of sub-routines
 Summary

The use and necessity


of sub-routines
Section 1

Call-up of sub-routines
Section 2

Programming of sub-
Section 3
routines

Summary
Section 4

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A311
Section 1 The use and necessity of sub-routines
Notes
If contours are programmed that are used repeatedly, it is possible to do
this using sub-routines. Here a differentiation is made between local sub-
routines, which are just used for the one work piece and global sub-
routines, which are generally usable. Sub-routines have the file extension
*.SPF (SubProgramFile)

Global sub-routines
These sub-routines can be used for all kinds of work piece programs;
these must be written keeping in mind the danger of possible collisions.
Both programs using incremental or absolute dimensions can be used.

Example:
The machine table is to be positioned at a certain location for tool chang-
ing after the machining has been completed. The co-ordinates can there-
fore be stated with absolute values.
In order to avoid collisions, z must be positioned first of all followed by x/y.

Local sub-routines
Local sub-routines are often used where contours are repeated on the
same work piece. If, for instance, a pocket is to be milled several times on
one work piece, it can be programmed just once and then repeated sev-
eral times. Since the absolute dimension vary, the pocket must be pro-
grammed from a defined starting point, which is then approached in the
main program. From there the pocket is then described with incremental
dimensions.

Example:
The contour of a pocket must be milled at 2 different locations.

SINUMERIK 840D/810D Training and Programming Page 2 A311


Section 2 Call-up of sub-routines
Notes
The choice of the type of dimensions depends largely on the usage of the
sub-routine.
When programming the following principle must be kept in mind: When
leaving the sub-routine, the status that existed before the call-up must be
re-established.

The sub-routine is called up by its name and the number of times it is to be


used. The number of repeats is programmed with the address P.
At the end there must follow the instruction M17 (end of sub-routine). After
this the control jumps back to the calling-up place in the main program and
continues with the next block.

Main program Sub-routine (contour) Explanation

N40 G90 G0 x20 y20 z2 Approach of the starting point

N50 Contour p1 Call-up of the sub-routine Contour


for 1 pass

N10 G91 Switching to incremental


dimensions

N20 G1 z-5 Plunging into the contour to z–3

N30 x10 Motion by 10mm along x-axis in


+direction

N40 y-10 Motion by 10mm along y-axis in


-direction

N50 X-10 Motion by 10mm along x-axis in


-direction

N60 y10 Motion by 10mm along y-axis in


+direction

N70 G90 Re-establish status of main


program

N80 M17 End of sub-routine

N60 G1 z2 Retraction to safety level

N70 G0 x50 y20 z2 Approach of next starting point

N80 contour p2 Call-up of the local sub-routine


contour for 2 passes

Milling of the pocket to –8

N90 G1 z2 Retraction to safety level

N100 Workpcechange p1 Call-up of the global sub-routine


Workpcechange

G53 G0 z200 Zero point offset block-by-block


OFF and retraction in z direction

G53 x200 y200 Zero point offset block-by-block


OFF and retraction in x/y direction

M17 End of sub-routine

N110 M30 End of main program

SINUMERIK 840D/810D Training and Programming Page 3 A311


Section 3 Programming of sub-routines
Notes
Below you are asked to programme the pocket as a sub-routine
(Name:UP_Modul31). The sub-routine is to be called up from the main
program (Name: Modul31).

Course work 1:
The work piece has already been programmed in the program Modul30.
This is now to be copied, renamed in [Link] and then modified.
Change to the Sector Program. Open the program directory and select the
program [Link] an.

Change to sector Open your program


Program management directory and select
with the vertical Softkey the program
[Link]

Copy the file with the


vertical Softkey

The program ac-


knowleges the
copying in the
status line
With the vertical Softkey
insert the file into the di-
rectory

The window ‚Save as‘ opens. Rename the file in MODUL31 and
acknowledge with the Softkey OK.

SINUMERIK 840D/810D Training and Programming Page 4 A311


Section 3 Programming of sub-routines
Notes

Course work 2:
Commence a new sub-routine by the name of UP_MODUL31.SPF and pro-
gramme the following program lines with the respective supplements. The pro-
gram starts at the centre cross.

N10 g… Switching to incremental dimensions


N20 g… z… Infeed by 4mm on the z-axis at feed rate
N30 g… g… DISR=… x5 Activate cutter radius compensation for climb milling with soft approach
in a quarter circle r=0.5
N40
N50
N60
N70
N80
N90 Contour description using climb milling
N100
N110
N120
N130
N140
N150 g… g… DISR=… x-5 De-activate cutter radius compensation with soft leaving the contour in
a quarter circle r=0.5
N160 g… Switching to absolute dimension programming
N170 m… End of sub-routine

For solution see page 8


Course work 3:
In the main program [Link] delete all lines as from block N620.

Open program [Link]


and set cursor on N620

Move cursor until all lines are


marked

SINUMERIK 840D/810D Training and Programming Page 5 A311


Section 3 Programming of sub-routines

Notes
Course work 4:
Alter the main program [Link] such that the internal contours are machined
using the sub-routine. When positioning in the z-axis care must be taken to con-
sider the infeed amount (z-4) per sub-routine pass.

….
N610 x150 y150
N620 G… x… y… z… M… With rapid traverse to the start-point of the upper left contour and
coolant ON
N630 …………….. p… Call-up of sub-routine for one pass
N640 G1 z1 Retraction from the pocket at feed rate
N650 g... x… y… z… With rapid traverse to the start-point of the upper right contour
N660 …………….. p... Call-up of sub-routine for two passes
N670 G… z… Retraction from the pocket at feed rate
N680 G… z… M... Departure in z to the tool changing point and coolant OFF
N690 G… x… y… Departure in x and y to the tool changing point
N700 M… End of main program

For solution see page 9

SINUMERIK 840D/810D Training and Programming Page 6 A311


Section 4 Summary

Notes

Path information / Departure commands

Instruction Meaning

UP_... P1 Sub-routine call-up with number of repeats

M17 End of sub-routine

G147 Approach with a straight

G148 Leaving with a straight

G247 Approach with a quarter circle

G248 Leaving with a quarter circle

G347 Approach with a semi-circle

G348 Leaving with semi-circle

G340 Approach and leaving in space

G341 Approach and leaving in a plane

Parameter Explanation

DISR Radius of the tool centre path for approach and


leaving
DISCL DISCL=... Distance of the end point for the rapid
infeed motion
FAD Speed of the slow infeed motion

SINUMERIK 840D/810D Training and Programming Page 7 A311


Section 3 Solution of Programming of sub-routines
Notes
Course work 2:
Commence a new sub-routine by the name of UP_MODUL31.SPF and pro-
gramme the following program lines with the respective supplements. The pro-
gram starts at the centre cross.

N10 g91 Switching to incremental dimensions


N20 g1 z1 Infeed by 4mm on the z-axis at feed rate
N30 g41 g247 DISR=0.5 x5 Activate cutter radius compensation for climb milling with soft approach
in a quarter circle r=0.5
N40 g1 x5
N50 g1 y9 rnd=4
N60 x-10.8 chf=2.12
N70 y10 rnd=4
N80 x-11 rnd=4
N90 y-17 rnd=4 Contour description using climb milling
N100 x7.8
N110 y-5.71 ang=-55
N120 y-5.287 rnd=4
N130 x10 rnd=4
N140 y9
N150 g40 g248 DISR=0.5 x-5 De-activate cutter radius compensation with soft leaving the contour in
a quarter circle r=0.5
N160 g90 Switching to absolute dimension programming
N170 m17 End of sub-routine

Course work 3:
In the main program [Link] delete all lines as from block N620.

Open program [Link]


and set cursor on N620

Move cursor until all lines are


marked

SINUMERIK 840D/810D Training and Programming Page 8 A311


Section 3 Solution of Programming of sub-routines

Notes

Course work 4:
Alter the main program [Link] such that the internal contours are machined
using the sub-routine. When positioning in the z-axis care must be taken to con-
sider the infeed amount (z-4) per sub-routine pass.

….
N610 x150 y150
N620 G0 x28.8 y50 z1 M8 With rapid traverse to the start-point of the upper left contour and
coolant ON
N630 UP_Modul31 p1 Call-up of sub-routine for one pass
N640 G1 z1 Retraction from the pocket at feed rate
N650 g0 x53.6 y50 z3 With rapid traverse to the start-point of the upper right contour
N660 UP_Modul31 p2 Call-up of sub-routine for two passes
N670 G1 z2 Retraction from the pocket at feed rate
N680 G0 z150 M9 Departure in z to the tool changing point and coolant OFF
N690 G0 x150 y150 Departure in x and y to the tool changing point
N700 M30 End of main program

SINUMERIK 840D/810D Training and Programming Page 9 A311


Notes

SINUMERIK 840D/810D Training and Programming Page 10 A311


A312 Loops, jumps, repeats

1 Brief description
Objective of the module:

Having worked through this program you will be able to programme a milling program with loops,
jumps and repeats.

Description of the module:

In the module you will learn the commands for the looping of parts of the program, for jumping to cer-
tain blocks in the program and the repeating of sections of the program.

Content of the module:

 Label denomination, Parameter usage


 Jump instructions, Program section repeats
 Example
 Summary

Label denomination,
Parameter usage
Section 1

Jump instructions,
Program section Section 2
repeats

Example
Section 3

Summary
Section 4

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A312
Section 1 Label denomination, Parameter usage
Notes
Label denomination

In order to mark up certain sections of the program or to produce a jump


mark it is possible to use labels. These can be called up in the program
by their name.
The name must consist of at least two or a maximum of 8 characters. The
first two characters must always be letters or under-lines. The name must
always be followed by a colon.

N100 ..
N110 BL123: Denomination of a label by the name of BL123
N120 G0 x10..

Parameter usage

In same cases the use of parameters is highly advisable. For instance,


the cutting values for the tools to be used can be assigned to the parame-
ters in the program heading, which can then be used for programming
instead of the cutting values themselves. The parameters are pro-
grammed with the address letter R and a number 1 (R1). Values can be
assigned to these in the sector Parameters as also in the program itself.

;T1—WSF Dr60
Program heading
R1=200 ; n for WSF Dr60
R2=30 ; vf for WSF Dr60
...
N100 T1 ; WSF Dr60
N110 m6
N120 S=R1 F=R2 M3 M8 D1 Aassignment of speed and feed by means of R1 and
R2
N130 ...

Parameters can be used within the program for the evaluation of individ-
ual values or by themselves. For reason of the advance evaluation by the
control unit it is possible that undesirable effects on the active parameters
might occur. This can be prevented by using the instruction STOPRE -
The next block will only be executed after the previous block has been
finished. For this STOPRE must be written in a block by itself.

N10 R1=0
...
N110 BL123:
N120 G0 x10..

N140 STOPRE The control unit waits until block N130 has been completed.
N150 R1=R1+1 Each time the block is run for machining R1 is increased by 1.
N160 EL123:

SINUMERIK 840D/810D Training and Programming Page 2 A312


Section 2 Jump instructions, Program section repeats
Notes

Jump instructions

Jump instructions can also be used within a program. These permit the
omission of parts of the program or to jump back for repeats. The instruc-
tion GOTOF is used to jump forward, while the GOTOB is used to jump
backward. .
For this a search is carried out for the included label name or the block
number before the jump to this location is carried out.

;T1—WSF Dr60
R1=200 ; n for WSF Dr60
R2=30 ; vf for WSF Dr60
N10 GOTOF N100 Jump to block N100
N20 LB001:

N90 GOTOF N170 Jump to block N100
N100 T1 ; WSF Dr60
N110 m6
N120 S=R1 F=R2 M3 M8 D1
N130 …
...
N160 GOTOB LB001 Jump back to lLabel LB001
N170 T4

The jump instruction caused a change in the machining sequence.

Program section repeats

Program sections between two labels can be repeated any number of


times as specified under the address P. For this the program jumps to the
first stated label name and executes all blocks of the program until the
second label name is reached. If the number of repeats is greater than
one, this procedure will be repeated as often as stated under address P.

;T1—WSF Dr60
R1=200 ; n for WSF Dr60
R2=30 ; vf for WSF Dr60
N10 T1 ; WSF Dr60
N20 m6
N30 S=R1 F=R2 M3 M8 D1
1 N40 G0 z2
N50 LB001:
2
N50 G1 z=ic(-10)

N90 LE001:
... Jump back to Label LB001 and two
N160 Repeat LB001 LE001 P2 repeats between LB001and LE001
N170 T4

SINUMERIK 840D/810D Training and Programming Page 3 A312


Section 3 Example
Notes

Holes are to be drilled into the milled work piece. These holes are to be
programmed using jumps and parameters.

Course work 1:
Under ‚Program management‘ in the sector ‚Program‘ copy the file [Link].
Rename this program [Link]. For explanations see Module 31 Sub-
program techniques.

Course work 2:
Open the file [Link] and supplement the program by the following lines for
the drilling.

….
N690 G0 x150 y150 Traverse to the tool changing point in x and y
N700 R1=... R2=... Set the parameter R1 (drilling and counter depth) and R2 (feed rate)
to zero
N710 T=„NC-centre drill“ Request NC-centre drill Ø larger 12mm (for simulation SF10)
N720 M6 Load NC-centre drill
N730 R1=… R2=... Specify depth for centring and feed rate
N740 S1000 F=... M3 M8 D1 Specify technology data for centring
N750 Repeat ... ... p1 Execute program between the Labels LB001 and LE001 once
N760 T=„SPB8“ Request drill diameter 8mm (for simulation SF8)
N770 … Load drill
N775 … Advance evaluation Stop
N780 ...=8+(8*1/3) ...=50 Specify depth for centring and countering in R1 and feed rate in R2
N790 S800 F=R2 M3 M8 D1 Specify technology data for the drill
N800 R...=8+(8*1/3) Specify depth for drilling (1/3 drill point)
N810 ... LB001 LE001 p1 Execute the program between the Labels once
N820 G0 Z150 Retraction in Z-direction
N830 X150 Y150 Retraction in X and Y-direction
N840 M30 End of program

N850 … Specify label denomination LB001


N860 G... X... Y... Z... Traverse to 1st drilling position
N870 GOTOF ... Jump to block N920
N880 LB002: Specify label denomination LB002
N890 G... X... Y... Z... Traverse to 2nd drilling position
N900 Repeat N... N… Execute blocks N920 to N940
N910 … Specify label denomination LE001

N920 G1 z=... F=... Drill at feed rate


N930 G4 S2 Dwell after reaching the drilling depth for smoothing
N940 G1 z... F=... With double the feed rate move to z2
N950 ... … Jump back to Label LB002

SINUMERIK 840D/810D Training and Programming Page 4 A312


Section 4 Summary
Notes

Path information / Departure commands

Instruction Meaning

GOTOF Forward jump to destination mark


GOTOF Lb001 or GOTOF N110

GOTOB Backward jump to destination mark


GOTOB Lb002 or GOTOB N10

When using GOTOB and GOTOF care must be


taken against endless loops. These call up each
other repeatedly. Hence the program cannot leave
this range.
The use of block numbers as destination mark is not
advisable. if the block number changes, there will be
no automatic correction.

REPEAT Repeats the section between the labels for the pro-
grammed number of times.
Repeat LB002 LE002 P2

The use of block numbers as destination mark is not


advisable. if the block number changes, there will be
no automatic correction.

R... Parameter 1-99


R1

STOPRE The next block will not be decoded until the previous
block has been completed.

….: Label denomination


LB001:

Label denominations must have at least 2 and a


maximum of 8 characters, the first 2 of which must
be either letters or under-lines.

G4 Dwell
G4 S2 Dwell for 2 revolutions
G4 F2 Dwell for 2 seconds

SINUMERIK 840D/810D Training and Programming Page 5 A312


Section 3 Lösung Example
Notes

Holes are to be drilled into the milled work piece. These holes are to be
programmed using jumps and parameters.

Course work 1:
Under ‚Program management‘ in the sector ‚Program‘ copy the file [Link].
Rename this program [Link]. For explanations see Module 31 Sub-
program techniques.

Course work 2:
Open the file [Link] and supplement the program by the following lines for
the drilling.

….
N690 G0 x150 y150 Traverse to the tool changing point in x and y
N700 R1=0 R2=0 Set the parameter R1 (drilling and counter depth) and R2 (feed rate)
to zero
N710 T=„NC-Anbohrer“ Request NC-centre drill Ø larger 12mm (for simulation SF10)
N720 M6 Load NC-centre drill
N730 R1=-5 R2=100 Specify depth for centring and feed rate
N740 S1000 F=R2 M3 M8 D1 Specify technology data for centring
N750 Repeat LB001 LE001 p1 Execute program between the Labels LB001 and LE001 once
N760 T=„SPB8mm“ Request drill diameter 8mm (for simulation SF8)
N770 M6 Load drill
N775 STOPRE Advance evaluation Stop
N780 R1=8+(8*1/3) R2=50 Specify depth for centring and countering in R1 and feed rate in R2
N790 S800 F=R2 M3 M8 D1 Specify technology data for the drill
N800 R1=8+(8*1/3) Specify depth for drilling (1/3 drill point)
N810 Repeat LB001 LE001 p1 Execute the program between the labels once
N820 G0 Z150 Retraction in Z-direction
N830 X150 Y150 Retraction in X and Y-direction
N840 M30 End of program

N850 LB001: Specify label denomination LB001


N860 G0 x25 y25 z2 Traverse to 1st drilling position
N870 GOTOF N920 Jump to block N920
N880 LB002: Specify label denomination LB002
N890 G0 x50 y25 z2 Traverse to 2nd drilling position
N900 Repeat N920 N940 Execute blocks N920 to N940
N910 LE001: Specify label denomination LE001

N920 G1 z=R1 F=R2 Drill at feed rate


N930 G4 S2 Dwell after reaching the drilling depth for smoothing
N940 G1 z2 F=R2*2 With double the feed rate move to z2
N950 GOTOB LB002 Jump back to Label LB002

SINUMERIK 840D/810D Training and Programming Page 6 A312


A313 Circular and rectangular pockets

1 Brief description
Objective of the module:

Having worked through this module you will be able to programme circular and rectangular pockets
using DIN-commands.

Description of the module:

This module explains the possibilities of DIN-programming when machining circular and rectangular
pockets.

Content of the module:

 Finishing allowance
 Programming of circular pockets
 Programming of rectangular pockets
 Exercise
 Summary

Finishing allowance
Section 1

Programming of circu-
lar pockets Section 2

Programming of rec-
Section 3
tangular pockets

Exercise
Section 4

Summary
Section 5

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A313
Section 1 Finishing allowance

Notes

It is often necessary to provide a finishing allowance when machining con-


tours and tolerance dimensions, especially if the tools were only preset. In
this case it is possible to take a measurement after the first machining fol-
lowed by a second pass permitting the tool to be corrected accordingly.

There are several possibilities for machining with a finishing allowance. For
instance, the tool radius can be theoretically increased by means of the
wear correction feature.

Without theoretically increased radius

wear = 0

G41 G1 x… y…
x… y...

With theoretically increased radius

Theoretical radius increase

Real radius

Wear = 1

G41 G1 x… y…
x… y…

SINUMERIK 840D/810D Training and Programming Page 2 A313


Section 1 Finishing allowance

Notes

Das finishing allowance kann auch durch die Verwendung des Befehls
OFFN erreicht werden. Der Wert for OFFN steht standardmäßig immer auf
0. Der Radius entspricht immer dem der toolverwaltung. Ändert sich der
Wert von OFFN somit immer dann wenn die
Schneidenradiuskompensation aktiv ist der Wert von OFFN dem Radius
zugeschlagen. Damit lässt sich das finishing allowance im Programm
beeinflussen.

OFFN>0

Realer Radius

G41 G1 x… y… G41 G1 x… y…
x… y... x… y…

Um bei der Bearbeitung von Folgewerkstücken auf das finishing allowance


verzichten zu können, empfiehlt sich die Programmierung in einem
Ausblendsatz. Dieser kennzeichnet sich durch einen Schrägstich am
Satzanfang. Dieser Satz wird bei der Aktivierung der der Ausblendsätze
bearbeitet. Sind diese Ausgeblendet wird der Satz nicht gelesen. Achten
Sie bei der Verwendung von OFFN immer darauf das der Wert wieder
zurück auf Null gestellt wird. Ansonsten bleibt der eingestellte Wert aktiv
bis M30.

N..
/ N300 OFFN=1

N400 OFFN=0

SINUMERIK 840D/810D Training and Programming Page 3 A313


Section 2 Programming of circular pockets

Notes

The circular pockets shown below are to be programmed using DIN-


commands. This can also be achieved by means of cycles. This means of
programming is described in the module ‚Cycles‘. The machining is to be
carried out with a milling cutter of 12 mm diameter.

Course work 1
Set up a file by the name of ‚[Link]‘

Course work 2
The circular pocket with a diameter of 22mm is to be milled. After the
straight plunge into the pocket, it is to be milled with a circular motion leav-
ing 0.5 mm finishing allowance for subsequent finishing.

SINUMERIK 840D/810D Training and Programming Page 4 A313


Section 2 Programming of circular pockets

Notes

N10 G55 G64 G17 Soft Zero point offset 55, plane xy, ...
N20 T=„SF12“ Call up tool SF12
N30 M6 Change tool
N40 S1300 F230 M3 M8 Select speed and feed, start spindle and coolant ON
N50 G0 X60 y20 z2 Positioning 2mm above the 1st circular pocket
N60 G1 z-3,8 Straight line plunging into the circular pocket, finishing
allowance 0,2mm
/N70 OFFN=0,25 Detrermine finishing allowance at edge in the deletion block
N80 R1=... Specify circular pocket radius
N90 CT1: Choose label for the circular pocket
N100 G41 G247 Disr=1 x=ic(R1) Approach of pocket edge with a quarter circle, radius 1
N110 G3 x=(ic0) I=ic(r1*-1) Milling the circular pocket counter-clockwise
N120 G1 G... G248 x60 y20 Disr=1 Leave edge with a quarter circle and de-activation of cutter
radius compensation
N130 CT1E: Choose label for end of circular pocket
N140 G0 z2 OFFN=0 Retraction with rapid traverse in Z from pocket

Solution see page 9

SINUMERIK 840D/810D Training and Programming Page 5 A313


Section 3 Programming of rectangular pockets

Notes

Course work 3
The rectangular pocket of length 25mm, width 20mm is to be milled. After
the straight line plunge into the pocket, it is to be milled counter-clockwise,
leaving a finishing allowance of 0.5mm for subsequent finishing.

N150 G0 X... Y... Positioning above the middle of the pocket


N160 R11=... R12=... R13=... Specification of the length (R11), the width (R12) and radius (R13)
N170 G1 z-3,8 Straight line infeed into pocket leaving finishing allowance 0,2mm
...N180 OFFN=... Determine finishing allowance of 0,25 in the deletion block
N190 RT1: Choose label for rectangular pocket
N200 G41 G... DISR=0,5 Y=ic(R12/2) Approach pocket edge with quarter circle, radius 1
N210 G1 x=ic(R11/2*(-1)) RND=R13
N220 y=ic(R12*(-1)) RND=R13
N230 x=R11 RND=R13 Machining of pocket
N240 y=ic(…..) RND=...
N250 x=ic(R11/2*(-1))
N260 G40 G248 DISR=0,5 y=ic(R12/2*(-1))
N270 RT1E: Choose label for the end of the rectangular pocket
N280 OFFN=... Set finishing allowance to zero
N290 G0 Z2 Retraction in Z

Solution see page 10

SINUMERIK 840D/810D Training and Programming Page 6 A313


Section 4 Exercise

Notes
Course work 4
Load the milling cutter SF8 and programme the roughing of the second
circular- and rectangular pocket.

N300 G0 Z100 Retraction in Z


N310 X100 Y100 Retraction in X and Y
N320 T=„SF8“ Call up milling cutter End mill 8mm
N330 M6 Load milling cutter
N340 S1500 F200 M3 M8 D1 Specify technology data for the cutter
N350 G0 X24,5 Y17 Z2 Positioning above the circular pocket
...N360 …..=0,25 Determine finishing allowance of 0,25 in the deletion block
N370 R1=8 Specify pocket radius
N380 G... Z... Infeed to 2mm before work piece surface
N390 G... z... Positioning for 1st roughing cut at z-8
N400 Repeat CT1 CT1E Mill pocket
N410 G1 z-12 Positioning for 2nd roughing cut at z-12
N420 Repeat ….. ….. Mill pocket
N430 G1 z-13,8 Positioning for 3rd roughing cut at z-13.8
N440 Repeat CT1 CT1E Mill pocket
N450 G0 Z2 Retraction in z
N460 G0 X60 Y20 Positioning above the rectangular pocket
N470 G0 z2 Infeed with rapid traverse to 2mm before work piece surface
N480 R11=... R12=... R13=... Specify pocket dimensions
N480 G1 z-8 Positioning for 1st roughing cut at z-8
N490 Repeat ….. ….. Mill pocket
N500 G1 z-8,8 Positioning for 2nd roughing cut at z-12
N510 Repeat RT1 RT1E Mill pocket
N520 G0 z2 OFFN=... Retraction in z and de-activation of finishing allowance
N530 G0 z150 Retraction in Z
N540 X100 Y100 Retraction in x and y
N550 T=„SF10“ Call up finishing cutter
N560 M6 Load finishing cutter
N570 S2000 F180 M3 M8 D1 Specify technology data for the finishing cutter
N580 G0 X60 Y20 Z2 Positioning above the first circular pocket
N590 G0 Z-4 Plunging to –4 (the face is machined)
N600 R1=11
N600 Repeat CT1 CT1E Mill the circular pocket
N610 G0 Z-7 Positioning above the bottom of pocket
N620 G1 Z-9 Plunging to bottom of pocket
N630 Repeat RT1 RT1E Mill rectangular pocket
N640 G0 z2 Retraction in z
N650 G0 X... Y... Positioning above second rectangular pocket
N660 R11=... R12=... R13=... Defining the pocket dimensions
N670 G0 z-2 Positioning above the bottom of pocket
N680 G1 z... Plunging to bottom of pocket
N690 Repeat RT1 RT1E Mill rectangular pocket
N700 G0 z-2 Lifting OFF from pocket bottom
N710 X….. Y... Positioning above the circular pocket
N720 G0 z-12 Positioning above the bottom of pocket
N730 G1 z... Plunging to bottom of pocket
N740 R1=8 Defining the pocket dimensions
N750 Repeat CT1 CT1E Milling of round corner pocket
N760 G0 z100
N770 X100 Y100
N780 M30

Solution see page 11

SINUMERIK 840D/810D Training and Programming Page 7 A313


Section 5 Summary

Notes

Path information / Departure commands

Instruction Meaning

OFFN ... Evaluation of an equidistant path - e.g. in order to


leave a finishing allowance

OFFN=0 De-activation of the evaluated equidistant path

/N… Specification of a deletion block


This block will not be executed if deletion blocks
are de-activated.

SINUMERIK 840D/810D Training and Programming Page 8 A313


Section 2 Solution for programming of circular pockets

Notes

N10 G55 G64 G17 Soft Zero point offset 55, plane xy, ...
N20 T=„SF12“ Call up tool SF12
N30 M6 Change tool
N40 S1300 F230 M3 M8 Select speed and feed, start spindle and coolant ON
N50 G0 X60 y20 z2 Positioning 2mm above the 1st circular pocket
N60 G1 z-3,8 Straight line plunging into the circular pocket, finishing
allowance 0,2mm
/N70 OFFN=0,25 Determine finishing allowance at edge in the deletion block
N80 R1=11 Specify circular pocket radius
N90 CT1: Choose label for the circular pocket
N100 G41 G247 Disr=1 x=ic(R1)Approach of pocket edge with a quarter circle, radius 1
N110 G3 x=(ic0) I=ic(r1*-1) Milling the circular pocket counter-clockwise
N120 G1 G40 G248 x60 y20 Disr=1 Leave edge with a quarter circle
N130 CT1E: Choose label for end of circular pocket
N140 G0 z2 OFFN=0 Retraction with rapid traverse in Z from pocket

SINUMERIK 840D/810D Training and Programming Page 9 A313


Section 3 Solution for programming of rectangular pockets

Notes
Course work 3
The rectangular pocket of length 25mm, width 20mm is to be milled. After
the straight line plunge into the pocket, it is to be milled counter-clockwise,
leaving a finishing allowance of 0.5mm for subsequent finishing.

N150 G0 X20 Y15 Positioning above the middle of the pocket


N160 R11=25 R12=20 R13=8 Specification of the length (R11), the width (R12) and radius (R13)
N170 G1 z-3,8 Straight line infeed into pocket leaving finishing allowance 0,2mm
/N180 OFFN=0,25 Determine finishing allowance
N190 RT1: Choose label for rectangular pocket
N200 G41 G247 DISR=0,5 Y=ic(R12/2) Approach pocket edge with quarter circle, radius 1
N210 G1 x=ic(R11/2*(-1)) RND=R13
N220 y=ic(R12*(-1)) RND=R13
N230 x=R11 RND=R13 Machining of pocket
N240 y=ic(R12) RND=R13
N250 x=ic(R11/2*(-1))
N260 G40 G248 DISR=0,5 y=ic(R12/2*(-1))
N270 RT1E: Choose label for the end of the rectangular pocket
N280 OFFN=0 Set finishing allowance to zero
N290 G0 Z2 Retraction in Z

SINUMERIK 840D/810D Training and Programming Page 10 A313


Section 4 Solution of Exercise

Notes
Course work 4
Load the milling cutter SF8 and programme the roughing of the second
circular- and rectangular pocket.

N300 G0 Z100 Retraction in Z


N310 X100 Y100 Retraction in X and Y
N320 T=„SF8“ Call up milling cutter End mill 8mm
N330 M6 Load milling cutter
N340 S1500 F200 M3 M8 D1 Specify technology data for the cutter
N350 G0 X24,5 Y17 Z2 Positioning above the circular pocket
/N360 OFFN=0,25 Determine finishing allowance
N370 R1=8 Specify pocket radius
N380 G0 z-2 Infeed to 2mm before work piece surface
N390 G1 z-8 Positioning for 1st roughing cut at z-8
N400 Repeat CT1 CT1E Mill pocket
N410 G1 z-12 Positioning for 2nd roughing cut at z-12
N420 Repeat CT1 CT1E Mill pocket
N430 G1 z-13,8 Positioning for 3rd roughing cut at z-13.8
N440 Repeat CT1 CT1E Mill pocket
N450 G0 Z2 Retraction in z
N460 G0 X60 Y20 Positioning above the rectangular pocket
N470 G0 z2 Infeed with rapid traverse to 2mm before work piece surface
N480 R11=19 R12=12 R13=5 Specify pocket dimensions
N480 G1 z-8 Positioning for 1st roughing cut at z-8
N490 Repeat RT1 RT1E Mill pocket
N500 G1 z-8,8 Positioning for 2nd roughing cut at z-12
N510 Repeat RT1 RT1E Mill pocket
N520 G0 z2 OFFN=0 Retraction in z and de-activation of finishing allowance
N530 G0 z150 Retraction in Z
N540 X100 Y100 Retraction in x and y
N550 T=„SF10“ Call up finishing cutter
N560 M6 Load finishing cutter
N570 S2000 F180 M3 M8 D1 Specify technology data for the finishing cutter
N580 G0 X60 Y20 Z2 Positioning above the first circular pocket
N590 G0 Z-4 Plunging to –4 (the face is machined)
N600 R1=11
N600 Repeat CT1 CT1E Mill the circular pocket
N610 G0 Z-7 Positioning above the bottom of pocket
N620 G1 Z-9 Plunging to bottom of pocket
N630 Repeat RT1 RT1E Mill rectangular pocket
N640 G0 z2 Retraction in z
N650 G0 X20 y15 Positioning above second rectangular pocket
N660 R11=25 R12=20 R13=8 Defining the pocket dimensions
N670 G0 z-2 Positioning above the bottom of pocket
N680 G1 z-4 Plunging to bottom of pocket
N690 Repeat RT1 RT1E Mill rectangular pocket
N700 G0 z-2 Lifting OFF from pocket bottom
N710 X24,5 Y17 Positioning above the circular pocket
N720 G0 z-12 Positioning above the bottom of pocket
N730 G1 z-14 Plunging to bottom of pocket
N740 R1=8 Defining the pocket dimensions
N750 Repeat CT1 CT1E Milling of round corner pocket
N760 G0 z100
N770 X100 Y100
N780 M30

SINUMERIK 840D/810D Training and Programming Page 11 A313


Notes

SINUMERIK 840D/810D Training and Programming Page 12 A313


A314 Mirroring, Offset, Rotating and Scaling
when milling

1 Brief description
Objective of the module:

Having worked through the module you will know the commands for Mirroring, Offset, Rotating and
Scaling of contours.

Description of the module:

This module explains the use of the commands for the machining of identical contour elements in
various positions.

Content of the module:

 Scaling
 Mirroring
 Offset
 Rotating

Offset
Section 1

Rotating
Section 2

Mirroring
Section 3

Scaling
Section 4

Summary
Section 5

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A314
Section 1 Offset
Notes
General introduction

The commands in this module are known as frames (calculation instruc-


tions). They can influence, cancel or condition each other. In our example
a known contour, which is described in a sub-program, is to be milled in
various positions and sizes.
For this the zero point at the starting point of the contour of the sub-
program must be rotated. In order to be able to rotate the program about
the starting point of the sub-program, this point must be the zero point. Our
work piece zero point (G54) lies in the middle of the work piece.

TRANS, ATRANS

The zero point can be offset in the programmed axes by means of these com-
mands. The command TRANS clears all active frames. ATRANS (adaptive offset)
generates the active frames.

Work piece 1 Work piece 2 Work piece 3 Work piece 4

ATRANS x30 ATRANS x30


TRANS x60 ATARNS x30

For instance in case of multiple settings of work pieces the zero point can be off-
set and the main program executed repeatedly.

SINUMERIK 840D/810D Training and Programming Page 2 A314


Section 1 Offset
Notes

In the following example the zero point is to be transformed to the starting


point of the left hand contour.

Course work 1

Set up a new file by the name of [Link]

Course work 2

Programme the lines for milling the surface. Take into account that the
zero point lies in the middle. The milling cutter (PF60) has a diameter of
60mm, the work piece measures 80x80mm.

N10 G54 G64 G17 Soft


N20 T="PF60"
N30 M6
N40 S1000 F200 M3 M8 D1
N50 G0 x80 y20 z2
N60 G1 z0
N70 x-80
N80 G0 z2
N90 x80 y-20
N100 G1 z0
N110 x-80
N120 G0 z150
N130 x150 y150 M9

Course work 3

Load a milling cutter SF8, offset the zero point to the starting point of the contour
and position the tool at this location.

N140 T="SF8" Call up the tool


N150 ... Tool change
N160 S2000 F100 M3 M8 D1 Technology data for the tool
N170 …. X…. Y…. Offset the zero point additively
N180 G0 X... Y... Z... Position the tool

Solution see page 9

SINUMERIK 840D/810D Training and Programming Page 3 A314


Section 2 Rotating
Notes

ROT, AROT

The co-ordinate sytem can be rotated by means of the command ROT or


AROT. The counter-clockwise rotation id taken to be positve. The positive
X-axis represents the zero-degree position.

There are two ways of programming.

Variant 1
Rotation about an axis
AROT X.. Y.. Z..

X+
+
+
Y+

AROT z=90
X+ Y+
The zero point has been rotated by 90° about the Z-axis.

Variant 2
Rotation of the active plane
AROT RPL...

X+
+
+
Y+

AROT RPL=90 Y+
X+

The active plane has been rotated by 90° about the Z-axis.

The command ROT resets the co-ordinate system and all other active
frames back to the original status.

Course work 4

Rotate the co-ordinate system by the required amount about the now valid
zero point. Enter the work piece with the cutter at feed rate by 3mm. After
that start the sub-program. Now un-select all frames.

N190 … … Rotate the co-ordinate system


N200 g… z... plunging into the contour contour
N210 ……. Call up the sub-program UP_Modul31
N220 G0 z2 Retract to 2mm above the work piece
N230 …. Terminate all Frames

Solution see page 10

SINUMERIK 840D/810D Training and Programming Page 4 A314


Section 3 Mirroring
Notes

MIRROR, AMIRROR

With the command MIRROR or AMIRROR the co-ordinate system can be


mirrored about the programmed axis or axes. In such a case the pro-
grammed co-ordinates are mirrored about the axis or axes by their sign.

Variant 1
Mirroring an axis
AMIRROR X0
Y+

Y+
X+
X+
Variant 2
Mirroring several axes
MIRROR X0 Y0
Y+

X+ X+

Y+
The command MIRROR resets the co-ordinate system and all other
active frames back to the original status.

Course work 5

Mirror the work piece about the X-axis. Offset the zero point to the starting point of
the contour and there rotate the co-ordinate system. Take into account the posi-
tion of the positive X-axis.

N240 ….. X… Mirroring the X-axis


N250 a…. X... Y... Offset to the starting point of the contour
N260 g0 x... y... z2 Position the tool
N270 … ... Rotate co-ordinate system additively

Solution see page 11

SINUMERIK 840D/810D Training and Programming Page 5 A314


Section 4 Scaling
Notes
SCALE, ASCALE

In some cases the Scaling of contour elements is quite sensible. The exist-
ing contours can be scaled up or down by a given factor.

The factor is defined following the command Scale for each individual axis.

SCALE y2 SCALE x2 SCALE x2 y2

ASCALE y2 ASCALE x2 SCALE

When programming with ASCALE the calculations are always referred to


the presently valid co-ordinate system. With the command Scale the val-
ues of the active zero point offset are taken as a basis. All presently active
offsets, mirrorings, scalings and transformations (frames) are cancelled.

If no value follows the command scale SCALE all frames are cancelled.
The same applies to the command M30.

The value programmed under SCALE represents a factor. If this is >1 an


enlargement takes place, in case of values <1 diminished. Care must be
taken that radii are also affected. This can possibly lead to errors..

Variant 1
Scaling of an axis
ASCALE X1.5

All X-values are multiplied by 1.5.

Variant 2
Scaling of several axes
ASCALE X=1x1.5 Y=1x1.5

The scaling factor can also be calculated in the program by entering


the formula.

SINUMERIK 840D/810D Training and Programming Page 6 A314


Section 4 Scaling
Notes

Course work 6

Scale the X and Y-axis. Let the control unit calculate the respective factor.
Plunge into the work piece by 3mm and cal up the sub-program
UP_Modul31. Traverse to the tool changing point. Terminate the main pro-
gram.

The scaling factor (Sf) is calculated from the formula:

Dimension of command geometry 32.55


Sf    1,1625
Dimension of actual geometry 28

N280 ... x=32.55/... y=…/21.8 Scale additively the X and Y-axis


N290 G... z-3 Plunge into the contour.
N300 ….. Call up the sub-program
N310 G... z200 Retraction in Z
N320 x150 y150 Traverse to tool changing position
N330 M... End of program

Course work 7 Solution see page 12

Set up the simulation as follows.

SINUMERIK 840D/810D Training and Programming Page 7 A314


Section 5 Summary
Notes
Frame - Concept (Calculation instructions)

Absolute programmable zero point offset as referred to the presently


TRANS X... Y... Z... valid, with G54 to G57 and G505 to G599 selected work piece
zero point
ATRANS X... Y... Z... Additive programmable zero point offset as referred to the presently
valid, selected or programmed zero point
X..... Y..... Z..... Offset value in direction of the stated axis
TRANS De-activation of programmable zero point offsets, previously
programmed frames are cleared

Absolute programmable rotation as referred to the presently valid, with


ROT X.. Y.. Z.. G54 to G57 and G505 to G599 selected work piece zero point
RPL=..

AROT X.. Y.. Z..


RPL=.. Additive programmable rotation as referred to the presently
valid, selected or programmed zero point
X..... Y..... Z..... Rotation angle in space: - Geometry axis that is being rotated
RPL= ..... Rotation angle in a plane: - angle by which the co-ordinate system
Is rotated - (plane previously selected with G17 to G19)
ROT De-activation of programmable rotation, previously programmed
frames are cleared

SCALE X... Y... Z... Absolute programmable enlarging or diminishing (scaling), as referred
to the presently valid, with G54 to G57 and G505 to G599 selected
work piece zero point

ASCALE X... Y... Z... Additive programmable enlarging or diminishing (scaling) as referred

to the presently valid, selected or programmed zero point


X..... Y..... Z..... Scaling factor (smaller / greater 1) in direction of stated axis

De-activation of programmable enlarging or diminishing, previously


SCALE programmed frames are cleared

MIRROR X... Y... Z... Absolute programmable mirroring as referred to the presently valid,

with G54 to G57 and G505 to G599 selected work piece zero point
AMIRROR X...Y...Z... Additive programmable mirroring as referred to the presently
valid, selected or programmed zero point

X..... Y..... Z..... Co-ordinate axis, in which the signs are changed,

(the value for X / Y or Z can be freely selected - e.g. X0 / Y0 / Z0)

MIRROR De-activation of programmable mirroring, previously programmed

frames are cleared

SINUMERIK 840D/810D Training and Programming Page 8 A314


Section 1 Solution Trans
Notes

In the following example the zero point is to be transformed to the starting


point of the left hand contour.

Course work 1

Set up a new file by the name of [Link]

Course work 2

Programme the lines for milling the surface. Take into account that the
zero point lies in the middle. The milling cutter (PF60) has a diameter of
60mm, the work piece measures 80x80mm.

N10 G54 G64 G17 Soft


N20 T="PF60"
N30 M6
N40 S1000 F200 M3 M8 D1
N50 G0 x80 y20 z2
N60 G1 z0
N70 x-80
N80 G0 z2
N90 x80 y-20
N100 G1 z0
N110 x-80
N120 G0 z150
N130 x150 y150 M9

Course work 3

Load a milling cutter SF8, offset the zero point to the starting point of the contour
and position the tool at this location.

N140 T="SF8" Call up the tool


N150 M6 Tool change
N160 S2000 F100 M3 M8 D1 Technolgy data for the tool
N170 Atrans x-16.02 y-10.02 Offset the zero point additively
N180 G0 x0 y0 z2 Position the tool

SINUMERIK 840D/810D Training and Programming Page 9 A314


Section 2 Solution Rotating
Notes

ROT, AROT

With the command ROT or AROT the co-ordinate system can be rotated.
In this case the anti-clockwise direction is positive. The positive X-axis is
taken to be the zero position.

For this there are two ways of programming.

Variant 1
Rotation about an axis
AROT X.. Y.. Z..

X+
+
+
Y+

AROT z=90
X+ Y+
The zero point was rotated by 90° about the Z-axis.

Variant 2
Rotation about the active plane
AROT RPL...

X+
+
+
Y+

AROT RPL=90 Y+
X+

The active plane has been rotated by 90° about the Z-axis.

The command ROT resets the co-ordinate system and all other active
frames back to the original status.

Course work 4

Rotate the co-ordinate system by the required amount about the now valid zero
point. Plunge the milling cutter into the work piece by 3mm with feed rate. After
that start the sub-program. After that de-activate all frames.

N190 Arot z-20 or (Arot RPL-20) Rotate the co-ordinate system


N200 g1 z-3 Plunge into the contour
N210 UP_Modul31 Call up sub-program UP_Modul31
N220 G0 z2 Retraction to 2mm above the work piece
N230 Trans or (Rot) De-activate all frames

SINUMERIK 840D/810D Training and Programming Page 10 A314


Section 3 Solution Mirroring
Notes

MIRROR, AMIRROR

With the command MIRROR or AMIRROR the co-ordinate system can be


mirrored about the programmed axis/axes. The co-ordinates programmed
hereafter will be mirrored about the axis/axes by changing the sign.

Variant 1
Mirroring einer axis
AMIRROR X0
Y+

Y+
X+
X+

Variant 2
Mirroring mehrer axisn
AMIRROR X0 Y0
Y+

X+ X+
Y+
The command MIRROR resets the co-ordinate system and all other active
frames back to the original status.

Course work 5

Mirror the work piece about the X-axis. Offset the zero point to the starting point of
the contour and there rotate the co-ordinate system. Take into account the posi-
tion of the positive X-axis.

N240 amirror x0 Mirroring the X-axis


N250 atrans x-16.02 y-10.02 Offset to the starting point of the contour
N260 g0 x0 y0 z2 Position the tool
N270 arot z-20 or RPL=-20 RRotate co-ordinate system additively

SINUMERIK 840D/810D Training and Programming Page 11 A314


Section 4 Scaling
Notes
Course work 6

Scale the X and Y-axis. Let the control unit calculate the respective factor.
Plunge into the work piece by 3mm and cal up the sub-program
UP_Modul31. Traverse to the tool changing point. Terminate the main pro-
gram.

The scaling factor (Sf) is calculated from the formula:

Dimension of command geometry 32.55


Sf    1,1625
Dimension of actual geometry 28

N280 ascale x=32.55/28 y=26.35/21.8 Scale additively the X and Y-axis


N290 G1 z-3 Plunge into the contour.
N300 up_Modul31 Call-up of sub-program
N310 G0 z200 Retraction in Z
N320 x150 y150 Traverse to tool changing position
N330 M30 End of program

Course work 7

Set up the simulation as follows.

SINUMERIK 840D/810D Training and Programming Page 12 A314


A315 Machining with cycles

1 Brief description
Objective of the module:

Having worked through this module you will be able to programme with cycles.

Description of the module:

This module shows the general way that cycles work and enables you to employ them.

Content of the module:

 General aspects of programming with cycles


 General cycle layout
 List of cycles

General aspects of
programming with
Section 1
cycles

General cycle layout


Section 2

List of cycles
Section 3

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A315
Section 1 2 General aspects of programming with cycles
Notes

Many standard machining jobs can be carried out with cyces. This applies
for example to face-milling, the milling of slots and pockets or drilling of
work pieces. The available cycles vary from machine to machine. Further-
more, the layout of the individual cycle depends on the respective cycle
status (version).

Example for drilling:


For drilling the hole positions as well as the way the bore is to be made are
required.

Example for pocket milling:


The length, width and position of the pocket would have to be pro-
grammed.

The blocks needed for this are implemented in the cycle. the cycle takes
care of the approach motions, the machining and the defined ending.
This means that after the cycle has been completed, all values that were
active before the start of the cycle are once more activated.

The cycles used on the Sinumerik all have the same layout. Hence it is
relatively easy to understand the functions and explanations. Graphics of-
ten provide useful support to this end.

Cycles

Sequence

The available cycles for the required sequence (boring, milling) can eas-
ily be found by means of the horizontal Softkeys.

The cycles available for the selected sequence are then shown for se-
lection by means of the vertical Softkeys.

SINUMERIK 840D/810D Training and Programming Page 2 A315


Section 2 2 General cycle layout
Notes

The parameters used in all cycles will be explained briefly below.

The retraction plane


is approached with
rapid traverse before
and after the cycle.

The retraction plane should be chosen such that a lateral departure is pos-
sible without danger of collision. This must be borne in mind particularly in
the case of complex set-ups.
Explanation

The reference plane


is that of the starting
point for the
machining.

If a face has just been milled at Z–3 and holes are now to be drilled into
this face, the reference plane can be specified at –3.

The safety distance


is used for the
approach at rapid
traverse rate.

The control unit traverses the tool to this point with rapid traverse and then
switches to the programmed feed rate. The safety distance is incremental
relative to the reference plane.

SINUMERIK 840D/810D Training and Programming Page 3 A315


Section 2 2 General cycle layout
Notes

The depth repre-


sents the final depth
for the machining.

The depth is programmed as an absolute dimension referred to the work


piece zero point.
Alternative

The type of machin-


ing can be selected.

In some of the input masks there is often a possibility of choosing the type
of machining. The possible values are already provided. These can be
chosen by means of the Softkey ‚Alternative‘.

Permits the direct access


to Online-Help

SINUMERIK 840D/810D Training and Programming Page 4 A315


Section 3 2 List of cycles

Notes
The cycles listed here are but a small selection.

Drilling without swarf clearance / reaming / cen-


tring

Drilling with swarf relief or chip breaking

Boring

Tapping
Boring

Hole positions with circular or rectangular ar-


rangement

Will be explained later

Provides the possibility to carry out pro-


grammed cycles again

Planar milling of work pieces

Milling along a programmed path that is


defined in a sub-program.
Milling

Rectangular or circular pockets

Milling of slots

Milling a spigot

Further cycles

Provides the possibility to carry out pro-


grammed cycles again

SINUMERIK 840D/810D Training and Programming Page 5 A315


Notes

SINUMERIK 840D/810D Training and Programming Page 6 A315


A316 Dealing with cycles

1 Brief description
Objective of the module:

Having worked through this module you will be able to add the parameter values to cycles comforta-
bly with the support of the editor.

Description of the module:

This module describes the general dealing with cycles in the program editor by means of the drilling
cycle „CYCLE82“.

Content of the module:

 General aspects regarding cycles


 Selection in the editor
 Input mask and parametering
 Multiple call-up

General aspects Section 1


regarding cycles

Selection in the editor Section 2

Input mask and Section 3


parametering

Call-up in a program Section 4

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A316
Section 1 General aspects regarding cycles

Notes

Why the necessity of cycles?

The manufacturer of the control unit has provided a number of cycles for
certain, often recurring technological sequences on CNC-machines.

Assuming a complex contour pocket were to be milled or items were being


turned with a number of back-cuts and the entire sequence were to be pro-
grammed with G-codes.

Quite apart from the extremely high programming effort the alteration of
certain dimensions might well mean that the whole NC-program would
have to be newly created.

Cycles simplify the programming significantly and provide over and


above this a great number of technological variations for the machin-
ing of work pieces.

The technological steps are already programmed into these efficient and
productive programs. The necessary mathematical co-ordinate values, the
technological data and variations are supplied to the control by means of
parameters.

Example: Layout of a drilling cycle:

Cycle „Drilling, centring— CYCLE82“:

Programming: CYCLE82 (RTP, RFP, SDIS, DP, DTP)

Name
Retraction plane
Reference plane
Safety level
Final drilling depth
Dwell

The programmer simply has to provide these parameters together


with the specific work piece values for programming.

The input of the parameter values into the program can be carried out ei-
ther via the input mask for cycle support or directly in the NC-block.

SINUMERIK 840D/810D Training and Programming Page 2 A316


Section 2 Selection in the editor

Notes
When the editor is opened, the whole pallet of the cycles implemented in
the control unit is at your disposal.

The cycles are sub-divided into the technologies drilling, Milling and Turn-
ing.

The horizontal Softkeys lead to the respective technology.

For further explanation of the general dealing with cycles the cycle
„Drilling, centring“ will be described in the following. .

The vertical Softkey strip shown in the image below appears after pressing
the Softkey „Drilling“ and shows the available cycles together with the ad-
ditional functions provided.

Drilling of low-depth holes and reaming.

For deep holes with the options chip breaking and swarf
removal.

Drilling and counter drilling with single point tools.

Tapping with and without compensation chuck.

Drilling patterns for holes in line, on a grid, pitch circle,


any positions and repeat of position.

Un-selection of a modal call-up.

Opening the input mask for editing an already parame-


tered cycle in an NC-block.

Hint: Depending on the software version and cycle availability of


your control unit the assignment to the various keys can be
different.

SINUMERIK 840D/810D Training and Programming Page 3 A316


Section 3 Input mask and parametering

Notes
After selection of the cycle the editor opens an input mask for the safe pro-
gramming of the necessary parameters:

Optional Softkeys

Name of the cycle Description of the current


parameter

Parameter with input


field alongside

For leaving the input


mask
Graphics

Return to the upper level Start of the help screen


of the editor

SINUMERIK 840D/810D Training and Programming Page 4 A316


Section 3 Input mask and parametering

Notes
The more important parameters of a machining cycle are described below
using the example CYCLE82.

rapid traverse feed

A graphical help depiction is shown permanently to back up the displayed


parameter description.

Parameter description

Retraction plane RTP

 This serves as a safety plane for the approach of the first and any
further machining position. With this any possible collision with
clamps and other parts of the work piece, which extend above the
machining plane, is avoided.

Reference plane RFP

 Work piece plane on which the machining commences.

Safety distance SDIS

 Safety distance above the reference plane. The control unit auto-
matically locates this in the opposite direction to the drilling direction.
(please do not enter a directional sign!)

Final drilling depth DP

 The input can be either as an absolute dimension relative to the work


piece zero point or incremental from the reference plane.

Dwell DTB

 Dwell period in seconds for tool relief and cleaning up at the bottom
of the hole.

SINUMERIK 840D/810D Training and Programming Page 5 A316


Section 3 Input mask and parametering

Notes
The values of any parameters not required for a particular machining se-
quence (e.g. the dwell when drilling small diameter holes) can remain „0“
or else the values can be deleted.

After specifying the parameter values return to the editor by pressing the
key “OK“.

Block N140 shows a completely parametered drilling cycle.

Alteration of the parameter values

In order to change any parameters, position the cursor in the block of the
NC-program containing the cycle and press the Softkey ‘Revert to mask’.

The graphics together with the input mask appear once more showing the
parameters already programmed. These can now be changed as neces-
sary.

Obviously it is also possible to edit the parameter values directly in the NC-
block without using the mask.

In this case it is most important to ensure the correct sequence and that
the values are properly separated by correctly placed kommas.

Hint: If the inputs are changed by direct editing, the possibility to


revert to the mask is lost.

SINUMERIK 840D/810D Training and Programming Page 6 A316


Section 4 Call-up in a program

Notes
Before a cycle is started, the tool must be activated and located in a safe
position such as to prevent a collision during approach to the work piece.

Important: After the cycle has been completed, the tool will be back
in that position which it had before the cycle was called
up.

When carrying out the cycle, the control differentiates in case of a drilling
cycle between a once-only and multiple call-up.

Once-only call-up

If only one hole is to be drilled, the tool must be traversed to the required
drilling position in the active plane (X and Y in case of vertical milling ma-
chines) before the cycle is called up.

The co-ordinates for the infeed axis (Z-axis) are always stated in the cy-
cle. A preceding approach is not necessary.

SINUMERIK 840D/810D Training and Programming Page 7 A316


Section 4 Call-up in a program

Notes
If several holes are to be drilled with the same tool, a modal call-up of the
drilling cycle is advisable.

Multiple call-up

As in all other cases when using a cycle, the prime requisite before starting
the cycle is that the activated tool is located at a safe, collision-free posi-
tion.
However, it is not necessary to approach the co-ordinates of any drilling
position; the cycle always expects the position statements directly after it
has been called up.

By pressing this key (see page 4) the cycle is acti-


vated modally.

The positions can be stated with the Code G0.

For pitch circles or systematically spaced holes the control unit provides an
effective means for the input using positioning cycles.

These can be accessed by means of the key shown alongside (see page
3)

The code MCALL should be seen as a switch. It renders the cycle call-up
modal (block N190).

Directly after stating the positions for drilling, the multiple call-up must be
switched OFF again with the same code (block N230).

If this is omitted the ensuing running of the program can pos-


sibly be disrupted considerably.

SINUMERIK 840D/810D Training and Programming Page 8 A316


A317 Drilling cycles - Milling

1 Brief description
Objective of the module:

Having worked through this module you will be able to programme drilled holes using cycles.

Description of the module:

This module explains how to use cycles for drilling operations on the milling machine.

 Overview of the co-ordinate system


 Zero point offset side in the control unit
 Setting the zero point offset

Content of the module:


Deep hole drilling
Section 1

Modal call-up
Section 2

Drilling patterns
Section 3

Tapping
Section 4

Summary
Section 5

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A317
Section 1 Deep hole drilling
Notes
The menu selection showing the available drilling cycles is
accessed by pressing the horizontal Softkey „Drilling“ .

By pressing the vertical Softkey „Deep hole drilling“ the


required cycle is selected.

Final drilling depth,


absolute relative to the
zero point or incremental
relative to the reference
plane

Drilling depth 1 absolute


relative to the zero point
or incremental relative to
the reference plane

Further explanations:

DAM Degression, reduction of the ensuing drilling depths,


(every further drilling depth is reduced by this value)

DTP Dwell at the intermediate drilling depth in seconds or


revolutions

FRF Correction factor for the feed rate programmed with F


specially for the first drilling depth

Machining Technology for chip breaking or chip clearance

Axis Axis, which is parallel to the hole. (Z=3rd geo-axis)

MDEP Minimum drilling depth if the actual drilling depth has be


come too small due to the degression.

VRT Retraction distance for chip breaking

DTD Dwell for cleaning at the final depth in seconds or


revolutions.

SINUMERIK 840D/810D Training and Programming Page 2 A317


Section 1 Deep hole drilling
Notes

Explanation of drilling depth when centring.

NC-centring drills are used for the centring on


CNC-machines. These feature a 90° point an-
gle and a very small lateral cutting edge. In or-
der to attain the required chamfering diameter Final drilling depth=
the centring drill must enter the work piece to a chamfer diameter/2
depth equal to the chamfer radius (see sketch).

Chamfer diameter

The shown work piece is to be drilled in the course of this work piece.
As a first step the hole at x-20 y-20 is drilled. For this the hole must be centred
deep enough to attain the chamfering diameter followed by drilling the hole. In the
example the cycle ‚Drilling/centring‘ CYCLE82 is used for centring and for drilling
the deep hole drilling cycle CYCLE83. Here all parameters
necessary for the machining can be set. For this open the %[Link]
N10 G54 G64 G17 Soft
program [Link] and supplement the program. N20 T="PF60"
N30 M6
N40 S1000 F200 M3 M8 D1
N50 G0 x115 y65 z2
N60 G1 z0
N70 x-35
N80 G0 z200

N90 T="ZB12"
The CYCLE82 can also
N100 M6
be used for reaming.
N110 S1200 F150 M3 M8 D1
N120 G0 x-20 y-20

N130 CYCLE82(2,0,1,-4.25,,1)
N140 T="SPB8"
N150 M6
N160 S1200 F150 M3 M8 D1
N170 G0 x-20 y-20
M6

20
x10

8* 4
/ 20

5°(3
0
R1
20

60°)

N180 CYCLE83(2,0,1,-30,,-10,,1,0,,1,1,3,3,,-1,1)
N190 G0 Z200
45°
45

n
8
9

-3
0
TIE
F
9xn 8
x20
9

11

SINUMERIK 840D/810D Training and Programming Page 3 A317


Section 1 Deep hole drilling
Notes
Exercise

In the deep hole drilling cycle the following values have been programmed (see
page 3). Please answer the posed questions.

To which position does the machine traverse at rapid traverse rate?

X Y Z

Where does the face to be drilled commence?

Z
Up to which Z value (abs) does the machine plunge into the work piece for the first
drilling?

Z
Up to which Z-dimension (abs) does the machine drill in the first step?

Z
How deep is the second drilling depth?

How many chip clearing processes are there? State the depths (abs)

1 2 3 4 5 6 7 8 9 10
M6

For solution see page 12 20


x10

8* 4
/ 20

5°(3
0
R1
20

60°)
45°
45

n
8
9

-3
0
TIE
F
9xn 8
x20
9

11

SINUMERIK 840D/810D Training and Programming Page 4 A317


Section 2 Modal call-up
Notes

In order to machine similar holes with just one cycle definition, the modal call-up is
posssible.
With the modal call-up a range is defined in which the type of machining and the
associated hole positions are described. This range starts with an MCALL and
finishes with a second MCALL. If these hole positions are to be used again for a
later machining sequence, they can be called up again with a label denomination.

Example:

N100 MCALL CYCLE82(:::) Open the modal range, state the


…. machining parameters for centring
N110 POS001: Specify label denomination
N120 G0 x… y…
N130 G0 x… y… Drilling positions
N140 G0 x… y…
N150 MCALL Close the range MCALL
N160 POS001E: Specify label denomination
….
N200 MCALL CYCLE83(:::) Open the modal range, state the
machining parameters for drilling

N210 REPEAT POS001 POS001E Repeat drilling position

Exercise

In the following the holes on the pitch circle are to be defined in a Label by means
of polar co-ordinates and centered 3.25mm deep. For this insert the program
section after line 130.

N200 MCALL CYCLE82(2,0,1,-3.25,,1) Open the modal range and specify machining with
CYCLE 82 festlegen
N210 POS001: Specify label denomination POS001
N220 G111 x-20 y... Specify POL for polar the co-ordinates to be the centre
of the circular pocket
N230 G0 ap=... rp=... Specify polar co-ordinates for the 1st hole
N240 G0 ap=ic(...) rp=10
N250 G0 ap=ic(...) rp=10 Explanation see solution Summary page 10
N260 G0 ap=ic(...) rp=10
N270 G0 ap=ic(...) rp=10 Incremental advance for 7 further holes
N280 G0 ap=ic(...) rp=10
N290 G0 ap=ic(...) rp=10
N300 G0 ap=ic(...) rp=10
N310 ... Terminate modal range
N320 …. Specify label denomination POS001E

For solution see page 13


M6

20
x10

8* 4
/ 20

5°(3
0
R1
20

60°)
45°
45

n
8
9

-3
0
TIE
F
9xn 8
x20
9

11

SINUMERIK 840D/810D Training and Programming Page 5 A317


Section 3 Drilling patterns
Notes

Cycles are available for a circular and rectangular pattern for the programming of
standard drilling pattern.

Using the pattern „Grid for holes in line“ the holes on the grid of our
work piece are now to be centred.

Exercise

N330 MCALL CYCLE82(2,0,1,-4.25,,1) Specifying the machining parameter for the


centring in a modal manner

Name Label Denomination of the label for later call-up


SPCA Point at bottom left in x
In our example the point at the top right is dimensioned. In order to be
able to use this the grid will be rotated later on.
SPCO Point at bottom left in y
Angle Angle to the positive x-axis.
In our example it is rotated by 180°. Hence the point at the top right is
located at the 0° position at the bottom left.

180° 90°

DIS1 Distance between lines 9mm


DIS2 Distance between columns 9mm
NUM1 Number of lines 3
NUM2 Number of columns 3

N340 POS002:
N350 CYCLE801(-11,-45,180,9,9,3,3) Result of the cycle programming
N360 ENDLABEL:
N370 MCALL

SINUMERIK 840D/810D Training and Programming Page 6 A317


Section 3 Drilling patterns
Notes

Programme the following machining steps.

Drilling the holes in the hole grid and the central bore of the pitch circle

N380 T="SPB8" Call-up of drill


N390 … Load drill
N400 S1200 F150 M3 M8 D1 Specify technology data
N410 MCALL CYCLE83(2,0,1,-20,,-10,,1,0,,1,1,3,3,,-1,1) Using the deep hole drilling cycle
machine the hole grid in modal
manner.
N420 ………. ……….. …………. call up the label range for hole
N430 MCALL

Drilling der holes im pitch circle


N440 T="SPB5" Call-up of drill
N450 M6 Load drill
N460 S1900 F120 M3 M8 D1 Specify technology data
N470 ………. CYCLE83(2,0,1,…..,,-10,,1,0,,1,1,3,3,,-1,1) Define deep hole drilling cycle for pitch
modally
N480 ………. ……….. …………. Call up the drilling positions by means
of the label

For solution see page 14


M6

20
x10

8* 4
/ 20

5°(3
0
R1
20

60°)
45°
45

n
8
9

-3
0
TIE
F
9xn 8
x20
9

11

SINUMERIK 840D/810D Training and Programming Page 7 A317


Section 4 Tapping
Notes
For the cutting of threads the cycle „Tapping“ can be used.

As for the drilling cycle the machining parameters must be specified. The cycle
can be used with and without a compensating chuck. The direction of rotation at
the cycle start determines whether a left or right hand thread is being cut. The
pitch can be defined for standard threads by stating the size of thread. For other
threads the actual value of the pitch can be entered.

DP The final depth has been chosen to be –12. The


lead is 2mm.

DTP A dwell may be programmed at the end of the


cycle.

SDAC States a direction of rotation at the end of the


cycle.

Axis States the geo-axis on which machining takes


place

Selection Specifies the direction of rotation for tapping

Table The thread can be selected


No input = programming of the pitch

PIT Determines the pitch

POSS If the lead is is to be at a certain angle, it can be


defined here

SST Spindle speed for tapping

SST1 Spindle speed for retraction

Infeed If during thread cutting the chips are to be cleared,


several infeed depths can be specified.

SINUMERIK 840D/810D Training and Programming Page 8 A317


Section 4 Tapping
Notes

Exercise

Finally the threads M6 are to be tapped now. For the description of the tapping
positions the pitch circle is to be used.

N490 T="GBO6" Call up tap


N500 M6 Load tap
N510 S350 F100 M3 M8 D1 Specify technology data
N520 Call up tapping cycle and define modal
machining

…………………………………………………………….

N530 Call up pitch circle and define pitch


circle

N540 …………………………….. Result of the cycle programming


N550 ENDLABEL:
N560 ……. terminate MCALL– range
N570 G0 X100 Y100 Z200 Retraction in xyz
N580 M…. End of program

For solution see page 15


M6

20
x10

8* 4
/ 20

5°(3
0
R1
20

60°)
45°
45

n
8
9

-3
0
TIE
F
9xn 8
x20
9

11

SINUMERIK 840D/810D Training and Programming Page 9 A317


Section 5 Summary
Notes

Path information / Departure commands

Instruction Meaning

G111 Absolute pole offset for polar dimensioning

AP AnglePolar; Angle input for polar dimensions

RP RadiusPolar; Radius input for polar dimensions

Polar co-ordinate system

When programming drilling patterns (e.g. holes on a pitch circle) the polar co-ordinate system is often
used. This often saves extensive calculation effort that would be necessary if the centres of the holes
were to be programmed in Cartesian co-ordinates.

The plane polar co-ordinate system consist of an origin, the pole of the plane and a number of rays
from the pole outwards (polar axes). A point can thus be defined explicitly by means of the radius vec-
tor and the polar angle.
Y

The point P therefore is defined by the following


polar co-ordinate statement: P (R; φ). The posi- P2 R 
tive direction of the increasing angle φ is anti- P1 100 +42°
clockwise, starting from the positive X–axis. If +65°
00 P2 100
necessary the polar co-ordinates can be evalu- P1
R= 1

ated using the trigonometric functions.

+42
+6

G111 in x

Polarachse
Pol X

G111 in y

Cycles Explanation

CYCLE82(…) Drilling without chip clearance, centring, reaming

CYCLE83(…) Deep hole drilling (chip clearance or chip


breaking)

CYCLE84(…) Tapping

CYCLE801(…) Drilling pattern holes in line or hole grid

HOLES82(…) Drilling pattern pitch circle

SINUMERIK 840D/810D Training and Programming Page 10 A317


Section 6 Summary
Notes

SINUMERIK 840D/810D Training and Programming Page 11 A317


Section 1 Solution for Deep hole drilling
Notes

Exercise

In the deep hole drilling cycle the following values have been programmed (see
page 3). Please answer the posed questions.

To which position does the machine traverse at rapid traverse rate?

X -20 Y -20 Z 2

Where does the face to be drilled commence?

Z 0

Up to which Z value (abs) does the machine plunge into the work piece for the first
drilling?

Z 1

Up to which Z-dimension (abs) does the machine drill in the first step?

Z -10

How deep is the second drilling depth?


9mm

How many chip clearing processes are there? State the depths (abs)

1 2 3 4 5 6 7 8 9 10
-9 -19 -27 -30
M6

20
x10

8* 4
/ 20

5°(3
0
R1
20

60°)
45°
45

n
8
9

-3
0
TIE
F
9xn 8
x20
9

11

SINUMERIK 840D/810D Training and Programming Page 12 A317


Section 2 Solution for Modal call-up
Notes

In order to machine similar holes with just one cycle definition, the modal call-up is
possible.
With the modal call-up a range is defined in which the type of machining and the
associated hole positions are described. This range starts with an MCALL and
finishes with a second MCALL. If these hole positions are to be used again for a
later machining sequence, they can be called up again with a label denomination.

Example:

N100 MCALL CYCLE82(:::) Open the modal range, state the


…. machining parameters for centring
N110 POS001: Specify label denomination
N120 G0 x… y…
N130 G0 x… y… Drilling positions
N140 G0 x… y…
N150 MCALL Close the range MCALL
N160 POS001E: Specify label denomination
….
N200 MCALL CYCLE83(:::) Open the modal range, state the
machining parameters for drilling

N210 REPEAT POS001 POS001E Repeat drilling position

Exercise

In the following the holes on the pitch circle are to be defined in a Label by means
of polar co-ordinates and centred 3.25mm deep. For this insert the program sec-
tion after line 130.

N200 MCALL CYCLE82(2,0,1,-3.25,,1) Open the modal range and specify machining with
CYCLE 82
N210 POS001: Specify label denomination POS001
N220 G111 x-20 y-20 Specify POL for polar the co-ordinates to be the centre
of the circular pocket
N230 G0 ap=20 rp=10 Specify polar co-ordinates for the 1st hole
N240 G0 ap=ic(45) rp=10
N250 G0 ap=ic(45) rp=10
N260 G0 ap=ic(45) rp=10
N270 G0 ap=ic(45) rp=10 Incremental advance for 7 further holes
N280 G0 ap=ic(45) rp=10
N290 G0 ap=ic(45) rp=10
N300 G0 ap=ic(45) rp=10
N310 MCALL Terminate modal range
N320 POS001E: Specify label denomination POS001E
M6

20
x10

8* 4
/ 20

5°(3
0
R1
20

60°)
45°
45

n
8
9

-3
0
TIE
F
9xn 8
x20
9

11

SINUMERIK 840D/810D Training and Programming Page 13 A317


Section 3 Solution for Drilling patterns
Notes
Programme the following machining steps.

Drilling the holes in the hole grid and the central bore of the pitch circle

N380 T="SPB8" Call-up of drill


N390 M6 Load drill
N400 S1200 F150 M3 M8 D1 Specify technology data
N410 MCALL CYCLE83(2,0,1,-20,,-10,,1,0,,1,1,3,3,,-1,1) Using the deep hole drilling cycle
machine the hole grid in modal
manner.
N420 REPEAT POS002 ENDLABEL Call up the label range for hole
N430 MCALL Terminate the modal range

Drilling the holes on the pitch circle


N440 T="SPB5" Call-up of drill
N450 M6 Load drill
N460 S1900 F120 M3 M8 D1 Specify technology data
N470 MCALL CYCLE83(2,0,1,-20,,-10,,1,0,,1,1,3,3,,-1,1) Define deep hole drilling cycle for pitch
modally
N480 REPEAT POS001 POS001E Call up the drilling positions by means
of the label

M6

20
x10

8* 4
/ 20

5°(3
0
R1
20

60°)
45°
45

n
8
9

-3
0
TIE
F
9xn 8
x20
9

11

SINUMERIK 840D/810D Training and Programming Page 14 A317


Section 4 Solution for Tapping
Notes

Exercise

Finally the threads M6 are to be tapped now. For the description of the tapping
positions the pitch circle is to be used.

N490 T="GBO6" Call up tap


N500 M6 Load tap
N510 S350 F100 M3 M8 D1 Specify technology data
N520 Call up tapping cycle and define modal
machining

MCALL CYCLE84(2,0,1,-12,,,3,,1,,350,500,3,1,0,0,,)

N530 Call up pitch circle and define pitch


circle

N540 HOLES2(-20,-20,10,22.5,45,8) Result of the cycle programming


N550 ENDLABEL:
N560 MCALL Terminate MCALL– range
N570 G0 X100 Y100 Z200 Retraction in xyz
N580 M30 End of program

SINUMERIK 840D/810D Training and Programming Page 15 A317


Notes

SINUMERIK 840D/810D Training and Programming Page 16 A317


A340 The operating surface of the control unit
Sinumerik 840D

1 Brief description
Objective of the module:

Having worked through this module you will be able to use the most important operating aspects of
the control unit and to set up a part program.

Description of the module:

This module presents an overview of the operation sectors machine, parameters and program.

Content of the module:

 Operation sector Machine


 Operation sector Parameters
 Operation sector Program
 Summary

Operation sector
Machine Section 1

Operation sector Section 2


Parameters

Operation sector Section 3


Program

Summary Section 4

SINUMERIK 840D/810D Training and Programming Page 1


This document was produced for training purposes.
Siemens assumes no responsibility for its contents. A340
Section 1 Operation sector Machine

Notes
The control unit can be switched ON and OFF in a variety of ways. That
depends largely on the overall configuration of the individual machine.

Here the recommendations of the manufacturer must be observed under


all circumstances.

Of the large amount of information displayed on the screen in the opera-


tion sector „Machine“ only the most important parts of the mode-of-
operation „Automatic“ will be dealt with here.

1 2

3 4

5
6

1 Mode-of-operation Automatic
2 Name of the selected part program
3 Display of the present tool positions in the available axes
4 Statements regarding the master spindle
5 Display of the current NC-program block
6 NC-display Feed
7 Active tool
8 Horizontal Softkey strip
9 Vertical Softkey strip

By pressing the respective Softkey the functions currently shown on the


screen are called up.

Displayed in the operation sector 'Machine' is the execution of the part pro-

SINUMERIK 840D/810D Training and Programming Page 2 A340


Section 2 Operation sector Parameter

Notes

By pressing the shown key the operation sector


'Parameters' will be accessed.

In this range the operator can edit the necessary data for the execution of
programs.

The following data are of foremost importance here:

Tool compensation

 Definition of tools and editing the tool correction data

R-Parameter

 Value assignment for the R-parameters that can be freely used in the
program

Setting data

 Setting of certain pre-selections on the machine:


e.g. limitation of the geometrical working range, spindle data, data for
the manual operation (jogging data), protection ranges etc.

Zero point offset

 Input or correction of the work piece zero point offsets

SINUMERIK 840D/810D Training and Programming Page 3 A340


Section 3 Operation sector Programm

Notes

By pressing the key shown alongside the operation


sector 'Program' will be accessed.

The operation sector 'Program' contains the whole process of program ed-
iting and management:

 Overview of the programs already available


 Defining, copying, re-naming or clearing of data files
 Editing and alteration of the programs
 Simulation
 Loading or unloading the programs into the control unit

Meaning of the file extensions:

.WPD Program listing (Work Piece Directory)


.MPF Main program (Main Program File)
.SPF Sub-program (Sub Program File)
.INI Initialisation file

Using the cursor keys permits you to navigate up and down


amongst the files.

The key 'Input' (Enter) has the following functions:


- Opening and closing a directory (WPD)
- Opening the programs (e.g. MPF and SPF)
- Acknowledgement of the inputs and line advance in the
editor

SINUMERIK 840D/810D Training and Programming Page 4 A340


Section 3 Operation sector Programm

Notes
The following notes describe the sequence for editing a part program in the
operation sector 'Program':

Example: Definition of a directory „[Link]“ with the main program


„[Link]“

After pressing the vertical Softkeys „New“ the shown


display screen will appear.

Enter the required name MOTOR for the directory, select the data extension
„Work Piece Data (WPD)“ and acknowledge the input with 'Enter'.

After pressing the Softkeys „OK“ you are already in the work
piece directory „[Link]“.

Enter here the program name PLEUEL and acknowledge after your choice
of the data extension „Part Programm File (MPF)“ the inputs with 'Enter'
and OK.

The program editor of the control unit is available for the input of the codes
or cycles.

With this Softkey the editor will be closed and the


program will be stored automatically.

SINUMERIK 840D/810D Training and Programming Page 5 A340


Section 4 Summary

Notes
All basic functions of the control unit are accessible to the machine opera-
tor via the operation surface. They are combined in the Operation sec-
tors.

When using the plant the product instructions by the manufacturer must be
regarded.

Basic functions Operation sectors

Manual operation of the


machine,
setting-up mode,
execution of part pro-
grams

Tool correction,
zero point offsets,
R-parameters,
setting data

Program editing,
simulation,
program management

Entering and reading-


out of programs and
data

Alarm messages,
service messages

Matching of the NC-


data to the machine,
system setting-up

SINUMERIK 840D/810D Training and Programming Page 6 A340

You might also like