Sunteți pe pagina 1din 149

D.

ELECTRON
dal 1977 Al t a Tecnol ogi a
per l a Macchi na Ut ensi l e

Z32
CNC
Programming guide (Milling Machines)

Document M323
C0 31.01.07

Read thoroughly before installation


Contains important information on:
programming
This manual contains information exclusively devoted to the user of D.Electron products to allow a correct usage of delivered
devices. No part of this manual can be duplicated or delivered to third parties for an usage not corresponding to that indicated.
All information here contained have been accurately checked to be exact and reliable, but D.Electron doesnt assume any
responsibility for possible inaccuracies. D.Electron reserves the right to make all modifications necessary to improve the
performance and reliability of its products.
D.Electron - Via R. Giuliani 140 - 50141 Firenze ITALY Internet: www.delectron.it
Tel ++39 - 055 - 416927 Fax ++39 - 055 - 434220 email delectron@delectron.it

CNC Z32 - Programming guide (Milling Machines)

CONTENTS
1.

INTRODUCTION .................................................................................................................................................... 1

2.

BASE PROGRAMMING ....................................................................................................................................... 2


2.1

INTRODUCTION.................................................................................................................................................... 2
2.1.1 Machine behavior at reset....................................................................................................................... 2
2.1.2 Line number .............................................................................................................................................. 3
2.1.3 The standard ISO line.............................................................................................................................. 3
2.1.4 Comment lines.......................................................................................................................................... 4
2.1.5
G functions (modals and with stop) ............................................................................................................ 4
1.1.
F PARAMETER AND FEED MANAGEMENT (G93 G94 G95) ................................................................................... 5
2.2
S PARAMETER AND SPEED MANAGEMENT (G96 G97) ......................................................................................... 5
2.3
M FUNCTIONS ..................................................................................................................................................... 6
2.4
AUXILIARY FUNCTIONS MA, MB, MC ................................................................................................................ 7
2.5
END OF PROGRAM AND END OF SUBPROGRAM (M2 G26)..................................................................................... 7
2.6
ORIGIN RECALL FUNCTIONS................................................................................................................................ 8
2.7
T PARAMETER AND TOOL CHANGE ................................................................................................................... 10
2.8
TOOL LENGTH AND RADIUS ............................................................................................................................... 11
2.8.1
Tool length and radius modification (DDL DDR) .................................................................................... 11
2.9
CANCELLATION AND SUSPENSION OF ORIGINS AND LENGTHS (G53 G54 G45) .................................................. 12
2.10 WORKING TERN (G25), TOOL AXIS (G43 - G44) AND CONTOURING PLANE ....................................................... 13
2.11 MOVEMENT PROGRAMMING (G0 G1 G2 G3) .................................................................................................... 14
2.11.1 Rapid movement (G0) ........................................................................................................................... 14
2.11.2 Linear interpolation (G1) ....................................................................................................................... 15
2.11.3 Circular interpolation (G2 G3)............................................................................................................... 15
2.11.4 Helical interpolation (G12 G13) ............................................................................................................ 15
2.12 INCREMENTAL COORDINATES PROGRAMMING (G90 G91) ................................................................................. 16
2.13 THREADING AND RIGID TAPPING ....................................................................................................................... 17
2.13.1 Fixed pitch threading (G33) .................................................................................................................. 17
2.13.2 Variable pitch threading (G34, G35) ........................................................................................................ 18
2.13.3 Rigid tapping (G63)................................................................................................................................ 18
2.14 ROTATION, TRANSLATION, MIRRORING, SCALE FACTOR .................................................................................... 20
2.14.1 Machining rotation (IR JR QR) ................................................................................................................ 20
2.14.2 Machining translation (DA DB DC) ......................................................................................................... 20
2.14.3 Mirroring on the working plane (G56 G55)........................................................................................... 21
2.14.4 Scale factor ............................................................................................................................................. 21
2.14.5 Other correction parameters................................................................................................................. 22
2.14.6 Typical transformations examples: ........................................................................................................... 22
2.15 G116 MACHINING ON SLOPING PLANES (ROTO-TRANSLATION) .......................................................................... 23
2.16 OTHER FUNCTIONS ........................................................................................................................................... 25
2.16.1 Dwell (G4 TT..) ....................................................................................................................................... 25
2.16.2 Axes change (G16) ................................................................................................................................ 25
2.16.3 Alive axes management (G28, G29)......................................................................................................... 26
2.16.4 Suspending and resuming Tool change (G38, G39) ................................................................................. 27
2.16.5 Mounted tool reading (G104)................................................................................................................ 27
2.16.6 Real positions reading (G105) .................................................................................................................. 27
2.16.7 Radial programming (G106) ................................................................................................................. 27
2.16.8 Diametrical programming (G107) ............................................................................................................ 28
2.16.9 Axis movement with alarm CNxx12 (G119) ............................................................................................ 28
2.16.10 Working field limits (G123).................................................................................................................... 28
3.

TOOL RADIUS CORRECTION ......................................................................................................................... 30


3.1
3.2

INCOMPATIBLE PROFILE ERROR .............................................................................................................. 31


APPROACH TO PROFILE .................................................................................................................................... 32

CNC Z32 - Programming guide (Milling Machines)

3.2.1
G41/G42 circular approach with final positions and slope (G41/G42 X.. Y.. QF..) .............................. 32
3.2.2
G41 /G42 linear approach without positions (G41/G42) ....................................................................... 33
3.2.3
G41 /G42 linear approach with final positions (G41/G42) .................................................................... 33
3.3
RETRACT FROM PROFILE .................................................................................................................................. 34
3.3.1
G40 circular tangent retract (G40 X.. Y..).............................................................................................. 34
3.3.2
G40 retract without positions (G40)....................................................................................................... 35
3.4
FEED MANAGEMENT WITH RADIUS CORRECTION (G109V, G109U)................................................................... 35
3.5
NULL OR NEGATIVE RADIUS .............................................................................................................................. 36
3.6
CONNECTING RADIUS ON EXTERNAL EDGES (G109S, G109T) ........................................................................... 36
4.

RTCP (ROTATING TOOL CENTRE POINT) ................................................................................................. 37


4.1

G117 RTCP FOR ROTATING HEADS ................................................................................................................ 37


4.1.1 Static G117 (G117 KA2)........................................................................................................................ 37
4.1.2 Dynamic G117 (G117 KA1) .................................................................................................................. 39
4.1.3 G117 usage............................................................................................................................................. 39
4.1.4
Handwheel enable on rotating axes in G117 (G124) ................................................................................ 40
4.2
RTCP FOR TURNTABLES .................................................................................................................................. 41
4.2.1 G118 simple ............................................................................................................................................ 41
4.2.2 G118 HR1................................................................................................................................................ 43
4.2.3 G118 usage............................................................................................................................................. 44
4.3
WORKPIECE MOUNTING ERRORS COMPENSATION ON TILTING TABLES (G122)................................................... 45
4.4
TOOL TIP CONSTANT VELOCITY WITH RTCP ACTIVE (G131)............................................................................. 46
5.

PARAMETRIC PROGRAMMING ...................................................................................................................... 47


5.1

PARAMETER MANAGEMENT............................................................................................................................... 47
5.1.1 Parameter assignment........................................................................................................................... 49
5.1.2
Parameter assignment through a formula .................................................................................................. 49
5.1.3
Axis movement programming with parameters ........................................................................................ 50
5.1.4 System parameters programming........................................................................................................ 50
5.1.5
Axes programming through parameters AA, AB, AC .............................................................................. 51
5.2
PROGRAMMING WITH ADVANCED LINES ( ! ... ! )............................................................................................ 52
5.2.1
Assigning values to parameters and computing expressions..................................................................... 52
5.2.2
Executing jumps without return (!GON..!) ............................................................................................... 52
5.2.3
Executing jumps with return (!GON....!) ................................................................................................ 53
5.2.4
Executing conditioned jumps (!IF .. ; GON.. !) ........................................................................................ 53
5.2.5
Controlling more than one condition on the same advanced line.............................................................. 54
5.2.6 Structuring conditioned jumps .............................................................................................................. 54
5.2.7
Jump to a CMOS subprogram (! GOP.. !)................................................................................................. 55
5.2.8
Jump to a CMOS subprogram with label (! GOP.. N..!) ......................................................................... 55
5.2.9
Jump to a CMOS subprogram with two labels (! GOP.. N.. N..!)......................................................... 56
5.3
CONDITIONING BLOCKS OF PROGRAMS (--IF)..................................................................................................... 56
5.4
PROGRAM BLOCK REPETITION (--DO --LOOP).................................................................................................. 58
5.4.1
Specifying the repetition number (LOOP {N}) ........................................................................................ 58
5.4.2 Repetition condition................................................................................................................................ 58
5.4.3
Anticipated exit condition --DO --LOOP (--EXIT DO)............................................................................ 59
5.5
WRITING CMOS PROGRAMS (--DEFINE P..) .................................................................................................... 60
5.6
WRITING A TEMPORARY SUBPROGRAM SUBTEMP (--DEFINE S..) ................................................................. 60
6.

Z32 FIXED CYCLES AND MACROS................................................................................................................ 62


6.1

Z32 FIXED CYCLES (G800).............................................................................................................................. 62


6.1.1 G800K1: Drilling...................................................................................................................................... 64
6.1.2
G800K2: Deep drilling with chip breakage .............................................................................................. 64
6.1.3
G800K3: Deep drilling with chip extraction ............................................................................................. 65
6.1.4 G800K4: Tapping ................................................................................................................................... 65
6.1.5 G800K5: Reaming.................................................................................................................................. 65
6.1.6 G800K6: Boring ...................................................................................................................................... 65
6.1.7
G800K7: Deep drilling with chip breakage and extraction ....................................................................... 66
6.1.8
G800K8: Two zones drilling with gap ...................................................................................................... 67

ii

CNC Z32 - Programming guide (Milling Machines)

6.1.9 G800K9: Three zones drilling ............................................................................................................... 67


6.1.10 G800K10: Internal spiral milling-boring .................................................................................................. 68
6.1.11 G800K11: External spiral milling-boring ................................................................................................. 68
6.2
Z32 POSITIONING MACROS (G801) ................................................................................................................. 69
6.2.1
G801K1: Line - starting point and increments.......................................................................................... 71
6.2.2
G801K2: Line starting point, angle and point distance.......................................................................... 71
6.2.3
G801K3: Line - starting and end point ..................................................................................................... 71
6.2.4
G801K4: Grid row and column increments ........................................................................................... 72
6.2.5
G801K5: Grid starting point, distances and angles................................................................................ 72
6.2.6
G801K6: Grid row and column starting and end points ........................................................................ 72
6.2.7
G801K7: Circle initial angle and total increment .................................................................................. 73
6.2.8
G801K8: Circle initial angle and angular distance ................................................................................ 73
6.2.9
G801K9: Circle initial and final angle ................................................................................................... 74
6.2.10 G801K10: Rectangle center and pitch ................................................................................................... 74
6.2.11 G801K11: Rectangle center and sides ................................................................................................... 74
6.2.12 G801K12: Rectangle corner and pitch................................................................................................... 75
6.2.13 G801K13: Rectangle corner and sides................................................................................................... 75
6.3
Z32 MACHINING MACROS (G802) .................................................................................................................... 76
6.3.1
G802K1: Circular pockets roughing ......................................................................................................... 78
6.3.2
G802K2: Rectangular pocket roughing pocket center ........................................................................... 79
6.3.3
G802K3: Rectangular pocket roughing - corner ....................................................................................... 80
6.3.4
G802K4: Circular pockets finishing ......................................................................................................... 81
6.3.5
G802K5: Rectangular pocket finishing pocket center ........................................................................... 82
6.3.6
G802K6: Rectangular pocket finishing - corner ....................................................................................... 83
6.3.7 G802K7: Linear eyelet........................................................................................................................... 84
6.3.8
G802K8: Circular eyelet eyelet center ................................................................................................... 85
6.3.9
G802K9: Circular eyelet curvature center ............................................................................................. 86
6.3.10 G802K10: Hole thread milling with a single flute end mill...................................................................... 87
6.3.11 G802K11: Hole thread milling with a comb end mill............................................................................... 88
6.3.12 G802K12: Stud thread milling with a single flute end mill ...................................................................... 89
6.3.13 G802K13: Stud thread milling with a comb end mill ............................................................................... 90
6.3.14 G802K14: Face milling .......................................................................................................................... 91
6.4
MACHINE TOOL BUILDERS FIXED CYCLES (G27C..).......................................................................................... 92
7.

PROFILES ON THE PLANE .............................................................................................................................. 93


7.1

CLOSED LINES................................................................................................................................................... 95
7.1.1
Line end point (G1 X.. ; G1 Y.. ; G1 X.. Y..) ........................................................................................ 95
7.1.2
Line end coordinate and slope (G1 X..QF.. ; G1 Y..QF..) ..................................................................... 95
7.1.3
Line two coordinates end point and slope (G1 X.. Y.. QF..).................................................................. 96
7.2
OPEN LINES (G1 ; G1 QF..) ............................................................................................................................ 97
7.3
CLOSED CIRCLES .............................................................................................................................................. 98
7.3.1
Circle center and end point (G2/G3 I..J..X..Y..) .................................................................................... 98
7.3.2
Circle end point and radius (G2/G3 X..Y..RA..).................................................................................... 99
7.3.3
Circle center, radius and end slope (G2/G3 I..J..RA..QF..).................................................................. 100
7.3.4
Circle center and end slope (G2/G3 I..J..QF..)..................................................................................... 100
7.3.5
Circle radius and end slope (G2/G3 RA..QF..) .................................................................................... 101
7.3.6
Circle end point (G2/G3 X..Y..)........................................................................................................... 102
7.3.7
Circle center and end arc length (G2/G3 I..J..QA..)............................................................................. 102
7.4
OPEN CIRCLES ................................................................................................................................................ 103
7.4.1
Circle center and radius (G2/G3 I..J..RA..).......................................................................................... 103
7.4.2 Circle center (G2/G3 I..J..)............................................................................................................... 104
7.4.3 Circle radius (G2/G3 RA..)............................................................................................................... 104
7.5
LINE-CIRCLE COMBINATIONS .......................................................................................................................... 105
7.6
AUTOMATIC FILLETS (RR..) ............................................................................................................................ 107
7.7
CHAMFERS ...................................................................................................................................................... 111
8.

DISK FILES RECALL ....................................................................................................................................... 112


8.1

MACHINING OF FILES GENERATED BY CAD-CAM SYSTEMS ........................................................................... 112

iii

CNC Z32 - Programming guide (Milling Machines)

8.2
8.3
9.

DNC DISK PROGRAM RECALL ( !:L254 ! )................................................................................................... 112


SOME NOTE ON THE DNC PART-PROGRAM ...................................................................................................... 113
HIGH SPEED SETTING .................................................................................................................................... 114

9.1
9.2
9.3
9.4
9.5
9.6
9.7
10.

HIGH SPEED ACTIVATION: G114 RA..K..J..I..HY..HR..................................................................................... 114


MOVEMENT CONTROL FUNCTION: G113X (KA1)............................................................................................ 116
RECOMPOSING CURVES FROM A SERIES OF POINTS: G113A (OR G113B)......................................................... 116
CAM SETTINGS FOR POINT PROGRAMS GENERATION ....................................................................................... 117
CURVE DECELERATION REDUCTION: G135 I HX ..................................................................................... 118
HIGH SPEED PARAMETERS SETTINGS (SUMMARY TABLE) ................................................................................. 119
HIGH SPEED PARAMETERS - EXAMPLES ......................................................................................................... 120
PROGRAMMING EXAMPLES......................................................................................................................... 121

10.1
10.2
10.3
10.4
10.5
10.6
10.7
10.8
10.9
10.10
10.11
10.12
10.13
10.14
10.15
10.16
10.17
10.18
10.19
10.20
10.21
10.22
10.23

PROFILE 1 ....................................................................................................................................................... 121


PROFILE 2 ....................................................................................................................................................... 122
ROTATION ....................................................................................................................................................... 123
TRANSLATION .................................................................................................................................................. 124
ROTO-TRANSLATION 1 .................................................................................................................................... 125
ROTO-TRANSLATION 2 .................................................................................................................................... 126
MIRRORING 1 .................................................................................................................................................. 127
MIRRORING 2 .................................................................................................................................................. 128
THIRD AXIS TURNOVER ................................................................................................................................... 129
ANGULAR REPETITION OF A PROFILE................................................................................................................ 130
LINEAR REPETITION OF A PROFILE .................................................................................................................. 131
PROFILE 1 REPETITION WITH VARIOUS DEPTHS ................................................................................................ 132
FINISHING OF A SPHERICAL SURFACE ............................................................................................................... 133
ELLIPSE ........................................................................................................................................................... 134
ROTO-TRANSLATION IN THE SPACE (SPHERICAL SURFACE) .............................................................................. 135
REVOLUTION SOLID ......................................................................................................................................... 136
MACHINING OF A X-Z PROGRAMMED PROFILE ................................................................................................ 137
SLANTED HEAD DRILLING ................................................................................................................................ 138
CIRCUMFERENCE POSITIONING AND DRILLING FIXED CYCLE............................................................................ 139
POSITIONING OF A MACHINING AROUND A CIRCUMFERENCE, WITH ROTATION ................................................ 140
POSITIONING OF A MACHINING AROUND A CIRCUMFERENCE, WITHOUT ROTATION .......................................... 141
CIRCULAR POCKET ROUGHING ....................................................................................................................... 142
CIRCULAR POCKET ROUGHING POSITIONED ON A CIRCUMFERENCE ............................................................. 143

iv

CNC Z32 - Programming guide (Milling Machines)

1.

INTRODUCTION

This manual contains a simplified description of Z32 control programming.


This document doesnt contain a detailed description of all functionalities available, focusing only on the most
common and useful for the programming of milling machines or machining centers.
For a complete and detailed description of all functionalities available in the Z32 numerical control, please consult
Programming Manual M96.
This manual is valid for SIS T109-8 version or later.

CNC Z32 - Programming guide (Milling Machines)

2.

BASE PROGRAMMING

2.1

Introduction

The base programming Z32 numerical controls follows the indications of ISO directions.
The program for a workpiece (or part-program) is a text file composed by a series of instructions stored in
sequential way.
The ISO lines are composed by a line number (not mandatory) and by a series of elementary instructions.

2.1.1 Machine behavior at reset


The machine behavior at reset is defined as the condition assumed by the machine when the pushbutton Reset is
pressed on the console. This behavior is important because it determines the machine functionality in its base
condition.
The reset condition is activated in the following ways:
- At CNC power up
- At the start of a program execution
- After pressing the pushbutton Reset

Offset behavior at reset


The behavior of the zero offset at reset, is function of machine setup.
Depending on the setup, the following can happens:
- The machine sets its base origin (axis positions related to machine zero)
- The machine sets as active the origin (zero offset) number 1 on all continuous axes
- The machine leaves as active the last programmed offset
Please consult the machine tool builder for further information.

Parameter behavior at reset


All parameters used for the parametric programming of part-program are set to zero after reset.
The following parameters behaves differently:
- Tool parameters. After reset all parameter values contained in the active tool description are
assigned. The active tool is the tool actually inserted on the spindle. If the tool parameters contain
technological parameters, like parameter F (feed) or parameter S (speed), these values are set at
reset with the corresponding values in the tool table. Parameters normally contained in the tool
description, are length L and radius R.

Behavior of working plane at reset


As described later on, there are functions which allow to set the working plane of the machine and to define
the tool length correction. These functions are G25, G43 and G44.
At reset the machine switches to the configuration defined by setup made by the machine tool builder
As an example, in a standard machine with three axes, the working plane is the plane X-Y, and the tool
length correction is assigned to Z axis.
Please consult the machine tool builder for further information.

Axes behavior at reset (alive axes at reset)


After reset the axes can be alive or not. An alive axis is an axis whose position is controlled by the
numerical control. A non alive axis is an axis without control. A machine setup data defines the behavior at
reset. During part-program execution an axis can be switched alive or not alive through instructions G28
and G29.
- If the alive axes are defined as reset-transparent, the reset will not alter the actual map of alive
axes.
- If the alive axes are defined as non reset-transparent, the reset restores the map of alive axes
defined in the setup.
Please consult the machine tool builder for further information.

CNC Z32 - Programming guide (Milling Machines)

All geometric transforms, translations, mirroring, rotations, scale factors, etc. are disabled at reset.

All functions and settings related to RTCP (rotating tool centre point) are disabled at reset.

At reset, all high speed settings are restored with the corresponding parameters contained in the machine
setup. Please consult the machine tool builder for further information.

Warning: it is important to remember that at the beginning of a part-program execution, a reset


condition is forced. Thus the machine initiates the execution starting from the reset state, and every
modification to be made on this state must be expressly programmed in the part-program.

2.1.2 Line number


The line number is composed by the letter N followed by a number (also decimal). The line number programming
is not mandatory. As an example, all following syntaxes are equivalent:
G0 Z100
and
N10 G0Z100
Line number format: The line number can be an integer or decimal number, with the decimal position
indicated either with a point or a comma. It is possible to insert some space characters between the letter
N and the number. As an example, it is possible to write:
N100
N 100.2
N100,34
The only limitation is the total number of numeric characters before and after the decimal delimiter, which
cannot be more than 9 characters.
Line number as jump destination: The line number may be used as jump destination in the logicmathematic programming. For a description of this functionality, please consult this manual in the logicmathematic programming section.

2.1.3 The standard ISO line


After the optional line number N, the ISO line is composed by a sequence of elementary instructions. Each
instruction is composed by two parts:
- ADDRESS
- VALUE
The address is composed by alphabetic characters and specifies the type of operation desired.
The value, normally numeric, specifies the operation to be executed.
Between address and value, an arbitrary number of spaces can be inserted.
The same line may contain more than one couple address-value.
The followings are all valid ISO lines:
N10 G0 Z100
N20 G0 X 100 Y200
G0Z0X0Y0

CNC Z32 - Programming guide (Milling Machines)

Format of numeric values:


- At least one number must be programmed (the zero value is programmed with one or more 0
characters)
- The division between integer and decimal part may be indicated either with . (point) and with ,
(comma).
All following sample programming are valid ISO lines:
X.1
X .1
X,1
X0,1
X 0.1
X00000,1000
- All numbers cannot have more than 9 significant digits before or after the decimal delimiter.
All following sample programming are valid ISO lines:
X123456789
X0.123456789
X0.0000123456789
X12345.6789
Invalid programming samples:
X1234567.12345
X12345.67890000
X1.00000001234
- A number cannot contain space characters.

2.1.4 Comment lines


A part-program may contain comment lines.
A comment is contained between parenthesis.
Example:
G0 Z100 (initial approach)
2.1.5 G functions (modals and with stop)
The G functions are preparatory functions responsible to prepare the CNC to interpret the following functions.
The number following the G letter identifies the particular function for which the Z32 must be prepared. The value
following the G letter must always be a numeric value (CANNOT be an expression result).
Only some G functions (i.e. only some numeric values) are interpreted and executed from Z32. If a not
implemented G function is programmed, Z32 issues the related alarm.
The functions are those contained in the ISO regulations, with some adaptations. In particular:
The initial zero digits of G codes can be omitted (G0 is equivalent to G00)
More than one G function can be programmed in the same block: in this case the G functions are
recognized and executed by the CNC as they are encountered in the programmed line: if contrasting
G functions are programmed, the last programmed G function remains active.
Some particular G functions require additional data to complete their definition.
MODAL functions are those G functions whose effect will be maintained also in the blocks following the
one where they were programmed: modal G functions are normally deactivated by other special G
functions.
Some G functions require the machine STOP: the profile must be completely defined when they are
executed. In this case no contouring with open profile, or contouring with radius compensation can be
active.

CNC Z32 - Programming guide (Milling Machines)

1.1. F parameter and Feed management (G93 G94 G95)


The F parameter defines the feed velocity during machining and it is programmed writing the letter F followed by
the desired feed value (numeric value with a maximum of 9 significant digits).
Programmed after G94 it defines the F velocity in units per minute. Example:
With linear axes measured in millimeters, F100 means 100 mm/min.
With linear axes measured in inches, F100 means 100 in/min.
With round axes measured in degrees, F100 means 100 deg/min.
G94 is active after reset and it is thus the normal mode if not otherwise specified.
Programmed after G95 it defines the feed velocity as units per spindle round. Units can be millimeters, inches or
degrees, depending on the axis type.
Programmed after G93 it defines the velocity as the inverse of time (expressed in minutes) necessary to execute
the programmed movement. In this case the F value to be programmed is equal to the velocity desired on the
trajectory, divided by the length of the trajectory itself:

F = Velocity (mm/min or in/min) / Space (mm or inches)

2.2

S parameter and Speed management (G96 G97)

The S parameter defines the spindle rotational speed and is programmed writing the letter S followed by the
desired speed value (numeric value with a maximum of 9 significant digits). The S function doesnt activate the
spindle rotation, activated through the auxiliary functions M3 or M4.
Programmed after G97 it defines the spindle rotational speed in rpm.
G97 is active after reset and it is thus the normal mode if not otherwise specified.
Programmed after G96 it sets the mode Constant cutting speed". This is a typical functionality of lathes: the
spindle rotational speed is computed in such a way that the cutting speed is equal to the programmed S value
(expressed in m/min), considering the tool distance from the rotation centre of the spindle.
Note on G96: In order to avoid excessive speed when the distance from spindle center is very small, aside
G96 the parameter MS is activated (programmable also before the S value) which sets the maximum spindle
rotational speed (in rpm) allowed. The active MS value is that present at the moment of last programmed S: if
the parameter MS is newly programmed, the limit doesn't change until a new programming of S value.
The tool may jump over the rotation centre: the speed is in every case determined by the absolute value of
the distance from spindle center, while the center crossing is limited by the programmed MS. It is possible to
program:
MS 4000
G96 S100 M3
This programming imposes a cutting speed of 100 m/min.
With a maximum speed limit of 4000 rpm.

CNC Z32 - Programming guide (Milling Machines)

2.3

M Functions

