siemens 840D Programming Guide

Programming Guide 11/2002 Edition
Fundamentals SINUMERIK 840D/840Di/810D
Fundamental Geometrical Principles
1
SINUMERIK 840D/840Di/810D
Fundamentals
Programming Guide
Fundamental Principles of NC Programming
Positional Data
Programming Motion Commands
Path Action
Frames
Feedrate Control and Spindle Motion
2
3
4
5
6
7
Valid for
Control Software Version
SINUMERIK 840D 6 SINUMERIK 840DE (export version) 6 SINUMERIK 840D powerline 6 SINUMERIK 840DE powerline 6 SINUMERIK 840Di 2 SINUMERIK 840DiE (export version) 2 SINUMERIK 810D 3 SINUMERIK 810DE (export version) 3 SINUMERIK 810D powerline 6 SINUMERIK 810D powerline 6
Tool Offsets
Miscellaneous Functions
Arithmetic Parameters and Program Jumps
Subprograms and Repetition of Program Sections
Tables
Appendix
8
9
10
11
12
A
11.02 Edition
Contents 11.02
0
SINUMERIK® Documentation
Printing history
Brief details of this edition and previous editions are listed below.
The status of each edition is shown by the code in the "Remarks" column.
Status code in the "Remarks" column:
A .... New documentation.
B .... Unrevised edition with new order no.
C .... Revised edition with new status.
If factual changes have been made on the page since the last edition, this is indicated by a new edition coding in the header on that page.
0
Edition Order No. Remarks
02.95 6FC5298-2AB00-0BP0 A
08.97 6FC5298-4AB00-0BP0 A
12.95 6FC5298-3AB00-0BP0 C
03.96 6FC5298-3AB00-0BP1 C
08.97 6FC5298-4AB00-0BP0 C
12.97 6FC5298-4AB00-0BP1 C
12.98 6FC5298-5AB00-0BP0 C
08.99 6FC5298-5AB00-0BP1 C
04.00 6FC5298-5AB00-0BP2 C
10.00 6FC5298-6AB00-0BP0 C
09.01 6FC5298-6AB00-0BP1 C
11.02 6FC5298-6AB00-0BP2 C
This manual is included in the documentation available on CD ROM (DOCONCD) Edition Order No. Remarks
11.02 6FC5298-6CA00-0BG3 C
Trademarks
SIMATIC trademarks of Siemens AG. Other names in this publication might be trademarks whose use by a third party for his own purposes may violate the rights of the registered holder.
â
, SIMATIC HMIâ, SIMATIC NETâ, SIROTECâ, SINUMERIKâ and SIMODRIVEâ are registered
Further information is available on the Internet under: http: //www.ad.siemens.de/si numer ik
This publication was produced with WinW ord V8.0 and Designer V4.0. The reproduction, transmission or use of this document or its contents is not permitted without express written authority. Offenders will be liable for damages. All rights, including rights created by patent grant or registration of a utility model or design, are reserved.
© Siemens AG, 1995–2002. All rights reserved
Order No. 6FC5298-6AB00-0BP2 Printed in Germany
Other functions not described in this documentation might be executable in the control. This does not, however, represent an obligation to supply such functions with a new control or when servicing.
We have checked that the contents of this document correspond to the hardware and software described. Nonetheless, differences might exist and therefore we cannot guarantee that they are completely identical. The information given in this publication is reviewed at regular intervals and any corrections that might be necessary are made in the subsequent printings. We welcome suggestions for improvement.
Subject to change without prior notice
Siemens Aktiengesellschaft
11.02 Contents
0
Contents
Fundamental Geometrical Principles 1-21
0
1.1 Description of workpiece points ...................................................................................... 1-22
1.1.1 Workpiece coordinate systems ................................................................................. 1-22
1.1.2 Definition of workpiece positions............................................................................... 1-23
1.1.3 Polar coordinates ...................................................................................................... 1-25
1.1.4 Absolute dimension ................................................................................................... 1-26
1.1.5 Incremental dimension .............................................................................................. 1-27
1.1.6 Plane designations .................................................................................................... 1-28
1.2 Position of zero points ..................................................................................................... 1-29
1.3 Position of coordinate systems ....................................................................................... 1-29
1.3.1 Overview of various coordinate systems................................................................... 1-29
1.3.2 Machine coordinate system ...................................................................................... 1-31
1.3.3 Basic coordinate system ........................................................................................... 1-33
1.3.4 Workpiece coordinate system................................................................................... 1-34
1.3.5 Frame system ........................................................................................................... 1-34
1.3.6 Assignment of workpiece coordinate system to machine axes ................................ 1-36
1.3.7 Current workpiece coordinate system....................................................................... 1-36
1.4 Axes ................................................................................................................................1-37
1.4.1 Main axes/Geometry axes ........................................................................................ 1-38
1.4.2 Special axes .............................................................................................................. 1-39
1.4.3 Main spindle, master spindle..................................................................................... 1-39
1.4.4 Machine axes ............................................................................................................ 1-39
1.4.5 Channel axes ............................................................................................................ 1-39
1.4.6 Path axes ..................................................................................................................1-40
1.4.7 Positioning axes ........................................................................................................ 1-40
1.4.8 Synchronized axes .................................................................................................... 1-42
1.4.9 Command axes......................................................................................................... 1-42
1.4.10 PLC axes................................................................................................................... 1-42
1.4.11 Link axes (SW 5 and higher)..................................................................................... 1-43
1.4.12 Leading link axes (SW 6 and higher) ........................................................................ 1-45
1.5 Coordinate systems and workpiece machining............................................................... 1-48
Fundamental Principles of NC Programming 2-51
2.1 Structure and contents of an NC program ...................................................................... 2-52
2.2 Language elements of the programming language ........................................................ 2-53
2.3 Programming a sample workpiece.................................................................................. 2-75
2.4 First programming example for milling application.......................................................... 2-77
2.5 Second programming example for milling application .................................................... 2-78
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 0-5
Contents 11.02
0
2.6 Programming example for turning application................................................................. 2-81
Positional Data 3-83
3.1 General information .........................................................................................................3-84
3.2 Absolute/incremental dimensions, G90/G91 ...................................................................3-85
3.2.1 G91 extension (SW 4.3 and higher) ..........................................................................3-88
3.3 Absolute dimensions for rotary axes, DC, ACP, ACN ..................................................... 3-89
3.4 Metric/imperial dimensions, G70/G71/G700/G710.......................................................... 3-91
3.5 Zero offset (frame), G54 to G599.................................................................................... 3-94
3.6 Selecting the working plane, G17 to G19 ........................................................................3-99
0
3.7 Programmable working area limitation, G25/G26 .........................................................3-102
3.8 Reference point approach, G74 ....................................................................................3-105
Programming Motion Commands 4-107
4.1 General information .......................................................................................................4-108
4.2 Traversing commands with polar coordinates, G110, G111, G112, AP, RP ................ 4-110
4.3 Rapid traverse movement, G0 ...................................................................................... 4-114
4.4 Linear interpolation, G1 .................................................................................................4-119
4.5 Circular interpolation, G2/G3, CIP .................................................................................4-122
4.6 Helical interpolation, G2/G3, TURN............................................................................... 4-135
4.7 Involute interpolation, INVCW, INVCCW ......................................................................4-137
4.8 Contour definitions......................................................................................................... 4-141
4.8.1 Straight line with angle ............................................................................................4-141
4.8.2 Two straight lines..................................................................................................... 4-142
4.8.3 Three straight lines ..................................................................................................4-143
4.8.4 End point programming with an angle..................................................................... 4-144
4.9 Thread cutting with constant lead, G33 .........................................................................4-145
4.9.1 Programmable run-in and run-out path (SW 5 and higher)..................................... 4-151
4.10 Linear progressive/degressive thread pitch change, G34, G35 (SW 5.2 and higher)... 4-153
4.11 Rigid tapping, G331, G332 ............................................................................................4-155
4.12 Tapping with compensating chuck G63 ........................................................................4-157
4.13 Stop during thread cutting .............................................................................................4-159
4.14 Approaching a fixed point, G75 ..................................................................................... 4-161
4.15 Travel to fixed stop ........................................................................................................ 4-163
0-6 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Contents
0
4.16 Special turning functions ............................................................................................... 4-169
4.16.1 Position of workpiece .............................................................................................. 4-169
4.16.2 Dimensions for: Radius, diameter........................................................................... 4-170
4.17 Chamfer, rounding ........................................................................................................ 4-172
Path Action 5-177
5.1 Exact stop, G60, G9, G601, G602, G603 .................................................................... 5-178
5.2 Continuous-path mode, G64, G641, G642, G643........................................................ 5-181
5.3 Acceleration pattern, BRISK, SOFT, DRIVE ................................................................ 5-190
5.3.1 Acceleration modes................................................................................................. 5-190
5.3.2 Influence of acceleration modes on following axes................................................. 5-191
0
5.4 Overview of the various velocity controls ..................................................................... 5-194
5.5 Path velocity smoothing ............................................................................................... 5-195
5.6 Traversing with feedforward control, FFWON, FFWOF............................................... 5-196
5.7 Programmable contour accuracy, CPRECON, CPRECOF.......................................... 5-197
5.8 Dwell time, G4 .............................................................................................................. 5-198
5.9 Program sequence: Internal preprocessor stop ........................................................... 5-199
Frames 6-201
6.1 General......................................................................................................................... 6-202
6.2 Frame instructions........................................................................................................ 6-203
6.3 Programmable zero offset............................................................................................ 6-205
6.3.1 TRANS, ATRANS ................................................................................................... 6-205
6.3.2 G58, G59: Axial programmable ZO (SW 5 and higher) .......................................... 6-209
6.4 Programmable rotation, ROT, AROT ........................................................................... 6-212
6.5 Programmable frame rotations with solid angles, ROTS, AROTS and CROTS.......... 6-220
6.6 Programmable scale factor, SCALE, ASCALE ............................................................ 6-221
6.7 Programmable mirroring, MIRROR, AMIRROR........................................................... 6-224
6.8 Frame generation according to tool orientation, TOFRAME, TOROT ......................... 6-228
6.9 Deselect frame SUPA, DRFOF, CORROF, TRAFOOF ............................................... 6-230
Feedrate Control and Spindle Motion 7-235
7.1 Feedrate ........................................................................................................................ 7-236
7.2 Traversing positioning axes, POS, POSA, POSP ......................................................... 7-244
7.3 Position-controlled spindle operation, SPCON, SPCOF ............................................... 7-247
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 0-7
Contents 11.02
0
7.4 Positioning spindles (position-controlled axis operation): SPOS, M19 and SPOSA .....7-248
7.5 Milling on turned parts: TRANSMIT............................................................................... 7-254
7.6 Cylinder surface transformation: TRACYL .................................................................... 7-256
7.7 Feedrate for positioning axes/spindles: FA, FPR, FPRAON, FPRAOF ........................7-257
7.8 Percentage feedrate override, OVR, OVRA ..................................................................7-260
7.9 Feedrate with handwheel override, FD, FDA ................................................................7-261
7.10 Percentage acceleration correction: ACC (Option) ....................................................... 7-265
7.11 Feedrate optimization for curved path sections, CFTCP, CFC, CFIN...........................7-266
7.12 Spindle speed S, direction of spindle rotation M3, M4, M5 ........................................... 7-269
0
7.13 Constant cutting rate, G96, G97, LIMS .........................................................................7-272
7.14 Constant grinding wheel peripheral speed, GWPSON, GWPSOF ...............................7-274
7.15 Constant workpiece speed for centerless grinding: CLGON, CLGOF ..........................7-277
7.16 Programmable spindle speed limitation, G25, G26....................................................... 7-279
7.17 Several feedrates in one block: F.., FMA.. ....................................................................7-280
7.18 Blockwise feedrate: FB... (as of SW 5.3) ...................................................................... 7-282
Tool Offsets 8-285
8.1 General information ...................................................................................................... 8-286
8.2 List of tool types............................................................................................................8-289
8.3 Tool selection/tool call T ............................................................................................... 8-293
8.3.1 Tool change with M06 (mill) .................................................................................... 8-293
8.3.2 Tool change with T command (rotate) .................................................................... 8-295
8.4 Tool offset D .................................................................................................................8-297
8.5 Tool selection T with tool management ........................................................................ 8-299
8.5.1 Turning machine with circular magazine .................................................................8-299
8.5.2 Milling machine with chain magazine ......................................................................8-300
8.6 Tool offset call D with tool management ...................................................................... 8-302
8.6.1 Turning machine with circular magazine .................................................................8-302
8.6.2 Milling machine with chain magazine ......................................................................8-303
8.7 Make active tool offset operative immediately.............................................................. 8-304
8.8 Tool radius compensation, G40, G41, G42 .................................................................. 8-305
8.9 Approach and retract from contour, NORM, KONT, G450, G451................................ 8-313
8.10 Compensation at outside corners, G450, G451 ...........................................................8-316
0-8 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Contents
0
8.11 Smooth approach and retraction .................................................................................. 8-319
8.11.1 Extension approach and retract: G461/G462 (SW 5 and higher) ........................... 8-327
8.12 Collision monitoring, CDON, CDOF ............................................................................. 8-331
8.13 2 1/2 D tool offset, CUT2D, CUT2DF ........................................................................... 8-333
8.14 Tool length offset for orientable tools: TCARR, TCOABS, TCOFR ............................. 8-335
8.15 Grinding-specific tool monitoring in parts program TMON, TMOF............................... 8-338
8.16 Additive offsets (SW 5 and higher)............................................................................... 8-340
8.16.1 Select offset (by DL number) .................................................................................. 8-340
8.16.2 Define wear and setup values ................................................................................. 8-341
8.16.3 Delete additive offsets (DELDL) .............................................................................. 8-343
0
8.17 Tool offset – special features (SW 5 and higher)......................................................... 8-344
8.17.1 Mirroring of tool lengths........................................................................................... 8-345
8.17.2 Wear sign evaluation............................................................................................... 8-345
8.17.3 Tool length and plane change ................................................................................. 8-346
8.18 Tools with a relevant tool point direction (SW 5 and higher) ........................................ 8-349
Miscellaneous Functions 9-351
9.1 Auxiliary function outputs ............................................................................................. 9-352
9.1.1 M functions .............................................................................................................. 9-357
9.1.2 H functions .............................................................................................................. 9-360
Arithmetic Parameters and Program Jumps 10-361
10.1 Arithmetic parameters R ............................................................................................ 10-362
10.2 Unconditional program jumps .................................................................................... 10-365
10.3 Conditional program jumps ........................................................................................ 10-367
Subprograms and Repetition of Program Sections 11-369
11.1 Use of subprograms ................................................................................................... 11-370
11.2 Subroutine call............................................................................................................ 11-373
11.3 Subprogram with program repetition .......................................................................... 11-375
11.4 Program section repetition (SW 4.3 and higher) ........................................................ 11-376
Tables 12-385
12.1 List of statements ....................................................................................................... 12-386
12.2 List of addresses ........................................................................................................ 12-403
12.2.1 Address letters ...................................................................................................... 12-403
12.2.2 Fixed addresses.................................................................................................... 12-404
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 0-9
Contents 11.02
0
12.2.3 Fixed addresses with axis extension .....................................................................12-405
12.2.4 Settable addresses................................................................................................12-407
12.3 List of G functions/preparatory functions.................................................................... 12-411
12.4 List of predefined subprograms.................................................................................. 12-423
12.4.1 Predefined subprogram calls................................................................................. 12-424
12.4.2 Predefined subprogram calls in motion-synchronous actions ...............................12-434
12.4.3 Predefined functions.............................................................................................. 12-435
12.4.4 Data types .............................................................................................................12-438
Appendix A-439
A Abbreviations ....................................................................................................................A-440
0
B Terms ................................................................................................................................A-448
C References........................................................................................................................A-474
D Index .................................................................................................................................A-489
E Commands, identifiers ......................................................................................................A-496
0-10 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Preface
0
Structure of the manual
0
Preface
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Organization of documentation
SINUMERIK documentation is organized on three different levels:
General Documentation
User documentation
Manufacturer/Service Documentation
Target group
This Manual is intended for machine-tool users. It provides detailed information that the user requires to program the SINUMERIK 840D/840Di/810D control system.
Standard scope
This Programming Guide describes the functionality afforded by standard functions. Differences and additions implemented by the machine-tool manufacturer are documented by the machine-tool manufacturer.
More detailed information about other publications relating to SINUMERIK 840D/840Di and publications that apply to all SINUMERIK controls (e.g. Universal Interface, Measuring Cycles...) can be obtained from your local Siemens branch office.
Other functions not described in this documentation might be executable in the control. This does not, however, represent an obligation to supply such functions with a new control or when servicing.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 0-11
Preface 11.02
0
Structure of the manual
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
0
Applicability
This Programming Guide applies to the following controls: SINUMERIK 840D 6
SINUMERIK 840DE (export version) 6 SINUMERIK 840D powerline 6 SINUMERIK 840DE powerline 6 SINUMERIK 840Di 2 SINUMERIK 840DiE (export version) 2 SINUMERIK 810D 3 SINUMERIK 810DE (export version) 3 SINUMERIK 810D powerline 6 SINUMERIK 810D powerline 6
with operator panels OP 010, OP 010C, OP 010S, OP 12 or OP 15 (PCU 20 or PCU 50)
SINUMERIK 840D powerline
From 09.2001 onwards, improved performance versions of
SINUMERIK 840D powerline and
SINUMERIK 840DE powerline
will be available. For a list of available powerline modules, please refer to Section 1.1 /PHD/ of the hardware description /PHD/.
0-12 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
SINUMERIK 810D powerline
From 12.2001 onwards, improved performance versions of
SINUMERIK 810D powerline and
SINUMERIK 810DE powerline
will be available. For a list of available powerline modules, please refer to Section 1.1 of the hardware description /PHC/.
Siemens AG, 2002. All rights reserved
11.02 Preface
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Hotline
If you have any queries, please contact the following hotline: A&D Technical Support Phone: ++49-(0)180-5050-222
Please send any queries about the documentation (suggestions or corrections) to the following fax number or email address:
Fax form: see feedback sheet and the end of the publication.
http://www.ad.siemens.de/sinumerik
Internet address
Export version
The following functions are not available in the export version:
Function 810DE 840DE
Five axis machining package
Handling transformation package (five axes)
Multi-axis interpolation (> four axes)
Helical interpolation 2D+6
Synchronized actions, stage 2
Measurements, stage 2
Adaptive control
Continuous dressing
Utilization of compile cycles (OEM)
Sag compensation, multi-dimensional
Fax: ++49-(0)180-5050-223 Email: adsupport@siemens.com
Fax: ++49-(0)0131-98-2176 Email: motioncontrol.docu@erlf.siemens.de
1)
O
1)
O
1)
O
1)
O
1)
O
− Function not available
1)
Restricted functionality
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 0-13
Preface 11.02
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Fundamentals
This Programming Guide Fundamentals is intended for use by skilled machine operators with the appropriate expertise in drilling, milling and turning operations. Simple programming examples are used to explain the commands and statements which are also defined according to DIN 66025.
Advanced The Programming Guide "Advanced" is intended for use by technicians with in-depth, comprehensive programming knowledge. By virtue of a special programming language, the SINUMERIK 840D/810D control enables the user to program complex workpiece programs (e.g. for sculptured surfaces, channel coordination, ...) and greatly facilitates the programming of complicated operations. The commands and statements described in this Guide are not specific to one particular technology. They can be applied for a variety of technologies, such as
Grinding
Cyclical machines (packaging, woodworking)
Laser power controls.
0-14 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
0
11.02 Preface
Structure of the manual
840D
NCU 571
Structure of descriptions
840D
NCU 572
NCU 573
All cycles and programming options have been described according to the same internal structure as far as this is meaningful and practicable. The various levels of information have been organized such that you can selectively access the information you need for the task in hand.
1. A quick overview
If you look up a rarely used command or the meaning of a parameter, you can see at a glance how the function is programmed and find helpful explanations of the commands and parameters.
This information is always displayed at the top of the page.
Note: Due to lack of space, it has not been possible to show all the modes of representation afforded by the programming language for individual commands and parameters. For this reason, we have illustrated those command programming schemes that are used most frequently in practice in a workshop situation.
810D
840Di
Drilling cycles and drilling patterns 03.96
2
2.1 Drilling cycles
2.1.2 Drilling, centering – CYCLE81 Programming
CYCLE81 (RTP, RFP, SDIS, DP)
RTP
real Retraction plane (absolute)
RFP
real Reference plane (absolute)
SDIS
real Safety clearance (enter without sign)
DP
real Final drilling depth (absolute)
DPR
real Final drilling depth relative to reference plane (enter without sign)
Function
The tool drills at the programmed spindle speed and feedrate to the programmed final drilling depth.
Operating sequence
Position reached before the beginning of the cycle:
The drilling position is the position in the two axes of the selected plane.
The cycle implements the following motion sequence:
Approach of the reference plane brought forward by the safety clearance with G0
Travel to the final drilling depth at the feedrate programmed in the calling program (G1)
Retraction to retraction plane with G0
2-36
Z
SINUMERIK 840D/810D/FM-NC Programming Guide, Cycles (PGZ) - 08.97 Edition.
Siemens AG 1997 All rights reserved.
0
2
X
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 0-15
Preface 11.02
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
2. Detailed explanations
You will find detailed answers to the following questions in the theory section:
Why is the command needed?
What does the command do?
How is it programmed and executed?
What do the parameters do?
What else do I need to know?
03.96 Drilling cycles and drilling patterns
2
Explanation of parameters
RFP and RTP
Generally, the reference plane (RFP) and the retraction plane (RTP) have different values. In the cycle it is assumed that the retraction plane lies in front of the reference plane. The distance between the retraction plane and the final drilling depth is therefore greater than the distance between the reference plane and the final drilling depth.
SDIS
The safety clearance (SDIS) refers to the reference plane. which is brought forward by the safety clearance. The direction in which the safety clearance is active is automatically determined by the cycle.
DP and DPR
The drilling depth can be defined either absolute (DP) or relative (DPR) to the reference plane. If it is entered as an absolute value, the value is traversed directly in the cycle.
Additional notes
If a value is entered both for the DP and the DPR, the final drilling depth is derived from the DPR. If the DPR deviates from the absolute depth programmed via the DP, the message "Depth: Corresponds to value for relative depth" is output in the dialog line.
2.1 Drilling cycles
Z
2
G1 G0
RTP RFP+SDIS
RFP
X
DP=RFP-DPR
The theoretical sections are primarily intended as learning material for the NC entry-level user. You should work through the manual at least once to get an idea of the functional scope and capability of your SINUMERIK control.
Siemens AG 1997 All rights reserved.
SINUMERIK 840D/810D/FM-NC Programming Guide, Cycles (PGZ) - 08.97 Edition.
2-37
3. From theory to practice
The programming examples illustrate how commands
Drilling cycles and drilling patterns 03.96
2
2.1 Drilling cycles
08.97
2
can be applied in practice.
If the values for the reference plane and the
You will find an application example for virtually every command after the theoretical section.
retraction plane are identical, a relative depth must not be programmed. The error message 61101 "Reference plane incorrectly defined" is output and the cycle is not executed. This error message is also output if the retraction plane lies behind the reference plane, i.e. the distance to the final drilling depth is smaller.
Programming example
Drilling_centering
You can use this program to make 3 holes using the drilling cycle CYCLE81, whereby this cycle is called with different parameter settings. The drilling axis is always the Z axis.
N10 G0 G90 F200 S300 M3 N20 D3 T3 Z110 N30 X40 Y120 N40 CYCLE81 (110, 100, 2, 35)
N50 Y30 N60 CYCLE81 (110, 102, , 35) N70 G0 G90 F180 S300 M03 N80 X90 N90 CYCLE81 (110, 100, 2, , 65)
N100 M30
Y
Y
120
30
0
Specification of the technology values Traverse to retraction plane Traverse to first drilling position Cycle call with absolute final drilling depth, safety clearance and incomplete parameter list Traverse to next drilling position Cycle call without safety clearance Specification of the technology values Traverse to next position Cycle call with relative final drilling depth and safety clearance End of program
40B90
A - B
A
X
35
100 108
Z
Siemens AG 1997 All rights reserved.
2-38
SINUMERIK 840D/810D/FM-NC Programming Guide, Cycles (PGZ) - 08.97 Edition.
0-16 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
0
11.02 Preface
Structure of the manual
840D
NCU 571
Explanation of symbols
Operating sequence
840D
NCU 572
NCU 573
810D
840Di
0
Explanation
Function
Parameters
Programming example
Programming
Additional notes
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 0-17
Cross-references to other documentation or
sections
Notes and warnings
Machine manufacturer (MH n)
Ordering data option
n= number of the note per section to which the machine manufacturer can refer.
Preface 11.02
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Principle
Your SIEMENS 840D/840Di/810D has been
designed and constructed according to state-of-
the-art technology and approved safety
regulations and standards.
Additional equipment
The applications of SIEMENS controls can be expanded for specific purposes through the addition of special add-on devices, equipment and expansions supplied by SIEMENS.
Personnel
Only appropriately trained, authorized and reliable
personnel may be allowed to operate this equipment. The control must never be operated, even temporarily, by anyone who is not appropriately skilled or trained.
The relevant responsibilities of personnel who set up, operate and maintain the equipment must be clearly
defined; the proper fulfillment of these responsibilities
must be monitored.
Behavior
Before the control is started up, it must be ensured that the Operator's Guides have been read and understood by the personnel responsible. The operating company is
also responsible for constantly monitoring the overall technical state of the control (visible faults and damage, altered service performance).
Servicing
Repairs must be carried out according to the information supplied in the service and maintenance
guide by personnel who are specially trained and
qualified in the relevant technical subject. All relevant safety regulations must be followed.
0-18 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Preface
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Note
The following is deemed to be improper usage and
exempts the manufacturer from any liability:
Any application which does not comply with the rules for proper usage described above.
If the control is not in technically perfect condition or is operated without due regard for safety regulations and accident prevention instructions given in the Instruction Manual.
If faults that might affect the safety of the equipment are
not rectified before the control is started up.
Any modification, bypassing or disabling of items of equipment on the control that are required to ensure fault-free operation, unlimited use and active and passive safety.
Improper usage gives rise to unforeseen dangers to:
Life and limb of personnel,
The control, machine or other assets of the owner
and the user.
The following special symbols and keywords have been used in this documentation:
Notes
This symbol appears in this documentation whenever it is necessary to draw your attention to an important item of information. In this documentation, you will find this symbol with a reference to an ordering option. The function described is executable only if the control contains the designated option.
Warnings
The following warnings with varying degrees of severity appear in this document.
Danger
Indicates an imminently hazardous situation which, if
not avoided, will result in death or serious injury or in substantial property damage
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 0-19
Preface 11.02
0
Structure of the manual
0
840D
NCU 571
840D
NCU 572
NCU 573
810D
840Di
Warning
Indicates a potentially hazardous situation which, if not
avoided, could result in death or serious injury or in substantial property damage.
Caution
Used with the safety alert symbol indicates a potentially
hazardous situation which, if not avoided, may result in minor or moderate injury or in property damage.
Caution
Used without safety alert symbol indicates a potentially
hazardous situation which, if not avoided, may result in property damage.
Notice
Used without the safety alert symbol indicates a
potential situation which, if not avoided, may result in an undesirable result or state.
0-20 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
Fundamental Geometrical Principles
1.1 Description of workpiece points ...................................................................................... 1-22
1.1.1 Workpiece coordinate systems................................................................................ 1-22
1.1.2 Definition of workpiece positions.............................................................................. 1-23
1.1.3 Polar coordinates ..................................................................................................... 1-25
1.1.4 Absolute dimension.................................................................................................. 1-26
1.1.5 Incremental dimension............................................................................................. 1-27
1.1.6 Plane designations................................................................................................... 1-28
1.2 Position of zero points ..................................................................................................... 1-29
1.3 Position of coordinate systems ....................................................................................... 1-29
1.3.1 Overview of various coordinate systems ................................................................. 1-29
1.3.2 Machine coordinate system .....................................................................................1-31
1.3.3 Basic coordinate system .......................................................................................... 1-33
1.3.4 Workpiece coordinate system.................................................................................. 1-34
1.3.5 Frame system .......................................................................................................... 1-34
1.3.6 Assignment of workpiece coordinate system to machine axes ............................... 1-36
1.3.7 Current workpiece coordinate system...................................................................... 1-36
1
1.4 Axes ................................................................................................................................1-37
1.4.1 Main axes/Geometry axes ....................................................................................... 1-38
1.4.2 Special axes............................................................................................................. 1-39
1.4.3 Main spindle, master spindle ................................................................................... 1-39
1.4.4 Machine axes........................................................................................................... 1-39
1.4.5 Channel axes ........................................................................................................... 1-39
1.4.6 Path axes ................................................................................................................. 1-40
1.4.7 Positioning axes....................................................................................................... 1-40
1.4.8 Synchronized axes................................................................................................... 1-42
1.4.9 Command axes........................................................................................................ 1-42
1.4.10 PLC axes ................................................................................................................. 1-42
1.4.11 Link axes (SW 5 and higher) ................................................................................... 1-43
1.4.12 Leading link axes (SW 6 and higher)....................................................................... 1-45
1.5 Coordinate systems and workpiece machining............................................................... 1-48
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-21
Fundamental Geometrical Principles 11.02
1
1.1 Description of workpiece points
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
1.1 Description of workpiece points
1.1.1 Workpiece coordinate systems
In order for the machine or control to operate with the specified positions, these data must be made in a reference system that corresponds to the direction of motion of the axis slides. A coordinate system with the axes X, Y and Z is used for this purpose. DIN 66217 stipulates that machine tools must use right-handed, rectangular (cartesian) coordinate systems.
The workpiece zero (W) is the origin of the workpiece coordinate system. Sometimes it is advisable or even necessary to work with negative positional data. Positions to the left of the origin are prefixed by a negative sign (–).
Milling:
X-
Y-
Z+
W
Z-
90°
Y+
90°
90°
X+
Turning:
Z-
X-
Y+
W
Y-
90°
X+
90°
90°
Z+
1-22 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.1 Description of workpiece points
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
1.1.2 Definition of workpiece positions
To specify a position, imagine that a ruler is placed along the coordinate axes. You can now describe every point in the coordinate system by specifying the direction (X, Y and Z) and three numerical values. The workpiece zero always has the coordinates X0, Y0 and Z0.
Example: For the sake of simplicity, we will only use one plane of the coordinate system in this example, i.e. the X/Y plane. Points P1 to P4 then have the following coordinates:
P1 corresponds to X100 Y50 P2 corresponds to X-50 Y100 P3 corresponds to X-105 Y-115 P4 corresponds to X70 Y-75
X-
Y+
50
P2
100
100
P1
50
X+
75
115
P3
105
70
P4
Y-
One plane is sufficient to describe the contour on a turning machine.
Example:
Points P1 to P4 are defined by the following coordinates:
P1 corresponds to X25 Z-7.5 P2 corresponds to X40 Z-15 P3 corresponds to X40 Z-25 P4 corresponds to X60 Z-35
P4
P3
35
P2
25
15
P1
7.5
X
Ø 60
Ø 40
Ø 25
Z
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-23
Fundamental Geometrical Principles 11.02
1
1.1 Description of workpiece points
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
Example: Points P1 and P2 are defined by the following coordinates:
P1 corresponds to X-20 Y-20 Z23 P2 corresponds to X13 Y-13 Z27
The infeed depth must also be described in milling operations. To do this, we need to specify a numerical value for the third coordinate (Z in this case).
Example: Points P1 to P3 are defined by the following coordinates:
60
Y+
Y+
X+
P1
13
P2
20
P2
P1
13
20
X+
P1
P2
Z+
P1
23
27
Y+
P2
P1
P1 corresponds to X10 Y45 Z-5 P2 corresponds to X30 Y60 Z-20 P3 corresponds to X45 Y20 Z-15
45
20
10
30
45
P3
X+
P3
15
20
Z+
5
1-24 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.1 Description of workpiece points
1
840D NCU 571
840D NCU 572 NCU 573
1.1.3 Polar coordinates
The coordinates used up to this point to specify points in the coordinate system are called "Cartesian coordinates".
However, there is another way to specify coordinates, namely as "polar coordinates".
It is useful to use polar coordinates in cases where a workpiece or part of a workpiece is dimensioned by radius and angle. The origin of the dimensional measurements is referred to as the "pole".
Example: The points P1 and P2 can then be described – with reference to the pole – as follows: P1 corresponds to radius =100 plus angle =30° P2 corresponds to radius =60 plus angle =75°
810D
840Di
Y
P2
P1
0
6
75°
Pole
30
15
0
0
1
30°
X
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-25
Fundamental Geometrical Principles 11.02
1
1.1 Description of workpiece points
1
840D NCU 571
840D NCU 572 NCU 573
1.1.4 Absolute dimension
With absolute dimensions, all the positional parameters refer to the currently valid zero point. Applied to tool movement this means:
The absolute dimensions describe the position to which the tool is to travel.
Example for milling: The positional parameters for points P1 to P3 in absolute dimensions referring to the zero point are the following: P1 corresponds to X20 Y35 P2 corresponds to X50 Y60 P3 corresponds to X70 Y20
810D
840Di
Y
P2
P1
60
P3
35
20
X
20
50
70
Example for turning: The positional parameters for points P1 to P4 in absolute dimensions referring to the zero point are the following: P1 corresponds to X25 Z-7.5 P2 corresponds to X40 Z-15 P3 corresponds to X40 Z-25 P4 corresponds to X60 Z-35
P4
P3
35
P2
25
15
P1
7.5
X
Ø 60
Ø 40
Ø 25
Z
1-26 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.1 Description of workpiece points
1
840D NCU 571
840D NCU 572 NCU 573
1.1.5 Incremental dimension
Production drawings are frequently encountered, however, where the dimensions refer not to the origin, but to another point on the workpiece.
In order to avoid having to convert such dimensions, it is possible to specify them in incremental dimensions.
Incremental dimensions refer to the positional data for the previous point. Applied to tool movement this means:
The incremental dimensions describe the distance the tool is to travel.
Example for milling: The positional data for points P1 to P3 in incremental dimensions are: P1 corresponds to X20 Y35 ;(with reference to the
P2 corresponds to X30 Y20 ;(with reference to P1) P3 corresponds to X20 Y-35 ;(with reference to P2)
810D
840Di
zero point)
1520
20
Y
P2
P1
P3
X
20
30
20
Example for turning: The positional data for points P1 to P4 in incremental dimensions are: G90 P1 corresponds to X25 Z-7.5
;(with reference to the zero point)
G91 P2 corresponds to X15 Z-7.5
;(with reference to P1)
G91 P3 corresponds to Z-10 ;(with reference to P2) G91 P4 corresponds to X20 Z-10 ;(with reference to P3)
When DIAMOF or DIAM90 is active, the path setpoint is programmed as a radius dimension with G91.
P4
10
P3
10
P2
7.5
X
P1
Ø 60
Ø 40
Ø 25
Z
7.5
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-27
Fundamental Geometrical Principles 11.02
1
1.1 Description of workpiece points
1
840D NCU 571
1.1.6 Plane designations
A plane is defined by means of two coordinate axes. The third coordinate axis is perpendicular to this plane and determines the infeed direction of the tool (e.g. for 2½D machining).
When programming, it is necessary to specify the working plane in order that the control can calculate the tool offset values correctly. The plane is also relevant to certain types of circular programming and polar coordinates.
840D NCU 572 NCU 573
810D
840Di
Milling:
G
Z
Y
1
8
G
1
9
G
1
7
X
Turning:
The working planes are specified as follows in the NC program with G17, G18 and G19:
Plane Identifier Infeed direction
X/Y G17 Z Z/X G18 Y Y/Z G19 X
G
Y
X
1
9
G
1
7
G
Z
1
8
1-28 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.2 Position of zero points
1
840D NCU 571
840D NCU 572 NCU 573
1.2 Position of zero points
The various origins and reference positions are defined on the NC machine. They are reference points
for the machine to approach and
refer to programming the workpiece dimensions.
They are: M = Machine zero A = Blocking point. Can coincide with the
workpiece zero (turning machines only) W = Workpiece zero = Program zero B = Start point. Can be defined for each program. Start point of the first tool for machining. R = Reference point. Position determined by cam and measuring system. The distance to
the machine zero M must be known, so
that the axis position can be set to exactly
this value at this position. The diagrams show the zero points and reference points for turning machines and drilling/milling machines.
810D
840Di
Y
W1 W2
M
X
R
B
M
X
A
W
Z
1.3 Position of coordinate systems
1.3.1 Overview of various coordinate systems
We distinguish between the following coordinate
systems:
The machine coordinate system with the machine
zero M
The basic coordinate system (this can also be the
workpiece coordinate system W)
The workpiece coordinate system with the
workpiece zero W
The current workpiece coordinate system with the
current offset workpiece zero Wa
In cases where various different machine coordinate
systems are in use (e.g. 5-axis transformation), an internal transformation function mirrors the machine kinematics on the coordinate system currently selected for programming.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-29
Fundamental Geometrical Principles 11.02
1
1.3 Position of coordinate systems
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
The individual axis identifiers are explained in the
subsection headed "Axis types" in this section.
Z
Z
m
w
Y
m
M
X
m
W
Z
a
Wa
Y
w
Y
a
X
a
X
w
Y+
M
X+
W
Z+
1-30 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.3 Position of coordinate systems
1
840D NCU 571
1.3.2 Machine coordinate system
840D NCU 572 NCU 573
810D
840Di
The machine coordinate system comprises all the
physically existing machine axes.
Reference points and tool and pallet changing points (fixed machine points) are defined in the machine coordinate system.
Where the machine coordinate system is used for programming (this is possible with some of the G functions), the physical axes of the machine are addressed directly. No allowance is made for workpiece clamping.
The location of the coordinate system relative to the
machine depends on the machine type. The axis directions follow the so-called "three-finger rule" of the right hand (in accordance with DIN 66217).
Standing in front of the machine, the middle finger of the right hand points away from the infeed direction of the main spindle. The following then applies:
The thumb points in the +X direction
The index finger points in the +Y direction
The middle finger points in the +Z direction
Zm
M
Ym
Xm
+Z
+Y
+X
In practice, this can look quite different on different
types of machine. The following are examples of machine coordinate systems for various machines.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-31
Fundamental Geometrical Principles 11.02
1
1.3 Position of coordinate systems
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
-Y
+Z
+Z
-B
-Y
+X
+X
C+
Y+
C-
X+
Z+
+Z
B
+
B
-
+A
-A
+X
+Y
1-32 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.3 Position of coordinate systems
1
840D NCU 571
1.3.3 Basic coordinate system
840D NCU 572 NCU 573
810D
840Di
The basic coordinate system is a Cartesian
coordinate system, which is mirrored by kinematic transformation (for example, 5-axis transformation or by using Transmit with peripheral surfaces) onto the machine coordinate system.
If there is no kinematic transformation, the basic coordinate system differs from the machine coordinate system only in terms of the axes designations.
The activation of a transformation can produce deviations in the parallel orientation of the axes. The coordinate system does not have to be at a right angle.
Zero offset, scaling, etc. are always executed in the basic coordinate system.
The coordinates also refer to the basic coordinate system when specifying the working field limitation.
Basic coordinate system
for face end
X
Y
Basic coordinate system
for peripheral surface
Workpiece coordinate system
for turning plane
W
X
Z
Y
Z
Y
MCS
MCS
MCS = Machine coordinate system BCS = Basic coordinate system
BZS = Basic zero system SZS = Settable zero system
WCS = Workpiece coordinate system
Y
BCS
DRF shift, external zero offset
BCS
Kinematic transformation
Y
Y
BZS
SZS
Programmable FRAME
SZS
G54...G599 settable FRAMES
BZS
Base offset (base frame)
Y
WCS
WCS
X
X
MCS
BCS
X
BZS
X
X
WCS
SZS
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-33
Fundamental Geometrical Principles 11.02
1
1.3 Position of coordinate systems
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
1.3.4 Workpiece coordinate system
in the workpiece coordinate system. In other words,
the data in the NC program refer to the workpiece coordinate system.
The workpiece coordinate system is always a Cartesian coordinate system and assigned to a specific workpiece.
Z
Y
X
1.3.5 Frame system
The frame is a self-contained arithmetic rule that
transforms one Cartesian coordinate system into another Cartesian coordinate system. It is a: Spatial description of the workpiece coordinate
system
The following components are available within a frame:
Zero offset
Rotate
Mirror
Scale
These components can be used individually or in any combination.
Rotation
around the Z axis
Z0
e
s
f
f
o
o
r
e
Z
t
Z1=Z2
X0
Y0
Y1
Y2
X1
X2
1-34 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.3 Position of coordinate systems
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
Mirroring of the Z axis
One way of machining inclined contours is to use
appropriate fixtures to align the workpiece parallel to the machine axes.
M
X
Zero offset
X
Z
Z
W
W
Z
1
Zero offset
M
1
Y
Another way is to generate a coordinate system which
is oriented to the workpiece. The coordinate system can be moved and/or rotated with programmable frames.
This enables you to
move the zero point to any position on the
workpiece
align the coordinate axes parallel to the desired
working plane by rotation
and thus machine surface clamped in inclined
positions, produce drill holes at different angles.
perform multiside machining operations.
Z
Y
Z
0
X
Y1
Z
1
X
1
X
0
X
Y
0
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-35
Fundamental Geometrical Principles 11.02
1
1.3 Position of coordinate systems
1
840D NCU 571
Working plane, tool offsets The conventions for the working plane and the tool
840D NCU 572 NCU 573
810D
840Di
offsets must be observed – in accordance with the machine kinematics – for machining operations in inclined working planes. For further information, please see Section 3.6 "Selection of working plane, G17 to G19".
1.3.6 Assignment of workpiece coordinate system to machine axes
The location of the workpiece coordinate system in
relation to the basic coordinate system (or machine
ZM=Z
B
coordinate system) is determined by settable frames.
The settable frames are activated in the NC program by means of commands such as G54.
M
YM=Y
Z
W
B
Y
W
1.3.7 Current workpiece coordinate system
Sometimes it is advisable or necessary to reposition
and to rotate, mirror and/or scale the originally selected workpiece zero within a program.
The programmable frames can be used to reposition (rotate, mirror and/or scale) the current zero point at a suitable point in the workpiece coordinate system. You will thus obtain the current workpiece coordinate system.
Several zero offsets are possible in the same program.
Current workpiece coordinate system
Y
B
Frame 1
Z
1
Z
B
Frame 1...settable offset and rotation Frame 2...programmable offset and rotation
X
B
Y
2
Z
2
Y
Frame 2
1
X
Workpiece coordinate system
XM=X
1
X
W
B
X
2
1-36 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.4 Axes
1
840D NCU 571
1.4 Axes
840D NCU 572 NCU 573
810D
840Di
A distinction is made between the following types of
axis when programming:
Machine axes
Channel axes
Geometry axes
Special axes
Path axes
Synchronized axes
Positioning axes
Command axes
(motion-synchronized axes)
PLC axes
Link axes
Leading link axes.
Geometry, synchronized and positioning axes are
programmed.
Path axes traverse with feedrate F in accordance with the programmed travel commands.
Synchronized axes traverse synchronously to path axes and take the same time to traverse as all path axes.
Positioning axes traverse asynchronously to all other axes. These traversing movements take place independently of path and synchronized movements.
Command axes traverse asynchronously to all other axes. These traversing movements take place independently of path and synchronized movements.
PLC axes are controlled by the PLC and can traverse asynchronously to all other axes. The traversing movements take place independently of path and synchronized movements.
Geometry axes Positioning axes
Machine axes
Geometry axes
Channel axes
Path axes PLC axes
Synchr on.
axes
Positioning
axes
Kinematic
Machine axes
transformati on
Special axes
Command
axes
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-37
Fundamental Geometrical Principles 11.02
1
1.4 Axes
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
1.4.1 Main axes/Geometry axes
The main axes define a right-angled, right-handed
coordinate system. Tool movements are programmed in this coordinate system.
In NC technology, the main axes are called geometry axes. This is the term used in this Programming Guide.
For turning machines: Geometry axes X and Z are used, and sometimes Y.
For milling machines: Geometry axes X, Y and Z are used.
A maximum of three geometry axes are used for
programming frames and the workpiece geometry (contour).
Identifiers: X, Y, Z
The identifiers for geometry and channel axes can be the same, as long as mirroring is possible.
Geometry axis and channel axis names can be the same in any channel in order that the same programs can be executed. The "Switchable geometry axes" function (see Advanced) can be used to alter the geometry axes grouping configured by machine data. Here any geometry axis can be replaced by a channel axis defined as a synchronous special axis.
Tools
X
(master spindle) C axis
Turret swivel axis
Z
Geometry axesMain spindle
Tail­stock
Additional spindle
Special axis
1-38 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.4 Axes
1
840D NCU 571
1.4.2 Special axes
In contrast to the geometry axes, no geometrical
relationship is defined between the special axes. Example: Turret position U, tailstock V
1.4.3 Main spindle, master spindle
The machine kinematics determine which spindle is
the main spindle. This spindle is declared the master spindle in the machine data. As a rule, the main spindle is declared the master spindle.
This assignment can be changed with the program
command SETMS (spindle number) (see Chapter 7). Special functions such as thread cutting apply to the master spindle. Identifiers: S or S0
840D NCU 572 NCU 573
810D
840Di
1.4.4 Machine axes
The axis identifiers can be set in the machine data.
Standard identifiers: X1, Y1, Z1, A1, B1, C1, U1, V1
There are also standard axis identifiers that can always be used: AX1, AX2, …, AXn
1.4.5 Channel axes
All axes which traverse in a channel.
Identifiers: X, Y, Z, A, B, C, U, V
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-39
Fundamental Geometrical Principles 11.02
1
1.4 Axes
1
840D NCU 571
1.4.6 Path axes
Path axes define the path and therefore the
movement of the tool in space.
The programmed feedrate is active for this path.
The axes involved in this path reach their position at the same time. As a rule, these are the geometry axes.
However, default settings define which axes are the path axes and therefore determine the velocity. Path axes can be specified in the NC program with FGROUP (see Chapter 5).
840D NCU 572 NCU 573
810D
840Di
1.4.7 Positioning axes
Positioning axes are interpolated separately, i.e. each
positioning axis has its own axis interpolator and its own feedrate.
A distinction is made between positioning axes with synchronization at the block end or over several blocks.
POS axes: Block change occurs at the end of the block when all the path and positioning axes programmed in this block have reached their programmed end point.
POSA axes: The movement of these positioning axes can extend over several blocks.
POSP axes: The movement of these positioning axes for approaching the end position takes place in sections.
You will find further information on POS, POSA and
POSP in the section on "Traversing positioning axes, POS, POSA, POSP".
1-40 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
1.4 Axes
1
840D NCU 571
Additional notes
Continuous-path mode (G64) for path axes is only
Positioning axes become synchronized axes if they are traversed without the special POS/POSA identifier.
possible if the positioning axes (POS) reach their final position before the path axes.
Path axes that are programmed with POS/POSA are removed from the path axis grouping for the duration of this block.
Positioning axes are traversed by the NC program or the PLC.
If an axis is to be traversed simultaneously by the NC program and the PLC, an error message appears.
Typical positioning axes are:
Loaders for workpiece loading
Loaders for workpiece unloading
Tool magazine/turret.
840D NCU 572 NCU 573
810D
840Di
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-41
Fundamental Geometrical Principles 11.02
1
1.4 Axes
1
840D NCU 571
1.4.8 Synchronized axes
Synchronized axes traverse synchronously to the path
from the start position to the programmed end position.
The feedrate programmed in F applies to all the path axes programmed in the block, but does not apply to synchronized axes. Synchronized axes take the same time as the path axes to traverse.
A synchronized axis can be a rotary axis which is traversed synchronously to the path interpolation.
1.4.9 Command axes
840D NCU 572 NCU 573
810D
840Di
Command axes are started from synchronized
actions in response to an event (command). They can be positioned, started and stopped fully asynchronous to the parts program. An axis cannot be moved from the parts program and from synchronized actions simultaneously. Command axes are interpolated separately, i.e. each command axis has its own axis interpolator and its own feedrate. References: /FBSY/, Synchronized Actions
1.4.10 PLC axes
PLC axes are traversed by the PLC via special
function blocks in the basic program; their movements can be asynchronous to all other axes. The traversing movements take place independently of path and synchronized movements.
1-42 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
840D NCU 573
1.4.11 Link axes (SW 5 and higher)
1.4 Axes
1
Link axes are axes which are physically connected to
another NCU and whose position is controlled from this NCU. Link axes can be dynamically assigned to channels of a different NCU. Link axes are not local axes from the perspective of a particular NCU. The dynamic changing of an assignment to an NCU is based on the axis container concept. Axis substitution with GET and RELEASE is not available for link axes from the parts program.
Preconditions:
The participating NCUs, NCU1 and NCU2, must
be connected by means of high-speed communication via the link module.
References:
/PHD/, Configuring Manual NCU 571-573.2, Link Module
The axis must be configured appropriately by
machine data.
The link axis option must be installed.
NCU 1 NCU 2611D 1
Channel 1
Channel 2
Link module (HW) Link module (HW)
Link communication
A1
A2
A3
Channel 1
611D 2
B1
B2
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-43
Fundamental Geometrical Principles 11.02
1
1.4 Axes
840D NCU 573
1
Functionality
For further information about link axes, please refer to
An axis container is a circular buffer data structure in
In addition to the direct reference to local axes or link
a container number and
The entry in a circular buffer location contains:
Axis container entries contain local machine axes or
The position control is implemented on the NCU on which the axis is physically connected to the drive. This NCU also contains the associated axis VDI interface. The position setpoints for link axes are generated on another NCU and communicated via the NCU link. The link communication must provide the means of interaction between the interpolators and the position controller or PLC interface. The setpoints calculated by the interpolators must be transported to the position control loop on the home NCU and, vice versa, the actual values must be returned from there back to the interpolators.
References: /FB/ B3, Multiple Operator Panels and NCUs
Axis container (SW 5 and higher)
which local axes and/or link axes are assigned to channels. The entries in the circular buffer can be shifted cyclically.
axes, the link axis configuration in the logical machine axis image also allows references to axis containers. Such a reference consists of:
a slot (circular buffer location within the container)
a local axis or
a link axis
link axes from the perspective of an individual NCU. The entries in the logical machine axis image MN_AXCONF_LOGIC_MACHAX_TAB of an individual NCU are fixed. The axis container function is described in References: /FB/ B3, Multiple Operator Panels and NCUs
1-44 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
840D NCU 573
1.4.12 Leading link axes (SW 6 and higher)
1.4 Axes
1
A leading link axis is one that is interpolated by one
NCU and utilized by one or several other NCUs as the master axis for controlling slave axes. An axial position controller alarm is sent to all other NCUs which are connected to the affected axis via a leading link axis.
NCUs that are dependent on the leading link axis can
utilize the following coupling relationships with it:
- Master value (setpoint, actual value, simulated master value)
- Coupled motion
- Tangential follow-up
- Electronic gear (ELG)
- Synchronous spindle
Preconditions:
The dependent NCUs, i.e. NCU1 to NCUn (n
equals, max. of 8), must be interconnected via the link module for high-speed communication.
References:
/PHD/, Configuring Manual NCU 571-573.2, Link Module
The axis must be configured appropriately by
machine data.
The link axis option must be installed.
The same interpolation cycle must be configured
for all NCUs connected to the leading link axis.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-45
1
Fundamental Geometrical Principles 11.02
1.4 Axes
840D NCU 573
1
NCU 1
Interpolator Interpolator
Servo Servo
611 D
A1
Restrictions:
A master axis which is leading link axis cannot be
a link axis, i.e. it cannot be operated by other NCUs as their home NCU.
A master axis which is leading link axis cannot be
a container axis, i.e. it cannot be addressed alternately by different NCUs.
A leading link axis cannot be the programmed
leading axis in a gantry grouping.
Couplings with leading link axes cannot be
cascaded.
Axis replacement can only be implemented within
the home NCU of the leading link axis.
Programming:
Master NCU:
Only the NCU which is physically assigned to the master value axis can program travel motions for this axis. The travel program must not contain any special functions or operations.
NCUs of slave axes:
The travel program on the NCUs of the slave axes must not contain any travel commands for the leading link axis (master value axis). If it does, an appropriate alarm will be generated. The leading link axis is addressed in the usual way via channel axis identifiers. The states of the leading link axis can be accessed by means of selected system variables.
A1 setpoints
Influenced by
following axis/axes
A1 real values
NCU link modules
611 D
NCU 2
NCU n...
B1
B2
1-46 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
1
840D NCU 573
1.4 Axes
1
The following system variables can be used in
If these system variables are updated by the home
System variables:
conjunction with the channel axis identifiers of the leading link axis: $AA_LEAD_SP ; Simulated master value position SAA_LEAD_SV ; Simulated master value velocity
NCU of the master axis, the new values are also transferred to any other NCUs who wish to control slave axes as a function of this master axis. References: /FB/ B3, Multiple Operator Panels and NCUs
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-47
Fundamental Geometrical Principles 11.02
g
1
1.5 Coordinate systems and workpiece machinin
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
1.5 Coordinate systems and workpiece machining
Relationship between the travel commands from
workpiece coordinates and the resulting machine
movements
Axis movement programmed in the workpiece coordinate system
Description of the workpiece geometry using geometry axes (e.g. X, Y, Z)
Frame calculation:
Translation (TRANS)
Rotation (ROT)
Scaling (SCALE)
Contour in Cartesian coordinate system of the channel (BCS)
Tool radius compensation
Movement of the tool zeropoint in the BCS
Description of the tool orientation by orientation vector/Euler angle
Remaining traversing instructions using special axes (e.g. C, U, V)
Frame calculation:
Offset
Scaling
Tool length compensation
Kinematic transformation (if active)
Movement of the machine axes of the channel abc
Rotary ax es with 5 axis transformator
Path calculations The path calculation determines the distance to be traversed in a block, taking into account all offsets and compensations.
1-48 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Geometrical Principles
g
1
840D NCU 573
1.5 Coordinate systems and workpiece machinin
1
In general: Distance = setpoint - actual value + zero offset (ZO) + tool offset (TO)
If a new zero offset and a new tool offset are
programmed in a new data block, the following applies:
With absolute dimensioning:
Distance = (absolute dimension P2 - absolute
dimension P1) + (ZO P2 - ZO P1) + (TO P2 - TO P1).
With incremental dimensioning:
Distance = incremental dimension +
(ZO P2 - ZO P1) + (TO P2 - TO P1).
X
T
TO
position
Absolute
Set-
point
M
ZO
Absolute position
W
Set­point
TO
Z
ZO P2
ZO P1
Abs. dim. (setpoint) for P2
Abs. dim.
(setpoint) for P 2
Actual value 1
TC P1
Actual value 2
TC P2
Distance
Movement
n
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 1-49
Fundamental Geometrical Principles 11.02
g
1
1.5 Coordinate systems and workpiece machinin
1
840D NCU 571
840D NCU 572 NCU 573
810D
840Di
Notes
1-50 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Principles of NC Programming
2
Fundamental Principles of NC Programming
2.1 Structure and contents of an NC program ...................................................................... 2-52
2.2 Language elements of the programming language ........................................................ 2-53
2.3 Programming a sample workpiece.................................................................................. 2-75
2.4 First programming example for milling application.......................................................... 2-77
2.5 Second programming example for milling application .................................................... 2-78
2.6 Programming example for turning application ................................................................ 2-81
2
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-51
Fundamental Principles of NC Programming 11.02
2
2.1 Structure and contents of an NC program
2
840D NCU 571
840D NCU 572 NCU 573
810D 840Di
2.1 Structure and contents of an NC program
DIN 66025 is the guideline for designing a parts program.
An (NC/part) program consists of a sequence of NC blocks (see table below). Each data block represents one machining step. Instructions are written in the blocks in the form of words. The last block in the execution sequence contains a special word for the end of program: M2, M17 or M30.
Block Word Word Word ... ;Comment
Block N10 G0 X20 ... ;1st block
Block N20 G2 Z37 ... ;2nd block
Block N30 G91 ... ... ;...
Block N40 ... ... ...
Block N50 M30 ... ... ;End of program (last block)
Program names
Each program has a different name; the name can be chosen freely during program creation (except for punch tape format), taking the following conditions into account:
The first two characters must be letters (or a letter
with an underscore character)
Otherwise: letters or numerals
Example: _MPF100 or SHAFT or SHAFT_2 Only the first 24 characters of a program identifier are displayed on the NC.
2-52 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Principles of NC Programming
2
2.2 Language elements of the programming language
2
840D NCU 571
Examples:
Punch tape format File names:
1. File names can contain the characters
2. File names must have a 3-digit identifier
3. Data in punch tape format can be created
%_N_SHAFT123_MPF = parts program SHAFT123 or %flange3_MPF = parts program flange3
For further information on downloading, creating and
storing parts programs, please refer to: /BA/, Operator's Guide, in the sections on the "Program" and "Services" user areas.
840D NCU 572 NCU 573
0...9, A...Z, a...z or ____and may be up to
24 characters in length.
(_xxx).
externally or modified using an editor. The name of a file which is stored internally in the NC memory begins with "_N_". A file in punch tape format begins with %<name>, "%" must appear in the first column of the first line.
810D 840Di
2.2 Language elements of the programming language
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-53
Character set
The following characters are available for writing NC programs:
Upper case A, B, C, D, E, F, G, H, I, J, K, L, M,
N, (O), P, Q, R, S, T, U, V, W, X, Y, Z
Please note: Take care to differentiate between the letter "O" and the numeral "0".
Fundamental Principles of NC Programming 11.02
2
2.2 Language elements of the programming language
2
840D NCU 571
Lower case a, b, c, d, e, f, g, h, i, j, k, l, m,
n, o, p, q, r, s, t, u, v, w, x, y, z
Numerals 0, 1, 2, 3, 4, 5, 6, 7, 8, 9
No distinction is made between upper and lower case
letters.
Special characters %
( ) [ ] < > : = / * +
­ " ´
$ _ ? ! . , ; & L
F
Tab character Space character
Non-printable special characters are treated like
blanks.
840D NCU 572 NCU 573
810D 840Di
Program start character (used only for writing programs on an external PC)
For bracketing parameters or expressions
For bracketing parameters or expressions
For bracketing addresses or indexes
For bracketing addresses or indexes
Less than
Greater than
Main block, label suffix, chain operator
Assignment, part of equation
Division, block suppression
Multiplication
Addition
Subtraction, minus sign
Double quotation marks, identifier for character string
Single quotation marks, identifier for special numerical values: hexadecimal, binary
System variable identifiers
Underscore, belonging to letters
Reserved
Reserved
Decimal point
Comma, parameter separator
Comment start
Format character, same effect as space character
Block end
Separator
Separator (blank)
2-54 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Principles of NC Programming
2
2.2 Language elements of the programming language
2
840D NCU 571
840D NCU 572 NCU 573
810D 840Di
Words NC programs are made up of blocks and each block is made up of words.
A word in the NC language consists of an address character and a digit or sequence of digits representing an arithmetic value.
The address character of the word is usually a letter. The sequence of digits can contain a leading sign and decimal point. The leading sign always appears between the address letter and the sequence of digits. The positive leading sign (+) does not have to be specified.
Blocks and block format
An NC program consists of individual blocks. A block generally consists of (several) words. A block should contain all the data required for performing an operation step and is terminated with the character "L
" (LINE FEED = new line).
F
The characters "L
" character does not have to be
F
inserted manually, it is generated automatically when
you change lines.
Block length A block may contain
up to SW 3.x a maximum of 242 characters
SW 4 and higher a maximum of 512 characters
(including the comment and end-of-block character "L
F
").
Word Word
Digits
Address
Digits
Address
Word
Address
G01 X-50 S2000
Block
Digits
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-55
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
840D
NCU 571
840D
NCU 572 NCU 573
e elements of the programming language
810D
840Di
2
Three blocks of up to 66 characters each are normally
displayed in the current block display on the screen. Comments are also displayed. Messages are displayed in a separate message window.
Word sequence in blocks In order to keep the block structure as clear as possible, the words in a block should be arranged as follows:
Example: N10 G… X… Y… Z… F… S… T… D… M… H…
Address N 10 G X,Y,Z F S T D M H
Some addresses can be used repeatedly within a
block (e.g.: G…, M…, H…).
Main block/subblock There are two types of blocks:
Main blocks and
Subblocks.
The main block must contain all the words necessary to start the operation sequence in the program section beginning with the main block.
Definition
Address of block number
Block number
Preparatory function
Positional data
Feed
Speed
Tool
Tool offset number
Miscellaneous function
Auxiliary function
2-56 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
2.2 Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Main blocks can be contained in both main programs
and subprograms. The control does not check whether a main block contains all the necessary information.
Block number Main blocks are identified by a main block number. A main block number consists of the character ":" and a positive integer (block number). The block number always appears at the start of a block.
Main block numbers must be unique within a program
to achieve an unambiguous result when searching.
Example: :10 D2 F200 S900 M3
Subblocks are identified by a subblock number. A
subblock number consists of the character "N" and a positive integer (block number). The block number always appears at the start of a block.
Example: N20 G1 X14 Y35 N30 X20 Y40
Subblock numbers must be unique within a program in
order to achieve an unambiguous result when searching.
The order of the block numbers is arbitrary, however
increasing block numbers are recommended.
You can also program NC blocks without block numbers.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-57
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
840D
NCU 571
840D
NCU 572 NCU 573
e elements of the programming language
810D
840Di
2
Addresses Addresses are fixed or variable identifiers for axes (X, Y, ...) spindle speed (S), feed (F), circle radius (CR), etc. Example: N10 X100
Important addresses
Address Meaning (default setting) Remarks A=DC(...)
A=ACP(...) A=ACN(...)
ADIS B=DC(...)
B=ACP(...) B=ACN(...) C=DC(...) C=ACP(...) C=ACN(...)
CHR=... D... F... FA[axis]=... or
FA[spindle]=... or [SPI(spindle)]=...
G... H...
H=QU(...)
I... J... K... L... M...
M=QU(...)
N... OVR=... P...
Rotary axis variable
Rounding clearance for path functions fixed
Rotary axis variable
Rotary axis variable
Chamfer the contour corner fixed
Tool number fixed
Feed fixed
Axial feed
(only if spindle no. defined by variable)
Preparatory function fixed
Auxiliary function Auxiliary function without read stop
Interpolation parameters variable
Interpolation parameters variable
Interpolation parameters variable
Subprogram call fixed
Miscellaneous function Miscellaneous fct. w/o read stop
Subblock fixed
Path override fixed
Number of program passes fixed
fixed
fixed
fixed
2-58 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
840D
NCU 571
840D
NCU 572 NCU 573
2.2 Lan
810D
e elements of the programming language
840Di
2
Address Meaning (default setting) Remarks POS[axis]=... POSA[axis]=... SPOS=...
SPOS[n]=... SPOSA=... SPOSA[n]=...
Q... R0=... to Rn=...
R... RND RNDM S... T... U... V... W... X...
X=AC(...) X=IC(...) Y... Y=AC(...) Y=IC(...) Z... Z=AC(...) Z=IC(...)
AR+=... AP=... CR=... RP=... :...:
Positioning axis fixed
Positioning axis across block boundary fixed
Spindle position fixed
Spindle position across block boundary fixed
Axis variable
Arithmetic parameter, n can be set
via MD (default 0-99)
Axis (SW 5.1 and higher)
Round contour corner fixed
Round contour corner (modal) fixed
Spindle speed fixed
Tool number fixed
Axis variable
Axis variable
Axis variable
Axis " absolute " incremental
Axis variable
Axis variable
Aperture angle variable
Polar angle variable
Circle radius variable
Polar radius variable
Main block fixed
fixed
variable
variable
"fixed"
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-59
These address names are available for a specific function.
Machine manufacturer (MH2.1)
"variable" These addresses can be assigned another name via the machine data.
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
840D
NCU 571
840D
NCU 572 NCU 573
e elements of the programming language
810D
840Di
2
Modal/non-modal addresses Modal addresses remain valid with the programmed value (in all subsequent blocks) until a new value is programmed at the same address. Non-modal addresses only apply in the block in which they were programmed.
Example: N10 G01 F500 X10 N20 X10 ;Feed is effective until
Addresses with axial extension In addresses with axial extension, an axis name is inserted in square brackets after the address. The axis name assigns the axis.
Example: FA[U]=400;
Axis-specific feed for U axis
Extended addresses Extended address notation enables a larger number of axes and spindles to be organized in a system. An extended address is composed of a numeric extension or a variable identifier enclosed in square brackets and an arithmetic expression assigned with an "=" sign.
Example: X7 X4=20 CR=7.3 S1=470 M3=5
a new value is entered.
;No "=" required, 7 is a value, but the "=" ;character is also possible here ;Axis X4 ("=" required) ;2 letters ("=" required) ;Speed for 1st spindle 470rpm ;Spindle stop for 3rd spindle
2-60 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
2.2 Lan
e elements of the programming language
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
The extended address notation is only permitted for the following direct addresses:
X, Y, Z, … I, J, K S SPOS, SPOSA M H T F
Axis addresses
Interpolation parameters
Spindle speed
Spindle position
Miscellaneous functions
Auxiliary functions
Tool number
Feed
The number (index) in extended address notation can
be substituted by a variable for M, H and S addresses and SPOS and SPOSA. The variable identifier is enclosed in square brackets.
Example: S[SPINU]=47
;Speed for the spindle whose number is stored in the variable SPINU
0
M[SPINU]=3 T[SPINU]=7
;Clockwise rotation for the spindle whose number is stored in the variable SPINU ;Selection of the tool for the spindle whose number is stored in the variable SPINU
Fixed addresses The following addresses are set permanently:
Address Meaning (default setting) D F G H L M N P R S T :
Tool edge number
Feed
Preparatory function
Auxiliary function
Subprogram call
Special function
Subblock
Number of program passes
Arithmetic parameter
Spindle speed
Tool number
Main block
2
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-61
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
840D
NCU 571
840D
NCU 572 NCU 573
e elements of the programming language
810D
840Di
2
Example for programming:
N10 G54 T9 D2
When programming with the axis extension, the axis to be traversed is enclosed in square brackets.
Fixed addresses with axis extension
Address Meaning (default setting) AX ACC FA FDA FL IP OVRA PO POS POSA
Example: N10 POS[X]=100
Axis value (variable axis programming)
Axial acceleration
Axial feed
Axis feedrate for handwheel override
Axial feed limit
Interpolation parameter (variable axis programming)
Axial override
Polynomial coefficient
Positioning axis
Positioning axis across block boundary
You will find a complete list of all fixed addresses in
the Appendix.
Settable addresses Addresses can be defined either as an address letter (with numerical extension if necessary) or as freely selected identifiers.
Variable addresses must be unique within the control,
i.e. the same identifier name may not be used for
different address types.
2-62 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
2.2 Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
A distinction is made between the following address
types:
Axis values and end points
Interpolation parameters
Feeds
Approximate positioning criteria
Measurements
Axis and spindle response
Variable address letters are:
A, B, C, E, I, J, K, Q, U, V, W, X, Y, Z
The user can change the names of the variable
addresses in the machine data.
Example:
X1, Y30, U2, I25, E25, E1=90, …
The numeric extension has one or two digits and is always positive.
Address identifier The address notation can be expanded by adding further letters.
Example: CR XPOS
e.g. for circle radius
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-63
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
== Equal to
<> Not equal to
> Greater than
< Less than
>= Greater than or equal to
<= Less than or equal to
840D
NCU 571
Operators/mathematical functions
+
­ * /
DIV
MOD Modulo division (only type INT) produces remainder of INT division, e.g. 3
:
Sin() COS() TAN() ASIN() ACOS() ATAN2() SQRT() ABS() POT() TRUNC() ROUND() LN() EXP()
Comparison and logic operators
AND OR NOT XOR
840D
NCU 572 NCU 573
e elements of the programming language
810D
Addition
Subtraction
Multiplication
Division NOTICE: (Type INT)/(Type INT)=(Type REAL); e.g. 3/4 = 0.75
Division, for variable type INT and REAL NOTICE: (Type INT)DIV(Type INT)=(Type INT); e.g. 3 DIV 4 = 0
MOD 4=3
Chain operator (for FRAME variables)
Sine
Cosine
Tangent
Arcsine
Arccosine
Arctangent2
Square root
Absolute number
2nd power (square)
Truncate to integer
Round to integer
Natural logarithm
Exponential function
AND
OR
Negation
Exclusive OR
840Di
2
2-64 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
2.2 Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
In arithmetic expressions, the execution order of
all the operators can be specified by parentheses, in order to override the normal priority rules.
Value assignments Values can be assigned to the addresses. The method of value assignment depends on the type of address identifier.
An "=" sign must be inserted between the address identifier and the value if
the address identifier consists of more than one letter,
or
the value consists of more than one constant.
The "="-sign can be omitted if the address identifier is a single letter and the value consists of only one constant. Leading signs are allowed and separators are permitted after the address letter.
Examples: X10 X1=10
;Value assignment (10) to address X, "=" not required ;Value assignment (10) to address (X) with numeric extension (1), "=" required
FGROUP(X1, Y2) AXDATA[X1] AX[X1]=10 X=10*(5+SIN(37.5))
;Axis names from passed parameters ;Axis name as an index when accessing axis data ;Indirect axis programming ;Value assignment by means of a numeric expression, "=" required
A numeric extension must always be followed by one of
the special characters "=", "(", "[")"]", "," or an operator in order to distinguish an address name with numeric extension from an address letter with a value.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-65
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
840D
NCU 571
840D
NCU 572 NCU 573
e elements of the programming language
810D
840Di
2
Identifiers
Identifiers can also be used to describe words (in compliance with DIN 66025). The identifiers have the same meaning as the words within an NC block. Identifiers must be unique. Identical identifiers must not be used for different objects.
Identifiers can stand for:
Variables
- System variables
- User variables
Subprograms
Vocabulary words
DIN addresses with several letters
Jump labels
Structure The identifiers are composed of up to 32 characters. The following characters may be used:
Letters
Underscores
Numerals
The first two characters must be letters or underscores, separators must not be programmed between the individual characters (see the following pages). Example: CMIRROR, CDON
Reserved vocabulary words must not be used as
identifiers. Separators are not permitted between the
individual characters.
Number of characters for each identifier:
Program names: 24 characters
Axis identifiers: 8 characters
Variable identifiers: 31 characters
2-66 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
2.2 Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Rules for allocating identifiers
The following rules are provided in order to avoid identifier collisions:
All identifiers which begin with "CYCLE" or "_" are
reserved for SIEMENS cycles.
All identifiers which begin with "CCS" are reserved for
SIEMENS compile cycles.
User compile cycles begin with "CC".
We recommend that users select identifier names
which either begin with "U" (User) or contain the underscore symbol, because these are not used by the system or compile cycles or SIEMENS cycles.
Further reserved identifiers
The identifier "RL" is reserved for conventional turning
machines.
All identifiers beginning with "E_ " are reserved for
EASYSTEP programming.
Variable identifiers
In variables used by the system, the first letter is replaced by the "$" character. This character may not be used for user-defined variables.
Examples (see Programming Guide "Advanced"): $P_IFRAME, $P_F
Leading zeroes are ignored in variables with numeric extensions (i.e. R01 is interpreted as R1). Separators are allowed before a numeric extension.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-67
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Array identifiers
The rules for elementary variables also apply to array identifiers. It is possible to address arithmetic variables as arrays. Example: R[10]=…
Data types
A variable can contain a numeric value (or several) or a character (or several), e.g. an address letter.
The data type permitted for the variable is determined when the variable is defined. The data type for system variables and predefined variables is fixed.
Elementary variable types/data types are:
Type Definition Value range
INT REAL
Integers with leading sign ±(231 - 1)
-300
Real numbers (fractions with decimal
±(10
10
point, LONG REAL according to IEEE)
BOOL
Boolean values: TRUE (1) and
1, 0
FALSE (0)
CHAR
1 ASCII character specified by the
0 … 255
code
STRING
Character string, number of
Sequence of values with 0 … 255 characters in […], maximum of 200 characters
AXIS FRAME
Axis names (axis addresses) only Any axis identifiers in the channel
Geometrical parameters for translation, rotation, scale and mirror
Identical elementary types can be combined in arrays. Up to two-dimensional arrays are possible.
+300
)
2-68 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
2.2 Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Constants
Integer constants: Integer with or without leading sign, e.g. for assigning a value to an address
Examples: X100 X-100
;Assignment of the value +100 to address X ;Assignment of the value –100 to address X
Real constants: Real number, e.g. with decimal point, with or without leading sign, e.g. for assigning a value to an address
Example: X10.25 X-10.25 X0.25 X.25 X=-.1EX-3
;Assignment of the value +10.25 to address X ;Assignment of the value –10.25 to address X ;Assignment of the value +0.25 to address X ;Assignment of the value +0.25 to address X without leading "0" ;Assignment of the value –0.1*10-3 to address X
If, in an address which permits decimal point input,
more decimal places are specified than actually provided for the address, then they are rounded to fit the number of places provided.
X0 cannot be replaced with X.
Example: Do not replace G01 X0 with G01 X!
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-69
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
840D
NCU 571
840D
NCU 572 NCU 573
e elements of the programming language
810D
840Di
2
Hexadecimal constants Constants can also be interpreted in hexadecimal format. The letters "A" to "F" stand for the digits 10 to
15.
Hexadecimal constants are enclosed in single quotation marks and start with the letter "H", followed by the value in hexadecimal notation. Separators are allowed between the letters and digits.
Example for machine data (see also "Advanced"): $MC_TOOL_MANAGEMENT_MASK='H3C7F'
The maximum number of characters is limited by the value range of the integer data type.
Binary constants Constants can also be interpreted in binary format. In this case, only the digits "0" and "1" are used.
Binary constants are enclosed in single quotation marks and start with the letter "B", followed by the binary value. Separators are allowed between the digits.
Example for machine data (see also "Advanced"): $MN_AUXFU_GROUP_SPEC='B10000001'
The maximum number of characters is limited by the value range of the integer data type.
;Assignment of hexadecimal
values to machine data
;Assignment of binary constants to
machine data
Bits 0 and 7 are set
2-70 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
2.2 Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Program section A program section consists of a main block and several subblocks. Examples: :10 D2 F200 S900 M3 N20 G1 X14 Y35 N30 X20 Y40 N40 Y-10 ... N100 M30
Skipping blocks Blocks which are not to be executed on every program pass can be skipped (e.g. positioning program). Blocks which are to be skipped are marked with an oblique "/" in front of the block number. Several consecutive blocks can also be skipped. The instructions in the skipped blocks are not executed; the program continues with the next block which is not skipped.
Examples:
N10 ...
/N20 ...
N30 ...
/N40 ...
/N50 ...
/N60 ...
N70 ...
N80 ...
N90 ...
N100 ...
N110 ...
N120
Program execution
N10 … /N20 … N30 … /N40 … N70 …
;is executed
;skipped
;is executed
;skipped
;is executed
SW 5 and higher Up to eight skip levels can be programmed. Only one skip level can be specified per NC block:
/ ... ;Block is skipped (1st skip level)
/0 ... ;Block is skipped (1st skip level)
/1 N010... ;Block is skipped (2nd skip level)
/2 N020... ;Block is skipped (3rd skip level)
...
/7 N100... ;Block is skipped (8th skip level)
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-71
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
840D
NCU 571
840D
NCU 572 NCU 573
e elements of the programming language
810D
840Di
2
/8 N080... ;Block is skipped (9th skip level)
/9 N090... ;Block is skipped (10th skip level)
Label names are allocated with at least two and up to
SW 6.3 and higher Up to ten skip levels can be programmed. Only one skip level can be specified per NC block:
Machine manufacturer (MH2.2)
The number of skip levels that can be used depends on a display MD.
Block skipping of levels /0 to /9 is activated by an
operator action (see /BA/ Operator's Guide, program control menu in Machine operating area) or by the programmable controller.
System and user variables can also be used in
conditional jumps in order to control program execution.
Jump destinations (labels) Labels can be defined to jump within a program.
You will find further information in the Programming
Guide Advanced.
32 characters (letters, digits, underscore). The first two characters must be letters or underscores. The label name is followed by a colon (":").
Labels must be unique within a program.
Labels always appear at the start of a block. If a
program number exists, the label appears immediately after the block number.
2-72 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
guag
11.02 Fundamental Principles of NC Programming
2
2.2 Lan
e elements of the programming language
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Comments To make NC programs easier to understand for other users and programmers, it is advisable to insert meaningful comments in the program.
Comments are appended to the end of a block and are separated from the program section of the NC block by a semicolon (";"). Examples: N10 G1 F100 X10 Y20 ; Comments to explain the NC block
or
N10 ; G&S Co., order no. 12A71 N20 ; Program written by Bob Miller, Dept. TV 4, on 21.11.94 N50 ; Part no. 12, housing for pump type TP23A
Comments are stored and appear in the current block
display when the program is running.
Programming messages
Messages can be programmed to provide the user with information about the current machining situation during program execution.
A message in an NC program is generated when the message text is typed after vocabulary word "MSG" in round parentheses "()" and quotation marks.
A message can be cleared by programming "MSG ()".
Example:
N10 MSG ("Roughing the contour") N20 X… Y… N … N90 MSG ()
;Activate message
;Clear message from N10
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-73
guag
Fundamental Principles of NC Programming 11.02
2
2.2 Lan
Contents of variables can also be displayed in
Examples:
or
840D
NCU 571
A message text can be up to 124 characters long and is displayed in two lines (2*62 characters).
message texts.
N10 R12=$AA_IW [X] N20 MSG (check position of X axis<<R12<<″″) N … N90 MSG ()
N20 MSG (check position of X axis<<$AA_IW[X]<<″″)
Setting alarms
You can also set alarms in addition to messages in an NC program. Alarms are displayed in a separate field on the screen display. An alarm is associated with a reaction on the control which depends on the alarm category.
Alarms are programmed by writing the vocabulary word "SETAL" followed by the alarm number enclosed in brackets.
The valid range for alarm numbers lies between 60,000 and 69,999, whereby 60,000 to 64,999 are reserved for SIEMENS cycles and 65,000 to 69,999 are available to the user.
Alarms are always programmed in a separate block.
Example: N100 SETAL (65000)
You will find a list of reactions associated with specific alarms in the Installation and Start-up Guide.
The alarm text must be configured in the MMC.
840D
NCU 572 NCU 573
e elements of the programming language
810D
840Di
;Set alarm no. 65,000
;Current position of the X axis in R12
;Clear message from N20
2
2-74 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Principles of NC Programming
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
2.3 Programming a sample workpiece
2.3 Programming a sample workpiece
2
Planning the machining sequence
The actual programming of the individual operation steps in the NC language generally only represents a small proportion of the work in the development of an NC program.
Programming of the actual instructions should be preceded by the planning and preparation of the operation steps. And the more accurately you consider how the NC program is to be structured and organized, the faster and easier it will be to produce a complete program which is clear and free of errors.
Clearly structured programs are a particular advantage
if you need to make changes at a later date.
Since different parts do not all look the same, it is naturally inadvisable to develop every program according to the same method. However, certain procedures apply in most cases and these are presented on the following pages in the form of a checklist.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-75
g
Fundamental Principles of NC Programming 11.02
2
2.3 Pro
840D
NCU 571
1. Prepare the workpiece drawing
Define the workpiece zero
Sketch in the coordinate system
Calculate any missing coordinates
2. Define machining sequence
What tools are used when and to machine which
contour?
In what order are the individual elements of the
workpiece manufactured?
Which individual elements are repeated (or also
rotated) and should therefore be stored in a subprogram?
Do these or similar contour sections already exist in
other parts programs or subprograms which could be used here? Where is it advisable or necessary to perform zero offset, rotation, mirroring or scaling (frame concept)?
3. Create a machining plan Define all the machining processes in steps, e.g.:
Rapid traverse movements for positioning
Tool change
Tool retraction for recalibration
Switching the spindle and coolant on and off
Calling tool data
Infeed
Path correction
Approach contour
Retract from contour
etc.
4. Translate the work steps into the programming
language
Enter each individual step in an NC block or blocks
5. Combine all the individual steps in a program
ramming a sample workpiece
840D
NCU 572 NCU 573
810D
840Di
2
2-76 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
prog
11.02 Fundamental Principles of NC Programming
2
2.4 First programming example for milling application
840D
NCU 571
840D
NCU 572 NCU 573
2.4 First
810D
ramming example for milling application
840Di
2
Please proceed on the NC as described below to
verify the following programming example (see Operator's Guide):
Create a new parts program (name)
Edit parts program
Select parts program
Activate single block
Start parts program
Alarms can occur during program verification. These
alarms have to be reset first.
Machine manufacturer (MH2.3)
The MD settings must be defined correctly before the program can run on the machine. References: /FB/ K2, "Axes, Coordinate Systems,.."
Programming example
_MILL1_MPF
N10 MSG("THIS IS MY NC PROGRAM")
:10 F200 S900 T1 D2 M3
N20 G0 X100 Y100 N30 G1 X150 N40 Y120 N50 X100 N60 Y100 N70 G0 X0 Y0 N100 M30
;Sample program
;MSG = Message output in an alarm line
;Feed, spindle, tool, ;tool offset, spindle clockwise
;Rapid traverse to position
;Rectangle with feed, straight line in X
;Straight line in Y
;Straight line in X
;Straight line in Y
;Return rapid traverse movement
;End of block
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-77
prog
Fundamental Principles of NC Programming 11.02
2
2.5 Second
2.5 Second programming example for milling application
This programming example contains surface and side
840D
NCU 571
milling, as well as drilling.
The workpiece is intended for machining on a
The dimensions are in inches.
840D
NCU 572 NCU 573
vertical milling machine.
ramming example for milling application
810D
840Di
Machine manufacturer (MH2.4)
The MD settings must be defined correctly before the program can run on the machine. References: /FB/ K2, "Axes, Coordinate Systems,.."
2
Programming example
%_N_RAISED_BOSS_MPF N005 MSG ("Traverse axes to tool change location") N010 START01:SUPA G0 G70 Z0 D0 N015 SUPA X0 Y0 ;********************Tool change******************** N020 MSG ("Tool change active") N025 T1 M6 ; d = 3 inch face cutter N030 MSG () ; clears the message from block N020 N035 MSG ("Face milling Z=0 workpiece surface") N040 G0 G54 X-2 Y.6 S800 M3 M8 N045 Z1 D1 N050 G1 Z0 F50 N055 X8 F25 N060 G0 Y3.5 N065 G1 X-2 N070 SUPA G0 Z0 D0 M5 M9 ;********************Tool change******************** N075 T2 M6 ; d = 1 inch face cutter MSG ("Side machining") N080 G0 X-1 Y.25 S1200 M3 M8 N085 Z1 D1 N090 G1 Z-.5 F50 N095 G42 X.5 F30 N100 X5.5 RNDM=-.375 ; modal rounding. Radius=0.375 N105 Y3.625
2-78 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Fundamental Principles of NC Programming
2
2.5 Second programming example for milling application
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
N110 X.5 N115 Y.25 N120 X=IC(.375) RNDM=0 ; required for edge rounding N125 G40 G0 Y-1 M5 M9 ; rapid traverse to delete position N130 Z1 N135 X-1 Y0 N140 Z-.25 ,********************Continue to use 1-inch mill**************** MSG ("Side Cut Top Boss") N145 G01 G41 X1 Y2 N150 G2 X1.5476 Y3.375 CR=2 N155 G3 X4.4524 CR=3 N160 G2 Y.625 CR=2 N165 G3 X1.5476 CR=3 N170 G2 X1 Y2 CR=2 N175 G0 G40 X0 N180 SUPA G0 Z0 D0 M5 M9 ; Z approaches tool change location N185 SUPA X0 Y0 ; X and Y to the tool change location ;********************Tool change******************** N190 T3 M6 ; 27/64 drill MSG ("Drill 3 holes") N195 G0 X1.75 Y2 S1500 M3 M8 ; approach first drill hole N200 Z1 D1 N205 MCALL CYCLE81 (1,0,.1,-.5,) N207 X1.75 ; drill first hole N210 X3 ; drill second hole N215 X4.25 ; drill third hole N220 MCALL N221 SUPA Z0 D0 M5 M9 ; Delete modal call. Z axis traverses to machine zero N225 SUPA X0 Y0 MSG () N230 M30 ; end of program
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-79
prog
Fundamental Principles of NC Programming 11.02
2
2.5 Second
ramming example for milling application
2
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
6.0
5.0
1.4524
-13
1/2
X 1.0 DP
4.0
3.5
2.0 R
0.75
0.5
Dimensions in inches
1.25
2.5
3.0 R
Dimension drawing of workpiece "The Raised Boss" (not to size).
1.375
2.0
0.75
0.25
0.375 R
0.25
0.25
Side view
Dimensions in inches
Siemens AG, 2002. All rights reserved
2-80 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
g
11.02 Fundamental Principles of NC Programming
2
840D
NCU 571
840D
NCU 572 NCU 573
2.6 Pro
810D
ramming example for turning application
840Di
2.6 Programming example for turning application
The sample program contains radius programming and tool radius compensation.
Programming example
2
%_N_1001_MPF
N5 G0 G53 X280 Z380 D0 N10 TRANS X0 Z250 N15 LIMS=4000 N20 G96 S250 M3 N25 G90 T1 D1 M8 N30 G0 G42 X-1.5 Z1 N35 G1 X0 Z0 F0.25 N40 G3 X16 Z-4 I0 K-10 N45 G1 Z-12 N50 G2 X22 Z-15 CR=3 N55 G1 X24 N60 G3 X30 Z-18 I0 K-3 N65 G1 Z-20 N70 X35 Z-40 N75 Z-57 N80 G2 X41 Z-60 CR=3 N85 G1 X46 N90 X52 Z-63 N95 G0 G40 G97 X100 Z50 M9
N100 T2 D2 N105 G96 S210 M3 N110 G0 G42 X50 Z-60 M8 N115 G1 Z-70 F0.12 N120 G2 X50 Z-80 I6.245 K-5 N125 G0 G40 X100 Z50 M9
N130 G0 G53 X280 Z380 D0 M5 N135 M30
;Program name
;Start point
;Zero offset
;Speed limitation (G96)
;Select constant feed
;Select tool and offset
;Activate tool with tool radius compensation
;Rotate radius 10
;Rotate radius 3
;Rotate radius 3
;Rotate radius 3
;Deselect tool radius compensation and approach tool change location
;Call up tool and select offset
;Select constant cutting speed
;Activate tool with tool radius compensation
;Rotate diameter 50
;Rotate radius 8
;Retract tool and deselect tool radius compensation
;Move to tool change location
;End of program
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 2-81
g
Fundamental Principles of NC Programming 11.02
2
2.6 Pro
840D
NCU 571
ramming example for turning application
840D
NCU 572 NCU 573
4
810D
°
5
840Di
2
X
R8
R3
R3
70
62
60
57
40
18
20
R3
15
12
R10
Ø 50
Ø 35
Ø 30
Ø 16
Z
4
80
Machine manufacturer (MH2.5)
The MD settings must be defined correctly before the program can run on the machine. References: /FB/ K2, "Axes, Coordinate Systems,.."
Siemens AG, 2002. All rights reserved
2-82 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
n
11.02 Positional Data
3
Positional Data
3.1 General information........................................................................................................ 3-84
3.2 Absolute/incremental dimensions, G90/G91.................................................................. 3-85
3.2.1 G91 extension (SW 4.3 and higher).......................................................................... 3-88
3.3 Absolute dimensions for rotary axes, DC, ACP, ACN.................................................... 3-89
3.4 Metric/imperial dimensions, G70/G71/G700/G710 ........................................................ 3-91
3.5 Zero offset (frame), G54 to G599................................................................................... 3-94
3.6 Selecting the working plane, G17 to G19 ....................................................................... 3-99
3.7 Programmable working area limitation, G25/G26 ........................................................ 3-102
3
3.8 Reference point approach, G74 ................................................................................... 3-105
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-83
Positional Data 11.02
3
3.1 General information
3
840D NCU 571
840D NCU 572 NCU 573
3.1 General information
In this section you will find a description of the commands that normally appear at the beginning of a NC program.
The way in which these functions are combined is not intended to be a patent remedy. For example, the choice of working plane may be made at another point in the NC program.
The real purpose of this and all the following sections is to illustrate the conventional structure of an NC program.
810D 840Di
3-84 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Positional Data
3
3.2Absolute/incremental dimensions, G90/G91
3
840D NCU 571
840D NCU 572 NCU 573
810D 840Di
3.2 Absolute/incremental dimensions, G90/G91
Programming
Absolute dimensioning
G90 X=AC(…) Y=AC(…) Z=AC(…)
Incremental dimensioning
G91 or X=IC(…) Y=IC(…) Z=IC(…)
Explanation of the parameters
X Y Z =AC =IC
Axis identifiers of the axes to be traversed Absolute dimensions (non-modal) Incremental dimensions (non-modal)
Function
The G90/91 commands and the non-modal dimensions AC/IC are used to define the system for describing the approach to setpoints.
Sequence
Absolute dimensions, G90
The dimensions refer to the origin of the active coordinate system. You program the point to which the tool is to travel, e.g. in the workpiece coordinate system.
Incremental dimensions, G91
The dimensions refer to the last point approached. You program how far the tool is to travel.
Non-modal absolute or incremental
dimensioning AC, IC
When G91 is active, AC can be used to allow entry of absolute dimensions for individual axes in a specific block. When G90 is active, IC can be used to allow entry of incremental dimensions for individual axes in a specific block.
85
G90
Y
35
G91
30 20
10 50
60
G90
X
G91
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-85
Positional Data 11.02
3
3.2 Absolute/incremental dimensions, G90/G91
3
840D NCU 571
840D NCU 572 NCU 573
810D 840Di
Additional notes
The commands G90 and G91 generally apply to all axes programmed in subsequent NC blocks. Both commands are modal.
On conventional turning machines it is standard practice to interpret incremental NC blocks in the transverse axis as radius values, while diameter dimensions are valid for absolute coordinates. This conversion for G90/G91 is performed using the commands DIAMON, DIAMOF or DIAM90.
You will find further information in "Special turning functions" (Section 4.13) in this Programming Guide.
G91
G90
X
G91
G90
Ø 25
Z
7.5
Programming example
The traverse paths are entered in absolute coordinates with reference to the workpiece zero.
The center point coordinates I and J for circular interpolation are specified blockwise in absolute coordinates, since the arc center is programmed – independent of G90/G91 – in incremental coordinates as standard.
N10 G90 G0 X45 Y60 Z2 T1 S2000 M3
N20 G1 Z-5 F500 N30 G2 X20 Y35 I=AC(45) J=AC(35)
or
N30 G2 X20 Y35 I0 J-25
N40 G0 Z2 N50 M30
Z
52535
Y
20 25
Absolute dimensioning, rapid traverse to
XYZ, tool, spindle on clockwise
Tool infeed
Circle center point in absolute dimensions
Circle center point in incremental
dimensions
Retract
End of block
X
X
3-86 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Positional Data
3
3.2Absolute/incremental dimensions, G90/G91
3
840D NCU 571
840D NCU 572 NCU 573
810D 840Di
N5 T1 D1 S2000 M3
2.5
21
27
Tool, spindle on clockwise
15
W
X
Z
Ø 11
N10 G0 G90 X11 Z1
N20 G1 Z-15 F0.2 N30 G3 X11 Z-27 I=AC(-5) K=AC(-21)
or
N30 G3 X11 Z-27 I-8 K-6
N40 G1 Z-40 N50 M30
Absolute dimensioning, rapid traverse to XYZ Tool infeed Circle center point in absolute dimensions
Circle center point in incremental dimensions Retract End of block
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-87
Positional Data 11.02
3
3.2 Absolute/incremental dimensions, G90/G91
3
840D NCU 571
840D NCU 572 NCU 573
810D 840Di
3.2.1 G91 extension (SW 4.3 and higher)
Programming
Incremental dimension data input G91 or X=IC(…) Y=IC(…) Z=IC(…)
without traversing through the active tool offset
SD 42442 TOOL_OFFSET_INCR_PROG = 0
without traversing through the active zero offset
SD 42440 FRAME_OFFSET_INCR_PROG = 0
Explanation of the parameters
SD 42440 FRAME_OFFSET_INCR_PROG = 0
SD 42442 TOOL_OFFSET_INCR_PROG = 0
Function
The active zero offset is not traversed.
The active tool offset is not traversed.
This can be set separately via SDs
For applications such as scratching, it is necessary only to traverse the path programmed in the incremental coordinates. The active zero offset or tool offset is not traversed.
FRAME_OFFSET_INCR_PROG (zero point) and TOOL_OFFSET_INCR_PROG (tool offset).
Programming example
G54 contains an offset of 25 in X
SD 42440 FRAME_OFFSET_INCR_PROG = 0
(no retraction of the active zero offset)
N10 G90 G0 G54 X100 N20 G1 G91 X10
N30 G90 X50
Traverse X by 10mm, the offset is not
traversed
Traverse to position X75, the offset is
traversed
3-88 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Positional Data
3
3.3 Absolute dimensions for rotary axes, DC, ACP, ACN
3
840D NCU 571
840D NCU 572 NCU 573
810D 840Di
3.3 Absolute dimensions for rotary axes, DC, ACP, ACN
Programming
A=DC(…) B=DC(…) C=DC(…) or
A=ACP(…) B=ACP(…) C=ACP(…) or
A=ACN(…) B=ACN(…) C=ACN(…)
Explanation of the parameters
A B C DC ACP ACN
Function
Axis identifier for rotary axis to be traversed Absolute dimensions, approach position directly Absolute dimensions, approach position in positive direction Absolute dimensions, approach position in negative direction
With the above parameters you can define the desired approach strategy for positioning rotary axes.
Sequence
Absolute dimensioning with The rotary axis travels to the position programmed in absolute coordinates along the shortest direct path. The rotary axis traverses across an area of up to 180°.
Absolute dimensioning with ACP The rotary axis travels to the positions programmed in absolute coordinates in the positive direction of axis rotation (counterclockwise).
Absolute dimensioning with ACN The rotary axis travels to the positions programmed in absolute coordinates in the negative direction of axis rotation (clockwise).
DC
ACP ACN
Maximum traversing range
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-89
Positional Data 11.02
3
3.3 Absolute dimensions for rotary axes, DC, ACP, ACN
3
840D NCU 571
840D NCU 572 NCU 573
810D 840Di
The traversing range between 0° and 360° must be
set in the machine data (modulo method) for positioning with directional data (ACP, ACN). G91 or IC must be programmed to traverse modulo rotary axes by more than 360° in a block. You will find more information on the previous pages.
The positive direction of rotation (clockwise or
counterclockwise) is set in the machine data.
Additional notes
All of the commands are modal. You can also use DC, ACP and ACN for spindle positioning from zero speed. Example:
SPOS=DC(45)
Programming example
Machining on a rotary table: The tool is stationary, the table rotates through 270° in clockwise
direction to produce a circular groove.
Z
5
Y
X
X
270°
N10 SPOS=0 N20 G90 G0 X-20 Y0 Z2 T1 N30 G1 Z-5 F500 N40 C=ACP(270)
Spindle in position control
Absolute, infeed in rapid traverse
Reduce feed
The table rotates through 270° in
clockwise direction, the tool mills a
circular groove
N50 G0 Z2 M30
Lift, end of program
Siemens AG, 2002. All rights reserved
3-90 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
11.02 Positional Data
p
3
840D
NCU 571
840D
NCU 572 NCU 573
3.4 Metric/im
810D
840Di
erial dimensions, G70/G71/G700/G710
3.4 Metric/imperial dimensions, G70/G71/G700/G710
3
Programming
Call G70 or G71 G700 or G710 SW5 and higher
Explanation of the commands
G70 G71 G700 G710
Function
Depending on the dimensions in the production drawing, you can program workpiece geometries alternately in metric measures and inches.
In SW 5 and higher, the functionality of G70/G71 has
been extended with G700/G710. In addition to the geometrical parameters, the technological parameters, such as feed F, are interpreted during parts program execution in the system of units set in G700/G710.
Sequence
Imperial measure (length [inches]) Metric measure (length [mm]) Imperial measure (length [inch]; feedrate [inch/min]) Metric measure (length [mm]; feed [mm/min])
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-91
G70 or G71 You can instruct the control to convert the following geometrical dimensions (with necessary deviations) into the system of units not set and then enter them directly (see examples):
Positional data X, Y, Z, …
Intermediate point coordinates I1, J1, K1
Interpolation parameters I, J, K and circle radius CR in circle programming
Thread lead
Programmable zero offset (TRANS)
Polar radius RP
Positional Data 11.02
p
3
3.4 Metric/im
840D
NCU 571
840D
NCU 572 NCU 573
erial dimensions, G70/G71/G700/G710
810D
840Di
3
All other parameters such as feedrates, tool offsets
The representation of system variables and machine
The programmed feedrate value is modal and thus
If the feedrate in the G70/G71/G700/G710 context is to
or settable zero offsets are interpreted (when using G70/G71) in the default system of units (MD 10240: SCALING_SYSTEM_IS_METRIC).
data is also independent of the G70/G71 context.
G700 or G710 In SW 5 and higher, the controller interprets all feedrates used with G700/G710 in the programmed system of units, unlike G70/G71.
The G700/G710 codes are contained in the same group as G70/G71.
For information about the action of G70/G71 and
G700/G710 on NC addresses, please refer to Section 12.2. "List of addresses".
does not change automatically on subsequent G70/G71/G700/G710 selections.
be activated, a new F value must be programmed explicitly.
All length-related NC data, machine data and setting
data for G700/G710 are always read and written in the programmed context of G700/G710.
References: /FB, G2/, Sect. 2.2 "Metric/Inch
System of Units"
3-92 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Positional Data
p
3
3.4 Metric/im
erial dimensions, G70/G71/G700/G710
3
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Synchronized actions If positioning tasks are performed in synchronized actions and no G70/G71/G700/G710 command is programmed in the synchronized action itself, the G70/G71/G700/G710 context active at the time of execution determines which system of units is used.
References: /PGA/ Chapter 10,
Motion-synchronous actions
/FBSY/ Synchronized Actions
Programming example
Change between metric and imperial input with basic setting metric (G70/G71).
Y
G70
G71 G70
3.54"
3.22"
30
20
1.18"
G71
X
2.75" 90
N10 G0 G90 X20 Y30 Z2 S2000 M3 T1 N20 G1 Z-5 F500 N30 X90 N40 G70 X2.75 Y3.22
Basic setting metric At feed in Z [mm/min]
Enter destination positions in inches, G70 is active until deselected by G71 or end of program
N50 X1.18 Y3.54 N60 G71 X 20 Y30 N70 G0 Z2 M30
Enter positions in mm Retract in rapid traverse, end of program
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-93
Positional Data 11.02
(
3
3.5 Zero offset
840D
NCU 571
3.5 Zero offset (frame), G54 to G599
840D
NCU 572 NCU 573
frame), G54 to G599
810D
840Di
3
Programming
Call G54 or G55 or G56 or G57 or G505 … G599 Deactivate G53 or G500 or SUPA or G153
Explanation of the commands
G53
G54 to G57 G153 G500
SUPA
G505 ... G599
Non-modal deactivation of current settable zero offset and programmable zero offset Call the second to fifth settable zero offset/frame Non-modal suppression of settable, programmable and total basic frame
G500=zero frame, default setting,
(contains no offset, rotation, mirroring or scaling)
Deactivation of settable zero offsets / frames (G54 to G599)
until the next call.
Activation of the total basic frame ($P_ACTBFRAME).
G500 is not 0
Activation of first settable zero offset/frames ($P_UIFR[0]) and
Activation of total basic frame ($P_ACTBFRAME), or a
modified basic frame is activated. Non-modal deactivation, including programmed offsets, handwheel offsets (DRF), external zero offset and PRESET offset. Call the 6th to the 99th settable zero offset
3-94 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Positional Data
3
3.5 Zero offset (frame), G54 to G599
3
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Function
The settable zero offset relates the workpiece zero on all axes to the origin of the basic coordinate system. It is therefore possible to call up cross-program zero points for different fixtures with a G command.
For turning, e.g. the offset value for tightening the
chuck is entered in G54.
Milling:
Z
Turning:
Z
4
5
G
Y
Y
X
X
X
Z
M
W
G54
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-95
Positional Data 11.02
(
3
3.5 Zero offset
frame), G54 to G599
3
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Sequence
Setting the offset values On the operator panel or universal interface, enter the following values in the internal control zero offset table:
Coordinates for the offset
Angle for rotated clamping and
Scale factors if necessary
Please see the Operator’s Guide for the procedure.
Y
Scale
Y
X
R o
t
a
t
e
Offset
X
Activating the zero offset In the NC program, the zero offset is moved from the machine coordinate system to the workpiece coordinate system by executing commands G54 to G57.
In the next NC block with a programmed movement, all of the positional parameters and thus the tool movements refer to the workpiece zero which is now valid.
Y
Y
Y
X
Y
X
X
The four available zero offsets can be used, e.g. for multiple machining operations, to describe four workpiece clamping positions simultaneously and
X
execute them in the program.
3-96 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Positional Data
3
3.5 Zero offset (frame), G54 to G599
3
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Further settable zero offsets, G505 to G599 Command numbers G505 to G599 are available for this purpose. This enables you to create up to 100 settable zero offsets in total, in addition to the four default zero offsets G54 to G57, by using the machine data. They are stored in the zero point memory. Please refer to Chapter 4 for further information.
Deactivating a zero offset Command G500 activates the first settable zero offset including basic offset, i.e. when zero frame is selected as the default, the current settable zero offset is deactivated. G53 suppresses the programmable and settable offset non-modally. G153 has the same effect as G53 and also suppresses the total basic frame. SUPA has the same effect as G153 and also suppresses the DRF offset, overlaid motions and external ZOs.
You will find more information on programmable
zero offsets in Chapter 6 (frames).
Additional notes
The basic setting at program start, e.g. G54 or G500, can be set with machine data.
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-97
Positional Data 11.02
(
3
3.5 Zero offset
frame), G54 to G599
3
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
Programming example
In this example, three workpieces, arranged on a pallet according to the zero offset values G54 to G56, are machined successively.
The machining sequence is programmed in subprogram L47.
N10 G0 G90 X10 Y10 F500 T1 N20 G54 S1000 M3
N30 L47
N40 G55 G0 Z200 N50 L47 N60 G56 N70 L47 N80 G53 X200 Y300 M30
Y
M
G
Y
X
Y
6
5
G
5
4
5
5
G
TRANS X10 M0
Y
X
X
Approach Call the first zero offset, spindle clockwise Run program, in this case as a subprogram Call the second zero offset Z via obstacle Run program as subprogram Call third zero offset Run program as subprogram Suppress zero offset, end of program
X
M
3-98 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
11.02 Positional Data
3
3.6 Selecting the working plane, G17 to G19
840D
NCU 571
840D
NCU 572 NCU 573
810D
840Di
3.6 Selecting the working plane, G17 to G19
3
Programming
Call G17 or G18 or G19
Explanation of the commands
G17 G18 G19
The axis assignment for G17, G18, G19 specified above is based on the supposition that X is assigned to the 1st geometry axis, Y to the second and Z to the third in the machine data.
Function
The specification of the working plane, in which the contour is to be machined also defines the following functions:
The plane for tool radius compensation
The infeed direction for tool length compensation
The plane for circular interpolation.
Working plane X/Y Infeed direction Z Working plane Z/X Infeed direction Y Working plane Y/Z Infeed direction X
Milling:
Z
Infeed
Y
X
depending on the tool type
I
n
f
e
d
e
e
f
n
I
Siemens AG, 2002. All rights reserved SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition 3-99
e
d
Positional Data 11.02
g
3
3.6 Selectin
840D
NCU 571
840D
NCU 572 NCU 573
the working plane, G17 to G19
810D
840Di
3
Sequence
It is advisable to define the working plane at the beginning of the program.
The working plane must be specified when the tool path compensation G41/G42 (see Section "Tool offsets") is called so that the control can correct the tool length and radius. In the initial setting, G17 (X/Y plane) is defined for milling and G18 (Z/X plane) is defined for turning.
Machining on inclined planes
Rotate the coordinate system with ROT (see Section "Coordinate system offset") to position the coordinate axes on the inclined surface. The working planes rotate accordingly.
Turning:
G
Y
7
1
G
1
9
G
1
8
Z
X
Tool length compensation in inclined planes
The tool length compensation generally always refers to the fixed, non-rotated working plane.
3-100 SINUMERIK 840D/840Di/810D Programming Guide Fundamentals (PG) – 11.02 Edition
Siemens AG, 2002. All rights reserved
Loading...