The M functions (miscellaneous) are mainly related to the machine tool behavior and their functionality is mostly
defined by the machine tool builder.
All M functions require a machine stop.
The ISO standards indicate the functionality of many M codes: only some M codes are decoded and managed by
the Z32, and only these codes will be discussed.
The numeric value (two integer digits) following the letter M, indicates the programmed M function. All leading
zeros can be omitted (G0 = G00).
ISO M codes
M0 - stop
It stops the program execution; program resuming trough Start pushbutton. This function also stops
spindle and coolants.
M1 conditioned stop
Same behavior as M0, but M1 activity is conditioned by a dedicated logic input: for further details, please
consult the machine tool builder. This function also stops spindle and coolants.
M2 End of program
Exits the control EXECUTION mode and terminates all automatic operations.
M3 Spindle clockwise
Requests a clockwise rotation of the spindle, with the previously programmed S (speed).
M3 Spindle counterclockwise
Requests a counterclockwise rotation of the spindle, with the previously programmed S (speed).
M5 Spindle stop
Requests the spindle stop. It stops also the coolants.
M6 Tool change
Requests the mounting of last programmed T (in the same or preceding blocks) on the spindle. It also
stops spindle and coolants. After the M6 execution, the CNC takes into account the description of the tool
mounted on the spindle, updating accordingly all parameters.
M7 coolant #1 delivery
Requests delivery of coolant #1.
M8 coolant #2 delivery
Requests delivery of coolant #2.
M9 Coolant stop
Requests stop of coolants delivery.
M19 Spindle orientation
Requests the spindle orientation.
This function also stops spindle and coolants.
The machine tool builder can define other M functions for particular usage and purposes of the machine. For
further details, please consult the machine tool builder.
Special M codes
A category of M functions is defined as Special M. Unlike normal M functions, interpreted exclusively by the
machine PLC, every special M code is associated with a service part-program. A typical example of special M is
the M6 for tool changing.
The definition and programming of subprograms associated with special M codes, are activities reserved to the
machine tool builder.
During the execution of the subprogram associated to a special M, the progressive block number counting is
suspended (in block search the special M appears as a single block, not searchable in an intermediate point).
The subprogram associated to the special M may be executed as a single block.

CNC Z32 - Programming guide (Milling Machines)

2.4

Auxiliary functions MA, MB, MC

Besides M auxiliary functions, the Z32 control offers to the machine tool builder three more auxiliary functions
categories (MA, MB, MC) sent to the machine logic.
The MA, MB and MC functions may be programmed with 9 significant digits, before or after the decimal delimiter.
The MA, MB and MC functions provoke the machine stop.
For further details, please consult the machine tool builder.

2.5

End of program and end of subprogram (M2 G26)

The end of program instruction is the M2 code.


When the Z32 control decodes the M2 instruction, the execution will be terminated.
The G26 instructions represents the end of a subprogram.
When the Z32 control decodes the G26 instruction, the execution of the actual subprogram is aborted and the
execution of calling program is restored.
If the instruction G26 is found in the main program (not in a subprogram), the instruction has the same meaning of
M2, i.e. the part-program execution is aborted.

CNC Z32 - Programming guide (Milling Machines)

2.6

Origin recall functions

Two types of origins are defined for the machine:


- Base origins: set by the machine tool builder, they define the fixed reference system of the machine. These
origins normally doesnt require modifications during machine usage.
- Supplementary origins: defined by the user, they define the position of working area with respect to the base
origins. When a supplementary origin is activated, all positions programmed in the part-program are related to
the active supplementary origin.
In this example, the supplementary origins on X and Y axes (OX1
and OY1) define the reference point for the positions
programmed in the part-program:
The setup of supplementary origins is
generally an activity to be done on the
workpiece mounted on the machine.
The program will then recall the desired
supplementary origins.

OX1 OY1
G0 X20 Y25
G1 X55
Y40
X20
Y25

The address O indicates an origin recall


to the Z32.

The syntax for an origin recall is as follows:


- programming of letter O
- name of desired axis
- character indicating the origin.
The character indicating the origin may be composed from:
- characters from 1 to 9
Warning: it is not possible to define as supplementary origin the origin 0, because this
origin is the base origin setup by the machine tool builder
- alphabetic letters, lower and upper case
- other characters (not recommended)
Warning: upper and lower case characters refer to different origins, i.e. OXA and OXa are two
different origins
Example:
OX1
(activates origin 1 on axis X)
OX2 OY2 (activates origin 2 on axes X and Y)
OX1 OYA (activates origin 1 on axis X and origin A on axis Y)
Erroneous programming example:
OX10
(the origin must be indicated by a single character)
To deactivate the supplementary origin it is possible to program the origin 0.
Example, the programming:
OX0 OY0
deactivates the supplementary origins on axes X and Y. After this instruction, all CNC positions are related to the
machine base origin setup by the machine tool builder.

CNC Z32 - Programming guide (Milling Machines)

Note: The supplementary origins are stored in the CNC CMOS memory.
Depending on the process the origins belong, the files are the following:
Process:
Origin file:

0
126

1
123

2
120

3
117

4
114

5
111

In single process machines, the file containing the origins is the file 126 (the file related to process 0).
The syntax of an origin file is as follows:
:OS
X1=123.4
Y1=-231.5

The file begins with the header :OS which indicates the start of the section specific for the origins
In the following lines, the values of the various origins are stored.
In the example:
The origin number 1 on X axis determines a translation of 123.4 with respect to the base origin.

CNC Z32 - Programming guide (Milling Machines)

2.7

T parameter and tool change

The T parameter is devoted to the tool change, together with the M6 function. The digits following the T letter
indicate the tool number to recall.
The T parameter has the purpose to prepare the machine for the tool changing (i.e. to prepare the axes of tool
magazine for the change), while the function M6 starts the actual change.
For further details, please consult the machine tool builder.
Warning: At the moment of tool change all parameters present in the tool table for the desired tool are
recalled and assigned.
The values for tool length (L) and radius (R) are assigned, together with every other parameter stored in the
table. It is thus possible to save in the table also the S and F values (Speed and Feed) related to the
tool interested. In this mode, after tool change, also these values will be assigned.
Note: The tool table is stored in the CNC CMOS memory.
Depending on the process the tool tables belong, the files are the following:
Process:
Tool table:

0
127

1
124

2
121

3
118

4
115

5
112

In single process machines, the file containing the tool descriptions is the file 127 (the file related to process 0).
The syntax of a tool table file is as follows:
T1P127
:TL
T0#0R0L,000
T1#1L10,000R2(CENTER DRILL)

The file starts with the tool actually mounted on the spindle. In the above example, it is the tool number 1,
contained in the file number 127.
The :TL label specifies the start of the section describing the tools.
In the following lines, the descriptions of the various tool are stored.
- The T parameter indicates the tool number
- The # parameter indicates the position of the tool in the tool magazine.
- The various parameters describing the tool are inserted in the line through the parameter name and
its numeric value.
- The line may have a comment inserted between parenthesis.
In the above example:
The tool T1 is positioned at place #1, has a length L10 and radius R2

10

CNC Z32 - Programming guide (Milling Machines)

2.8

Tool length and radius


The tool length is the value of parameter L.
The length can be set inserting the tool length value in the tool table
(in this case the length will be updated on tool change), or expressly
programming the "L" parameter in a program line:
N10 L10.23 (tool length 10.23)
The tool length L may be a positive or negative value.
The correction of tool length is automatically done by the control
taking into account the L length along the axis defined as tool
axis, without need to modify the part-program positions.

2.8.1

The tool radius is the value of parameter R.


The radius can be set inserting the tool radius value in the tool table
(in this case the radius will be updated on tool change), or expressly
programming the "R" parameter in a program line:
N10 R3
(tool radius 3)
The value of tool radius is used by the control during the contouring of
plane profiles with radius correction, through the functions G40, G41
and G42.

Tool length and radius modification (DDL DDR)

Through the parameters DDL and DDR it is possible to modify length and radius of the active tool.
To compute the correction related to the tool length, the Z32 numerical control considers the sum between
parameters L and DDL.
The correction set through the parameter DDL is not incremental; to cancel its effect it is necessary to program
DDL0.
Example:
N10 T1M6
N20 L100 (imposes a tool length of 100)
N30 DDL1 (tool correction equals L + DDL, i.e. 101)
N40 DDL0 (cancels DDL, tool correction equals 100)
The correction of tool radius happens through the parameter DDR.
The correction set through the parameter DDR is not incremental; to cancel its effect it is necessary to program
DDR0.
Example:
N10 T1M6
N20 R5 (imposes a tool radius of 5)
N30 DDR0.1 (tool radius equals R + DDR, i.e. 5.1)
N40 DDR0 (cancels DDR, tool radius equals 5)

11

CNC Z32 - Programming guide (Milling Machines)

2.9

Cancellation and suspension of origins and lengths (G53 G54 G45)

These functions must be used by expert programmers.


To cancel an origin it is necessary to program the base origin, for example:
OX0 OY0 OZ0
To cancel the tool length corrections it is necessary to program a null length:
L0
To suspend the corrections introduced by supplementary origins and tool length it is possible to program the
G53 function. By programming the G53 function, all roto-translations, mirroring and scale factors are
suspended, in order to reference all movements to the base origin. After programming the G53 function, all
movements are related to the base origin (origin 0)
The restoring of corrections due to supplementary origins and tool length happens by programming the G54
function. After programming the G54 function, the situation of origins, lengths, roto-translations, mirroring and
scale factors existing before the G53 programming is restored.
To suspend only the correction due to the tool length it is possible to use the G45 function. After programming
of the G45 function, all movements of the tool axis dont take into account the tool length. The correction can
be restored by programming the G43 or G44 function.

12

CNC Z32 - Programming guide (Milling Machines)

2.10 Working tern (G25), tool axis (G43 - G44) and contouring plane
The function allowing the definition of the machine working tern and the contouring plane is the G25 function.
The G25 code must be followed by three characters representing three axis names defined as continuous on the
machine.
As example: G25XYZ define the working tern composed by the three axes X, Y, Z.
The first two axes of the working tern define the contouring plane (where circular interpolations are allowed). The
third axis is an additional axis coordinated to the first two (may be used for fixed cycles and for other machine
functions).
At power on and after each program start, the working tern defined by the machine tool builder setup is activated.
The axis along which the tool length is considered is defined from G43 (positive correction) or G44 (negative
correction) as shown in the figure:

L
G43Z

G43X

G44X

Typical situations for three axis machine are the followings:


1) Working plane XY and positive tool length correction along axis Z
This configuration can be programmed with:
Y

G25 XYZ
G43Z
X

2) Working plane ZX and positive tool length correction along axis Y


This configuration can be programmed with:
Z

G25 ZXY
G43Y
X

3) Working plane YZ and positive tool length correction along axis X


This configuration can be programmed with:
Z

G25 YZX
G43X
X

The default machine tern is normally set by the machine tool builder, together with the default axis for tool
length correction. This situation is always restored after a reset.

13

CNC Z32 - Programming guide (Milling Machines)

2.11 Movement programming (G0 G1 G2 G3)


The programming of machine movements happens through the functions:
G0: rapid movement
G1: linear interpolation
G2: circular CW interpolation
G3: circular CCW interpolation
The ISO standard states that all G functions for the movement must be MODAL. That means, for instance, that
after programming a G0 movement, all successive movements will be in G0 mode, unless a different move type will
be programmed.
Example:
(behavior with MODAL G movement functions)
F1000
G0 Z100 (G0 movement)
X100 (G0 movement)
Y100 (G0 movement)
G1 X0 (G1 movement)
Y0 (G1 movement)
X10 (G1 movement)

It is possible to define a different machine behavior through the setup, setting all G movement functions as NOT
MODAL.
In this case all movement without an explicit G function indication are assumed as programmed in G1 mode.
(behavior with NOT MODAL G movement functions)
F1000
G0 Z100 (G0 movement)
X100 (G1 movement)
Y100 (G1 movement)
G1 X0 (G1 movement)
Y0 (G1 movement)
X10 (G1 movement)

2.11.1 Rapid movement (G0)


G0 X..Y..Z..
Z

The G0 function specifies a rapid movement. Only linear movements can be


programmed in rapid mode, allowing the programming of more than one axis.
Up to ten axes can be simultaneously programmed.
Example:
G0 Z100
G0 X0 Y0

The G0 velocity is defined in the setup.


The G0 function can be modal or not, depending on machine setup.
If the function is modal, after the first positioning in G0 mode, all successive positioning without explicit specification
of G0, will be also executed in G0 mode.
If the function is not modal, all movements without an explicit motion function will be executed in G1 mode.

14

CNC Z32 - Programming guide (Milling Machines)

2.11.2 Linear interpolation (G1)


Y

Up to five axes can be simultaneously programmed. The trajectory followed by


the axis group to reach the programmed end point is linear: all programmed
axes arrive together to the programmed point.

G1 X..Y..Z..
X

The velocity in G1 mode is defined through the programmed feed (address F).

Warning: programming only G1 on a line (without positions) is allowed, but it has a special meaning
(OPEN linear move, see the chapter describing the profile programming) and doesnt have the purpose
to prepare for a G1 movement.
Example:
...
N10 G1
N11 X0 Y0
...
not allowed: block 11 issues the error CN3414
2.11.3 Circular interpolation (G2 G3)

I,J

X,Y

G2
I,J

G3
X,Y
X

The functions G2 and G3 specify clockwise circular interpolation


(G2) or counterclockwise circular interpolation (G3).
The movement must be programmed on the first two axes of the
contouring plane, defined with the G25.
The circular interpolation must be preceded by a positioning on
the circle starting point.
The movement velocity corresponds to the programmed F (feed)
value.

The circular interpolation programming happens through:


- G2 or G3 which defines the interpolation direction
- The circle end point coordinates
- The circle center point coordinates indicated by the address I for the first axis of the contouring plane, and
address J for the second axis.
Example:
G2 X..Y..I..J..
Warning: If the contouring plane is different from XY plane, but is for instance the ZX plane, the syntax
becomes:
G3 Z.. X.. I.. J..
where I indicates the first axis of the contouring plane (Z) and J the second axis (X)
2.11.4 Helical interpolation (G12 G13)
The function G12 allow the execution of helical interpolations.
The function G13 disables this mode.
The position programmed for the third axis is reached at end movement, together with the two axes of the plane.
The velocity when G12 is active is the programmed F value.
G12 can be activated also if the radius correction is active (G41 or G42 active): it thus allow the motion of the third
axis, always coordinated with that of the first two.
G12 may remain active, in radius correction mode, also in shortened or deleted segments.

15

CNC Z32 - Programming guide (Milling Machines)

Warning: If a segment shortened or deleted due to the radius correction, contains a movement on
the third axis, this movement will be completely executed together with the next valid movement.
Because the function G12 poses some limitations (slope, radius correction, etc.) it is a good programming practice
to program it only when necessary and disable it (G13) when not.
Example:
G12
G3 X..Y..I..J..Z..
G13
It is not possible to program an helicoids more than one complete turn in a single block. To program more than one
turn, a repeating cycle must be used.

2.12 Incremental coordinates programming (G90 G91)


The programming of incremental positions happens through the G91 function.
The syntax is as follows:
Starts the incremental programming in micron

HX.. G91

The parameter HX defines the scale of increment expressed in thousandth of display units.
To get programmed increments in display units (millimeters, inches or degrees) it is necessary to program HX1000
In the normal practice it is common to program:
HX1000 G91
The G91 function is modal and can be deactivated by programming G90.
Y

Example:
80

15

35

10

0
20

0 10

F1000
G0 X10 Y10
(activates incremental programming:)
HX1000 G91
G1 X20
Y35
X30
Y15
(deactivates incremental programming:)
G90
X80 Y80

30

80

Warning: The HX parameter must be programmed before the G91 programming:


Correct:
HX1000 G91
Erroneous:
G91 HX1000

16

CNC Z32 - Programming guide (Milling Machines)

2.13 Threading and rigid tapping


2.13.1 Fixed pitch threading (G33)
Modal in automatic execution, active only on the block in semiauto.
Typical function for lathes, can be used also in milling machines.
After G33 programming, G1 is automatically activated.
The G33 function has the purpose to synchronize the axes movement with the spindle rotational speed.
The threading movements must be programmed after the G33 and they can be linear or circular movements.
The end of G33 movements is obtained by programming G0, G93, G94, G95, G96.
The syntax is as follows:
G33 K..
The parameter K determines the pitch along the threading direction.
The threading can be done through circular or linear segments on the plane, however oriented.
More than one threading movements can be executed in sequence: the threading pitch remain constant, unless
accelerations or speed exceeding the setup values are requested.
Warning:
- If the first threading segment is a circular one, it is necessary to program G33G2 or G33G3. Please note that G33
must precede G2/G3 in the line: if G2 or G3 are programmed before G33 (i.e. G2G33) they are canceled from G33
which forces G1.
- During the G33 movements it is not allowed the programming of functions requiring a stop of the CNC or the
programming of not alive axes.
- While G33 is active, the progressive operation number is not incremented: in block search with progressive
number is thus only possible to search the first G33 block.
- During the G33 the following are not active:
axes override
spindle override
single block
- In case of taper threading, the pitch along the longitudinal axis is shorter due to the presence of the slope,
because the parameter K is evaluated along the thread direction.
Example:
G25 XZY
M3 S500
G0 X30 Z100
(first threading movement:)
G33 Z5 K1.25
G3 I35 J5 X35 Z0
G0 Z100 (end of threading)
It is possible to execute a threading in more than one pass with different depths, because the start of the
movement is synchronized with the spindle zero crossing.

17

CNC Z32 - Programming guide (Milling Machines)

2.13.2 Variable pitch threading (G34, G35)


The term variable pitch threading indicates a threading whose pitch is not constant, but varies continuously
according to a determined variation quantity.
The variable pitch threading is programmed through two different G functions:
G34 K.. I..
increasing pitch threading
G35 K.. I..
decreasing pitch threading
All descriptions related to the fixed pitch threading (G33) remain valid also for the variable pitch threading (G34 and
G35).

K = initial threading pitch (mm or inches) This parameter can be programmed in the same block of G34/G35, or in
preceding blocks.
Warning: if the K parameter is newly programmed in subsequent blocks, when G34/G35 is active, an
abrupt pitch variation is encountered.
I = pitch increment expressed in mm/round or in/round. This parameter can only be programmed in the same line of
G34/G35. The parameter is always positive and assumed as absolute value if programmed as a negative
number.
In G34 mode, it expresses the increment in mm or inches imposed on pitch K at every round.
In G35 mode, it expresses the decrement in mm or inches imposed on pitch K at every round.
Warning: if the continuous decrement of K brings to a negative value, the alarm CN1F13 will be issued
(in real time).
Threading movements with a fixed or variable pitch may be executed in sequence: the threading pitch will
continuously vary or remain constant, or it will have a discontinuity, depending on the threading function and
parameters programmed.

2.13.3 Rigid tapping (G63)


G63 activates a tapping movement composed by:

advance with pitch K up to the programmed position

on-the-fly spindle inversion

return to the starting position.


The movement of programmed axes (normally only Z axis) is rigidly connected to that of the spindle for the
complete duration of the cycle (one K increment for every spindle turn).
Example:
...
N10 G0 X0 Y0 Z10 S300 M3
N11 G63 K1.25 Z-50
N12 G0 X-10
N13 G63 Z-50
...
N10: rapid positioning to hole start position and spindle on.
N11: tapping cycle. It is necessary that the spindle reaches its nominal speed before tapping start.
Cycle composition:
wait for spindle zero crossing
start of Z axis. It is necessary to leave an adequate margin for the axis acceleration, in order
to reach complete synchronization while still in air.
tapping with a pitch of 1.25 and Z axis synchronized with the spindle up to position Z-50

18

CNC Z32 - Programming guide (Milling Machines)

spindle inversion. During the inversion time, the Z axis, still connected to the spindle,
continues to advance overriding the -50 programmed position, in order not to lose the
thread: if the axis go beyond its final point of an excessive quantity (setup definable,
normally 10 mm), the alarm CN0713 will be issued. It is however necessary to leave
sufficient space at hole end.
return, still with Z axis connected to the spindle, up to starting position (Z10)
positioning of Z axis to starting position (Z10). Because the axis requires a braking space,
the synchronization Z axis/spindle is broken at a certain distance from the end point: the
programmer is in charge to leave an adequate safety space.
N12: spindle inversion (returns in M3 direction) and rapid movement up to X-10
N13: another tapping cycle. Please note that the spindle must have completed its inversion before
the start of N13. If the spindle inversion is not terminated, the initial sign will be erroneously acquired,
provoking the axis to go rearward when the spindle has finally inverted, up to the issuing of alarm
CN0713.
It is possible to repeat an already executed thread (only if the tap has not been turned in the spindle!)
because the movement start is synchronized with the spindle zero crossing.
- During the G63 the following are not active:
axes override
spindle override
feed-hold
- In order to use the rigid tapping function, the machine must be equipped with a transducer on the spindle and
the spindle inversion must be properly managed in the machine logic.

19

CNC Z32 - Programming guide (Milling Machines)

2.14

Rotation, translation, mirroring, scale factor

With these functions it is possible to translate, rotate, mirror and scale a workpiece program.
Please note that all these transformations are made on programmed positions, instead of measured positions.
2.14.1 Machining rotation (IR JR QR)
Through the rotation functions it is possible to rotate the machining of an angle QR, around a point of coordinates
IR and JR.

The rotation activation happens automatically after programming


the QR parameter.
QR

(IR, JR)

JR

It is possible to execute rotations only on the working plane, set


by the function G25. The definition of point (IR, JR) follows the
rule:
IR is the rotation center coordinate related to the first axis of
contouring plane, while JR is the rotation center coordinate
related to the second axis.
For example, in G25XYZ: IR is the X coordinate, while JR is the Y
coordinate of rotation center.

IR

At Reset IR=0 JR=0 QR=0, all rotations are canceled


Warning: the rotation center (IR JR) is defined with respect to the active origin, without considering active
translations (DA DB DC), mirroring (G56) or scale factors.

2.14.2 Machining translation (DA DB DC)


The functions DA DB and DC allow to translate the program along the axis defined by the G25 function.
DA executes a translation along the first axis
DB executes a translation along the second axis
DC executes a translation along the third axis
For example, if the configuration G25XYZ is active:
DA translates the machining along X axis
DB translates the machining along Y axis
DC translates the machining along Z axis
The translation activation happens automatically after programming the DA DB DC parameters.
At Reset DA=0 DB=0 DC=0, all translations are canceled
For example, to execute a translation of 10 along the first axis and of 14 along the second axis:

DA10 DB14

14

10
In order to execute a roto-translation it is necessary to combine translations and rotations:

20

CNC Z32 - Programming guide (Milling Machines)

DA100 DB50
IR0 JR0 QR45

QR
DB

DA
2.14.3 Mirroring on the working plane (G56 G55)
The programmed figure is transformed in the mirror figure with respect to the mirroring axis defined by the point of
coordinates (IS, JS) and by the slope QS.

Y
QS

(IS, JS)
JS

X
IS

The mirroring must be enabled with G56 (modal). G55 cancels


G56 and thus the mirroring.

It is possible to activate the mirroring only on the first two axes of


contouring plane, defined by G25. The definition of point (IS, JS)
follows the rule:
IS is the coordinate related to the first axis of working plane, while
JS is the coordinate related to the second axis.
For example, in G25XYZ: IS is the X coordinate, while JS is the Y
coordinate of rotation center.
No more than one mirroring can be activated.

At reset IS = JS = QS = 0 and G55 active (mirroring not active)

2.14.4 Scale factor


The parameters KP and KT define the scale factors on the working plane (KP) and on third axis (KT), as defined by
G25.
For example, in the configuration G25XYZ, KP applies the scale factor on the plane XY, while KT applies the scale
factor on the positions of Z axis.

Y
The scale factors are automatically applied after programming the
parameters KP and KT.

KP = 2

At Reset KP=1 KT=1

21

CNC Z32 - Programming guide (Milling Machines)

2.14.5 Other correction parameters


It is possible to define further parameters as additive and multiplicative factors of the programmed positions.
multiplicative factor on a single axis: KM {+axis name}
additive factor on a single axis: KD {+axis name}
Example:
KMX 1.2 (scale factor of 1.2 only on X axis)
KDZ 10 (additive factor of 10 only on Z axis)
The additive and multiplicative factors are automatically applied after programming the parameters KM.. and KD...
At reset all effects related to these parameters are canceled.

Warning: Unlike all other translation, rotation, mirroring and scale factors, the additive and multiplicative
parameters on a single axis cannot be used in programs containing circular interpolations.

2.14.6 Typical transformations examples:

Translation on working plane (plane XY in G25XYZ).


The translation of the first axis of the plane is programmed as DA, while the translation of the second axis
is programmed as DB. Example:
DA100 DB50

Translation along the third axis defined by G25 (Z axis in G25XYZ)


Can be useful to maintain an offset with respect to the workpiece surface during a part-program test.
The translation for the third axis of the working tern must be programmed with DC. Example:
DC1

Mirroring along the first axis of working plane (X axis in G25XYZ)


IS0 JS0 QS0 G56

Mirroring along the second axis of working plane (Y axis in G25XYZ)


IS0 JS0 QS90 G56

Mirroring along the third axis of working plane (Z axis in G25XYZ)


In this case it is necessary to use the scale factor KT for the positions of third axis:
KT-1

Combined mirroring with respect to both first and second axis of working plane (axes X and Y in
G25XYZ)
In this case it is necessary to use a 180 degrees rotation with respect to zero point:
IR0 JR0 QR180

22

CNC Z32 - Programming guide (Milling Machines)

2.15 G116 machining on sloping planes (roto-translation)


The function G116 allows to roto-translate a machining.
It is possible to program G116 (working plane roto-translation) on three axes.
G116 acts on all programmed movements, rapid or feed, linear or circular.
The displayed position is always referred to the roto-translated coordinate system.
The syntax of G116 is as follows:
G116 KA... X... Y... Z... I... J... K...
Note: only one address among I, J and K may be programmed on the same line
KA is the parameter used to select the G116 mode:
KA0 disables G116
KA1 enables G116
KA2 without further parameters, generates automatically the angles necessary to orient the working plane
orthogonally to the spindle. This feature is possible only in conjunction with generalized G117, otherwise
the error CN2C14 (Incompatible parameters) will be issued.
If KA is not programmed, and one address among X Y Z I J K is programmed, it is equivalent to KA1.
X Y Z I J K determine the roto-translation to be made.
X Y Z indicate the origin of the new axes system.
I (or J or K), which may be programmed alternatively, indicate the rotation of the new axes system, around
the X axis (or Y or Z) in the active axis system, which may in turn be rotated by preceding G116 with
respect to the base situation.
In other words, G116 introduces a machining translation through the parameters X, Y, Z, and a rotation
angle I (or J or K).
I J K must be expressed in degrees.
The possibility to program only one rotation axis at a time is a necessary limitation to obtain the maximum
of clarity on the order of applications in case of multiple rotations: in fact, we doesnt get the same result
programming for instance at first a rotation around X and then a rotation around Y, or at first around Y and
then around X.
Rotations around more than one axis may be obtained by cascaded programming (in subsequent lines) the
various rotations in the desired order.
Note: if G116 is programmed without additional parameters:
G116
it will be activated the last programmed G116 with the same parameters, also if the control has been shut
down.
In case of a machine stop during an active G116, for example with a drilling bit inserted in a sloping hole, it is
thus possible power on the machine, program G116 in semiauto without parameters, switch to Jog mode and
extract the tool, driving the jog movements by means of pushbuttons.

Warning:
In order to avoid erroneous movements, the first positioning after the G116 programming, containing a
reference system translation, must contain the positions of all three axes with logical numbers 0, 1, 2
(normally X, Y, Z).

Warning: The G116 function affects only the first three continuous axes defined for the machine, i.e. on the
axes with logical number 0, 1 and 2. In all examples shown, the G116 operates properly only if axis X has
the logical number 0, Y the logical number 1 and Z the logical number 2. Please consult the machine tool
builder for further details.

23

CNC Z32 - Programming guide (Milling Machines)

Example:
Usage of G116 to machine the surfaces of a parallelepiped with an associative composition of the rotations.

30

40

30
Y

Y
Z

30

30

30

40

X
Y
Y
Z

X
Z

40

30
40

30

1) Vertical head:
Standard configuration
G116KA0
2) Right side face:
G116 X40 Z-30 K90
G116 I90
3) Rear face:
G116 Y30 Z-30 I-90
G116 K180
4) Left side face:
G116 X-40 Z-30 K-90
G116 I90
5) Front face:
G116 Y-30 Z-30 I90

24

CNC Z32 - Programming guide (Milling Machines)

2.16 Other functions


2.16.1 Dwell (G4 TT..)
The dwell value, expressed in seconds, is indicated by the parameter TT which can be programmed on the same
line of G4 function, or in a preceding line.
Example:
G4 TT2.5 (dwell of 2.5 seconds)
This function stops the machine:
The machine stops also if the function is programmed with a null dwell time.

2.16.2 Axes change (G16)


Through the function G16 it is possible to exchange the axes of the machine.
The exchange of axes names is executed starting from the axis definition in the machine setup, following the
diagram below:

G16

...
...
0 1 2 3 ...

Desired axis names

Logical axis number

G16 must be programmed according to the following rules:


- The desired axis names must be single uppercase alphabetic characters, excluding FGIJKLMNORST.
- The desired axis names must follow the G16 without any blank character.
- If the characters following the G16 are less than the machine axes, the remaining axes will be not
affected.
Example:
Logical axis number

Desired axis names

Setup axis names

The above example can be programmed:


G16ZXY
Warning:
- The axis change will be suspended by G53.
- The axis change is valid also for the functions G25, G28, G29, G43, G44, KM, KD
- The axis change is valid for all programmed positions, but doesnt change the contouring plane set by
G25. In order to change also the contouring plane, it is necessary to program a corrected G25.

25

CNC Z32 - Programming guide (Milling Machines)

2.16.3 Alive axes management (G28, G29)


One axis is defined as alive when its position is controlled by the CNC, also if it is stand still.

The function G28 (modal, with stop) asks the CNC to maintain under control the axis also when it is not
interested by the current move (alive axis).
After G28 the axis name (i.e. X) desired as alive must be specified, for instance:
G28X
Only one axis can be specified, choosing among those defined as continuous in the machine setup.
If more than one axis are desired as alive axes, it is possible to program G28 more than once, in the same
or subsequent lines. Example:
G28Z G28A
asks to maintain always under control the axes Z and A.
Some axes (defined in the machine setup) may be defined as alive since power on: at every program start
(or after a reset) the alive/not alive axes situation defined in the machine setup is restored.
Note: Depending on machine setup, it is possible to define the axes as alive at reset. With this setup
all axes programmed as alive (with G28) or abandoned (with G29) restore their alive/not alive axes
state also after a reset or next power on.
It is allowed, without effect, the request to activate one already alive axis.

The function G29 (modal, with stop) asks the CNC to abandon the specified axis.
After G29 the axis name (i.e. X) to be abandoned must be specified, for instance:
G29 X
Only one axis can be specified, choosing among those defined as continuous in the machine setup.
If more than one axis have to be abandoned, it is possible to program G29 more than once, in the same or
subsequent lines. Example:
G29X G29A
asks the CNC to abandon the axes X and A.
It is allowed, without effect, the request to deactivate one already not alive axis.
Note on programming not alive axes
If the part-program contains a movement for a not alive axis, the axis is automatically activated,
moved and then abandoned, but only if its physical position doesnt coincide with the programmed
one.
The CNC considers the physical position coincident with the programmed position if the error is
less than the positioning error defined in the setup (normally some hundredth of millimeter).
Some problem may arise if the error is very close to the tolerance. If the measured position of the
not alive axis (which shouldnt move) changes a little, bringing the error over the setup threshold,
an alarm CN1513 may be issued.
The measured position may oscillate by some transducer count, still remaining inside the
positioning threshold; the threshold override may thus happen if the position is already close to the
tolerance limit. Typical examples are:
a turntable (or other axis) during the mechanical lock may have a little movement bringing the axis
very close to the maximum setup error allowed
programming a little movement for a not alive axis, corresponding to a space very close to the
positioning threshold
In these cases it is recommended to not use the automatic activation of a not alive axis, but to
force it alive or not, directly with part-program instructions.

26

CNC Z32 - Programming guide (Milling Machines)

2.16.4 Suspending and resuming Tool change (G38, G39)


By programming G39 it is possible to suspend the automatic execution of tool change.
When the function G39 is active, the M6 (tool change) is no more automatically executed, provoking instead a
machine STOP to allow the operator to manually change the tool. When the operator, after changing the tool,
presses the pushbutton START, the program will resume from the interrupt point, and the tool change is
considered as done.
The programmed tool is thus considered in all its effects as already mounted on the spindle, with related acquisition
of its description, etc.
Example:

N10 G39
N12 T10 M6 (MANUALLY CHANGE WITH MILL R=10)
N13 G38

The function G39 is modal and it is deactivated by G38, which restores the automatic execution of tool change.
The function G38 is activated at reset.

2.16.5 Mounted tool reading (G104)


This function transfers the T value of the tool actually mounted on the spindle in the parameter HX.
The function is active only in the block where programmed.
Example:

N10 T101 M6
N11 G104

After execution of line N11, HX contains the value 101 (the tool actually mounted on the spindle is T101). If the
management for replacement tools is installed, and the tool actually mounted is a replacement for T101, the
parameter HX will contain the T code related to the tool actually mounted.

2.16.6 Real positions reading (G105)


The function G105 transfers the physical measured positions in the axes position parameters, for all machine axes.
The function is active only in the block where programmed, with stop.
With G105 the measured positions (referred to the active origins and corrections) are transferred in the axes
position parameters. The positions transfer happens only for all continuous axes, including those not alive.
Warning:
The position transferred is the actual measured position, not the reference position. These two positions may differ
due to positioning errors (however very small to remain inside the positioning threshold).
For example, if X10 is commanded and the axis moves to position 9,998, G105 acquire the position 9,998 and not
10.

2.16.7 Radial programming (G106)


Modal, always active at reset for milling machines, canceled by G107.
This function is used in lathe machines when radial programming is desired. On milling machines the function is not
used, because automatically active at reset. After G106 the X axis and J parameter programming are considered
as radial. For an example, see G107,

27

CNC Z32 - Programming guide (Milling Machines)

2.16.8 Diametrical programming (G107)


Specific function for lathes.
Modal, active at reset for lathes, cancels and is canceled by G106.
After G107 the X position and the associated J parameter are considered as diameters (i.e. the physical movement
is the half). Example (valid for lathes):
N1
N2
N3
N4
N5

G107
G0 X10
G106
X10
G107 X10

(X axis
(radial
(X axis
(X axis

goes to pos. 5, diameter 10)


programming)
goes to pos. 10, diameter 20)
goes to pos. 5, diameter 10)

2.16.9 Axis movement with alarm CNxx12 (G119)


In order to allow for the semiauto or jog movement of axes with transducer alarms (type CNxx12), the G119
function has been introduced, with the following characteristics:
Valid only if programmed in a semiauto line (MDI)
Modal, transparent to reset
If G119 is active, all transducer alarms type 12 are ignored.
The function is automatically reset if an auto program is started or after an attempt to execute a
subprogram (also related to a special M) from semiauto.
The axes with alarm type 12 can be moved in jog or semiauto, proceeding as follows:
Enter in semiauto
Digit G119, press ENTER and then START
Press RESET (all transducer alarms disappear)
Operate normally in semiauto or jog
Warning:
When G119 is active, the software limits are disabled on all axes, because the transducers may measure
not significant positions, possibly disabling the movement. The operator is in charge to have the maximum
awareness in order to avoid collisions and damages.
In every case, as safety precaution, the Z32 automatically enables the TEST condition (rapid reduction to
1/5) when G119 is active.

2.16.10 Working field limits (G123)


With G123 it is possible to limit the working field through the programmed positions of continuous axes (logical
number from 0 to 12).
WARNING
G123 is only active on the final programmed positions of linear movements. The intersection between movement
and limit position is not estimated, but only the substitution (or the test depending on the mode) of the final
programmed position.
For each continuous axis it is possible to define a working field, defined through an upper and a lower limit, which
limits the programmed positions after the processing of all transformations (G121, scale factors, etc.).
At machine power on, all limits related to G123 are disabled.
Limits setup:
The functions G123 KA1 and G123 KA-1 allow to program the positive (KA1) and negative (KA-1) limits:
G123 KA1 [X...] [Y...]

28

CNC Z32 - Programming guide (Milling Machines)

Sets the positive limits on the continuous axes X.., Y.. and activates the positive limits.
G123 KA-1 [X...] [Y...]
Sets the negative limits on axes X.., Y.. and activates the negative limits.

The limits are programmed by the name of continuous axis where the limits have to be applied.
The programmed limits are always referred to the active origin.
The limits are applied only on continuous axes explicitly programmed with G123KA1 or G123KA-1,
the other remaining unchanged.
At reset all limits are disabled.
Only the positive or negative limit can be active, or they may be both active.
On each axis : (positive limit) > (negative limit)
If the axes are already outside the limits when G123 KA1 or G123 KA-1 is programmed, the alarm
CN5514 will be issued

Function modes
G123 KA3
Activates alarm mode: if one of the programmed positions is outside the working field, the alarm
CN5614 is issued.
G123 KA4
Restores normal mode, the positions are limited by working field. This is the default mode, the
mode normally active if not otherwise programmed. If a movement outside the limits is
programmed, the movement stops when it reaches the limit set, without generating any alarm.
G123 KA5
Enables stop mode: if one or more programmed positions are outside working field, all movements
are stopped and resumed only when all programmed positions lie inside working field. When the
programmed positions re-enter inside the working field, all axes previously blocked are considered
as programmed.
Warning: if during the stop phase more than five axes were moving, when the
movement is restored, more than five axes are considered as programmed, bringing
to the alarm CN2C14 (incompatible parameters).

Rules and restrictions for G123


G123 must be programmed in a stand-alone line, otherwise the alarm CN2C14 (incompatible
parameters) will be issued.
If a circle (G2 or G3) is programmed when G123 is active, the alarm CN5714 (circle+G123) is issued.
If G53 is programmed when G123 is active, or vice versa G123 programmed when G53 is active, the alarm
CN5A14 (G123+G53) is issued.
If G105 is programmed when G123 is active, the alarm CN5914 (G123+G105) is issued.
Deactivation
By programming G123KA0 both positive and negative limits are disabled, but all limit settings (limit positions, KA3,
KA4) remain valid.
To restore the preceding positive limit, it is sufficient to program G123KA1 without any position, and to restore the
negative limit G123KA-1 without any position.

29

CNC Z32 - Programming guide (Milling Machines)

3.

TOOL RADIUS CORRECTION

When a contouring profile is programmed for the numerical control, the radius of tool executing the profile is
normally not known: the tool radius may vary due to many reasons (availability, sharpening, different tools used for
roughing and finishing, etc.).
The Z32 CNC allows to program directly the finished workpiece profile, and automatically executes all necessary
profile modifications as a function of the effective tool radius.
It is thus clear that the tool center path (i.e. the machine axes motion) is different from that necessary to describe
the programmed profile with a speckled tool (R=0).
In the figure, the tool center path (AG) corresponding to the programmed profile (16) is shown.

Please note the following:


internal edges may not be machined due to tool radius (areas X)
some fillets are automatically inserted (not programmed in the original profile) around external edges
(B and D)
some programmed segments have been eliminated because they cannot be machined with the
programmed tool radius (segment 5)
Generally, if the tool radius correction is activated in a program (with G41/G42), the Z32 CNC executes a series of
operations on each element of the programmed profile, in order to transform it in the tool center path.
These operations may bring to the elimination of some profile elements because they cannot be machined with the
tool radius. The possibility to eliminate some profile elements imposes the CNC to explore in advance the
trajectory, searching elements which cannot be machined.
The G109 function allows to determine how many elements are explored in advance in this search:
G109A
G109B
G109C
G109D
G109E

three elements (active at reset)


four elements
five elements
six elements
seven elements

30

CNC Z32 - Programming guide (Milling Machines)

In the figure an example is show of a


profile executed with a tool radius of 2
(left) and with a tool radius 6 (right).
Please note in the right execution that
many profile elements are not machined,
due to G109E programming.

3.1

OX1 OY1 OZ1


T1M6
S3000 M3 F1000
G109E
R6
G0X0 Y40
G41 X10 Y40 QF90
G2 I25 J40
G1 X60 Y45 QF0
Y60
X40
Y80
X5 Y90
Y95
X10
Y100
X-10
Y95
X-5
Y90
X-10
Y89
G1 KA1

G3 I0 J0 RA85 KA1
G1 X-80 Y60 QF180
Y50
G1 QF0 KA1
G3 I0 J0 RA85
G1 X-45 Y40 QF0
Y30
X-55
Y20
X-45
Y5
G1 G2 I-30 J0 RA5 QF-135
G1
X-20 Y-15 QF0
Y20 RR-5
G1 QF0 KA1
G3 I0 J15 RA6 KA1
G1 X25 Y20 QF0
G1 QF90
G2 I25 J40 X10 Y40
G40 X0 Y40
M2

INCOMPATIBLE PROFILE error

If a profile cannot be executed with tool radius compensation, the INCOMPATIBLE PROFILE error may be issued.
In these cases it is possible to program the function G109R, which forces the generation of a fillet also around
internal edges (provoking a kind of knot) with the purpose to display the element generating the problem, and
eliminating the issuing of INCOMPATIBLE PROFILE error.
G109R is canceled by G109N.
Please pay attention that the activation of G109R may provoke the tool to enter in the programmed profile, and
long fillets may remain around internal edges in case of complex profiles.
Warning: usually G109R is programmed only to understand the situation provoking the INCOMPATIBLE
PROFILE error with tool radius correction. It is not a function to be used in normal programming.

31

CNC Z32 - Programming guide (Milling Machines)

3.2

Approach to profile

To initiate the mode RADIUS CORRECTION on the Z32 CNC, it is necessary to program G41 (workpiece on the
right) or G42 (workpiece on the left).
After the function G41/G42, all programmed positions are no more interpreted as tool center positions, but as
positions of the workpiece profile.

3.2.1 G41/G42 circular approach with final positions and slope (G41/G42 X.. Y.. QF..)
Together with the preparatory function G41 (start of radius correction with workpiece on the right) or G42 (start of
radius correction with workpiece on the left) are programmed the following:
the two final positions of the approach movement (initial profile point)
final slope of circular arc
The final slope is programmed as described in the chapter for Geometry.
The approach to the profile is done through a circular arc bringing the tool to skim the programmed point, ready to
execute an element starting from the programmed point with a QF slope.
Length and curvature of the circular arc are automatically computed by the CNC, depending on the start point of
the approaching element.
The examples below show the tool movement with different tangent profile approaches
Y
40

...
G0 X0 Y40
G41 X0 Y20 QF0
G1 X50
...

...
G0 X-20 Y30
G41 X0 Y20 QF0
G1 X50
...

30
20

20

-20

...
G0 X-45 Y-15
G41 X-30 Y0 QF90
G2 I0 J0 X0 Y30
G1 X50
...

...
G0 X-50 Y0
G41 X-30 Y0 QF90
G2 I0 J0 X0 Y30
G1 X50
...

-15

R30

R30

-45

-50

In some cases it may be necessary to compute the final slope of the approaching movement:
Y

20

30

30

R40

R40

-20

...
G0 X<-20*CS30> Y<20*SN30>
G42 X<-40*CS30> Y<40*SN30> QF60
G2 I0 J0 X40 Y0
G1 Y-20
...

...
G0 X-20 Y0
G42 X<-40*CS30> Y<40*SN30> QF60
G2 I0 J0 X40 Y0
G1 Y-20
...

32

CNC Z32 - Programming guide (Milling Machines)

The advantage of this profile approach, if the slope is correctly programmed, is that the tool enters in contact with
the profile along the tangent, making a minimum mark on the workpiece.
A disadvantage may arise when the QF computing is difficult.
3.2.2 G41 /G42 linear approach without positions (G41/G42)
It is possible to program a sequence like this:
...
N20 G41
(without any position)
N21 G1 X10 Y4 (G1 may be omitted, both positions are mandatory)
N22 ...
The block N21 specifies the first point of profile to be reached with the radius correction.
The block N22 contains the first movement on the profile, with the radius correction; the movement can be chosen
among those valid for the Z32 geometry, starting from the point of N21.
The approaching movement will bring the tool tangent to the profile on the point programmed in N21 (the tool
center will be on the vertical of the profile point of N21, with an offset equal to the radius).
After programming G41/G42 without positions, a profile element in G1, G2 or G3 is normally programmed.

...
G0 X... Y...
G41
G1 X-40 Y10
X0 Y30
X50
...

...
G0 X... Y...
G41
G1 X<-40*CS30> Y<40*SN30>
G2 I0 J0 X0 Y40
G1 X50
...
Y
40

30

R40

10
0

30

-40

3.2.3 G41 /G42 linear approach with final positions (G41/G42)


Only the profile start point coordinates are programmed.
The approaching initial movement is a line segment, treated at all effects as a profile element, possibly shortened if
it interferes with the other profile elements.
This type of approach is different from that without positions, as shown in the example:

Y
40

...
G0 X0 Y40
G41
G1 X0 Y0
X50
...

Y
40

...
G0 X0 Y40
G41 X0 Y20
X50
...

20

20

G41/G42 without positions

G41/G42 with final positions

Please note that with the G41/G42 approach with final positions, the approaching element is considered at all
effects a profile element. Please note also that, differently from the approach without positions, this kind of
approach may left not machined zones on the profile.

33

CNC Z32 - Programming guide (Milling Machines)

3.3

Retract from profile

The retract from the profile is analogous to the profile approach: also in this case the CNC changes the meaning of
the programmed positions, but in inverted direction; it interprets no more the positions as profile positions, but as
tool center positions.
The G function to be used is G40.
In the first movement block following that containing G40, it is necessary to program a movement type (G1, G2 or
G3).

3.3.1 G40 circular tangent retract (G40 X.. Y..)


With G40 X Y the CNC executes a circular element tangent to the last profile element executed, Bringing the tool
center on the indicated final point.

Y
40

G41 ...
...
...
G1 X0 Y20
G40 X0 Y40
...

G41 ...
...
...
G1 X0 Y20
G40 X20 Y30
...
30
20

20

G41 ...
...
...
G2 I0 J0 X30 Y0
G40 X60 Y0
...

20

G41 ...
...
...
G2 I0 J0 X30 Y0
G40 X50 Y-15
...

R30

R30
-15
0

60

34

50

CNC Z32 - Programming guide (Milling Machines)

3.3.2 G40 retract without positions (G40)


If the final positions of connecting element are not programmed, the radius correction ends directly on the final
point of programmed profile: the subsequent block will have a starting point coinciding with the tool center
coordinates.
G41 ...
...
...
G1 X0 Y30
X40 Y10
G40
X... Y...
...

G41 ...
...
...
G2 I0 J0 X30 Y0
G40
X... Y...
...

30

10

R30

40

The block programmed after G40 without positions, may have any movement type G0, G1, G2, or G3.
If the end of radius correction G40 is programmed together with G0 and a position, for instance:
N30 G40 G0 Z20
the programming alarm CN1D14 will be issued.

3.4

Feed management with radius correction (G109V, G109U)

The programmed FEED is normally the velocity desired by the programmer for the profile machining. Normally the
CNC maintains constant the tool center velocity (if compatible with the dynamic limits imposed by allowed
accelerations), equal to the programmed F.
With radius correction the programmer normally desires to maintain constant the profile machining velocity,
corresponding to that of tool periphery, and not that of the center.
On linear elements, the velocities of tool center and tool periphery are the same, while differences arise with
circular elements.
The contouring velocity of tool periphery in internal arcs is higher that that of tool center, while it is smaller in
external arcs.
Normally, with radius correction, the Z32 CNC tries to maintain constant the contouring velocity of tool periphery,
instead of that of tool center: in every case are EXCLUDED velocity increments with respect to the tool center
programmed feed.
If it is instead desired to maintain the tool center velocity equal to the programmed feed, thus deactivating the
control on tool periphery velocity, it is necessary to program G109U.
The function G109V restores the control on tool periphery velocity with radius correction. The G109V mode is
active at reset, thus being the default setting.

35

CNC Z32 - Programming guide (Milling Machines)

3.5

Null or negative radius

Null or negative tool radius are allowed: in case of null radius, exactly the programmed profile will be executed,
while a negative radius is equivalent to exchange the meaning between G41 and G42.
A negative radius may be useful when the profile has already been computed (i.e. by an automatic programming
system) for the typical tool radius, and the operator has added the tool radius compensation directly on the
machine to compensate possible wearing or difference in the actual tool used.
Please, pay attention that the radius considered by the Z32 is fictitious, losing the automatic adaptation of tool
center velocity and the constancy of tool periphery velocity: in the blocks where this adaptation is required, the
FEED must be programmed anew.
Warning: in presence if very small tool radius (less than about 3 micron) the machined profile may have a
maximum error of about 2 micron, normally well supported in most applications, because these errors are
lower than other errors influencing the final result (following errors, temperature, tool geometry, etc.). If
this error entity cannot be supported, it is recommended not to program very small tool radius; it is better
to program the physical tool radius and not its correction with respect to the theoretical radius.

3.6

Connecting radius on external edges (G109S, G109T)

In case of normal radius correction, a connecting radius is inserted on external edges.


The function G109S it is possible to force the Z32 not to insert the connecting radius, continuing instead the current
segment up to the bisecting line of the edge.
The G109S may be active only on edges produced by two linear segments. If one or both elements are circular
arcs, the normal connecting radius is inserted.
G109S (modal, not active at reset) forces the bisecting line correction, while G109T (modal, active at reset) the
normal behavior of Z32 is restored, with the connecting radius insertion.

G109T

G109S

Warning: In order to avoid large elongations of programmed elements, the G109S mode cancels only the external
fillets below 91 degrees.

G109S

36

CNC Z32 - Programming guide (Milling Machines)

4.

RTCP (Rotating Tool Centre Point)

4.1

G117 RTCP for rotating heads

The function G117 manages spindle heads mounted on rotating axes. The head may rotate around a single axis
(mono-rotating head) or around two cascaded axes, the leading and the following (bi-rotating head).
G117 computes the tool displacement generated by head rotations.
G117 can be used in two modes:
4.1.1

Static G117 (G117 KA2)

The static G117 generates offsets (similar to origins) added to the displayed positions of linear axes (XYZ), without
inducing any movement on the axes.
The static G117 is used, for example, in three axes machining with fixed slant head. When the static G117 is
activated (by G117KA2), the linear axes doesnt move, but their displayed positions change as a function of the
rotating axes positions.
Warning: When one rotating axis is moved with static G117 active, the connected linear axes dont
move, nor change the displayed positions. If, after moving the rotating axes, an updating of the
correction due to head slant is desired, it is necessary to program again the static G117 with G117KA2.
The syntax of static G117 is as follows:
G117 KA2 [RA..] [I.. J.. K..]
RA: not programmed (or RA0) activates spindle parameters set 0 (in the machine setup, up to three parameter sets
may be inserted for mono/bi-rotating spindle heads; the RA parameter selects the set used)
RA1 spindle parameters set 1 is activated
RA2 spindle parameters set 2 is activated
I, J, K set the point around which the rotation is made. These values are added to the distance between spindle
nose and tool tip, along the three linear axes (XYZ). Their computing must be done by thinking to the
machine when the rotating axes are all on their zero point
Sample programming for G117KA2 mono-rotating (rotating axis B). The linear axes where G117 acts are X and Z:
G0X0Y0Z0
G0B30
(tilts the heads for 30 degrees without moving the linear axes)
G117KA2
(computes the offsets along X and Z due to head slant, adding them to displayed positions)

machining with head slanted by 30 degrees

G117KA0
deactivation of static G117
The G117 KA2 doesnt rotate the working plane. To activate the working plane rotation, it is necessary to combine
the usage of G117 and G116.

37

CNC Z32 - Programming guide (Milling Machines)

It is possible to combine the functions G116 and G117 in order to machine on planes with any inclination with a
slanted head. For this purpose it is very useful to program G116 KA2 which determines the rotation to be assigned
to the machining, starting from the angles of rotating head when G117 is active.
Warning: The function G116 KA2 is only available if the G117 is defined as generalized in machine setup.
Please consult the machine tool builder for further information.
The example below supposes to have a bi-rotating head with axis B (following) and C (leading).

30

40

30
Z
Y

Y
Z

30

30

30

40

X
Y

Y
Z

40

30
40

30

1) Vertical head:
G0 B0 C0
2) Right side face:
G0 B90 C0
G117 KA2
G116 X40 Z-30 KA2
3) Rear face:
G0 B90 C90
G117 KA2
G116 Y30 Z-30 KA2
4) Left side face:
G0 B90 C180
G117 KA2
G116 X-40 Z-30 KA2
5) Front face:
G0 B90 C270
G117 KA2
G116 Y-30 Z-30 KA2

Z
C+

Z
B+

X
Y

38

CNC Z32 - Programming guide (Milling Machines)

4.1.2

Dynamic G117 (G117 KA1)

The dynamic G117 maintains still the tool with respect to workpiece; in this case the head rotation induces
movements on the linear axes (XYZ).
The dynamic G117 function may be used, for example, in 4 or 5 axes machining programs generated by CAM
systems. The linear axes (XYZ) displayed positions are referred to the programmed positions and not to those
reached due to head rotation.
When the dynamic G117 is active, by programming the movement of a rotating axis, also the linear axes will be
moved in order to maintain the contact point with the workpiece.
Movements of both rotating and linear axes together are allowed.
Programming syntax of dynamic G117:
G117 [KA1] [RA..] [I.. J.. K..]
Warning: If the parameter KA is not programmed, it is assumed the default activation of G117 KA1
(dynamic G117)
RA: not programmed (or RA0) activates spindle parameters set 0 (in the machine setup, up to three parameter sets
may be inserted for mono/bi-rotating spindle heads; the RA parameter selects the set used)
RA1 spindle parameters set 1 is activated
RA2 spindle parameters set 2 is activated
I, J, K set the point around which the rotation is made. These values are added to the distance between spindle
nose and tool tip, along the three linear axes (XYZ). Their computing must be done by thinking the machine
when the rotating axes are all on their zero point.

4.1.3

G117 usage

G117 deactivation
The function G117 (static and dynamic) is deactivated by:
G117 KA0
I,J and K parameters in G117
The RTCP-head system, activated by G117, allows the head rotation by maintaining still the virtual tool tip.
In case of spherical tools, what is mostly wanted is to maintain still not the tool tip, but instead the tool center,
displaced by the tool radius.
It is possible to program, at the moment of G117 activation, a modification to the length of rotating components by
means of the three parameters I J K, which act correspondingly on the X Y and Z axes.
The values of parameters I J and K are referred to the condition of rotating axes in their zero position.
For example, on a mono-rotating vertical head (the tool is along Z when the rotating axis is at its zero), the
programming of G117 K10 is equivalent to shorten the tool by 10 mm.
The I J K programming is optional: if one or more of these parameters is not programmed, the length of the rotating
arm along the corresponding axis remain unchanged.
Example: activation of dynamic G117 with tool shortening:

G117 K10

Z
X

39

CNC Z32 - Programming guide (Milling Machines)

Warning:
- The reset cancels both static and dynamic G117.
- The static G117 is incompatible with dynamic G117. By programming G117 while G117KA2 is active, or
G117KA2 while G117 is active, an alarm CN2C14 (incompatible parameters) will be issued
- It is not allowed to change origin on the following/leading rotating axes when the dynamic G117 is active.
The origins may be modified only if G117 is not active,
- G105 doesnt function if G117, both static and dynamic, is active
- The G117 is non compatible with permanent formulas or copying movements (G111).
- The dynamic G117 is not compatible with G43/G44/G45, otherwise the alarm CN5B14 is generated.
- G53 cancels G117KA2
- By programming G117KA2 or G117 when G53 is active issues alarm CN3914 (formulas + G53/G54)
- The G54, which cancels G53, doesnt restore a static G117 possibly active before the G53: G117KA2
must be newly programmed to restore it.

IMPORTANT NOTE ON RTCP: When the RTCP functions (G116 G117 G118 G122) are activated, it is
necessary that all three linear axes (normally X Y Z) interested by the RTCP transformations are all alive,
otherwise the alarm CN7D14 (RTCP + not alive axis) will be issued. The same alarm is issued if a request to
abandon (G29) one linear axis interested by the RTCP is made when a RTCP function is active.
In order to avoid this kind of alarm, all linear axes interested by the RTCP must be alive axes

4.1.4

Handwheel enable on rotating axes in G117 (G124)

The G124 allows to activate handwheels on the rotating axes related to G117, while G117 is active.
The purpose is to allow the manual movement of the machine head during workpiece machining in auto or
semiauto.
While G124 is active, it is not allowed to program movements for the rotating axes connected to G117 (rotating axis
for a mono-rotating head, leading/following axes for a bi-rotating head).
G124 programming
Syntax:
G124 KA1 activates the handwheels on rotating axes connected to G117; KA1 not necessary
G124 KA0 deactivates G124
Rules and restrictions for G124
- After power on and at reset, G124 is disabled
- The programming of G124 has effect only if G117 is active.
- By programming G124 when G117 is not active has no effect, without issuing any alarm.
- The two activations: G124 or G124KA1 are equivalent
- If G117 is deactivated when G124 is active, also G124 is immediately deactivated.
- If a rotating axis connected to G117 is programmed while G124 is active, the alarm message CN5814
G124+ROTATING AXIS OF G117 is issued
The only way to move the rotating axes connected to G117, while G124 is active, is to use the related
handwheels.
Deactivation
By programming G124KA0 the handwheels connected to the rotating axes of G117 are disabled and these axes
may be newly programmed.

40

CNC Z32 - Programming guide (Milling Machines)

4.2

RTCP for turntables

The function G118 manages turntables. The turntable may rotate around a single axis (mono-rotating table) or
around two cascaded axes, the leading and the following (bi-rotating table).
G118 computes the tool center displacement generated by table rotations.
G118 can be used in two modes:
4.2.1 G118 simple
Manages the turntable rotation, but doesnt rotate the reference system.
This management mode is useful when the table has the purpose to orient the workpiece, but no machining is done
when the table moves.
When a table axis is moved, the linear axes are moved together with the table in order to maintain constant the
contact point between tool and workpiece.
The syntax of G118 is as follows:

G118N [KA..] [RA..] [I..J..K..] [X..Y..Z..]


or
G118{axis name} [KA..] [RA..] [I..J..K..] [X..Y..Z..]

KA (optional) selection parameter; if KA1, the management of KD parameter (additive constant) is


activated on the rotating axes connected to G118; if KA2 the G118 is activated on a rotating axis (table)
not associated with G118 in the machine setup (only on mono-rotating tables).
RA (optional): if not programmed (or RA0) activates table parameters set 0 (in the machine setup, up to
three parameter sets may be inserted for mono/bi-rotating tables; the RA parameter selects the set used)
RA1 table parameters set 1 is activated
RA2 table parameters set 2 is activated
By programming G118N the table RTCP is activated considering all rotating axes defined in the setup.
By programming G118{axis name} the table RTCP is activated considering only the axis specified.
For example, in case of tilting tables with two rotating axes, it may be necessary to activate the table RTCP
on only one axis and not on both.
Supposing to have a tilting table with the B axis as platform (leading) and C axis as turntable (following), to
activate the RTCP only on the turntable it is possible to program:
G118C

During table motion, the simple G118 maintain the position of tool tip relative to workpiece. Substantially, during the
motion of rotating axes, the distance between tool tip and workpiece is maintained constant.
Warning: with the simple G118 it is NOT possible to program coordinated movements between table
axes and linear axes moving together. It is necessary at first to position the table by moving only the
rotating axes, and then to program the machining executed by the linear axes.

41

CNC Z32 - Programming guide (Milling Machines)

I,J,K parameters (optional)


The preceding figures illustrate the standard usage of G118. The point dragged during table motion is the tool tip.
Through the optional parameters I, J and K it is possible to modify the dragged point. The programming of I, J and
K allows the dragging of a point whose distance from tool tip is expressed by the three parameters, during the
rotating axes movement. The parameters I, J and K refer to the active tern and to the configuration with all rotating
axes on their zero point.

Z
K

A normal usage of I, J and K parameters is that to refer the dragged point not at tool tip, but to the center of
spherical sector of the tool, as already discussed about G117.

42

CNC Z32 - Programming guide (Milling Machines)

X,Y,Z parameters (optional)


With the simple G118 it is possible to change the table center coordinates, by programming the table center
translation with respect to the setup values, through the parameters X, Y, Z (optional). This translation is expressed
considering the configuration with all rotating axes on their zero position.
KA parameter (optional)
G118KA1
The activation of G118KA1 allows to cancel the value contained in the parameter KD (additive constant for
single axis) from the initial position of the rotating axis (or rotating axes if bi-rotating table); if none of the
rotating axes connected to G118 has additive constants programmed on it, this activation has the same
effect as the only programming of G118 without KA1.
G118KA2
This G118 mode allows to use the G118 function configured as mono-rotating with a table axis different to
that defined in the setup, but being another table axis with the same physical characteristics (counts/turn and
rotation axis), having a different rotation center and a different logical number.
This feature is enabled by means of selection parameter KA2 programmed on the same line of G118, which
must contain the only used axis name.
G118{axis name} KA2 [HR1] [RA..] [I..J..K..] [X..Y..Z..]

4.2.2 G118 HR1


The function G118 HR1 is an evolution of the simple G118, allowing the execution of coordinated movements
between linear and rotating axes.
The syntax of G118 HR1 is as follows:
G118N HR1 [KA..] [RA..] [X..Y..Z..]
or
G118{axis name} HR1 [KA..] [RA..] [X..Y..Z..]
Like the simple G118:
KA (optional) selection parameter; if KA1, the management of KD parameter (additive constant) is
activated on the rotating axes connected to G118; if KA2 the G118 is activated on a rotating axis (table)
not associated with G118 in the machine setup (only on mono-rotating tables).
RA (optional): if not programmed (or RA0) activates table parameters set 0 (in the machine setup, up to
three parameter sets may be inserted for mono/bi-rotating tables; the RA parameter selects the set used)
RA1 table parameters set 1 is activated
RA2 table parameters set 2 is activated
By programming G118N the table RTCP is activated considering all rotating axes defined in the setup.
By programming G118{axis name} the table RTCP is activated considering only the axis specified.
The X Y Z parameters have the same meaning as the X, Y, Z parameters of the simple G118, modifying the center
table coordinates.

The difference between the simple G118 and G118 HR1 is that in the latter case a movement of rotating axes
provokes also a rotation of the reference system used for the programmed positions of part-program.

The example below clarify the behavior: supposing the rotating axis is C and the axis aligned with the tool is Z:

43

CNC Z32 - Programming guide (Milling Machines)

Y
Y'

G118C

G118C HR1

X'
4
5

3
1

4
5

2
X

G0 X100 Y0
G118C
C30 (1)
G1 X200 Y0 (2)
Y50 (3)
X100 (4)
Y0 (5)

2
1

G0 X100 Y0
G118C HR1
C30 (1)
G1 X200 Y0 (2)
Y50 (3)
X100 (4)
Y0 (5)

The simple G118 may be considered as an origin change: a movement of rotating axes provokes a translation of
workpiece origin.
G118 HR1 has a different behavior.
The programmed positions are referred to the machining desired on the workpiece. On this machining it is possible
to program rotating axes movement, without causing a different axes path on the workpiece.

4.2.3

G118 usage

G118 deactivation
G118 is deactivated by the instruction:
G118E

44

CNC Z32 - Programming guide (Milling Machines)

4.3

Workpiece mounting errors compensation on tilting tables (G122)

With G122 it is possible to compensate workpiece mounting errors on a tilting table.


The procedure to be used is the following:
- The workpiece mounting errors are measured and computed (normally in automatic, by means of proper
measuring sequences in G61)
- The rotating axes are moved to align the workpiece (faces to be machined aligned with the linear axes)
- Possible activation of origins on linear axes, to compensate all mounting errors in this aligned position.
- G122 is activated inserting in IJK the mounting errors along the three main linear axes.
For example, if:
the main machine axes are X, Y, Z and their respective logical number is 0, 1, 2.
After having aligned the workpiece, the rotating axes may have any error, but the workpiece faces have been
aligned with proper rotations. The mounting error measured on X is +1,5mm (i.e. the workpiece is mounted shifted
of 1,5mm toward positive X direction), 0,4mm on Y and 0,1 on Z.
The part-program line to activate the correction in G122 is the following:
G122 I1.5 J0.4 K0.1
G122 activation
The activation syntax of G122 is as follows:
G122 I J K
where:
I, J, K are the components of the mounting error respectively along X, Y, and Z axes.

Some important notes:


When G122 is active, no origin programming is allowed
G122 is deactivated at reset
The IJK parameters must be all programmed, otherwise the alarm CN2C14 INCOMPATIBLE
PARAMETERS is issued (see below the case where no parameters are programmed, to activate the
parameters stored in permanent memory)
G122 is not compatible with G43/G44/G45, otherwise the alarm CN5B14 is generated.
G122 is transparent to jog. It is allowed to program G122 in semiauto, then passing in jog without pressing
reset. If a rotating axis is moved in jog, the linear axes move automatically as set by G122. Returning in
semiauto from jog, with G122 active, a reset is activated, canceling the G122.
To allow usage flexibility of G122, the programmed parameters IJK are stored in permanent memory.
By programming G122 without parameters:
G122
the last programmed parameters are restored, remaining valid also after a machine shutdown and restart.
This feature may be very important during a machining restart after an interruption.

G122 deactivation
To deactivate the G122 correction, program the following:
G122 KA0

45

CNC Z32 - Programming guide (Milling Machines)

4.4

Tool tip constant velocity with RTCP active (G131)

The function G131 allows to maintain constant the relative velocity between tool and workpiece with RTCP
motions.
G131 is a modal function.
This feature allows to execute the relative motion between workpiece and tool tip with the programmed F velocity,
when the RTCP is active; the velocity to be maintained constant (equal to the programmed F) is that relative to the
programmed movements of the axes XYZ only, without taking into account the programmed motion of rotating axes
and dragging motions induced on the linear axes from the rotating axes movement.
The general format for G131 activation is the following:
G131 I
The I parameter programmed in the same line as G131 expresses the maximum velocity allowed for the rotating
axes interested by the movement. If this parameter is not programmed, the rapid velocity will be assumed.
When G131 is active, the CNC maintains the relative velocity between tool and workpiece equal to the
programmed F value, with the following restrictions:
-

No linear axis interested by the movement may exceed its maximum speed. If one or more axes is
requested to move at a velocity exceeding its rapid velocity, due to the effects of dragging motions
induced by the RTCP, the movement will be executed at a lower velocity, to respect the limitations
of all interested axes.
No rotating axis connected to the RTCP may exceed its rapid velocity, or the velocity expressed by
I parameter. For example, on blocks programmed with a null linear movements, the rotating axes
will be moved with the maximum allowed velocity (I parameter or rapid).

G0 is not influenced by G131.


By programming G131, the functions G93, G94 or G95 are disabled.
G131 may be deactivated by programming G93, G94 or G95, depending on the type of feed programming
required.

46

CNC Z32 - Programming guide (Milling Machines)

5.
5.1

PARAMETRIC PROGRAMMING
Parameter management

A parameter defines a numeric value recalled by means of an identifier.


The Z32 CNC offers to the user three types of parameters:

Literal parameters:
They are composed by a combination of one or more alphabetic characters.
The names of literal parameters cannot contain:
- space (BLANK) characters
- NUMERICAL characters
- the characters ! $ % ( ) * + , - . / ; < = >
- the first character cannot be one of the following: G, N, O
Lower case characters cannot be used.
SYSTEM PARAMETERS:
Some parameters have a special meaning in Z32 programming, and they cannot be used for purposes
different to those already assigned. These parameters, defines as system parameters, are:
AA
AB
AC
AE
AM
AN
AP
AU
BM
BN
BP
CM
DA
DB
DC
DM
F
HR
HT
HX
HY
I
IR
IS
J
JR
JS
K
KA
KD

first axis of tern set by G25


second axis of tern set by G25
third axis of tern set by G25
communication from the logic
first axis measure
negative probe correction first axis
positive probe correction first axis
communication to logic
second axis measure
negative probe correction second axis
positive probe correction second axis
third axis measure
first axis translation
second axis translation
third axis translation
measuring distance
feed
temporary for radius polar coordinate and G110
temporary for angle polar coordinate and G110
temporary for X cartesian coordinate and special G
temporary for Y cartesian coordinate and special G
first axis center coordinate
first axis rotation center coordinate
first axis mirroring center coordinate
second axis center coordinate
second axis rotation center coordinate
second axis mirroring center coordinate
threading pitch and G110
selection parameter
additive factor single axis

47

CNC Z32 - Programming guide (Milling Machines)

KG
KM
KP
KT
L
LX
LZ
M
MA
MB
MC
MS
P
QA
QF
QR
QS
R
RA
RB
RR
S
T
TA
TB
TT
#
#A - #Q

GEPI-2 code and permanent subprograms


multiplicative factor single axis
scale factor on the plane
third axis scale factor
tool length (milling machines)
tool length (lathes)
tool length (lathes)
auxiliary function
auxiliary function
auxiliary function
auxiliary function
maximum speed in G96
nurbs order
auxiliary slope
final slope
rotation angle
mirroring axis slope
tool radius
circle radius
chamfer
connecting radius
speed
programmed tool
place of tool on the spindle
place of programmed tool
dwell time
synchronizer between part-program and ML logic
synchronizer between part-program and ML logic

D.ELECTRON may define further parameters in the future, to enhance the Z32 software features.
AXES NAMES:
The axes names are always defined with a single letter, by choosing among the following:
A B C D H P Q U V W X Y Z
They must be defined in the machine setup.
USER PARAMETERS
The user is allowed to define up to 60 literal parameters in a program for the purpose of parametric
programming.
The following combinations are not allowed:
RQ SN CS AT
PI
PC CP
IF
EB

square root, sine, cosine, arc-tangent


pi constant
polar/cartesian conversion and inverted
test operator
advanced line interruption

It is common to use as user parameters for parametric programming, the parameters composed by the
letter H followed by a second letter, for instance HA, HB, HC, etc.

48

CNC Z32 - Programming guide (Milling Machines)

PAR[] parameters
The PAR parameters are composed by a vector of 513 parameters, numbered from PAR[0] to PAR[512].
The parameter number may be an expression result, for example:
HA10 HB5
PAR[6]30
PAR[HA + PAR[HB + 1]]
is equivalent to:
PAR[10+PAR[6]]
than means:
PAR[40]

The usage of PAR[] parameters may be a substitute for literal user parameters in all situations.
Furthermore, these parameters are not subject to any restriction on the maximum number of parameters
allowed to be used.
PAL[] parameters
Same usage notes as for the array PAR[].
The PAL parameters are composed by a vector of 513 parameters, numbered from PAL[0] to PAL[512].
These parameters contain only INTEGER numbers, normally used for the information exchange between
PLC and part-program.
The values from PAL[256] to PAL[512] are read only.
The values from PAL[0] to PAL[255] may be written by the part-program. When a non integer number is
assigned to a PAL[] parameter, the number is rounded to the nearest integer value.

5.1.1

Parameter assignment

The assignment of a numeric value to a parameter is made through a programming very similar to that for an axis
movement.
For example, to assign the value 100 to the parameter HA, it is possible to write:
HA100
or, to assign the value 1 to the parameter PAR[10], it is possible to write:
PAR[10]1
5.1.2

Parameter assignment through a formula

It is possible to program mathematical expression whose result is a function of numeric values or other parameters.
Mathematical operators with a single operand:
SN(sine of an angle in degrees)
CS(cosine of an angle in degrees)
TAN(tangent of an angle in degrees)
AT (arcotangent in degrees)
RQ (square root)
ABS (absolute value)
INT (truncated integer value)
NEI (rounded integer value)
- (sign change)
Mathematical operators with two operands:
+ addition
- subtraction
* multiplication
/ division

49

CNC Z32 - Programming guide (Milling Machines)

To assign an expression result to a parameter, the lower than sign < and higher than sign > (acute parenthesis)
are used to indicate the beginning and the end of the expression.
Inside the expression it is possible to use the parenthesis ( and ).
For example, to assign the value HB+1 to the parameter HA, it is possible to write:
HA< HB + 1 >
or to assign the square root value of parameter HC to the parameter PAR[10]:
PAR[10]< RQ(HC) >
Through the use of parenthesis it is possible also to program complex expressions.
HA< HB + (HC+HD/2)/(SN(HE) >
5.1.3 Axis movement programming with parameters
Through the parameter programming it is possible also to program machine movements.
A very simple example:
N10 HA 10
N20 HB 1000
N30 HC 30
N40 G0 X<HA>
N50 F<HB>
N60 G1 X<HC+100>
In lines from N10 to N30, values are assigned to the parameters.
In the line N40, a rapid movement of X axis is executed up to the position contained in the parameter HA
(i.e. 10)
I the line N50 a feed is set with the value contained in parameter HB (1000)
In the line N60 a feed movement of X axis is executed up to the position HC+100 (i.e. 130) with a Feed of
1000.
The movement programming using parametric expressions may be quite complex, following the same rules
indicated for parameters programming.

5.1.4 System parameters programming


Through parametric programming, it is possible to assign numeric values to the system parameters previously
described.
For example, it is possible to set or modify the tool length (L parameter):
L100
Assigns the value 100 to the tool length parameter.
or
L< L-2 >
shortens the tool length by 2
In a similar way it is possible to assign values, also by using expressions, to all system parameters.
Warning: the system parameters programming is absolutely equivalent to the programming of user parameters.
The usage of system parameters is however reserved to the purpose associated with the parameter and not for
generic parametric computations.
.

50

CNC Z32 - Programming guide (Milling Machines)

5.1.5 Axes programming through parameters AA, AB, AC


The system parameters AA, AB and AC are very useful for parametric programming (like macros or fixed cycles).
These parameters represents respectively the first (AA), the second(AB) and the third(AC) axis specified with G25.
For example, with G25XYZ, the parameter AA represents the axis X, parameter AB the Y axis and AC the Z axis.
Through these parameters it is thus possible to program axes movements independently from the real axes names.
By programming G25 the axis related to AA, the one related to AB and the one related to AC are specified, as
shown in the following diagram:

Example:
OX1 OY1 OZ1
T1M6
F1000
S3000 M3

OX1 OY1 OZ1


T1M6
F1000
S3000 M3

G25ZXY G43Y
G0 AA0 AB0 AC2
G1 AC0
AA5
AB2
AA0
AB0
AC-0.5
AA5
AB2
AA0
AB0
M2

G25XYZ G43Z
G0 AA0 AB0 AC2
G1 AC0
AA5
AB2
AA0
AB0
AC-0.5
AA5
AB2
AA0
AB0
M2

51

CNC Z32 - Programming guide (Milling Machines)

5.2

Programming with advanced lines ( ! ... ! )

The Z32 CNC allows the usage of special program lines, called advanced lines.
Through these lines it is generally possible to handle most cases of logic-parametric programming, allowing for
conditioning and jumps with or without return.
An advanced line is a program line beginning and terminating with the ! character. This line may be preceded by
the letter N followed by a line number.
Inside an advanced line more than one instruction may be contained, each separated from the others by means of
character ; or !, as below described.
Note:
In advanced lines it is NOT possible to program machine movements.

5.2.1 Assigning values to parameters and computing expressions


The assignment operator is the character = .
More than one assignment is possible, by using the separator ;.
Example:
N10 !HA=16 ; HB=RQ(HA)+5 ; HC=0!
Note: The computing of expressions or the assignment of a value to a parameter is possible both in an advanced
line and in a normal line; for instance, the following expressions are equivalent:
!HA=10!
or
HA10
Also equivalent are the instructions:
!HA=PAR[3]!
and
HA<PAR[3]>
Warning: as already told, it is not possible to program an axis movement in an advanced line.
For example, by programming
!X=100!
no machine movement are produced, but it has the only meaning to set the value of parameter X to the value 100.
A machine movement can be programmed only outside advanced lines.

5.2.2 Executing jumps without return (!GON..!)


The function allowing to jump to a label inside a program is the function:
!GON..!
Jump destination is the line corresponding to the number (also decimal) following the letter N.
Example:
The program executes N10 and jumps to the label N20:

N10 !GON20!

N20

52

CNC Z32 - Programming guide (Milling Machines)

5.2.3 Executing jumps with return (!GON....!)


The function
!GON..-N..!
allows to execute the program section contained between the N labels specified, and then to return to the line
following the calling line.
Example:

N20 !GON40-N50!
N30

N40

N50

The program executes N20, jumps to N40, executes the instructions between N40 and N50 and then returns
executing line N30.
Returning jumps may be nested inside other returning jumps up to a maximum depth of 10 levels.
Warning: In order to use the N numbers as destinations for a jump, it is necessary for the N character to be
the first character present in the line, without leading spaces.
Correct programming:

N10 !GON20!

N20

Erroneous programming:
N10 !GON20!

N20

5.2.4 Executing conditioned jumps (!IF .. ; GON.. !)


The instruction allowing the execution of conditioned jumps inside a program is the following:
!IF {condition} ; GON..!
A condition may be any parametric expression containing one of the following comparison operators between two
parametric expressions:
> higher than
< lower than
= equal
<> different
>= higher or same
>= lower or same
Example:
!IF HA > 10 ; GON20!
jumps to N20 if HA is higher than 10.
The condition may also be an expression:
!IF (HA+HB)*PAR[10] >= HC ; GON20!

53

CNC Z32 - Programming guide (Milling Machines)

5.2.5 Controlling more than one condition on the same advanced line
On a single advanced line it is possible to control more than one condition:
!IF HA > 10 ;IF HB < 5 ; GON30!
jumps to N30 if HA is higher than 10 and HB is lower than 5.

5.2.6 Structuring conditioned jumps


Normally the various commands to be executed in a single advanced line are separated by the ; character. When
an IF condition is programmed, if the condition is verified, the subsequent commands are executed, otherwise the
analysis jumps to the next ! character present in the line.
Example:
!IF HA > 10 ; GON20 ! IF HA >5 ; GON30 ! GON40!
In the above example, if the HA > 10 is verified, the program jumps to N20.
If HA > 10 is not verified, the instruction following next ! character is executed, thus controlling if HA is higher than
5.
With this logic, the sample line behaves as follows:
If HA is higher than 10, jump to N20.
If HA is between 5 and 10, jump to N30
Otherwise jump to N40
Warning: the character ! doesnt interrupt an advanced line execution. To interrupt an advanced line
execution, a jump command !GON..! is necessary, or the programming of an end of block instruction EB.
For example, in the following line:
!IF HA>=0 ; HA=HA+1 ; EB ! HA=HA-1!
the EB instruction is necessary to terminate the line execution.
The line has the following behavior:
If HA is higher or equal to zero, it is incremented by 1, otherwise it is decremented by 1.
If the programming were as follows:
!IF HA>=0 ; HA=HA+1 ; EB ! HA=HA-1!
This instruction is not correct because:
if HA is higher or equal to zero, HA is at first incremented and then decremented by 1, because, as already told, the
! character doesnt interrupt the line execution.
Another example of using the EB terminator is the following:
!IF HA > 0 ; EB ! GON10!
That means: if HA is higher than zero, it terminates the advanced line and continues the execution from next line,
otherwise, jumps to N10.

54

CNC Z32 - Programming guide (Milling Machines)

5.2.7 Jump to a CMOS subprogram (! GOP.. !)


With the instruction
!GOP..!
It is possible to suspend the execution of current program and jump to the execution of a subprogram.
The !GOP..! instruction is valid for programs stored in the CMOS memory (internal memory) of CNC, and it is used
by specifying the program number to be activated.
Example:
N10

N50 !GOP10!
The main program is executed up to line N50, then the execution jumps to CMOS program number 10.
The subprogram must terminate with the subprogram end instruction G26. Example:
N10

N50 !GOP10!

N60

CMOS Subprogram 10:


N10

N100 G26
The main program is executed up to line N50, then the execution switches to subprogram 10, executed
from line N10 to line N100. The G26 instruction indicates the end of subprogram, then the execution
switches back to the calling program continuing from line N60.
Warning: the subprogram end instruction is the function G26. If a called subprogram contains the
end of program instruction M2, the execution stops without returning to the calling program.

5.2.8 Jump to a CMOS subprogram with label (! GOP.. N..!)


It is possible to jump in a CMOS subprogram starting the execution from a given label.
Example:
N10

N50 !GOP10-N30!
N60

CMOS Subprogram 10:


N10

N30

N100 G26
The main program is executed up to line N50, then the execution switches to subprogram 10, executed
from line N30 to line N100. The G26 instruction indicates the end of subprogram, then the execution
switches back to the calling program continuing from line N60.

55

CNC Z32 - Programming guide (Milling Machines)

5.2.9 Jump to a CMOS subprogram with two labels (! GOP.. N.. N..!)
It is possible to jump in a CMOS subprogram starting the execution from a given label.
Example:

N10

N50 !GOP10-N30-N70!
N60

CMOS Subprogram 10:


N10

N30

N70

N100 G26
The main program is executed up to line N50, then the execution switches to subprogram 10, executed
from line N30 to line N70. After execution of line N70, the calling program continues the execution from line
N60.

5.3

Conditioning blocks of programs (--IF)

The structured instruction --IF is useful when it is necessary to condition the execution of whole program blocks.
Example:
--IF {condition 1}
N10

N20
--END IF
The program executes the lines from N10 to N20 only if {condition 1} is verified.
A condition may be any parametric expression containing one of the following comparison operators:
> higher than
< lower than
= equal
<> different
>= higher or same
>= lower or same
The complete syntax is as follows:
--IF {condition 1} ;comment
N10
(executed if condition 1 is true)
N20
--ELSE IF {condition 2} ;comment
N30
(executed if condition 1 is false and condition 2 is true)
N40
--ELSE ;comment
N50
(executed if condition 1 is false and condition 2 is false)
N60
--END IF ;comment
N70

56

CNC Z32 - Programming guide (Milling Machines)

The --IF instruction indicates the first checked condition. If {condition 1} is verified, the blocks from N10 and N20
are executed, then the execution passes to N70.
If {condition 1} is not verified, the condition --ELSE IF is checked. If {condition 2} is verified, the blocks from N30
and N40 are executed, then the execution passes to N70.
If neither {condition 1} nor {condition 2} are verified, the execution passes to the --ELSE block, and the blocks from
N50 to N60 are executed, then the execution passes to N70.
In lines containing --IF, --ELSE IF, --ELSE and --END IF it is possible to insert a comment after the character ;.
In synthesis:
The --IF instruction is the first checked condition.
The blocks --ELSE IF specify the conditions checked if the preceding conditions are not true. It is possible to have
more than one block --ELSE IF. In this case the conditions are checked in sequence.
--IF {condition 1}
(executed if condition 1 is true)
--ELSE IF {condition 2}
(executed if condition 1 is false and condition 2 is true)
--ELSE IF {condition 3}
(executed if condition 1 is false, condition 1 is false and condition 3 is true)
--ELSE
(executed if condition 1 is false, condition 1 is false and condition 3 is false)
--END IF
N70
The instruction --ELSE identifies the block of instructions executed if all other conditions are not true.
The --END IF instruction identifies the end of an IF block.
It is possible to nest IF instructions up to 31 levels.
Example:
--IF {condition 1}
--IF {condition 2}
--IF {condition 3}
N30
(executed if condition 1 is true, condition 1 is true and condition 3 is true)
N40
--END IF
--END IF
--END IF

57

CNC Z32 - Programming guide (Milling Machines)

5.4

Program block repetition (--DO --LOOP)

The blocks inserted between the instructions --DO and --LOOP are repeated until the exit condition is satisfied
Example:
--DO
N10

N100
--LOOP
The blocks from N10 to N100 are endless repeated.

5.4.1 Specifying the repetition number (LOOP {N})


The number of repetitions can be specified by inserting the number on the same line as the LOOP instruction:
--LOOP {N}
In the following example, blocks from N10 to N100 are repeated 10 times, then the execution passes to block
N110. The blocks from N10 to N100 are thus executed 11 times, because the number specified is the number of
repetitions. This specification may be passed through a parameter contained between acute parenthesis: --LOOP
<HA>. In this case the parameter is rounded to the nearest integer.
--DO
N10

N100
--LOOP 10
N110
5.4.2 Repetition condition
A condition to be checked in order to execute the repetition may be specified on the same line as the LOOOP
instruction:
--LOOP IF {condition}
In the following example, blocks from N10 to N100 are repeated if the specified condition is verified, then the
execution passes to block N110. That means, if HA is lower than 10, the repetitions are executed; if HA is higher
than 10 the repetitions are no more executed.
--DO
N10

N100
--LOOP IF HA < 10
N110

58

CNC Z32 - Programming guide (Milling Machines)

5.4.3 Anticipated exit condition --DO --LOOP (--EXIT DO)


An anticipated exit condition from a block loop execution may be expressed with:
--EXIT DO IF {condition}
The --EXIT DO instruction allows an anticipated exit from the --DO --LOOP structure when the specified condition is
true.
In the following example, blocks from N10 to N100 are repeated until the exit condition is verified. When the exit
condition is verified, the loop exit happens in block N50, the instructions from N50 and N100 are no more executed,
and the control passes to instruction N110.
--DO
N10

N50 --EXIT DO IF HA > 10

N100
--LOOP
N110
Warning: It is possible to use the --EXIT DO instruction also without the IF condition written on the
same program line; it is thus possible to write:
--DO

--IF HA>100
--EXIT DO
--END IF

--LOOP

59

CNC Z32 - Programming guide (Milling Machines)

5.5

Writing CMOS programs (--DEFINE P..)

Through the instruction --DEFINE P.. it is possible to write a CMOS file of the CNC.
With this instruction it is possible to write a CNC CMOS file without the need to directly edit it.
The --DEFINE P.. instruction may be used only for CMOS user files, that means for CMOS files from number 1 to
number 109.
The instruction has the following syntax:
--DEFINE P.. ; comment

{program listing}

--END DEFINE ; comment


In lines containing --DEFINE, --END DEFINE it is possible to insert a comment after the character ;.
The program to be written may only be a CMOS program and must be specified with its number. In the following
example, the CMOS program number 10 is written:
--DEFINE P10

{program listing}

--END DEFINE
The definition of a CMOS program doesnt produce any machine movement.
The written program may be executed by recalling it by a CMOS subprogram jump instruction !GOP..!
Example:
T1M6
F5000
--DEFINE P10
G1 X100
G1Y100
G1X0
G1Y0
G26
--END DEFINE
G0 Z100
G0 X0Y0
G0 Z1
G1 Z1
!GOP10!
M2
In the above example, the instructions for the definition of program 10 dont produce any movement; the CMOS
program number 10 is executed only after its recall trough the function !GOP10!
Warning: In the definition of a CMOS subprogram by means of the --DEFINE P.. instruction, it is necessary
to insert the subprogram end instruction G26.
Warning: The --DEFINE P.. instruction must be executed before the calling of the defined subprogram (by
the instruction !GOP..!)
Warning: The definition of a CMOS program through the --DEFINE P.. instruction is not temporary. The
program can be also used after machine shutdown and successive power on.

5.6

Writing a temporary subprogram SUBTEMP (--DEFINE S..)

Through the --DEFINE S.. instruction it is possible to write a temporary subprogram.


The instruction has the following syntax:
--DEFINE S.. ; comment

{program listing}

60

CNC Z32 - Programming guide (Milling Machines)

--END DEFINE ; comment


The subprogram to be written must be specified with the desired subtemp number.
In the following example, the subtemp number 20 is written:
--DEFINE S20

{program listing}

--END DEFINE
The definition of a subtemp doesnt produce any machine movement.
The written subtemp may be executed by recalling it by a subtemp subprogram jump instruction !GOS..!
This instruction has the same syntax as the subprogram jump instruction !GOP..!, the only difference being the
character S which must be used instead of character P, to specify the subtemp number.
Example:
T1M6
F5000
--DEFINE S20
G1 X100
G1Y100
G1X0
G1Y0
G26
--END DEFINE
G0 Z100
G0 X0Y0
G0 Z1
G1 Z1
!GOS20!
M2
Up to 64 subtemps may be used for a process.
A single subtemp may contain a program no larger than 240KB.
The total content of all defined subtemps cannot exceed 1MB.
A subtemp may be recalled by using the instructions !GOS..!, !GOS..N..! and !GOS..N..N..! These instructions
are equivalent to the corresponding !GOP.. ! instructions valid for CMOS programs.
It is possible to use a subtemp as a fixed cycle with the instruction G27S.. To program a subtemp as a fixed cycle,
please consult the section related to fixed cycles.
Warning: In the definition of a subtemp by means of the --DEFINE S.. instruction, it is necessary to insert
the subprogram end instruction G26.
Warning: The --DEFINE S.. instruction must be executed before the calling of the defined subtemp with the
instruction !GOS..!
Warning: The definition of a subtemp through the --DEFINE S.. instruction is temporary. The subtemp is
valid only during the current execution. At execution end, the subtemp is cleared.

61

CNC Z32 - Programming guide (Milling Machines)

6.

Z32 FIXED CYCLES AND MACROS

This chapter describes the standard macros and fixed cycles of the Z32 CNC. Cycles and machining here
described are valid for versions SIS T109-8B and following.
Cycles and machining are recalled through the functions:
G800 FIXED CYCLES
G801 POSITIONING MACROS
G802 MACHINING MACROS

6.1

Z32 Fixed cycles (G800)

The function G800 allows to program the system fixed cycles.


The system fixed cycles are unchangeable system subprograms, activated by programming:
G800 K..
Where the K letter must be followed by the number identifying the desired cycle.
When a fixed cycle has been activated, it is automatically executed at the end of each programmed G0 (RAPID)
positioning. Movements executed in feed dont trigger the fixed cycle execution.
The programming of G800 is as follows:
Parameter passing:
All necessary parameters are specified by programming them on the same line containing the activation of G800.
In the program line containing a G800 activation, it is possible to program only parameters related to fixed cycles
programming.
For example, with reference to the cycle G800K1, it is possible to set the parameters by programming:
G800 MHA0 MHB-20 MHC10
An example of not correct programming is the following:
G800 MHA0 MHB-20 MHC10 F1000
The parameter F is not directly programmable on the G800 line, so a correct writing is as follows:
F1000
G800 MHA0 MHB-20 MHC10
Fixed cycle activation
To recall and activate a fixed cycle, it is necessary to program on the G800 line also the K parameter used to
choose the cycle:
G800K1 MHA0 MHB-20 MHC10
Parameter programming and fixed cycle activation may happen on the same line or on different lines.
As an example, all following syntaxes are equivalent:
G800K1 MHA0 MHB-20 MHC10 (parameter programming and cycle activation)
and
G800 MHA0 MHB-20 MHC10 (parameter programming)
G800K1 (cycle activation)
Fixed cycle deactivation
The deactivation of a fixed cycle activated with G800 is obtained by programming:
G800K0
After a fixed cycle deactivation, the cycle parameters are cleared; if the recalling of a new fixed cycle is desired, all
necessary parameters must be programmed anew.

62

CNC Z32 - Programming guide (Milling Machines)

Fixed cycle suspension


The function G27X suspends the active fixed cycle. G27X is valid only in the block where programmed.
Example:

G800 MHA0 MHB-20 MHC10 K1 (activates fixed cycle)


G0 X100 Y100 (executes fixed cycle)
G27X G0 X200 (doesnt execute fixed cycle)
G0 X200 Y200 (executes fixed cycle)
G27C0 (deactivate fixed cycle)

Optional parameters management


In the fixed cycle definition some parameters defined as optional are present.
It is possible not to program all optional not desired parameters.

63

CNC Z32 - Programming guide (Milling Machines)

6.1.1

G800K1: Drilling
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position

feed MHF
feed F

MHC

G0

MHA

Optional parameters for centering:


(MHD): centering end position
(MHF): feed during centering
The segment from MHA to MHD is executed at feed
MHF
If MHF = 0 all the hole is executed with programmed F

MHD

MHB

Optional parameters for dwell at hole end:


(MHT): dwell time at hole end
If MHT = 0 the dwell is not executed

MHT

6.1.2 G800K2: Deep drilling with chip breakage


Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHI: depth increment before stop for chip breakage
Type of chip breakage:
MHR: retraction for chip breakage
if MHR > 0 the retraction is executed and MHT is
ignored
MHT: dwell time for chip breakage
Program MHR or MHT depending on the kind of chip
breakage desired.

feed MHF

G0

MHA
MHI

MHI

Optional parameters for centering:


(MHD): centering end position
(MHF): feed during centering
The segment from MHA to MHD is executed at feed
MHF
If MHF = 0 the centering is not executed

64

MHC

feed F

MHD

MHR

MHB

MHT

CNC Z32 - Programming guide (Milling Machines)

6.1.3

G800K3: Deep drilling with chip extraction


Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHI: depth increment before retraction for chip extraction.
This increment is reduced by 10% at every movement
up to a value of 50% of starting MHI value, then the
increments are constant.
MHZ: chip extraction position
Optional parameters for centering:
(MHD): centering end position
(MHF): feed during centering
The segment from MHA to MHD is executed at feed
MHF
If MHF = 0 the centering is not executed
Optional parameters for repositioning:
(MHS): safety distance for in hole repositioning.
If MHS = 0, a default distance of 0.5mm is assumed.

feed MHF

MHC

feed F

MHT
MHZ

G0

MHA
MHD
MHI

MHS

MHB

Optional parameters for dwell time at extraction position:


(MHT): optional dwell at chip extraction position MHZ

6.1.4 G800K4: Tapping


Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHP: tap pitch in millimeters
MHM: kind of tapping: rigid or with compensating chuck
MHM = 0: rigid tapping
WARNING: Please consult the machine tool
builder about the rigid tapping availability
MHM = 1: tapping with compensating chuck

MHP

MHC

G0

MHA

MHB
MHT

MHW

Optional parameters for dwells with compensator


(MHM=1)
(MHT): dwell time before spindle inversion command
(MHW): dwell time after spindle inversion command
MHT and MHW must be used only in tapping with compensating chucks.
6.1.5

feed F

G800K5: Reaming

MHC

G0

Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position

MHA

Optional parameters for dwell at hole end:


(MHT): dwell time at hole end
If MHT = 0 the dwell is not executed

MHB
MHT

6.1.6 G800K6: Boring

65

CNC Z32 - Programming guide (Milling Machines)

Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position

feed F

MHC
G0

MHA

Optional parameters for spindle orientation:


If MHS > 0 the machine is equipped with spindle
orientation M19:

MHB

WARNING: Please consult the machine tool


builder for availability of M19 instruction
(MHQ): angle rough value of boring bar cutting edge
HS
M
position with respect to transducer zero.
MHG
To measure this value, orient the spindle with M19
and observe the cutting edge position.
The angle value must be positive, and comprised
between 0 and 360 degrees.
(MHS): retraction from hole wall along the angle MHQ.
If MHS=0, the machine is not equipped with spindle orientation, and the return movement is
executed at hole center, without retraction from the hole wall.
Stop

Optional parameters for dwells:


(MHT): dwell time at hole end, before spindle stop or spindle orientation
(MHW): dwell time after spindle stop
6.1.7

G800K7: Deep drilling with chip breakage and extraction


Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHI: increment before feed stop for chip breakage
Type of chip breakage:
MHR: retraction for chip breakage
if MHR > 0 the retraction is executed and MHT is
ignored
MHT: dwell time for chip breakage if MHR = 0
Program MHR or MHT depending on the kind of chip
breakage desired.
MHU: chip breaking zone end position chip extraction
zone starting position
MHL: depth increment before retraction for chip extraction.
This increment is each time reduced by 10% up to a
value of 50% of its initial value, then the increments are
constant.
MHZ: chip extraction position
Optional parameters for centering:
(MHD): centering end position
(MHF): feed during centering
The segment from MHA to MHD is executed at feed MHF
If MHF = 0 the centering is not executed
Optional parameters for repositioning:
(MHS): safety distance for in hole repositioning.
If MHS = 0, a default distance of 0.5mm is assumed.
Optional parameters for dwells:
(MHW): dwell time at chip extraction position HZ

66

feed MHF

MHC

feed F

MHW

G0

MHZ

MHA
MHD

MHI
MHU
MHL
MHS
MHB

CNC Z32 - Programming guide (Milling Machines)

6.1.8 G800K8: Two zones drilling with gap


Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
MHU: end of first zone position
MHV: start of second zone position

feed MHF

MHC

feed F
G0

MHA
MHD
MHI

Optional parameters for centering:


(MHD): centering end position
(MHF): feed during centering
The segment from MHA to MHD is executed at feed MHF
If MHF = 0 the centering is not executed

MHU
MHV
MHI

Optional parameters for chip breaking:


(MHI): depth increment before stop for chip breakage
With MHI0 no chip breakage happens
Kind of chip breakage:
(MHR): retraction for chip breakage
if MHR > 0 the retraction is executed and MHT is ignored
(MHT): dwell time for chip breakage if MHR = 0
Program MHR or MHT depending on the kind of chip breakage desired.

MHB

6.1.9 G800K9: Three zones drilling


Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
Middle zone:
MHU: end high zone start middle zone position
(MHJ): feed inside middle zone. If MHJ=0, the middle zone
feed is equal to the high zone feed
(MHG): speed inside middle zone. If MHG=0, the middle
zone speed is equal to the high zone speed

feed MHF

feed MHJ

feed F

feed MHK

G0

MHC
MHA

MHD
MHI
MHU
MHI

Optional parameters for low zone:


(MHV): end middle zone start low zone position
If MHV = 0 no low zone exists. Middle zone ends at MHB
(MHK): feed inside low zone.
(MHH): Speed in low zone. If MHH=0, the low zone speed is
equal to the middle zone speed
Optional parameters for centering:
(MHD): centering end position
(MHF): feed during centering
The segment from MHA to MHD is executed at feed MHF
If MHF = 0 the centering is not executed
Optional parameters for chip breaking:
(MHI): depth increment before stop for chip breakage
If MHI = 0 no chip breakage happens
(MHR): retraction for chip breakage
If MHR > 0 the retraction is executed and MHT is ignored
(MHT): dwell time for chip breakage if MHR = 0
Program MHR or MHT depending on the kind of chip breakage desired.

67

MHV
MHI
MHB

CNC Z32 - Programming guide (Milling Machines)

Optional parameters for speed change:


(MHS): retraction for speed change
(MHW): dwell time after MHS retraction, to allow spindle setting

6.1.10 G800K10: Internal spiral milling-boring


Mandatory parameters:
MHB: hole end position
MHC: high retraction position
MHD: hole diameter
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)

MHD > 0

MHD < 0

MHD

MHC

Optional parameters for pass management:


(MHA): machining start position
(MHK): increment per round

MHA
MHK
MHB

6.1.11 G800K11: External spiral milling-boring


Mandatory parameters:
MHB: stud end position
MHC: high retraction position
MHD: stud diameter
MHD > 0: counterclockwise machining (G3)
MHD < 0: clockwise machining (G2)
Optional parameters for pass management:
(MHA): machining start position
(MHK): increment per round
Optional parameters for approach:
(MHS): starting point distance from approaching point
If MHS=0 a default value of 1mm is assumed.

68

MHD > 0
MHS
MHD

MHD < 0
MHC
MHA
MHK
MHB

CNC Z32 - Programming guide (Milling Machines)

6.2

Z32 positioning macros (G801)

The function G801 allows to program positioning macros.


The positioning macros are system, unchangeable subprograms activated by programming
G801 K..
Where the K letter must be followed by the number identifying the desired cycle.
The programming of a positioning macro starts the execution of all described positioning.
Normally these macros are used in combination with fixed cycles or machining macros (G802), used as a special
kind of fixed cycle.
The programming of G801 is as follows:
Parameter passing:
All necessary parameters are specified by programming them on the same line containing the activation of G801.
In the program line containing a G801 activation, it is possible to program only parameters related to fixed cycles
programming.
For example, with reference to the cycle G801K1, it is possible to set the parameters by programming:
G801 MPX0 MPY0 MPJ10 MPK5 MPN5
An example of not correct programming is the following:
G801 MPX0 MPY0 MPJ10 MPK5 MPN5 F1000
The parameter F is not directly programmable on the G801 line, so a correct writing is as follows:
F1000
G801 MPX0 MPY0 MPJ10 MPK5 MPN5
Activating a positioning macro
To recall and activate a positioning macro, it is necessary to program on the G801 line also the K parameter used
to choose the macro:
G801K1 MPX0 MPY0 MPJ10 MPK5 MPN5
Parameter programming and macro activation may happen on the same line or on different lines.
As an example, all following syntaxes are equivalent:
G801K1 MPX0 MPY0 MPJ10 MPK5 MPN5 (parameter programming
activation)
and
G801 MPX0 MPY0 MPJ10 MPK5 MPN5 (parameter programming)
G801K1 (macro activation)

and

macro

At the end of machining the macro parameters are cleared, if the recalling of a new machining is desired, all
necessary parameters must be programmed anew
Optional parameters management
In the macros definition some parameters defined as optional are present.
It is possible not to program all optional not desired parameters.
The available positioning macros may be used in two modes:
As positioning connected to a fixed cycle
If on every macro point the execution of a fixed cycle is desired, the fixed cycle must be activated before the
positioning macro recall. The fixed cycle must be deactivated (G27 C0) after calling the positioning macro, or after
all positioning where the fixed cycle must be executed.

69

CNC Z32 - Programming guide (Milling Machines)

As positioning connected to any machining


If a custom machining is desired, the machining must be stored in a CMOS file (from file 1 to file 109). The program
may be stored by directly editing the file number 90, or by using the --DEFINE P function internal to the same
part-program.
When the positioning macro is used to place a machining contained in a CMOS file, it is possible to enable the
part-program rotation during the positioning execution (see the example at the end of positioning macro
description).
It is furthermore possible to suspend the positioning on a set of points chosen by the programmer:
the parameter FN determined the number of points to be skipped. The values contained in the PAR array (from
PAR[1] to PAR[FN]) indicate the positioning to be skipped.
The skipping points numbering has the same order as the positioning execution.
Note: If a positioning macro is used to repeat a machining contained in a CMOS file, the CNC will use the
parameters DA, DB and QR to translate and rotate the machining on the various positioning points. It is
responsibility of the part-program programmer to use these functionalities in such a way they dont contrast with the
positioning macro.

70

CNC Z32 - Programming guide (Milling Machines)

6.2.1

G801K1: Line - starting point and increments


Mandatory parameters:
MPK
MPX, MPY: starting point coordinates
MPJ, MPK: increments on the first and second axis of the
plane
0
MPX
MPN: number of points
MPJ
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored in
MPY
CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of positioning
line
Optional parameters for positioning skipping:
(MPS): number of points to be skipped. The numbers of points to be skipped are stored in
PAR array from PAR[1] to PAR[MPS]

6.2.2 G801K2: Line starting point, angle and point distance


Mandatory parameters:
MPX, MPY: starting point coordinates
MPG: line slope angle
MPP: distance between points
MPN: number of points
0
MPX
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored in
CMOS program MPF, is positioned
MPY
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of positioning
line
Optional parameters for positioning skipping:
(MPS): number of points to be skipped. The numbers of points to be skipped
are stored in PAR array from PAR[1] to PAR[MPS]

MP

MPG

6.2.3 G801K3: Line - starting and end point


Mandatory parameters:
MPX, MPY: starting point coordinates
MPA, MPB: end point coordinates
MPN: number of points
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored in
CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of positioning
line
Optional parameters for positioning skipping:
(MPS): number of points to be skipped. The numbers of points to
be skipped are stored in PAR array from PAR[1] to PAR[MPS]

71

MPB
MPX

0
MPA

MPY

CNC Z32 - Programming guide (Milling Machines)

6.2.4 G801K4: Grid row and column increments

MPV
MPJ
MPK
MPW

M PM

Mandatory parameters:
MPX, MPY: starting point coordinates
MPJ, MPK: row increments
MPV, MPW: column increments
MPN: number of points in a row
MPM: number of points in a column
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored
in CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPY
MPR = 1 : the figure is rotated by the slope of
positioning line
0 MPX
Optional parameters for positioning skipping:
(MPS): number of points to be skipped. The numbers of
points to be skipped are stored in PAR array from PAR[1] to PAR[MPS]

MPN

6.2.5 G801K5: Grid starting point, distances and angles

M PM

Mandatory parameters:
MPT
MPX, MPY: starting point coordinates
MPP
MPP: distance between row points
MPG: row angle relative to the first axis of plane
MPQ: distance between columns points
MPQ
MPT: column angle relative to the first axis of plane
MPN: number of points in a row
MPM: number of points in a column
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored
MPY
in CMOS program MPF, is positioned
MPN
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of
0 MPX
positioning line
Optional parameters for positioning skipping:
(MPS): number of points to be skipped. The numbers of points to be skipped are stored in PAR
array from PAR[1] to PAR[MPS]

MPG

6.2.6 G801K6: Grid row and column starting and end points

72

MPD

M PM

Mandatory parameters:
MPX, MPY: first row starting point coordinates
MPA, MPB: first row end point, last column starting point
coordinates
MPC, MPD: last column end point coordinates
MPN: number of points in a row
MPM: number of points in a column
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored in
CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of positioning
line
Optional parameters for positioning skipping:

MPB
MPY
MPN

MPX

MPA MPC

CNC Z32 - Programming guide (Milling Machines)

(MPS): number of points to be skipped. The numbers of points to be skipped are stored in PAR array
from PAR[1] to PAR[MPS]

6.2.7 G801K7: Circle initial angle and total increment


Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If
MPC
is
positive,
positioning
happens
counterclockwise
MPL
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPA
MPN: number of points
MPY
Optional parameters for arc length
(MPL): total increment (positive value)
MPC
If MPL = 0 or MPL = 360 the points are spaced along
the whole circumference
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored in
MPF, is
0 CMOS program
MPX
positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of positioning line
Optional parameters for positioning skipping:
(MPS): number of points to be skipped. The numbers of points to be skipped are stored in PAR
array from PAR[1] to PAR[MPS]
Optional parameters for positioning type:
(MPW): movement type between points
MPW = 0 : linear movement
MPW = 1 : circular movement

6.2.8 G801K8: Circle initial angle and angular distance


MPP
Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
If MPC is positive, positioning happens
MPA
counterclockwise
If MPC is negative, positioning happens clockwise
MPY
MPA: initial angle
MPN: number of points
MPC
Optional parameters for arc length
(MPP): angular distance between points (positive
value)
If MPP = 0 the points are spaced along the whole
0
circumference, starting from the initial angle.
MPX
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored in CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of positioning line
Optional parameters for positioning skipping:
(MPS): number of points to be skipped. The numbers of points to be skipped are stored in PAR
array from PAR[1] to PAR[MPS]
Optional parameters for positioning type:
(MPW): movement type between points

73

CNC Z32 - Programming guide (Milling Machines)

MPW = 0 : linear movement


MPW = 1 : circular movement

6.2.9 G801K9: Circle initial and final angle

MPA

Mandatory parameters:
MPX, MPY: circle center coordinates
MPC: circle radius (positive or negative value)
M
PB
If
MPC
is
positive,
positioning
happens
counterclockwise
If MPC is negative, positioning happens clockwise
MPA: initial angle
MPB: final angle
MPY
If MPA = MPB the points are spaced along the whole
MPC
circumference, starting from the initial angle.
MPN: number of points
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored
0
MPX
in CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of positioning line
Optional parameters for positioning skipping:
(MPS): number of points to be skipped. The numbers of points to be skipped are stored in PAR
array from PAR[1] to PAR[MPS]
Optional parameters for positioning type:
(MPW): movement type between points
MPW = 0 : linear movement
MPW = 1 : circular movement

6.2.10 G801K10: Rectangle center and pitch


MPP

MPQ

MPG
MPY

MP
M

Mandatory parameters:
MPX, MPY: rectangle center coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored
in CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of
positioning line

MP

MPX

6.2.11 G801K11: Rectangle center and sides

MP

L
MP

MP

MPY

MP
M

MP

74

MPX

Mandatory parameters:
MPX, MPY: rectangle center coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPL: rectangle base
MPM: number of points on rectangle height
MPH: rectangle height

CNC Z32 - Programming guide (Milling Machines)

Optional parameters for machining position:


(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure, stored in CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of positioning line

6.2.12 G801K12: Rectangle corner and pitch


Q
MP

MPG

6.2.13

P
MP

M
MP

Mandatory parameters:
MPX, MPY: lower left corner coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure,
stored in CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of
positioning line

N
MP

MPY
MPX

G801K13: Rectangle corner and sides

L
MP

MP

MPY

MPX

MP

75

MP

MP

Mandatory parameters:
MPX, MPY: lower left corner coordinates
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPL: rectangle base
MPM: number of points on rectangle height
MPH: rectangle height
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MPF <> 0 : on all points a programmed figure,
stored in CMOS program MPF, is positioned
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of
positioning line

CNC Z32 - Programming guide (Milling Machines)

6.3

Z32 machining macros (G802)

The function G802 allows to program machining macros.


The machining macros are system, unchangeable subprograms activated by programming
G802 K..
Where the K letter must be followed by the number identifying the desired cycle.
The programming of G802 is as follows:
Parameter passing:
All necessary parameters are specified by programming them on the same line containing the activation of G802.
In the program line containing a G802 activation, it is possible to program only parameters related to fixed cycles
programming.
Unlike G800 and G801, with G802 it is possible to program the positions of continuous axes, in order to define the
macro reference point (i.e. a pocket center).
For example, with reference to the cycle G802K1, it is possible to set the parameters by programming:
G802 X10 Y10 MMA0 MMB-20 MMC10
An example of not correct programming is the following:
G802 X10 Y10 MMA0 MMB-20 MMC10 F1000
The parameter F is not directly programmable on the G802 line, so a correct writing is as follows:
F1000
G802 X10 Y10 MMA0 MMB-20 MMC10
Activating a machining macro
To recall and activate a fixed cycle, it is necessary to program on the G802 line also the K parameter used to
choose the cycle:
G802K1 X10 Y10 MMA0 MMB-20 MMC10
Parameter programming and fixed cycle activation may happen on the same line or on different lines.
As an example, all following syntaxes are equivalent:
G802K1 X10 Y10 MMA0 MMB-20 MMC10 (parameter programming and macro
activation)
and
G802 X10 Y10 MMA0 MMB-20 MMC10 (parameter programming)
G802K1 (cycle activation)
At the end of machining the macro parameters are cleared, if the recalling of a new machining is desired, all
necessary parameters must be programmed anew
Optional parameters management
In the fixed cycle definition some parameters defined as optional are present.
It is possible not to program all optional not desired parameters.

76

CNC Z32 - Programming guide (Milling Machines)

Using a machining macro as a fixed cycle


By programming the parameter HX1 on the same line as G802 K.. it is possible to use a machining macro like a
fixed cycle, thus allowing the macro replication on more than one point.
For example, it is possible to combine a machining macro, used as a fixed cycle, with a positioning macro.
When a machining macro is used as a fixed cycle, the macro reference point programmed through the axes
positions (i.e. a pocket center) will be no more set on the same line as G802, because the macro positioning point
is determined by succeeding positioning.
Example:
G802 MMA0 MMB-30 MMC10 MMD60
G802K1 HX1 MMK1 MME2 MMW1 MMQ4
Please note that the pocket center positions are not programmed.
The fixed cycle deactivation is programmed by the function
G802K0
After a fixed cycle deactivation, the cycle parameters are cleared; if the recalling of a new fixed cycle is desired, all
necessary parameters must be programmed anew.
A fixed cycle may be suspended by the function G27X (see introduction to G800 fixed cycles).
By using a machining macro connected with a positioning macro, it is possible to use the machining rotation
(parameter MHR).

77

CNC Z32 - Programming guide (Milling Machines)

6.3.1

G802K1: Circular pockets roughing


MMP

Mandatory parameters:
pocket center coordinates
through axes positions)
MMD: pocket diameter
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MMK: pass depth
MME: safety distance

MMJ=0

(programmed

Optional parameters for taper:


(MMN): taper (delivery angle). Must
comprised between 0 and 80 degrees.

AA, AB
MMJ=1
MMD
R

MMC
MMS

MME

MMA

MMK
MMU

be

MMB
MMN

Optional parameters for sinking feed:


(MMF): feed for sinking movements. If not programmed, or if equal to 0, the sinking feed
assumes the F value.
Optional parameters for ramp sinking:
(MMW): ramp sinking:
MMW=0: depth sinking executed on pocket center, inside a pre-hole.
MMW=1: depth sinking executed with a spiral movement, with maximum slope
MMQ
(MMQ): maximum slope of sinking ramp. If MMQ=0, the sinking is executed as a single
movement.
Optional parameters for pass overlapping:
(MMP): minimum overlapping between passes. Values between 0.2 and 1.9 times the
tool radius. If MMP=0 the value MMP=0.2 times tool radius is assumed
Optional parameters for movement direction:
(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)
Optional parameters for machining allowance:
(MMS): allowance at roughing end.
(MMV): allowance at end of pass:
MMV=0 leaves allowance unmachined
MMV=1 eliminates allowance with a final pass to MMD position
Optional parameters for non cylindrical tools:
(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert
radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

78

CNC Z32 - Programming guide (Milling Machines)

6.3.2

G802K2: Rectangular pocket roughing pocket center


Mandatory parameters:
pocket center coordinates
through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth

(programmed

MMP

MMG

MMR
AA, AB
MMH

MML

MMS

MMC
MME

MMA

MMK

Optional parameters for pocket rotation:


(MMG): pocket rotation angle.

MMU

MMN

MMB

Optional parameters for taper:


(MMN): taper (delivery angle). Must be comprised between 0 and 80 degrees.
(MMX): fillet management with taper pockets:
MMX=0 variable fillets
MMX=1 constant fillets
Optional parameters for sinking feed:
(MMF): feed for sinking movements. If not programmed, or if equal to 0, the sinking feed
assumes the F value.
Optional parameters for ramp sinking:
(MMW): ramp sinking:
MMW=0: depth sinking executed on pocket center, inside a pre-hole.
MMW=1: depth sinking executed with a spiral movement, with maximum slope MMQ
(MMQ): maximum slope of sinking ramp. If MMQ=0, the sinking is executed as a single
movement.
Optional parameters for pass overlapping:
(MMP): minimum overlapping between passes. Values between 0.2 and 1.9 times the tool
radius. If MMP=0 the value MMP=0.2 times tool radius is assumed
Optional parameters for movement direction:
(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)
Optional parameters for machining allowance:
(MMS): allowance at roughing end.
(MMV): allowance at end of pass:
MMV=0 leaves allowance unmachined
MMV=1 eliminates allowance with a final pass to MMD position
Optional parameters for non cylindrical tools:
(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

79

CNC Z32 - Programming guide (Milling Machines)

6.3.3 G802K3: Rectangular pocket roughing - corner


The machining cycle of this macro is very similar to the roughing macro where the pocket
center is known. The only difference is in the programmed coordinates: those of a
pocket corner, instead of pocket center.
In this case the AA and AB parameters represent one pocket corner, while MML and MMH
are the two pocket sides. The sign of MML and MMH must be assigned according to
the following figure:
MML>0

MMH>0

MMH<0

MML>0
MML<0

MMH>0

MMH<0

MML<0

MMP

MMG

MMR
MMH
MML

MMS

MMC
MME

MMA

MMK
MMB
MMN

MMU

80

CNC Z32 - Programming guide (Milling Machines)

6.3.4

G802K4: Circular pockets finishing


Mandatory parameters:
pocket center coordinates
through axes positions)
MMD: pocket diameter
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth

(programmed
MMJ=0

AA, AB

MMD

MMQ

MMJ=1

MMC
MMS

Optional parameters for pocket wall orientation:


(MMV): defines the wall where the approaching
and retraction movements from pocket
profile are made:
MMV=0: right wall
MMV=1: left wall

MME

MMA

MMK
MMU

MMB
MMN

Optional parameters for approaching distance:


(MMQ): profile approaching and retraction distance. If not programmed, or if equal to 0, a
value of 2mm is assumed.
Optional parameters for taper:
(MMN): taper (delivery angle). Must be comprised between 0 and 80 degrees.
Optional parameters for sinking feed:
(MMF): feed for sinking movements. If not programmed, or if equal to 0, the sinking feed
assumes the F value.
Optional parameters for spiral milling:
(MMW): spiral milling
MMW=0 finishing with constant depth passes
MMW=1 spiral finishing
Optional parameters for movement direction:
(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)
Optional parameters for machining allowance:
(MMS): allowance at machining end.
Optional parameters for non cylindrical tools:
(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert
radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

81

CNC Z32 - Programming guide (Milling Machines)

6.3.5

G802K5: Rectangular pocket finishing pocket center


Mandatory parameters:
pocket center coordinates (programmed
through axes positions)
MML: pocket base
MMH: pocket height
MMR: fillet radius
MMA: pocket start position
MMB: pocket end position
MMC: high retraction position
MME: safety distance
MMK: pass depth
Optional parameters for pocket wall orientation:
(MMV): defines the wall where the
approaching and retraction movements
from pocket profile are made:
MMV=0: right wall
MMV=1: left wall

MMQ
MMG

MMR
AA, AB
MMH
MML

MMS

MMC
MME

MMA

MMK
MMB
MMU

MMN

Optional parameters for approaching distance:


(MMQ): profile approaching and retraction distance. If not programmed, or if equal to 0, a
value of 2mm is assumed.
Optional parameters for pocket rotation:
(MMG): pocket rotation angle.
Optional parameters for taper:
(MMN): taper (delivery angle). Must be comprised between 0 and 80 degrees.
(MMX): fillet management with taper pockets:
MMX=0 variable fillets
MMX=1 constant fillets
Optional parameters for sinking feed:
(MMF): feed for sinking movements. If not programmed, or if equal to 0, the sinking feed
assumes the F value.
Optional parameters for spiral milling:
(MMW): spiral milling
MMW=0 finishing with constant depth passes
MMW=1 spiral finishing (only for cylindrical pockets, MMN=0)
Optional parameters for movement direction:
(MMJ): movement direction:
MMJ=0 counterclockwise (concordance)
MMJ=1 clockwise (discordance)
Optional parameters for machining allowance:
(MMS): allowance at machining end.
Optional parameters for non cylindrical tools:
(MMU): insert radius of toroidal tools
The R parameter contains the tool radius, while the MMU parameter the insert
radius:
MMU=0, cylindrical tool
MMU<R, toroidal tool
MMU=R, spherical tool

82

CNC Z32 - Programming guide (Milling Machines)

6.3.6 G802K6: Rectangular pocket finishing - corner


The machining cycle of this macro is very similar to the finishing macro where the pocket
center is known. The only difference is in the programmed coordinates: those of a
pocket corner, instead of pocket center.
In this case the AA and AB parameters represent one pocket corner, while MML and MMH
are the two pocket sides. The sign of MML and MMH must be assigned according to
the following figure:

MML>0

MMH>0

MMH<0

MML>0
MML<0

MMH>0

MMH<0

MML<0

MMQ
MMG

MMR
MMH
MML

MMS

MMC
MME

MMA

MMK
MMB
MMU

MMN

83

CNC Z32 - Programming guide (Milling Machines)

6.3.7 G802K7: Linear eyelet


Mandatory parameters:
eyelet center coordinates (programmed
through axes positions)
MML: eyelet length
MMD: eyelet width
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with
the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth

MMD
AA, AB
MML

MMC
MMS

MME

Optional parameters for machining allowance:


(MMS): allowance at roughing end.
Optional parameters for sinking:
(MMW): sinking mode
MMW = 0: sinking in a pre-hole centered in A or B, depending on the MML sign:
MML>0 sinking on point A
MML<0 sinking on point B
MMW > 0: sloped sinking with MMW oscillations between point A and point B
(MMF): sinking feed

84

MMA

MMK, MMH

Optional parameters for rotation:


MPG: rotation angle relative to the first axis of plane
The rotation is executed around the eyelet center.

Optional parameters for movement direction:


(MMJ): machining direction:
MMJ = 0: counterclockwise
MMJ = 1: clockwise

MMG

MMB

CNC Z32 - Programming guide (Milling Machines)

6.3.8

G802K8: Circular eyelet eyelet center


Mandatory parameters:
eyelet center coordinates (programmed
through axes positions)
MML: eyelet length
MMD: eyelet width
MMR: eyelet curvature radius
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with
the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth

MMR

MMC
MMS

MME

MMA

AA, AB
MMK
MMH

MMD

MMB

MML
B

Optional parameters for rotation:


MPG: rotation angle relative to the first axis of plane
The rotation is executed around the eyelet center.
Optional parameters for machining allowance:
(MMS): allowance at roughing end.
Optional parameters for sinking:
(MMW): sinking mode
MMW = 0: sinking in a pre-hole centered in A or B, depending on the MML sign:
MML>0 sinking on point A
MML<0 sinking on point B
MMW > 0: sloped sinking with MMW oscillations between point A and point B
(MMF): sinking feed
Optional parameters for movement direction:
(MMJ): machining direction:
MMJ = 0: counterclockwise
MMJ = 1: clockwise

85

MMG

CNC Z32 - Programming guide (Milling Machines)

G802K9: Circular eyelet curvature center


Mandatory parameters:
curvature center coordinates (programmed
through axes positions)
MML: eyelet length
MMD: eyelet width
MMR: eyelet curvature radius
MMA: eyelet start position
MMB: eyelet end position
MMC: high retraction position
MME: safety distance
Type of machining management:
MMV: machining type
MMV = 0: roughing and finishing with
the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth

A
MMR
MML

6.3.9

MMG

AA, AB

MMD

MMC
MMS

MMK
MMH

MME

MMA

B
MMB

Optional parameters for rotation:


MPG: rotation angle relative to the first axis of plane
The rotation is executed around the eyelet center.
Optional parameters for machining allowance:
(MMS): allowance at roughing end.
Optional parameters for sinking:
(MMW): sinking mode
MMW = 0: sinking in a pre-hole centered in A or B, depending on the MML sign:
MML>0 sinking on point A
MML<0 sinking on point B
MMW > 0: sloped sinking with MMW oscillations between point A and point B
(MMF): sinking feed
Optional parameters for movement direction:
(MMJ): machining direction:
MMJ = 0: counterclockwise
MMJ = 1: clockwise

86

CNC Z32 - Programming guide (Milling Machines)

6.3.10 G802K10: Hole thread milling with a single flute end mill
Mandatory parameters:
hole center coordinates (programmed through
axes positions)
MMD: bottom of thread diameter
MMQ: hole diameter
MMA: machining start position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The
roughing machining ends on thread bottom
(MMD). On this diameter are executed the
MMN polishing passes.

MMA

MMD

MMP
MMQ

MMB

Optional parameters for safety distance:


(MME): safety distance on thread top and bottom. The approach (and retraction) to the
thread is executed in a fourth of thread; the MME diameter indicates the starting
diameter initiating the fourth of thread approach to the machining. For example, if the
internal diameter is 50, tool radius is 10 and MME is 2, the approach point is at
coordinates X0 Y13. If MME=0 a default safety distance of 2mm is assumed.
Optional parameters for polishing passes:
(MMN): number of polishing passes.
Optional parameters for last roughing pass:
(MMW): last roughing pass depth. If MMW=0, all roughing passes have the same pass
increment, less than or equal to MMK. If MMW>0, the last roughing pass has a MMW
depth.
Optional parameters for thread direction:
(MMJ): thread direction:
MMJ = 0 : right thread
MMJ = 1 : left thread

87

CNC Z32 - Programming guide (Milling Machines)

6.3.11 G802K11: Hole thread milling with a comb end mill


Mandatory parameters:
MMD
hole center coordinates (programmed through
MMA
axes positions)
MMD: bottom of thread diameter
MMQ: hole diameter
MMP
MMA: machining start position
MMB: machining end position
MMQ
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The
roughing machining ends on thread bottom
MMH
(MMD). On this diameter are executed the
MMB
MMN polishing passes.
MMH: comb height (mm or inches, depending
on machine setup)
MMS: threads overlap (number of threads). If
the area to be threaded is smaller than comb height, the threading may be executed in
a single turn (adding a fourth of turn approach and a fourth of turn retract); if the area to
be threaded is higher than comb height, the threading is executed in more than one
turn. After each turn, the comb is translated by a quantity equal to comb height minus
the programmed overlap.
Optional parameters for safety distance:
(MME): safety distance on thread top and bottom. The approach (and retraction) to the
thread is executed in a fourth of thread; the MME diameter indicates the starting
diameter initiating the fourth of thread approach to the machining. For example, if the
internal diameter is 50, tool radius is 10 and MME is 2, the approach point is at
coordinates X0 Y13. If MME=0 a default safety distance of 2mm is assumed.
Optional parameters for polishing passes:
(MMN): number of polishing passes.
Optional parameters for last roughing pass:
(MMW): last roughing pass depth. If MMW=0, all roughing passes have the same pass
increment, less than or equal to MMK. If MMW>0, the last roughing pass has a MMW
depth.
Optional parameters for thread direction:
(MMJ): thread direction:
MMJ = 0 : right thread
MMJ = 1 : left thread

88

CNC Z32 - Programming guide (Milling Machines)

6.3.12 G802K12: Stud thread milling with a single flute end mill
Mandatory parameters:
stud center coordinates (programmed
through axes positions)
MMD: external diameter
MMQ: bottom of thread diameter
MMA: machining start position
MMB: machining end position
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The
roughing machining ends on thread bottom
(MMD). On this diameter are executed the
MMN polishing passes.

MMA

MMD

MMP
MMQ

MMB

Optional parameters for safety distance:


(MME): safety distance on thread top and
bottom. The approach (and retraction) to the thread is executed in a fourth of thread;
the MME diameter indicates the starting diameter initiating the fourth of thread
approach to the machining. For example, if the internal diameter is 50, tool radius is 10
and MME is 2, the approach point is at coordinates X0 Y37. If MME=0 a default safety
distance of 2mm is assumed.
Optional parameters for polishing passes:
(MMN): number of polishing passes.
Optional parameters for last roughing pass:
(MMW): last roughing pass depth. If MMW=0, all roughing passes have the same pass
increment, less than or equal to MMK. If MMW>0, the last roughing pass has a MMW
depth.
Optional parameters for thread direction:
(MMJ): thread direction:
MMJ = 0 : right thread
MMJ = 1 : left thread

89

CNC Z32 - Programming guide (Milling Machines)

6.3.13 G802K13: Stud thread milling with a comb end mill

MMH

Mandatory parameters:
MMD
stud center coordinates (programmed
MMA
through axes positions)
MMD: external diameter
MMP
MMQ: bottom of thread diameter
MMA: machining start position
MMB: machining end position
MMQ
MMC: high retraction position
MMP: thread pitch
MMK: pass depth for thread roughing. The
roughing machining ends on thread bottom
MMB
(MMD). On this diameter are executed the
MMN polishing passes.
MMH: comb height (mm or inches, depending
on machine setup)
MMS: threads overlap (number of threads). If the area to be threaded is smaller than
comb height, the threading may be executed in a single turn (adding a fourth of turn
approach and a fourth of turn retract); if the area to be threaded is higher than comb
height, the threading is executed in more than one turn. After each turn, the comb is
translated by a quantity equal to comb height minus the programmed overlap.
Optional parameters for safety distance:
(MME): safety distance on thread top and bottom. The approach (and retraction) to the
thread is executed in a fourth of thread; the MME diameter indicates the starting
diameter initiating the fourth of thread approach to the machining. For example, if the
internal diameter is 50, tool radius is 10 and MME is 2, the approach point is at
coordinates X0 Y37. If MME=0 a default safety distance of 2mm is assumed.
Optional parameters for polishing passes:
(MMN): number of polishing passes.
Optional parameters for last roughing pass:
(MMW): last roughing pass depth. If MMW=0, all roughing passes have the same pass
increment, less than or equal to MMK. If MMW>0, the last roughing pass has a MMW
depth.
Optional parameters for thread direction:
(MMJ): thread direction:
MMJ = 0 : right thread
MMJ = 1 : left thread

90

CNC Z32 - Programming guide (Milling Machines)

6.3.14 G802K14: Face milling


Mandatory parameters:
first vertex coordinates of rectangular area
(programmed through axes positions)
MMX: working plane first axis coordinate of
rectangular area second vertex.
MMY: working plane second axis coordinate of
rectangular area second vertex.
MMA: rapid approaching position
MMB: facing position
MMC: high retraction position

MMV=1

AA, AB

MMV=0 MMP

MMC

Optional parameters for pass overlapping:


(MMP): minimum overlapping between passes.
Values between 0.2 and 1.9 times the tool
radius. If MMP=0 the value MMP=0.2 times
tool radius is assumed

MMX, MMY

MMA MMB

Optional parameters for sinking feed:


(MMF): sinking feed If not programmed, or if equal to 0, the sinking feed assumes the F
value.
Optional parameters for pass increment:
(MMV): type of pass increment
MMV = 0 : the pass increment is executed in G1 on the internal side of working rectangle
MMV = 1 : the pass increment is executed in G0 on the external side of working rectangle
of 2mm.

91

CNC Z32 - Programming guide (Milling Machines)

6.4

Machine tool builders fixed cycles (G27C..)

Through the instruction G27C.. it is possible to activate a set of fixed cycles generally supplied by the machine tool
builder.
The syntax and usage of G27C.. instruction is the same as the G800K.. instruction.

G27C.. must be followed by the number of cycle to activate (ex. G27C1)

When the fixed cycle is activated, it will be executed after all successive rapid positioning.

The fixed cycle may be suspended through the instruction G27X (see description of G800 function).

The fixed cycle deactivations happens by means of the G27C0 instruction.

92

CNC Z32 - Programming guide (Milling Machines)

7.

PROFILES ON THE PLANE

The Z32 CNC offers an instruction set designed to solve computing problems of complex geometrical profiles.
It is possible to use the geometric instructions for complex profiles programming, only on the working plane
defined by G25.
All succeeding discussion assumes the plane X-Y as the working plane. To program profiles on different planes, it
is necessary to correctly program the G25 function, specifying the desired axes instead of X-Y.
A geometric profile is composed by the following elements:
-

points
linear segments
circular arcs
chamfers
fillets

Warning: When the G12 function (helical interpolation) is active, it is possible to coordinate a movement
along the third axis direction specified by G25, with any profile element.
Some preliminary notes:

A defined point is any point programmed on the plane or computed by Z32. A defined point may be
the starting or end point of an element.
An element is a line segment or a circular arc, and may be open or closed.
A line or a circle are defined as closed elements when their final point is known.
A line or a circle are defined as open elements when their end point is not defined, but will be
computed as intersection with the succeeding element.
Each element may terminate with a chamfer (only linear elements) or with a fillet.

As discussed with more detail in the following, the parameters used to define geometric elements are the following:

Element end point. Programmed with the axis name and corresponding position, i.e. X and Y.
Arc center coordinates. Programmed with the parameters I and J, where I is the coordinate related
to the first axis of working plane and J the coordinate related to the second axis.
Arc radius. Programmed with the RA parameter, always positive.
Element final slope. Programmed with the QF parameter, expressed in degrees and considering the
following figure:

QF > 0

QF < 0
-270 > QF > -360

0 < QF < 90
-180 > QF > -270

90 < QF < 180


QF

180 < QF < 270

270 < QF < 360

-90 > QF > -180

Fillet radius. Programmed with the parameter RR, with sign.


RR>0 counterclockwise fillet (G3)
RR<0 clockwise fillet (G2)
Fillet choice parameter. Programmed with KA parameter:
KA0 short fillet
KA1 long fillet
Chamfer. Programmed with the parameters RB and QA.

93

0 > QF > -90

CNC Z32 - Programming guide (Milling Machines)

Arc length in degrees or auxiliary slope. Programmed with QA parameter, expressed in degrees as for
parameter QF. It is used in two cases:
To define the length in degrees of a circular arc.
To define the slope of a line in the combinations line-circle G1 G2/G3.
Intersection choice. Programmed with KA parameter:
The end point of an open element may be computed through its intersection with the succeeding element.
If at least one of the elements is a circle, two different solutions are possible.
Observing the movement with reference to the first programmed element, one of the solutions turns to the
right while the other turns to the left.
The correct solution is chosen with the KA parameter:

KA0

KA1

KA0 (turns to the left)


KA1 (turns to the right)
KA0

KA1

By programming KA in a block where it is not required, it is ignored with no alarm issued; KA0 may be
omitted.
The radius sign of a fillet decides the intersection to be chosen; thus in most cases by programming a fillet
radius eliminates the need to choose an intersection with KA.

RR>0

RR<0

RR>0 counterclockwise fillet (G3)


RR<0 clockwise fillet (G2)

RR>0

RR<0

94

CNC Z32 - Programming guide (Milling Machines)

7.1

Closed lines

A line is defined as closed when its end point is defined.

7.1.1 Line end point (G1 X.. ; G1 Y.. ; G1 X.. Y..)


The end point may be defined with one or two coordinates:
G1 X..
G1 Y..
G1 X.. Y..
If the end point is defined with only one coordinate, a line parallel to one axis is specified.
If the end point is defined with two coordinates, a sloped line is specified.
The line may originate from another defined point.
The line may originate from an open circle; in this case a tangent condition with the circle is forced. In this case the
end point must be defined with both coordinates and must be external to the circle, otherwise the error CN3314 is
issued.
The line cannot originate from an open line.
Y
R10

G0 X40 Y0
G1 X20 Y20
X10
Y30
G3 I0 J30
G1 X-20 Y20
X-40
Y0

30
20

-40

-20

10

40

20

7.1.2 Line end coordinate and slope (G1 X..QF.. ; G1 Y..QF..)


G1 X.. QF..
G1 Y.. QF..
The line must originate from a defined point. Starting from the known starting point, the programmed coordinate is
reached with an element having QF slope.
Y

G0 X40 Y0
G1 Y10
Y30 QF120
X15
X0 QF210
Y40 QF135
X-40
X-50 QF-120
Y0

40
45

30

30
30

30

10
0

-50

-40

15

40

95

CNC Z32 - Programming guide (Milling Machines)

7.1.3 Line two coordinates end point and slope (G1 X.. Y.. QF..)
G1 X.. Y.. QF..
The programmed end point is reached with an element having programmed slope QF.
The preceding element must be an open circle or an open line.
If the preceding element is closet, an error is issued.
The line starting point is computed by intersecting the line with the preceding element.
If the preceding element is a circle, there are two possible intersections. In order to choose between the two
solutions it is possible to use the KA parameter, or to define a very small signed fillet.

G0 X50 Y0
G3 I35 J0 KA1 (or RR-0.0001)
G1 X0 Y30 QF150
X-10
G2 I-25 J30 KA1 (or RR-0.0001)
G1 X-40 Y40 QF100

40
30
30

10

R15

R15

-40

-25

-10

50

35

All closed lines may be terminated or be preceded by a fillet RR or by a chamfer RB, if the preceding or the
following elements are lines.
Y

40
R5

R10

30

R10

30

10

R15

G0 X50 Y0
G3 I35 J0 RR-5
G1 X0 Y30 QF150 RR10
X-10 RR5
G2 I-25 J30 RR-10
G1 X-40 Y40 QF100

R15

R5

-40

-25

-10

35

50

96

CNC Z32 - Programming guide (Milling Machines)

7.2

Open lines (G1 ; G1 QF..)

Open lines are defined only as direction and must then originate from a defined point, represented by a rapid
movement, the end point of a closed line or of a closed circle.
The line end point is computed by intersecting the line with the succeeding element. The succeeding element must
be an open element, line or circle. It cannot be a closed element.
If the succeeding element is a circle, there are two possible intersections.
To choose the intersection desired, the KA parameter must be used.
KA0 : turns to the left (default setting if KA is not programmed)
KA1 : turns to the right.
The desired intersection may be chosen also by inserting a fillet with a very small signed radius (i.e. RR0,0001 or
RR-0,0001)
The syntax for an open line is as follows:
G1 QF.. (known slope line)
G1 (continuing line)
The continuing line has the same slope as the preceding element.
If programmed after a closed line definition with end coordinates and angle, it defines a line of known slope, with
start and end points unknown, but with an intermediate known point.
Example:
Y

10

10

G0
G1
G3
G1
G1
G3
G1

15
5
0

R15

R15

-80

-30

80

30

10

10

G0
G1
G3
G1
G1
G3
G1

15
10

5
0

R15

R15

-80

-30

X-80 Y15
QF-10 KA1
I-30 J0 RA15 KA1
X0 Y5 QF0
KA1
I30 J0 RA15 KA1
X80 Y15 QF10

80

30

X-80 Y15
QF-10 RR-0.0001
I-30 J0 RA15 RR-0.0001
X0 Y5 QF10
RR-0.0001
I30 J0 RA15 RR-0.0001
X80 Y15 QF10

If programmed after a closed circle with center coordinates, radius and final slope, it defines a line tangent to the
preceding circle, and sloped by QF degrees.
Y
30
45

20
R12

R2
R2

R2

5
0
45

R15

R15
-55

-45

-25

25

55

97

G0
G1
G1
G3
G1
G1
G3
G1
G1

X-55 Y30
X-45 Y20
RR-2
I-25 J0 RA15 RR-2
X0 Y5 QF0
RR-2
I25 J0 RA15 QF45
RR12
X55 Y30 QF90

CNC Z32 - Programming guide (Milling Machines)

7.3

Closed circles

Z32 considers closed circles all circular arcs terminating on a point with known coordinates.

7.3.1

Circle center and end point (G2/G3 I..J..X..Y..)

G2 I.. J.. X.. Y..


G3 I.. J.. X.. Y..
The circle is defined by the end point coordinates (XY) and center point coordinates (IJ).
The circle may originate from a defined point programmed before the circle, from an open line or from an open
circle.
If the starting point doesnt belong to the circle, an error CN3214 is issued.
If the circle originates from an open line or circle, the KA parameter must be used to choose the desired
intersection.
KA0 : turns to the left (default setting if KA is not programmed)
KA1 : turns to the right.
It is otherwise possible to choose the intersection by programming a fillet with very small signed radius.

Y
15
R15
R15

-30

R15

-15

15

G0
G3
G2
G3

X30 Y0
X15 Y15 I15 J0
X-15 Y15 I0 J20
X-30 Y0 I-15 J0

30

G0 X-50 Y10
G1 QF10
G3 X50 Y30 I30 J30 KA1 (or RR-0.0001)

Y
30

10

10

-50

30

50

98

CNC Z32 - Programming guide (Milling Machines)

7.3.2 Circle end point and radius (G2/G3 X..Y..RA..)


Circle defined by end point coordinates and radius.
G2 I.. J.. RA..
G3 I.. J.. RA..

If the circle originates in a defined point, it solves the problem of a circle passing between two points with a given
radius.
If the circle originates in an open line, a tangent condition is forced and the rotation direction is chosen in such a
way the exit is tangent to the line, independently from the programmed G2/G3.
If the preceding element is an open circle, an error is issued.

Y
30
R50

R5
G0 X40 Y0
G42 X30 Y0 QF90
Y30 RR4
G2 X-30 Y30 RA50 RR4
G2 X-30 Y-30 RA50 RR4
G2 X30 Y-30 RA50 RR4
G1 Y0
G40 X40 Y0

R4

R4

R50
R4

R4
R50

-30

-30

30

If the circle originates in an open line, a tangent condition is forced and the rotation direction is chosen in such a
way the exit is tangent to the line, independently from the programmed G2/G3.

Y
30

R15
G0
G1
G1
G2
G1

30
5
0

20

50

99

X50 Y0
Y5
QF150
X20 Y30 RA15 (or G3)
X0

CNC Z32 - Programming guide (Milling Machines)

7.3.3 Circle center, radius and end slope (G2/G3 I..J..RA..QF..)


Circle defined by center point coordinates, radius and final slope.
G2 I.. J.. RA.. QF..
G3 I.. J.. RA.. QF..
The preceding element must be an open line or circle; if it is a closed element, an error is issued.
This geometric definition is useful to define in the subsequent block a line tangent to the circle, with the same
slope.
Y
R15

30
45

G0 X-10 Y0
G1 QF90 RR5
G2 I0 J30 RA15 QF-45
G1 RR-5
X40 Y0 QF-90

R5
R5
0

-10

40

7.3.4 Circle center and end slope (G2/G3 I..J..QF..)


Circle defined by center point coordinates and final slope.
G2 I.. J.. QF..
G3 I.. J.. QF..
The circle must originate from a defined point or from an open line.
If the preceding element is an open circle, an error is issued.
If the preceding element is an open line, this geometry solves the problem of a circle with known center, tangent to
a line. In this case a tangent condition is forced and the rotation direction is chosen in such a way to exit tangent to
the line, independently from the programmed G2/G3.
Y

G0 X0 Y0
G1 QF45
G3 I40 J20 QF-45
G1 RR-5
X65 Y0 QF-90

45

20
45

R5

40

65

100

CNC Z32 - Programming guide (Milling Machines)

If the preceding element is closed, a circle with center in a known point, passing through another known point is
obtained.
Y

10

G0
G1
G2
G1

R3
0

10

X30 Y10
X10 RR3
I0 J0 QF90
Y10

30

7.3.5 Circle radius and end slope (G2/G3 RA..QF..)


The circle has known radius and final slope.
G2 RA.. QF..
G3 RA.. QF..
The circle must originate from a defined point and slope; it is therefore a circle tangent to the preceding element.
Circle with known radius, tangent to a line in a known point:
Y
R10
30

G0
G1
G2
G1
0

X0 Y0
X30 Y30
RA10 QF-90
Y0

30

Circle with known radius, tangent to a circle in a known point:


Y
R10
R5
R15

45

G0 X-30 Y0
G1 X-15 RR3
G2 I0 J0 QF-45
G3 RA10 QF45
G1 RR-5
X50 Y20 QF0

20

R3
0

45

-30

-15

50

101

CNC Z32 - Programming guide (Milling Machines)

7.3.6 Circle end point (G2/G3 X..Y..)


Circle with known end point, tangent to previous and next elements The correct rotation direction is forced,
independently from G2/G3 programming.
G2 X.. Y..
G3 X.. Y..
If a G1 movement is programmed after this circle, a movement tangent to the circle is obtained.
Y
30
20

-50

-30

-10

G0 X-50 Y30
G1 X-30
G2 X-10 Y20
G3 X10 Y20
G1 RR-1
X50 Y30 QF0

50

10

Y
30

10
0

-50

-30

-10

10

30

G0
G1
G2
G3
G2
G1

X-50 Y30
X-30
X-10 Y10
X10 Y10
X30 Y30
X50

50

7.3.7 Circle center and end arc length (G2/G3 I..J..QA..)


Circle originating from a defined point or from an open line, with known center, tangent to preceding element, with
arc length equal to QA degrees.
G2 I.. J.. QA..
G3 I.. J.. QA..
If the circle originates in an open line, a tangent condition is forced and the rotation direction is chosen in such a
way to exit tangent to the line, independently from the programmed G2/G3.
90

30

G0 X-50 Y30
G1 QF0
G2 I-20 J20 QA90
G3 I0 J20 QA135
G1
X50 Y30 QF0

20

135

-50

-20

50

102

CNC Z32 - Programming guide (Milling Machines)

7.4

Open circles

Z32 considers as open circles all circular arcs whose end point is computed by the intersection with next element.
7.4.1 Circle center and radius (G2/G3 I..J..RA..)
The preceding element, line or circle, must be open.
G2 I.. J.. RA..
G3 I.. J.. RA..
The intersections between a line and a circle or between two circles are generally two. The programming of KA
parameter allows to choose the desired intersection.
KA0 : turns to the left (default setting if KA is not programmed)
KA1 : turns to the right.
The desired intersection may be chosen also by inserting a fillet with a very small signed radius (i.e. RR0,0001 or
RR-0,0001)
Next element may be a point external to the circle (in this case a tangent condition is forced) or another open or
closed circle, or a closed line.
The intersection choice criteria with next element may be the programming of KA parameter, or a small signed fillet
radius.
Y
40
20

30

R20

20

-50

-10

G0
G1
G1
G3
G1

X-50 Y0
Y20
QF0 RR-0.0001
I-10 J30 RA20 RR-0.0001
X50 Y40 QF20

G0
G1
G1
G3
G3
G1

X-50 Y0
Y20
QF0 RR-0.0001
I-10 J30 RA20 RR-0.0001
I15 J40 RA20
X50 Y40

50

Y
40
R20

30

R20

20

-50

-10

15

50

103

CNC Z32 - Programming guide (Milling Machines)

7.4.2

Circle center (G2/G3 I..J..)

G2 I.. J..
G3 I.. J..
The preceding element may be a defined point or an open line.

Y
40

G0
G1
G1
G2
G1
G2
G1

28
20
30

15
10

X
0

-60

-33

-20

X50 Y0
Y10
QF150
I15 J15 KA1 (or RR-0.0001)
X-20 Y20 QF180
I-33 J28
X-60 Y40

50

15

45

20

10

R30
0

-10

-10

-55

-20

G0
G1
G2
G3
G2
G1

20

30

40

X60 Y-10
X40 Y10
I30 J20 RR0.0001 (or KA0)
I0 J0 RA30 QF225
I-55 J20 RR-0.0001 (or KA1)
X-60 Y-10 QF180

60

-60

7.4.3

Circle radius (G2/G3 RA..)

G2 RA..
G3 RA..
The circle must originate from a defined point, possibly the end point of preceding line or circle. The circle starts
with the same slope as the preceding element.
Y

30

R1

R15

25

20
R1
R10

R10

30

-50

-20

60

20

104

G0
G1
G2
G1
G1
G2
G3
G1

X-50 Y0
X-20 Y30
RA10 RR1
X0 Y20 QF0
RR1
I20 J20 RA15 QF-120
RA10
X60 Y5

CNC Z32 - Programming guide (Milling Machines)

7.5

Line-circle combinations

This is an instruction generating a linear movement followed by a tangent circular movement.


G1 G2/G3 I..J..X..Y..
Line tangent to a circle defined by center and end point
G1 G2/G3 I..J..RA..
Line tangent to a circle defined by center and radius
G1 G2/G3 I..J..RA..QF..
Line tangent to a circle defined by center, radius and final slope
The three cases must originate from a defined point or from an open circle. In this latter case a tangent condition is
forced.
The line is tangent to the preceding open circle.
Y

20
R4
45
R10

10

R10

-50

-20

G0
G1
G1
G1
G1

X-50 Y0
G2 I-1 J20 RA10
G3 I30 J0 RA10 QF45
RR-4
X80 Y10 QF0

80

30

R30
50

0
R20

G0 X0 Y-10
G41 X0 Y-20 QF0
G3 I0 J0
G1 G3 I0 J50 RA30
G1 G3 I0 J0 RA20 QF0
G40 X0 Y-10

-10

G1 G2/G3 I..J..X..Y..QA..
Line with QA slope, tangent to a circle defined by center and end point
G1 G2/G3 I..J..RA..QA..
Line with QA slope, tangent to a circle defined by center and radius
G1 G2/G3 I..J..RA..QF..QA..
Line with QA slope, tangent to a circle defined by center, radius and final slope

105

CNC Z32 - Programming guide (Milling Machines)

The three cases must originate from an open line or from an open circle.
Y

R5
R30

30

45
R30
X

30

R5

-60

-40

40

106

G0 X-60 Y0
G41 X-70 Y0 QF-90
G3 I-40 J0 RR-5
G1 G3 I40 J0 RA30 QF225 QA-30
G1 RR-5
G1 G3 I-40 J0 RA30 QF-90 QA150
G40 X-60 Y0

CNC Z32 - Programming guide (Milling Machines)

7.6

Automatic fillets (RR..)

Fillets (connecting arcs) are inserted by programming the RR parameter representing the arc radius.
To insert a fillet it is necessary to consider that between a line and a circle, or between two not oriented circles, up
to 8 connecting arcs may exist.

The definition order of the two elements to be connected and the sign of the fillet radius allow to choose the desired
solution among those geometrically possible. The Z32 CNC chooses the solution warranting the rotation direction
concordance of the elements to be connected, and of the fillet itself.
The selection between the various solutions is made by using:
RR sign:
RR>0 : counterclockwise fillet (G3)
RR<0 : clockwise fillet (G2)
KA selection parameter:
KA0 : short fillet (default setting)
KA1 : long fillet
It is possible to insert a fillet between any two geometric elements, excluding the cases where the definition inhibit
the connection programming; it is not allowed, for example, to insert a connecting arc between already tangent
elements.
It is therefore possible to insert a fillet between:
- two linear open or closed elements
- a linear element and a circular element
- two intersecting circular elements
- two internal circular elements
- two external circular elements

107

CNC Z32 - Programming guide (Milling Machines)

Fillets between lines:


Y
20

G0 X0 Y0
G1 X20 Y20 RR-10
G1 X40 Y0

R10
0

40

20

Y
20

G0 X40 Y0
G1 X20 Y0 RR10
G1 X0 Y0

R10
0

40

20

Fillets between lines and circles


Y
20
R10
R6

G0
G1
G3
G1

R6

60

30

108

X0 Y20
X20 RR-6
I30 J20 X40 Y20 RR-6
X60

CNC Z32 - Programming guide (Milling Machines)

Fillets between circles


Y

R5

15
R15

G0
G1
G3
G3
G1

R15
R5

R5
0

-15

15

45

X-15 Y15
X0 RR-5
I15 J15 RR-5
I45 J15 RA15 RR-5
X75 Y15 QF0

75

Y
R10
R15

R15
G0
G2
G2
G2

X-35 Y0
I-20 J0 RR10
I20 J0 RA15 RR-70
I-20 J0 X-35 Y0

R70

-20

20

KA selection parameter
The KA selection parameter define if the desired connecting arc is a long or short fillet.
KA0 (short fillet)
KA1 (long fillet)
Usually the correct choice is the short fillet; this is also the Z32 default choice.
In some cases it may be necessary to choose the long connecting arc, for example in connecting two external
circular elements.
R40

R15

(short fillet)
G0 X0 Y-15
G1 QF180
G2 I-20 J0 RA15 RR-40 (KA0)
G2 I20 J0 RA15 QF180
G1 X0 Y-15

R15

-20

20

109

CNC Z32 - Programming guide (Milling Machines)

R40

R15

R15

-20

20

110

(long fillet)
G0 X0 Y-15
G1 QF180
G2 I-20 J0 RA15 RR-40 KA1
G2 I20 J0 RA15 QF180
G1 X0 Y-15

CNC Z32 - Programming guide (Milling Machines)

7.7

Chamfers

Chamfers are inserted at the end of the element, by programming the RB parameter, representing chamfer length
along the line element where RB is programmed.
If only RB is programmed, a symmetrical chamfer is assumed; if RB is programmed with QA, an asymmetrical
chamfer is assumed, following the rule:
Second element length / RB = tangent of QA
Chamfers may be programmed only between linear elements.
10

Y
30

10

G0 X30 Y0
G1 Y30 RB10
G1 X0

5.77
10

30

X
0

30

Y
30

G0 X30 Y0
G1 Y30 RB10 QA30
G1 X0

10

30
0

30

0
Y
10

30

10

G0 X0 Y0
G1 X30 Y30 RB10
G1 X60 Y0

30

30

G0 X0 Y0
G1 X30 Y30 RB10 QA30
G1 X60 Y30

5.77

60

111

60

CNC Z32 - Programming guide (Milling Machines)

8.

DISK FILES RECALL

8.1

Machining of files generated by CAD-CAM systems

When it is necessary to machine a file generated by CAD-CAM systems it is preferable to create a file recalling the
desired part-program to be executed, where all technological parameters relative to the machining are specified.
That means that the CAM file contains only machine movements, while the recalling file contains all settings related
to machining technological parameters: origin recall, tool recall, feed and speed setting, etc.
For example, suppose the CAM generated file has the name TEST.ISO, saved in the folder C:\Z32\PPG\CAM.
The launcher file may be also saved on the hard disk, in the same folder as TEST.ISO.

8.2

DNC disk program recall ( !:L254 ! )

Through the instruction !:L254! contained in an advanced line, it is possible to execute a program of any
dimension, stored on the hard disk.
The syntax is as follows:
!:L254 {program name}!
The program name may contain a full path specification.
For example, to recall the file TEST.ISO stored in folder C:\Z32\PPG\CAM, it is possible to write the instruction:
!:L254-C:\Z32\PPG\CAM\TEST.ISO!
If the launcher file is residing in the same folder of the called file, it is possible to omit the path specification.
For example, if the folder C:\Z32\PPG\CAM contains both TEST.ISO and its calling file TESTLAUNCH, the calling
instruction may the following:
!:L254-TEST.ISO!
Warning: the program files called in DNC mode must terminate with the subprogram end instruction G26. If
the program ends with the M2 instruction, the execution terminates without return to the calling program.
It is possible to organize the machining by calling more than one DNC file.
For example, suppose the folder C:\Z32\PPG\CAM contains the two files part1.iso and part2.iso. It is possible to
create a recall file for both machining with a content like the following:
OX1 OY1 OZ1 (origin 1 valid for part1.iso)
T5 M6 (tool for part1.iso)
F1500 S5000 M3 (feed and speed for part1)
G0 Z100 (initial approach)
!:L254-part1.iso!
OX2 OY2 OZ2 (origin 2 valid for part2.iso)
T8 M6 (tool for part2.iso)
F3000 S4000 M3 (feed and speed for part2)
G0 Z100 (initial approach)
!:L254-part2.iso!
G0 Z100 (final retract)
M2

112

CNC Z32 - Programming guide (Milling Machines)

Warning:
A program called by the instruction !:L254! cannot in turn call a program with the same instruction
!:L254!
A program called by the instruction !:L254! may call CMOS subprograms, or subtemp by means of
instructions !GOP...! or !GOS...!
A program called by the instruction !:L254! may contain the jump instruction !GON..!, repetition --DO
--LOOP and conditioning !IF..! and --IF.

8.3

Some note on the DNC part-program

initial % character not allowed


the program must not have the first character % (therefore the initial comment, if existing, must be enclosed in
parenthesis).
termination with G26
the program must terminate with the G26 instruction (subprogram return).
GON and GON-N jumps allowed with restrictions
The jumps, executed with GON or GON-N instructions, are allowed also for DNC programs, but with a length
limit for the jump, which cannot extend beyond the file section contained in the Z32 internal memory.
If the jump destination results external, the destination line is not found, provoking a programming error.
- a backward GON cannot jump more than 20.000 characters before any line already executed.
- the file initial line may not be found as destination of a backward jump: if necessary, insert a comment of
at least 4 characters at the beginning of file, to allow the following line to be found.
- a forward GON cannot jump more than 40.000 characters after the starting line
- both lines of GON-N instruction must respect the above conditions
Please note that the quantities of 20.000 and 40.000 contain a certain safety margin; it is therefore possible in
some cases, depending on character transmission speed, to find also farther lines. It is also important to note
that this behavior may be uncertain; D.Electron recommends to limit the distance of destination lines
inside the safety zone.

113

CNC Z32 - Programming guide (Milling Machines)

9.

HIGH SPEED SETTING

It may be useful to use the high speed functions offered by the Z32 CNC, when executing files generated by CADCAM systems.
Warning: in the following discussion it will be assumed that the motion control function G113X (or its
evolution G113X KA1) is available to the customer.
The functions to be used are:
- G114
- G113X (or its evolution G113X KA1)
- G113A (or its evolution G113B)
- G135

9.1

High speed activation: G114 RA..K..J..I..HY..HR..

The "RA" parameter represents the tolerance, expressed in mm or inches, used to round the edges. The
programming range varies from 0.0000625 mm (1/16 micron or 0,0000025 inches) to 2 mm (0.08 inches).
Warning: high values of RA (higher than 0.015mm) are reserved to roughing due to
possible differences between adjacent passes.
In finishing it is preferable to limit the RA programming field between 0.001 mm (0.00004
inches for very fine surfaces with high curvature changes) and 0.015 mm (0.0006 inches
for smoother surfaces).
A generally valid finishing value is RA = 0.005 mm (0.0002 inches).
Note: The deviation from ideal trajectory is higher for small curvature radius. On straight
angles edges, the deviation may be 4 times the RA value.

The K parameter represents the maximum allowed trajectory acceleration, expressed in mm/s . This
value may be equal or lower than the acceleration defined in the machine setup.
Warning: The K parameter of G114 doesnt have any effect on rapid movements; on
these movements only the setup values remain active.
2
Please note that K is expressed in mm/sec also on inches programmed machines.
No effect is produced if the K parameter requires acceleration values higher that those
expressed in the machine setup; lower acceleration values are instead allowed with the
aim to obtain still smoother movements, with related better finishing.
If K is not programmed, the limit of setup acceleration remain valid.

The J parameter represents the machine softness factor. This value is an integer parameter in the range
0 to 6 and may be up to one unit lower than the value defined in machine setup.
Warning: The J parameter of G114 doesnt have any effect on rapid movements; on
these movements only the setup values remain active.
If J is not programmed, the setup value remain active.
In defining the optimal value, please consider that J intervenes in all critical profile situations:
- allows softer accelerations and decelerations
- decelerates further on edges and points with curvature changes
Synthetically, an higher J increases machining time, but produces workpieces with a better finishing.
The suggested usage of J parameter is:
- dont program J for a normal machining (the J factor defined by machine tool builder remain active)
- program a lower J if a lower machining time is desired
- program an higher J if a better finishing is desired

114

CNC Z32 - Programming guide (Milling Machines)

The I parameter represents the minimum feed on profile edges. In computing the deceleration necessary
to execute profile edges, the I parameter expresses the minimum velocity imposed on the axes by the
CNC.
A common value for I parameter is 30 mm/min.
Higher values may spare machining time, but the workpiece may be "marked" on internal edges.
Lower values are normally not necessary.
The HY and HR parameters are used only if G113A (or G113B) is programmed. The HR and HY
parameters are connected to the algorithm for recomposing curves defined by a series of points, activated
by G113A (or G113B). During curve reconstruction, starting from CAM generated points, the CNC
recomposes the best continue and smooth trajectory as possible.
Warning: G113A (or G113B) functions must be used only on part-programs typically generated
by CAM systems. When the program is defined by means of geometrical elements, the function
G113A (or G113B) must not be used.
HY maximum length of segment to be rounded
It must be used only on part-programs defined by a series of points, when the function G113A or
G113B (rounding command) is active.
The parameter is not considered on part-programs defined composed of circular arcs or NURBS.
HY is the maximum length a segment may have in order to be considered as roundable. Longer
segments are not rounded.
HY can assume a maximum value of 6mm. Higher values are limited to the 6mm value.
The length of a segment is obtained as the square root of the sum of squares of single axes
movements. It is expressed in mm (or inches for machines programmed in inches) for linear axes, and
in degrees for rotating axes.
In case of mixed movements (with both linear and rotating axes) a measuring unit cannot be defined,
but the number expressing the total segment length is always computed with the square root of the
sum of squares of movements.
On machines programmed in inches the behavior is identical to that of a mm machine, considering the
conversion factor (25.4) between inches and millimeters.
Therefore, for an inches machine:
- maximum HY value: 6/25.4 = 0.2362
At reset and program start, HY is initialized with the setup value.
The HY parameter is normally set to its maximum (6mm).
A lower HY value may be useful if the CAM generating the profile has been set for a maximum chordal
length (always lower than 6mm). In this case, a HY value a little bit higher (i.e. +20%) than the CAM
maximum chordal length, may discriminate not roundable segments, having higher lengths.
HR maximum chordal distance for rounding
Only used on part-programs defined by a series of points, when the function G113A or G113B
(rounding command) is active.
The parameter is not considered on part-programs defined composed of circular arcs or NURBS.
HR is the maximum distance from the programmed linear segment allowed by G113B.
HR has the same measuring units as HY.
In case of inches programming and rotating axes movement, the same computing methods of HY are
valid.
At reset and program start, HR is initialized with a fixed value of 0.08mm.
The optimum choice of HR value is the maximum chordal error used by the CAM to generate the tool
center trajectory.

115

CNC Z32 - Programming guide (Milling Machines)

Warning: Some CAM systems compute the chordal error on workpiece surface, and not on
tool center. In these cases, for an external curvature, the chordal error seen by the CNC on
the tool center trajectory is increased by the two curvatures ratio.
In these cases, the best compromise is to set a HR value much higher then the
corresponding CAM value.
In summary:
- if the CAM limits the chordal error on tool center path, HR must be set equal to the CAM
chordal error
- if the CAM limits the chordal error on workpiece surface, HR must be much higher than the
CAM chordal error (up to 10 times higher)
It is clear that the latter situation is far from ideal: it is good practice to try to force the CAM
to measure its chordal error on the path considered by the CNC and not on workpiece
surface.

The machine setup defines standard values to be used by the G114 function.
To restore the machine setup values for G114, program:
G114 KA0
To deactivate the high speed settings activated by G114m program:
G115

9.2

Movement control function: G113X (KA1)

The high speed settings must consider the activation of G113X (or G113X KA1) function.
These functions affect the control of machine movement. The G113X KA1 function is an evolution of G113X; its
usage is preferable, if available.
The functions G113X and G113X KA1 consider the possibility to execute an auto-tuning on the machine axes.
The setup for G113X is made through G125.
The setup for G113X KA1 is made through G125 KA1.
The G125 function allows to execute the axes setup in a simple and automatic way, every time an optimal machine
setup is desired for a given machining configuration.
For programming conventions on automatic setup done by G125, please consult the machine tool builder, or the
high speed manual.

Warning: depending on machine setup, it is possible to activate G114 and G113 functions (or its evolution
G113KA1) at reset. In this case it is not necessary to activate the functions by programming, if the setup
configuration is desired.

9.3

Recomposing curves from a series of points: G113A (or G113B)

This paragraph discusses tool paths programmed as a series of points (only linear segments).
The finishing required by todays high speed machines, where a few micron difference between adjacent passes
are often detectable as defects, is possible only if the trajectory errors are very small, because only a few micron of
error may be clearly seen on the machined surface.
It is therefore useful:
- a CAM generating an adequate number of points, with sufficient precision, to the CNC

116

CNC Z32 - Programming guide (Milling Machines)

- a CNC interpolating between the received points not using linear segments, but curves more similar as possible
to the original curve.
The curve interpolation may be not necessary if the CAM generates a very high number of points, but this may lead
to an increase in CAM computing time and to very large part-programs.
In order to re-construct the curve (a process called rounding), the function G113A (or G113B) must be used,
utilizing the HR and HY parameters programmed together with G114.
G113B is an evolution of G113A.
Some other rules used by Z32 to manage edges and rounding:
- all functions with stop (i.e. the M, or a G4 dwell) introduce an edge, thus provoking a temporary movement stop
- a G0 movement may never be rounded
- a circular arc interrupts the sequence of roundable segments.
- a segment longer than the HY parameter of G114, interrupts the sequence of roundable segments
On inches programmed machines, the behavior is identical to that of millimeter machines, because all programmed
positions for linear axes are converted from inches to millimeters before their usage.

9.4

CAM settings for point programs generation

It is very important that the strategy used by CAM to generate the series of points and the strategy used by Z32 to
reconstruct the curve trough G113A (or G113B) be compatible.
The path generated by the CAM is better if the following conditions are respected:
All programmed points belong to the curve to be reproduced
If the curve to be reproduced contains edges, each edge corresponds to a programmed point
Between two successive edges, at least three segments are present
The chordal error is computed on tool center path
Other settings are then user definable; in particular:
- decimals number
- maximum chordal error
- maximum chordal length
The effects of all these settings on overall performance are as follows.

Decimals number
Positive effects of an higher decimals number:
- better precision
- better finishing
- better execution velocity computing
Negative effects:
- higher size of generated file
- higher CAM computing time
- higher CNC computing time
A good finishing may require local precision in the micron range, therefore the CAM must compute at least
the micron, better if 4 decimals (one tenth of a micron) are produced.

Chordal error
The chordal error determines the quantity of points generated by the CAM.
For the best Z32 operation, the CAM should choice the points by maintaining approximately constant the
chordal error on tool path center, and the same chordal error used by the CAM be transferred to the HR
parameter in G114 activation.
A chordal error normally used may be of 5 micron, therefore HR 0.005.

117

CNC Z32 - Programming guide (Milling Machines)

The strategy to maintain a very small chordal error (1 micron or less) gives better results, but produces very
large part-programs. In this case, interpolation velocity problems may arise, mainly due to the DNC
transmission speed, and secondarily to the Z32 reading speed (very high).

9.5

Maximum chordal length


The maximum chordal length must be not higher than that manageable from Z32 for rounding purposes
(6mm), also if the CAM doesnt have any special setup value for chordal length.
The limitation on chordal length is very important with high chordal errors, because in this case it is very
easy to generate segments longer than the maximum allowed (6mm).
If the CAM generates segments longer than 6mm, these segments are not rounded, provoking a poorer
finishing.

Curve deceleration reduction: G135 I HX

When G113X (high speed) is active, Z32 controls and limits the jerk (acceleration derivate), due to both velocity
changes (when the CNC accelerates or decelerates on the path), and to curvature changes (edge, discordant linecircle or circle-circle).
The maximum allowable jerk is defined in machine setup and may be modified with the J parameter (softness
factor) of G114.
Through the function G135 it is possible to modify the CNC behavior in presence of path curvature changes. A
curvature change imposes a deceleration; for example, on a 90 degrees corner it is clear the necessity to
decelerate before executing the corner. By means of G135 the deceleration amount due to curvature changes may
be reduced in order to reduce the machining time.
The deceleration reduction imposed by curvature changes has both positive and negative effects, to be evaluated
for every single case.
Positive effects using G135
- Machining time reduction
- Lower feed variation during the machining process
Negative effects using G135
- Higher solicitations on machine structure and possible increase of following error
The optional increase of curvature jerk is obtained by programming the HX parameter, followed by a number
between 0 and 4, together with G135 I1.
G135 I1
G135 I1 HX0
G135 I1 HX1
G135 I1 HX2
G135 I1 HX3
G135 I1 HX4
G135 I0

no increase in curvature jerk


no increase in curvature jerk
curvature jerk increases by 2 times
curvature jerk increases by 4 times
curvature jerk increases by 8 times
curvature jerk increases by 16 times
Disables G135

To orient the choice, it is advisable to start by programming G135 I1 HX1, increasing the value up to 4, or
decreasing to zero, depending on the results; the correct value is function of machine dynamics and therefore not
easy to forecast.

118

CNC Z32 - Programming guide (Milling Machines)

9.6

High speed parameters settings (summary table)


CAM setting for chordal
error used in path
generation (mm)
Used only with G113B

Z32
high
speed
system activation

N10

G114

RA0.01

Chordal error
allowed on the
path (mm)
(edge rounding)

N20

G113B

N30

G113X KA1

HR0.02

HY6

Roundable segment
maximum length(mm)
Used only with G113B

Maximum acceleration
2
(mm/s )

K4000

J2

I30

Movement softness
factor.
Integer value.
Function of machine
setup.
MIN=0 MAX=6

Minimum
velocity
(mm/min)

Activates the
algorithm for curve
reconstruction

Activates the algorithm


for advanced motion
control.
Use only if enabled.

Deceleration
reduction due to
curvature changes.

N40

G135 I1 HX2

Higher values bring


to lower deceleration
(allowed values 0-4)

Value 0 = disabled
Value 1 = enabled

Note: Depending on the machine and on the available software versions, it is possible that not all functions are
available or appropriated for a given application. Please consult the machine tool builder for further information.

119

CNC Z32 - Programming guide (Milling Machines)

9.7

High speed parameters - examples

Example 1: Recalls a DNC program with G114, G113X KA1 and G113B active
T1M6
OX1 OY1 OZ1
F1000 S4000 M3
G0 Z200
(high speed settings)
G114 RA0.01 K2000 J2 I30 HY6 HR0.02
G113X KA1
G113B
(DNC launch)
!:L254-prog1.iso!
M2
Example 2: Recalls a DNC program with G114 and G113X KA1 active
T1M6
OX1 OY1 OZ1
F1000 S4000 M3
G0 Z200
(high speed settings)
G114 RA0.01 K2000 J2 I30
G113X KA1
(DNC launch)
!:L254-prog1.iso!
M2
Example 3: Recalls two DNC programs, with different settings for each program
T1M6
OX1 OY1 OZ1
F1000 S4000 M3
G0 Z200
(high speed settings)
G114 RA0.02 K4000 J2 HY6 HR0.04 I30
G113X KA1
G113B
G135 I1 HX2
(DNC launch)
!:L254-prog1.iso!
T4M6
F4000 S6000 M3
(high speed settings)
G114 RA0.005 K2000 J2 HY6 HR0.02 I30
(The G113X KA1 and G113B remain active)
G135 I0 (deactivates G135)
(DNC launch)
!:L254-prog2.iso!
M2

120

CNC Z32 - Programming guide (Milling Machines)

10.

PROGRAMMING EXAMPLES

10.1 Profile 1
Y

70

R20

65

R10

R20

30

R20

20
R15
0
X
0

100

25

OX1 OY1 OZ1 (uses origin 1)


T1 M6 (uses tool 1)
F1000 (machining to 1000 mm/min)
S2000 M3 (starts spindle rotation at 2000 rpm)
R5 (sets tool radius)
G0 Z10 (initial approach)
G0 X0 Y100
G0 Z2 (approach)
G1 Z-5 (sinking inside workpiece)
G41 X0 Y90 QF0 (profile approach)
G2 RA20
G1 X25 Y30 RR10
G1 QF-5 RR20
G2 I100 J20 RA20 QF180
G1 QF180 RR-15
G1 G2 I0 J70 RA20 QA65 QF0
G40 X0 Y100 (profile retract)
G0 Z10 (retract in Z)
M5 (spindle stop)
M2 (program end)

121

CNC Z32 - Programming guide (Milling Machines)

10.2 Profile 2
Y
R15
65
R18

45
40

R8
75

R7

10
0
60

R20
-20

R18

-40

-35

-20

OX1 OY1 OZ1 (uses origin 1)


T1 M6 (uses tool 1)
F1000 (machining to 1000 mm/min)
S2000 M3 (starts spindle rotation at 2000 rpm)
R3 (sets tool radius)
G0 Z10 (initial approach)
G0 X0 Y-20
G0 Z2 (approach)
G1 Z-5 (sinking inside workpiece)
G42 X0 Y-40 QF180 (profile approach)
G1 QF180 RR-18
G1 X-35 Y10 QF75
G1 RR7
G2 I-20 J40 RA18 RR15
G1 X50 Y45 QF0 RR-8
G1 QF-90 RR-8
G3 I50 J0 RA20 QF-60
G1
G1 X40 Y-40 QF-90
G1 X0
G40 X0 Y-20
G0 Z10 (retract in Z)
M5 (spindle stop)
M2 (program end)

122

40

50

CNC Z32 - Programming guide (Milling Machines)

10.3 Rotation
Y
50
A
B

45

Profile A:
OX1 OY1 OZ1 (origin 1)
T1 M6 S2000 M3
G0 Z10 (initial approach)
G0 X0 Y0 (initial positioning)
G1 Z-1 F100(approach)
F1000 (machining to 1000 mm/min)
G1 Y50
X20
Y0
X0
G0 Z10 (retract)
M2
Profile B:
OX1 OY1 OZ1 (origin 1)
T1 M6 S2000 M3
G0 Z10 (initial approach)
QR45 (rotation)
G0 X0 Y0 (initial positioning)
G1 Z-1 F100(approach)
F1000 (machining to 1000 mm/min)
G1 Y50
X20
Y0
X0
G0 Z10 (retract)
M2
Profile C:
OX1 OY1 OZ1 (origin 1)
T1 M6 S2000 M3G0
Z10 (initial approach)
IR20 JR50 QR45 (rotation)
G0 X0 Y0 (initial positioning)
G1 Z-1 F100(approach)
F1000 (machining to 1000 mm/min)
G1 Y50
X20
Y0
X0
G0 Z10 (retract)
M2

45

20

123

CNC Z32 - Programming guide (Milling Machines)

10.4 Translation
Y
50
A

20

DA50

Profile A:
OX1 OY1 OZ1 (origin 1)
T3 M6 S5000 M3
G0 Z10 (initial approach)
G0 X0 Y0 (initial positioning)
G1 Z-1 F100(approach)
F1000 (machining to 1000 mm/min)
G1 Y50
X20
Y0
X0
G0 Z10 (retract)
M2
Profile B:
OX1 OY1 OZ1 (origin 1)
T3 M6 S5000 M3
G0 Z10 (initial approach)
DA50 DB-25
G0 X0 Y0 (initial positioning)
G1 Z-1 F100(approach)
F1000 (machining to 1000 mm/min)
G1 Y50
X20
Y0
X0
G0 Z10 (retract)
M2

124

DB-25

CNC Z32 - Programming guide (Milling Machines)

10.5 Roto-translation 1
40

Y'

20

Y
0

X'

R10

R20

30

50
R10

R20

20
0

-20

Y ''

R20

R10
-50

30
R20

R10
0

X''

-20
40

30

100

50

OX2 OY2 OZ2 (origin 2)


T6 M6 S1500 M3
G0 Z10 (initial approach)
G0 X0 Y20 (initial positioning)
G1 Z-1 F100(approach)
F1000 (machining to 1000 mm/min)
G1 X30 RR20
G1 QF90 RR-20
DA50 DB50 QR30 (X Y system)
G1 X40 Y20 QF0 RR-10
G1 QF-90 RR-20
DA0 DB0 QR0 (X Y system)
G1 X100 Y0 QF-90
G1 RR-20
DA50 DB-50 QR-30 (X Y system)
G1 X40 Y-20 QF-90 RR-10
G1 QF180 RR-20
DA0 DB0 QR0 (X Y system)
G1 X30 Y-20 QF90 RR10
G1 X0 Y-20
G0 Z10 (retract)
M2

125

CNC Z32 - Programming guide (Milling Machines)

10.6 Roto-translation 2
B

A
X

Y
X

E
X

OX1 OY1 OZ1 (origin 1)


T21 M6 S5000 M3
G0 Z10 (initial approach)
(Profile A:)
N1
G0 X40 Y0 (initial positioning)
G1 Z-2 F50(approach)
F2000 (machining to 2000 mm/min)
G0 X40 Y0
G1 G3 I0 J0 X-10 Y0
G3 I0 J0
G1 X40 Y0
G0 Z5 (retract)
N2
(Profile B:)
DA80 DB80 QR45
!GON1-N2!
(Profile C:)
DA-80 DB80 QR135
!GON1-N2!
(Profile D:)
DA-80 DB-80 QR-135
!GON1-N2!
(Profile E:)
DA80 DB-80 QR-45
!GON1-N2!
M2

126

CNC Z32 - Programming guide (Milling Machines)

10.7

Mirroring 1
Y
0

30

60

20
B

A
R10

10
0

OX3 OY3 OZ3 (origin 3)


T12 M6 S3000 M3
G0 Z10 (initial approach)
(Profile A)
N1
G0 X60 Y10 (initial positioning)
G1 Z-3 F100(approach)
F2000 (machining to 2000 mm/min)
G1 G2 I30 J20 X40 Y20
G0 Z5 (retract)
N2
(Profile B)
QS90 (sets mirroring line Y)
G56 (activates mirroring along Y)
(recalls profile A)
!GON1-N2!
G55 (disables mirroring)
(Profile C)
QS0 (sets mirroring line X)
G56 (activates mirroring along X)
(recalls profile A)
!GON1-N2!
G55 (disables mirroring)
(Profile D)
QR180 (activates rotation of 180 degrees)
(recalls profile A)
!GON1-N2!
QR0 (deactivates the 180 degrees rotation)
M2

127

CNC Z32 - Programming guide (Milling Machines)

10.8 Mirroring 2

10

20

60

30

45

R10
X

OX2 OY2 OZ2 (origin 2)


T4 M6 S3000 M3
G0 Z10 (initial approach)
(Profile A)
N1
QR45 (45 degrees rotation)
G0 X60 Y10 (initial positioning)
G1 Z-3 F200(approach)
F2000 (machining to 2000 mm/min)
G1 G2 I30 J20 X40 Y20
G0 Z10 (retract)
N2
(Profile B)
QS45 (sets mirroring line to 45 degrees)
G56 (activates mirroring)
(recalls profile A)
!GON1-N2!
G55 (disables mirroring)
(Profile C)
QS135 (sets mirroring line to 135 degrees)
G56 (activates mirroring)
(recalls profile A)
!GON1-N2!
G55 (disables mirroring)
M2

128

CNC Z32 - Programming guide (Milling Machines)

10.9 Third axis turnover

OX1 OY1 OZ1 (uses origin 1)


T1 M6 (uses tool 1)
F1000 (machining to 1,000 mm/min)
S2000 M3 (speed 2000 rpm)
R5 (sets tool radius)
G0 Z10 (initial approach)
G0 X0 Y0
G1Z0
--DO
Y<Y+1>
G1 X10 Z10
X30 Z0
X40
Y<Y+1>
X30
X10 Z10
X0 Z0
--LOOP 9
G0 Z10 (retract in Z)
M5 (spindle stop)
M2 (program end)

OX1 OY1 OZ1 (uses origin 1)


T1 M6 (uses tool 1)
F1000 (machining to 1,000 mm/min)
S2000 M3 (speed 2000 rpm)
R5 (sets tool radius)
KT-1
G0 Z10 (initial approach)
G0 X0 Y0
G1Z0
--DO
Y<Y+1>
G1 X10 Z10
X30 Z0
X40
Y<Y+1>
X30
X10 Z10
X0 Z0
--LOOP 9
G0 Z10 (retract in Z)
M5 (spindle stop)
M2 (program end)

129

CNC Z32 - Programming guide (Milling Machines)

10.10 Angular repetition of a profile


Y

45

OX1 OY1 OZ1 (origin 1)


T2 M6 S3000 M3
G0 Z10 (initial approach)
R3
--DO ; repetitions start
G0 X35 Y0
G1 Z-1 F100(approach)
F2000 (machining to 2000 mm/min)
G41 X40 Y0 QF90
G1 Y10 RR5
G1 QF-165 RR5
G1 X20 Y0 QF-90
G1 RR5
G1 X40 Y-10 QF-15 RR5
G1 X40 Y0
G40 X35 Y0
G0 Z10 (retract)
QR<QR+45> (increases rotation by 45 degrees)
--LOOP 7 ; repeat 7 times
M2

130

CNC Z32 - Programming guide (Milling Machines)

10.11 Linear repetition of a profile

OX1 OY1 OZ1 (origin 1)


T8 M6 S3000 M3
G0 Z10 (initial approach)
--DO ; repetitions start
G0 X35 Y0
G1 Z-2 F300(approach)
F3000 (machining to 3,000 mm/min)
G41 X40 Y0 QF90
G1 Y10 RR5
G1 QF-165 RR5
G1 X20 Y0 QF-90
G1 RR5
G1 X40 Y-10 QF-15 RR5
G1 X40 Y0
G40 X35 Y0
G0 Z5 (retract)
DA<DA+30> (increases translation by 30)
--LOOP 2 ; repeat 2 times
M2

131

CNC Z32 - Programming guide (Milling Machines)

10.12 Profile 1 repetition with various depths

OX1 OY1 OZ1 (uses origin 1)


T1 M6 (uses tool 1)
F1000 (machining to 1,000 mm/min)
S2000 M3 (starts spindle rotation at 2000 rpm)
R5 (sets tool radius)
G0 Z10 (initial approach)
G0 X0 Y100
G0 Z2 (approach)
G1 Z-2 (sinking inside workpiece)
--DO ; repetitions start
G41 X0 Y90 QF0 (profile approach)
G2 RA20
G1 X25 Y30 RR10
G1 QF-5 RR20
G2 I100 J20 RA20 QF180
G1 QF180 RR-15
G1 G2 I0 J70 RA20 QA65 QF0
G40 X0 Y100 (profile retract)
G1 Z<Z-5> (decreases Z by 5 on each repetition)
--LOOP 10; execute 10 repetitions
G0 Z10 (retract in Z)
M5 (spindle stop)
M2 (program end)

132

CNC Z32 - Programming guide (Milling Machines)

10.13 Finishing of a spherical surface

OX1 OY1 OZ1 (origin 1)


T3 M6 S3000 M3
G0 Z10 (initial approach)
F10000
G0X-1000 Y-1000
G0 Z-1
(HA: sphere radius)
(HB: initial angle)
(HC: final angle)
(HD: angular increment)
HA100 HB0 HC60 HD4
G0 X0Y0Z0
N1
HE<HA*CSHB>
HF<HA*SNHB>
G1 X<HE> Y0 Z<-HF>
G3 I0 J0 X<X> Y0
HB<HB+HD>
!IF HC>HB;GON1!
G0 Z100
M2

133

CNC Z32 - Programming guide (Milling Machines)

10.14 Ellipse

OX1 OY1 OZ1 (origin 1)


T3 M6 S3000 M3
G0 Z10 (initial approach)
F4000
(HA: major ellipse semiaxis)
(HB: minor ellipse semiaxis)
(HC: initial angle)
(HD: final angle)
(HE: angular increment on each point)
HA200 HB150 HC45 HD360 HE1
G0 X0 Y0
G1 Z-1
G41
N10
HF<HA*CSHC>
HG<HB*SNHC>
G1 X<HF> Y<HG>
HC<HC+HE>
!IF HD>=HC;GON10!
G40
M2

134

CNC Z32 - Programming guide (Milling Machines)

10.15 Roto-translation in the space (spherical surface)

OX2 OY2 OZ2


T1 M6
F1000 S3000 M3
G0 Z10
G0 X30Y0
G1 Z0
-- DO
G1 X30 Y0Z0
G2 X0 Z-30 I0 J0
G116K5
G3X30 Z0 I0J0
G116K5
--LOOP 36
M2

135

CNC Z32 - Programming guide (Milling Machines)

10.16 Revolution solid

T1M6
S2000 M3 F1000
G0 Z50
-- DO
X0 Y0 Z0
G1 Y10 RR-6
X20 RR10
X40 Y20 RR-20
X120 RR-10
Y0
G116

I-5

Y20 RR10
X40 RR20
X20 Y10 RR-10
X0RR6
Y0
G116 I-5
-- LOOP 18
G116 KA0
G0 Z50
M2

136

CNC Z32 - Programming guide (Milling Machines)

10.17 Machining of a X-Z programmed profile

G25 XZY
OX1 OY1 OZ1
T1 M6
F5000 M3 S3000
R3
X-75 Y-20 Z10 G0
!PAR[1]=0!
-- DO
DC<PAR[1]>
Y-15
G25XZY (sets working plane XZ)
G41 X-75Z0QF0
G1 X-45RR8
G1 Z25
G1 X-12 Z40
G2 I0 J20 X12 Z40
G1 X45 Z25
Z0 RR8
X75
G40 X75 Z10
Y-13.5
G41 X75Z0QF180
G1 X45RR-8
G1 Z25
G1 X12 Z40
G3 I0 J20 X-12 Z40
G1 X-45 Z25
Z0 RR-8
X-75
G40 X-75 Z10
!PAR[1]=PAR[1]+3!
-- LOOP 10
Z100 G0
G25 XYZ
M2

137

CNC Z32 - Programming guide (Milling Machines)

10.18 Slanted head drilling

Z'
Z
B-20

20

X'

X
OX1 OZ1

60

5
OX1 OY1
T2 M6
S1000 M3
F500
Z10
G117 B-20 (head rotation)
G116 X-60 KA2 (X Z reference system)
G0 X-20 Y0 Z5
G1 Z-10
Z5
M2

138

CNC Z32 - Programming guide (Milling Machines)

10.19 Circumference positioning and drilling fixed cycle


S2000 F1200 M3
G0 Z50
(parameters and fixed cycle recall)
G800K1 MHA2 MHB-10 MHC2
(positioning macro recall)
(definition of positioning to be skipped)
PAR[1]3
(MPX=10, MPY=20: the positioning circle is centered in 10,20)
(MPC=100: the positioning circle has diameter 100)
(MPA=0, MPL=0, MPN=8: execute 8 positioning on all the circumference)
(MPS=1: skips positioning defined in PAR[1])
(MPW=1: circular motion between positioning)
G801K7 MPX10 MPY20 MPC100 MPA0 MPL0 MPN8 MPS1 MPW1
G27C0 (fixed cycle deactivation)
G0 Z50
M2

139

CNC Z32 - Programming guide (Milling Machines)

10.20 Positioning of a machining around a circumference, with rotation


S2000 M3 F800
(Program P40 defines the figure to be moved on circle points)
--DEFINE P40
G0X0Y0
Z2
G1Z0
Z-1
G1X10
Y5
X-10
Y-5
X10
Y0
G0X0Y0
Z2G0
G26
--END DEFINE
PAR[1]3
(G801K7 recall to position the figure stored in CMOS program
number 40)
(MPF=40: positions program 40)
(MPR=1: rotate the figure)
(positioning macro recall)
G801K7 MPX10 MPY20 MPC100 MPA0 MPL0 MPN8 MPS1 MPW1 MPF40 MPR1
G0 Z50
G0 Z50
M2

140

CNC Z32 - Programming guide (Milling Machines)

10.21 Positioning of a machining around a circumference, without rotation


S2000 M3 F800
(Program P40 defines the figure to be moved on circle points)
--DEFINE P40
G0X0Y0
Z2
G1Z0
Z-1
G1X10
Y5
X-10
Y-5
X10
Y0
G0X0Y0
Z2G0
G26
--END DEFINE
(definition of positioning to be skipped)
PAR[1]3
(MPX=10, MPY=20: the positioning circle is centered in 10,20)
(MPC=100: the positioning circle has diameter 100)
(MPA=0, MPL=0, MPN=8: execute 8 positioning on all the circumference)
(MPS=1: skips positioning defined in PAR[1])
(MPF=40: positions program 40)
(positioning macro recall)
G801K7 MPX10 MPY20 MPC100 MPA0 MPL0 MPN8 MPS1 MPF40
G0 Z50
G0 Z50
M2

This second part-program is different from the preceding only for positioning type (linear movements) and the
machining stored in file 40 is not rotated (MPR=0).

141

CNC Z32 - Programming guide (Milling Machines)

10.22 Circular pocket roughing


S2000 F1200 M3
G0 Z50
R5
(parameters and fixed cycle recall)
(MMA=0: upper pocket position)
(MMB=-20: lower pocket position)
(MMC=10: exit position at machining end)
(MMD=60: pocket diameter)
(X,Y: pocket center)
(MMK=3: pass depth)
(MME=2: safety distance)
G802 MMA0 MMB-20 MMC10 MMD80
G802K1 X10 Y10 MMK3 MME2
M2

142

CNC Z32 - Programming guide (Milling Machines)

10.23 Circular pocket roughing positioned on a circumference


S2000 F1200 M3
G0 Z50
R5
(parameters and fixed cycle recall)
(MMA=0: upper pocket position)
(MMB=-10: lower pocket position)
(MMC=10: exit position at machining end)
(MMD=30: pocket diameter)
(X,Y: pocket center)
(HX=1: use as fixed cycle)
(MMK=3: pass depth)
(MME=2: safety distance)
(MMW=1: ramp sinking)
(MMQ=4: maximum slope of sinking ramp)
G802 MMA0 MMB-10 MMC10 MMD30
G802K1 HX1 MMK3 MME2 MMW1 MMQ4
(positioning macro recall)
(MPX=10, MPY=20:)
(the positioning circle is centered in 10,20)
(MPC=60: the positioning circle has diameter 60)
(MPA=0, MPL=0, MPN=8:)
(executes 8 positioning around all circumference)
(MPS=1: skips positioning defined in PAR[1])
(MPW=1:)
(circular motion between positioning)
(definition of positioning to be skipped)
PAR[1]3
G801K7 MPX10 MPY20 MPC60 MPA0 MPL0 MPN8 MPS1 MPW1
G27C0 (fixed cycle deactivation)
G0 Z50
M2

143

S-ar putea să vă placă și