M323C0GB - Milling Programming
M323C0GB - Milling Programming
M323C0GB - Milling Programming
ELECTRON
dal 1977 Al t a Tecnol ogi a
per l a Macchi na Ut ensi l e
Z32
CNC
Document M323
C0 – 31.01.07
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 doesn’t 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.
CONTENTS
1. INTRODUCTION .................................................................................................................................................... 1
i
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)
iii
CNC Z32 - Programming guide (Milling Machines)
iv
CNC Z32 - Programming guide (Milling Machines)
1. INTRODUCTION
For a complete and detailed description of all functionalities available in the Z32 numerical control, please consult
“Programming Manual” M96.
1
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
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.
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 logic-
mathematic programming. For a description of this functionality, please consult this manual in the logic-
mathematic programming section.
3
CNC Z32 - Programming guide (Milling Machines)
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.
4
CNC Z32 - Programming guide (Milling Machines)
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:
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.
5
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).
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.
6
CNC Z32 - Programming guide (Milling Machines)
7
CNC Z32 - Programming guide (Milling Machines)
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)
8
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: 0 1 2 3 4 5
Origin file: 126 123 120 117 114 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.
9
CNC Z32 - Programming guide (Milling Machines)
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.
Process: 0 1 2 3 4 5
Tool table: 127 124 121 118 115 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.
10
CNC Z32 - Programming guide (Milling Machines)
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)
11
CNC Z32 - Programming guide (Milling Machines)
2.9 Cancellation and suspension of origins and lengths (G53 G54 G45)
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 don’t 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:
Z Z L Z L
X X X
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:
Z Y
G25 XYZ
G43Z
X
G25 ZXY
G43Y
X
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)
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:
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.
G1 X0 (G1 movement)
Y0 (G1 movement)
X10 (G1 movement)
G0 X..Y..Z..
14
CNC Z32 - Programming guide (Milling Machines)
Z Y
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 doesn’t have the purpose
to prepare for a G1 movement.
Example:
...
N10 G1
N11 X0 Y0
...
not allowed: block 11 issues the error CN3414
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)
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.
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
80
F1000
15
G0 X10 Y10
(activates incremental programming:)
HX1000 G91
G1 X20
35 Y35
X30
Y15
10
(deactivates incremental programming:)
X G90
0 X80 Y80
20 30
0 10 80
16
CNC Z32 - Programming guide (Milling Machines)
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.
- 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)
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.
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.
- 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)
JR
(IR, JR) 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
X coordinate of rotation center.
IR
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.
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
Y
The mirroring must be enabled with G56 (modal). G55 cancels
QS
G56 and thus the mirroring.
21
CNC Z32 - Programming guide (Milling Machines)
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...
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.
• 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)
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 doesn’t 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.
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 2
3 40 30
Z
40 Y X
Y
30
Y X
Z Z
30
30
X
Y
Y X
Z Z
X
4 5
40
30
30 40
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)
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)
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:
Example:
Logical axis number 0 1 2 3 4
Desired axis names Z X Y A B
Setup axis names X Y Z A B
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 doesn’t 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)
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.
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 shouldn’t 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)
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.
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.
27
CNC Z32 - Programming guide (Milling Machines)
N1 G107
N2 G0 X10 (X axis goes to pos. 5, diameter 10)
N3 G106 (radial programming)
N4 X10 (X axis goes to pos. 10, diameter 20)
N5 G107 X10 (X axis goes to pos. 5, diameter 10)
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.
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.).
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).
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)
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:
30
CNC Z32 - Programming guide (Milling Machines)
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.
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.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
...
... G0 X-20 Y30
Y
Y G0 X0 Y40 G41 X0 Y20 QF0
G41 X0 Y20 QF0 G1 X50
40 G1 X50 ...
30
...
20
20
0
X
0
X
-20 0
...
...
G0 X-45 Y-15 G0 X-50 Y0
G41 X-30 Y0 QF90
G41 X-30 Y0 QF90
G2 I0 J0 X0 Y30
Y
G2 I0 J0 X0 Y30
G1 X50 Y
... G1 X50
...
0
X
X
-15
R30
R30
-45 0 -50 0
In some cases it may be necessary to compute the final slope of the approaching movement:
Y Y
20
30° 30°
R40
X X
R40 -20 0
... ...
G0 X<-20*CS30> Y<20*SN30> G0 X-20 Y0
G42 X<-40*CS30> Y<40*SN30> QF60 G42 X<-40*CS30> Y<40*SN30> QF60
G2 I0 J0 X40 Y0 G2 I0 J0 X40 Y0
G1 Y-20 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.
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... G0 X... Y...
G41 G41
G1 X-40 Y10 G1 X<-40*CS30> Y<40*SN30>
X0 Y30 G2 I0 J0 X0 Y40
Y G1 X50
X50 ...
... Y
40
30
R40
10
30°
0
X 0
X
-40 0
This type of approach is different from that without positions, as shown in the example:
... ...
G0 X0 Y40 G0 X0 Y40
Y
Y G41 G41 X0 Y20
G1 X0 Y0 40
X50
40 ...
X50
...
20 20
0 0
X X
0 0
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)
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.
G41 ...
G41 ... ...
... ...
...
G1 X0 Y20
Y Y
G1 X0 Y20 G40 X20 Y30
40 G40 X0 Y40 ...
...
30
20 20
0 0
X X
0 20
G41 ...
...
... G41 ...
G2 I0 J0 X30 Y0 ...
Y
G40 X60 Y0 ...
... Y G2 I0 J0 X30 Y0
G40 X50 Y-15
...
X
0
R30 X
R30
-15
0 60
0 50
34
CNC Z32 - Programming guide (Milling Machines)
G41 ...
... G41 ...
... ...
G1 X0 Y30
X40 Y10
...
G40
G2 I0 J0 X30 Y0
X... Y... G40
Y
... X... Y...
Y
...
30
10 R30
0
X
X
0 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.
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)
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.
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)
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).
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 doesn’t 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 don’t
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.
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 doesn’t 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 2
3 40 30
Z
40 Y X
Y
30
Y X
Z Z
30
30
X
Y
Y X
Z Z
X
4 5
40
30
30 40
1) Vertical head: Z
G0 B0 C0
2) Right side face: C+
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: Y Z
G0 B90 C180 B+
G117 KA2 X
G116 X-40 Z-30 KA2
5) Front face: Y
G0 B90 C270
G117 KA2
G116 Y-30 Z-30 KA2
38
CNC Z32 - Programming guide (Milling Machines)
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.
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.
G117 deactivation
The function G117 (static and dynamic) is deactivated by:
G117 KA0
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.
G117 K10
X K
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 doesn’t 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, doesn’t 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
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
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)
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).
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)
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)
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..]
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
Y'
5 3
5 2
2
1 1
X X
G0 X100 Y0 G0 X100 Y0
G118C G118C HR1
C30 (1) C30 (1)
G1 X200 Y0 (2) G1 X200 Y0 (2)
Y50 (3) Y50 (3)
X100 (4) X100 (4)
Y0 (5) Y0 (5)
The simple G118 may be considered as an origin change: a movement of rotating axes provokes a translation of
workpiece origin.
G118 deactivation
G118 is deactivated by the instruction:
G118E
44
CNC Z32 - Programming guide (Milling Machines)
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 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.
G122 deactivation
To deactivate the G122 correction, program the following:
G122 KA0
45
CNC Z32 - Programming guide (Milling Machines)
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 “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).
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. PARAMETRIC PROGRAMMING
• 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:
47
CNC Z32 - Programming guide (Milling Machines)
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:
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.
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
It is possible to program mathematical expression whose result is a function of numeric values or other parameters.
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 >
N40 G0 X<HA>
N50 F<HB>
N60 G1 X<HC+100>
The movement programming using parametric expressions may be quite complex, following the same rules
indicated for parameters programming.
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)
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
OX1 OY1 OZ1
T1M6
T1M6
F1000
F1000
S3000 M3
S3000 M3
G25ZXY G43Y
G25XYZ G43Z
G0 AA0 AB0 AC2
G0 AA0 AB0 AC2
G1 AC0
G1 AC0
AA5
AA5
AB2
AB2
AA0
AA0
AB0
AB0
AC-0.5
AC-0.5
AA5
AA5
AB2
AB2
AA0
AA0
AB0
AB0
M2
M2
51
CNC Z32 - Programming guide (Milling Machines)
Note:
In advanced lines it is NOT possible to program machine movements.
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.
Example:
The program executes N10 and jumps to the label N20:
…
N10 !GON20!
…
N20
…
52
CNC Z32 - Programming guide (Milling Machines)
…
…
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
…
Example:
!IF HA > 10 ; GON20!
jumps to N20 if HA is higher than 10.
The condition may also be an expression:
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:
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.
54
CNC Z32 - Programming guide (Milling Machines)
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.
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
…
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.
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.
57
CNC Z32 - Programming guide (Milling Machines)
Example:
--DO
N10
…
N100
--LOOP
--DO
N10
…
N100
--LOOP 10
N110
--DO
N10
…
N100
--LOOP IF HA < 10
N110
58
CNC Z32 - Programming guide (Milling Machines)
--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)
--DEFINE P10
…
{program listing}
…
--END DEFINE
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 don’t 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.
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 doesn’t 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)
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
62
CNC Z32 - Programming guide (Milling Machines)
63
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
feed MHF
MHA: start position
MHB: hole end position feed F MHC
MHC: high retraction position
G0
MHA
Optional parameters for centering:
(MHD): centering end position
(MHF): feed during centering
MHD
The segment from MHA to MHD is executed at feed
MHF
If MHF = 0 all the hole is executed with programmed F
Mandatory parameters:
MHA: start position
MHB: hole end position
MHC: high retraction position
feed MHF
MHI: depth increment before stop for chip breakage MHC
Type of chip breakage: feed F
64
CNC Z32 - Programming guide (Milling Machines)
feed F
6.1.5 G800K5: Reaming
G0 MHC
Mandatory parameters:
MHA: start position MHA
MHB: hole end position
MHC: high retraction position
65
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
MHA: start position
feed F
MHB: hole end position MHC
MHC: high retraction position 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 Stop
Mandatory parameters:
MHA: start position
MHB: hole end position feed MHF
MHC
MHC: high retraction position feed F
MHW
MHI: increment before feed stop for chip breakage G0
MHZ
Type of chip breakage: MHA
MHR: retraction for chip breakage
if MHR > 0 the retraction is executed and MHT is MHD
ignored MHI
MHT: dwell time for chip breakage if MHR = 0
Program MHR or MHT depending on the kind of chip MHU
breakage desired.
MHL
MHU: chip breaking zone end position – chip extraction
zone starting position
MHS
MHL: depth increment before retraction for chip extraction. MHB
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
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
MHA: start position feed MHF
MHC
MHB: hole end position feed F
MHC: high retraction position G0
MHU: end of first zone position MHA
MHV: start of second zone position
MHD
Optional parameters for centering: MHI
(MHD): centering end position MHU
(MHF): feed during centering
The segment from MHA to MHD is executed at feed MHF MHV
If MHF = 0 the centering is not executed
MHI
Optional parameters for chip breaking:
MHB
(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.
Mandatory parameters:
MHA: start position
MHB: hole end position feed MHF feed MHJ
MHC
MHC: high retraction position feed F feed MHK
Middle zone: G0
MHU: end high zone – start middle zone position MHA
(MHJ): feed inside middle zone. If MHJ=0, the middle zone
MHD
feed is equal to the high zone feed
(MHG): speed inside middle zone. If MHG=0, the middle MHI
zone speed is equal to the high zone speed MHU
MHI
Optional parameters for low zone: MHV
(MHV): end middle zone – start low zone position
If MHV = 0 no low zone exists. Middle zone ends at MHB MHI
(MHK): feed inside low zone.
MHB
(MHH): Speed in low zone. If MHH=0, the low zone speed is
equal to the middle zone speed
67
CNC Z32 - Programming guide (Milling Machines)
MHB
68
CNC Z32 - Programming guide (Milling Machines)
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
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
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 and macro
activation)
and
G801 MPX0 MPY0 MPJ10 MPK5 MPN5 (parameter programming)
G801K1 (macro 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
69
CNC Z32 - Programming guide (Milling Machines)
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 don’t contrast with the
positioning macro.
70
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
MPX, MPY: starting point coordinates MPK
Mandatory parameters:
MPX, MPY: starting point coordinates
MPG: line slope angle
P
MPP: distance between points MP
MPN: number of points
0 MPG
Optional parameters for machining position: MPX
(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
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]
Mandatory parameters:
MPX, MPY: starting point coordinates
MPA, MPB: end point coordinates MPB
MPN: number of points
MPX 0
Optional parameters for machining position: MPA
(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]
71
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
MPX, MPY: starting point coordinates MPV
MPJ, MPK: row increments MPJ
MPK
MPV, MPW: column increments
MPN: number of points in a row MPW
M PM
(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 MPN
positioning line
Optional parameters for positioning skipping: 0 MPX
(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]
Mandatory parameters:
MPX, MPY: starting point coordinates MPT
MPP: distance between row points MPP
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 M PM
MPM: number of points in a column
Optional parameters for machining position:
MPG
(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]
6.2.6 G801K6: Grid – row and column starting and end points
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 MPD
MPN: number of points in a row
MPM: number of points in a column
M PM
72
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]
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
Optional parameters for arc length MPY
73
CNC Z32 - Programming guide (Milling Machines)
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
MPA: initial angle
MPB: final angle MPY
If MPA = MPB the points are spaced along the whole
circumference, starting from the initial angle. MPC
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 0 MPX
(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
Mandatory parameters:
MPX, MPY: rectangle center coordinates MP
L
G
MP
MPL: rectangle base
MPY
MPM: number of points on rectangle height
MPH: rectangle height
MP
M
N
MP
MPX
0
74
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters: MP
P
MP
MPX, MPY: lower left corner coordinates
Q
MPG: rectangle rotation angle
MPN: number of points on rectangle base
MPG
MPP: distance between points on the base
MPM: number of points on rectangle height
MPQ: distance between points on the height
MP
Optional parameters for machining position:
M
(MPF): MPF = 0 : on all points a fixed cycle is executed MPY MP
N
MPF <> 0 : on all points a programmed figure,
MPX
stored in CMOS program MPF, is positioned 0
(MPR): MPR = 0 : the figure is not rotated
MPR = 1 : the figure is rotated by the slope of
positioning line
Mandatory parameters:
MPX, MPY: lower left corner coordinates
MPG: rectangle rotation angle L
MP
MPN: number of points on rectangle base
MPL: rectangle base
MP
H
G
MPM: number of points on rectangle height MP
MPH: rectangle height
Optional parameters for machining position:
(MPF): MPF = 0 : on all points a fixed cycle is executed
MP
N
stored in CMOS program MPF, is positioned MPY MP
75
CNC Z32 - Programming guide (Milling Machines)
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
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
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
76
CNC Z32 - Programming guide (Milling Machines)
Example:
G802 MMA0 MMB-30 MMC10 MMD60
G802K1 HX1 MMK1 MME2 MMW1 MMQ4
Please note that the pocket center positions are not programmed.
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)
MMB
Optional parameters for taper: MMU MMN
(MMN): taper (delivery angle). Must be
comprised between 0 and 80 degrees.
78
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
pocket center coordinates (programmed
MMP
through axes positions)
MML: pocket base MMG
MMR
MMH: pocket height
AA, AB
MMR: fillet radius
MMA: pocket start position MMH
MMB: pocket end position MML
MMC: high retraction position MMC
MMS MME
MME: safety distance R MMA
MMK: pass depth
MMK
Optional parameters for pocket rotation:
(MMG): pocket rotation angle. MMB
MMU MMN
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
79
CNC Z32 - Programming guide (Milling Machines)
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
MMC
MMS MME
R MMA
MMK
MMB
MMU MMN
80
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
pocket center coordinates (programmed
through axes positions) MMJ=0
AA, AB
MMD: pocket diameter
MMA: pocket start position
MMB: pocket end position MMD MMJ=1
MMQ
MMC: high retraction position
MME: safety distance
R MMC
MMK: pass depth MMS MME
MMA
Optional parameters for pocket wall orientation:
(MMV): defines the wall where the approaching MMK
and retraction movements from pocket
profile are made: MMU MMB
MMV=0: right wall MMN
MMV=1: left wall
81
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
pocket center coordinates (programmed
through axes positions)
MMQ
MML: pocket base
MMG
MMH: pocket height MMR
MMR: fillet radius AA, AB
MMA: pocket start position
MMH
MMB: pocket end position
MML
MMC: high retraction position MMC
MME: safety distance R MMS MME
MMK: pass depth MMA
82
CNC Z32 - Programming guide (Milling Machines)
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
MMC
R MMS MME
MMA
MMK
MMB
MMU MMN
83
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
eyelet center coordinates (programmed
MMG
through axes positions) B A
MMD
MML: eyelet length
MMD: eyelet width AA, AB
MMA: eyelet start position
MMB: eyelet end position MML
MMC: high retraction position
MMC
MME: safety distance MMS MME
Type of machining management: MMA
MMV: machining type MMK, MMH
MMV = 0: roughing and finishing with
the same tool
MMB
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
84
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
eyelet center coordinates (programmed
through axes positions)
MML: eyelet length MMR A
MMD: eyelet width
MMR: eyelet curvature radius
MMA: eyelet start position MMC
MMS MME
MMB: eyelet end position MMA
MMC: high retraction position AA, AB MMG
MME: safety distance MMK
MMH MMD
Type of machining management: MMB
MML
MMV: machining type
MMV = 0: roughing and finishing with B
the same tool
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
85
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
curvature center coordinates (programmed
through axes positions)
MML: eyelet length A
MMD: eyelet width MMR
MMR: eyelet curvature radius
MMA: eyelet start position
MML
MMB: eyelet end position
MMC: high retraction position AA, AB MMG
MME: safety distance MMC MMD
Type of machining management: MMS MME
MMA
MMV: machining type
MMV = 0: roughing and finishing with MMK
B
the same tool MMH
MMB
MMV = 1: roughing only
MMV = 2: finishing only
MMK: roughing pass depth
MMH: finishing pass depth
86
CNC Z32 - Programming guide (Milling Machines)
6.3.10 G802K10: Hole thread milling with a single flute end mill
87
CNC Z32 - Programming guide (Milling Machines)
Mandatory parameters:
hole center coordinates (programmed through MMD
axes positions) MMA
MMD: bottom of thread diameter
MMQ: hole diameter MMP
MMA: machining start position
MMB: machining end position
MMC: high retraction position MMQ
MMP: thread pitch
MMK: pass depth for thread roughing. The
roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMB MMH
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:
MMD
stud center coordinates (programmed MMA
through axes positions)
MMD: external diameter
MMQ: bottom of thread diameter MMP
MMA: machining start position
MMB: machining end position
MMC: high retraction position MMQ
MMP: thread pitch
MMK: pass depth for thread roughing. The
roughing machining ends on thread bottom
(MMD). On this diameter are executed the MMB
MMN polishing passes.
89
CNC Z32 - Programming guide (Milling Machines)
MMH
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)
Mandatory parameters:
MMV=1 AA, AB
first vertex coordinates of rectangular area
(programmed through axes positions)
MMX: working plane first axis coordinate of MMV=0 MMP
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 MMX, MMY
MMC
Optional parameters for pass overlapping:
(MMP): minimum overlapping between passes.
Values between 0.2 and 1.9 times the tool MMA MMB
radius. If MMP=0 the value MMP=0.2 times
tool radius is assumed
91
CNC Z32 - Programming guide (Milling Machines)
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.
92
CNC Z32 - Programming guide (Milling Machines)
- 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.
• 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 -90 > QF > -180 0 > QF > -90
180 < QF < 270
93
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.
KA0 KA1
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)
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.
R10
G0 X40 Y0
G1 X20 Y20
X10
30
Y30
20
G3 I0 J30
G1 X-20 Y20
X-40
Y0
0
X
-40 -20 0 10 20 40
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.
G0 X40 Y0
40 G1 Y10
45°
Y30 QF120
30°
30 X15
30° 30° X0 QF210
Y40 QF135
X-40
10 X-50 QF-120
Y0
0
X
-50 -40 0 15 40
95
CNC Z32 - Programming guide (Milling Machines)
7.1.3 Line – two coordinates end point and slope (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.
40 G0 X50 Y0
G3 I35 J0 KA1 (or RR-0.0001)
30 G1 X0 Y30 QF150
X-10
30°
R15
G2 I-25 J30 KA1 (or RR-0.0001)
G1 X-40 Y40 QF100
10°
R15
0
X
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
R10
30 G0 X50 Y0
G3 I35 J0 RR-5
30°
R15 G1 X0 Y30 QF150 RR10
X-10 RR5
10° G2 I-25 J30 RR-10
R15 R5 G1 X-40 Y40 QF100
0
X
96
CNC Z32 - Programming guide (Milling Machines)
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.
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 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°
15 G0 X-80 Y15
G1 QF-10 KA1
5
0
G3 I-30 J0 RA15 KA1
X
G1 X0 Y5 QF0
G1 KA1
R15 R15 G3 I30 J0 RA15 KA1
-80 -30 0 30 80 G1 X80 Y15 QF10
Y
10° 10°
15 G0 X-80 Y15
10° 5
G1 QF-10 RR-0.0001
0
G3 I-30 J0 RA15 RR-0.0001
X
G1 X0 Y5 QF10
G1 RR-0.0001
R15 R15 G3 I30 J0 RA15 RR-0.0001
G1 X80 Y15 QF10
-80 -30 0 30 80
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 G0 X-55 Y30
30 G1 X-45 Y20
45°
G1 RR-2
20 G3 I-25 J0 RA15 RR-2
G1 X0 Y5 QF0
R2 R12
R2 R2 G1 RR-2
5 G3 I25 J0 RA15 QF45
0 X G1 RR12
45°
G1 X55 Y30 QF90
R15 R15
97
CNC Z32 - Programming guide (Milling Machines)
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 doesn’t 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.
It is otherwise possible to choose the intersection by programming a fillet with very small signed radius.
15
R15 G0 X30 Y0
G3 X15 Y15 I15 J0
0 R15 R15 G2 X-15 Y15 I0 J20
X G3 X-30 Y0 I-15 J0
-30 -15 0 15 30
G0 X-50 Y10
G1 QF10
G3 X50 Y30 I30 J30 KA1 (or RR-0.0001)
Y
30
10 10°
0
X
-50 0 30 50
98
CNC Z32 - Programming guide (Milling Machines)
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
R4 R4 G0 X40 Y0
G42 X30 Y0 QF90
Y30 RR4
0
G2 X-30 Y30 RA50 RR4
X G2 X-30 Y-30 RA50 RR4
G2 X30 Y-30 RA50 RR4
R50 G1 Y0
G40 X40 Y0
R4 R4
-30 R50
-30 0 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 X50 Y0
G1 Y5
30° G1 QF150
G2 X20 Y30 RA15 (or G3)
5 G1 X0
0
X
0 20 50
99
CNC Z32 - Programming guide (Milling Machines)
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
R5 X40 Y0 QF-90
R5
0
X
-10 0 40
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
20 45° G1 QF45
G3 I40 J20 QF-45
G1 RR-5
45° R5 X65 Y0 QF-90
0
X
0 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
R3 G0 X30 Y10
0 G1 X10 RR3
X G2 I0 J0 QF90
G1 Y10
0 10 30
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 X0 Y0
G1 X30 Y30
G2 RA10 QF-90
G1 Y0
0
X
0 30
Circle with known radius, tangent to a circle in a known point:
Y
R10
R5
R15 45° 20 G0 X-30 Y0
G1 X-15 RR3
G2 I0 J0 QF-45
R3 G3 RA10 QF45
G1 RR-5
0
X X50 Y20 QF0
45°
-30 -15 0 50
101
CNC Z32 - Programming guide (Milling Machines)
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
G0 X-50 Y30
20
G1 X-30
G2 X-10 Y20
G3 X10 Y20
G1 RR-1
0 X50 Y30 QF0
X
Y
30
G0 X-50 Y30
G1 X-30
G2 X-10 Y10
10
G3 X10 Y10
G2 X30 Y30
0
X G1 X50
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.
Y
90°
30
G0 X-50 Y30
20 G1 QF0
G2 I-20 J20 QA90
G3 I0 J20 QA135
G1
0
135° X50 Y30 QF0
X
-50 -20 0 50
102
CNC Z32 - Programming guide (Milling Machines)
Z32 considers as open circles all circular arcs whose end point is computed by the intersection with next element.
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.
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.
40
20° G0 X-50 Y0
30 G1 Y20
R20
G1 QF0 RR-0.0001
20 G3 I-10 J30 RA20 RR-0.0001
G1 X50 Y40 QF20
0
X
-50 -10 0 50
40
R20 30 G0 X-50 Y0
R20
G1 Y20
20 G1 QF0 RR-0.0001
G3 I-10 J30 RA20 RR-0.0001
G3 I15 J40 RA20
G1 X50 Y40
0
X
-50 -10 0 15 50
103
CNC Z32 - Programming guide (Milling Machines)
G2 I.. J..
G3 I.. J..
40
G0 X50 Y0
28 G1 Y10
20 G1 QF150
30° 15 G2 I15 J15 KA1 (or RR-0.0001)
10 G1 X-20 Y20 QF180
G2 I-33 J28
0 0 X G1 X-60 Y40
0
G0 X60 Y-10
20 45° 20
G1 X40 Y10
10
G2 I30 J20 RR0.0001 (or KA0)
R30
G3 I0 J0 RA30 QF225
0 0
X G2 I-55 J20 RR-0.0001 (or KA1)
G1 X-60 Y-10 QF180
-10 -10
-55 -20 0 30 40 60
-60
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
G0 X-50 Y0
G1 X-20 Y30
30 R1 G2 RA10 RR1
25 R15
20
G1 X0 Y20 QF0
R1 G1 RR1
R10 R10 G2 I20 J20 RA15 QF-120
30° 5 G3 RA10
0 0 X G1 X60 Y5
-50 -20 0 20 60
104
CNC Z32 - Programming guide (Milling Machines)
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
G0 X-50 Y0
20
R4 G1 G2 I-1 J20 RA10
45° G1 G3 I30 J0 RA10 QF45
R10 R10 10
G1 RR-4
0 0 X G1 X80 Y10 QF0
-50 -20 0 30 80
R30
50 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
0 X
R20 -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
G0 X-60 Y0
R5 G41 X-70 Y0 QF-90
30° 45° G3 I-40 J0 RR-5
R30 R30 G1 G3 I40 J0 RA30 QF225 QA-30
G1 RR-5
X G1 G3 I-40 J0 RA30 QF-90 QA150
G40 X-60 Y0
R5 30°
-60 -40 0 40
106
CNC Z32 - Programming guide (Milling Machines)
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.
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.
107
CNC Z32 - Programming guide (Milling Machines)
20
G0 X0 Y0
G1 X20 Y20 RR-10
R10 G1 X40 Y0
0
X
20 40
0
20
G0 X40 Y0
G1 X20 Y0 RR10
G1 X0 Y0
R10
0
X
20 40
0
20
R10
G0 X0 Y20
R6 R6 G1 X20 RR-6
G3 I30 J20 X40 Y20 RR-6
G1 X60
0
X
30 60
0
108
CNC Z32 - Programming guide (Milling Machines)
15 R5 G0 X-15 Y15
R15 R15 G1 X0 RR-5
R5 R5 G3 I15 J15 RR-5
0 G3 I45 J15 RA15 RR-5
X G1 X75 Y15 QF0
-15 0 15 45 75
Y
R10
R15
R15
G0 X-35 Y0
G2 I-20 J0 RR10
X G2 I20 J0 RA15 RR-70
G2 I-20 J0 X-35 Y0
R70
-20 0 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 Y
(short fillet)
G0 X0 Y-15
G1 QF180
G2 I-20 J0 RA15 RR-40 (KA0)
X G2 I20 J0 RA15 QF180
G1 X0 Y-15
R15 R15
-20 0 20
109
CNC Z32 - Programming guide (Milling Machines)
R40
(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
X
R15 R15
-20 0 20
110
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.
Y 10
30
10
G0 X30 Y0
G1 Y30 RB10 Y 5.77
G1 X0 30
10
0
X
0
X
0 30
0 30 60
Y 5.77 G0 X0 Y0
G1 X30 Y30 RB10 QA30
30 G1 X60 Y30
10 G0 X30 Y0
G1 Y30 RB10 QA30
G1 X0
30°
0
X
0 30
Y
10 10
30 G0 X0 Y0
G1 X30 Y30 RB10
G1 X60 Y0
0
X
0 30 60
111
CNC Z32 - Programming guide (Milling Machines)
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.
Through the instruction !:L254…! contained in an advanced line, it is possible to execute a program of any
dimension, stored on the hard disk.
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:
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.
113
CNC Z32 - Programming guide (Milling Machines)
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 "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.
•
2
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 doesn’t 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 doesn’t 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.
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.
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.
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
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
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.
This paragraph discusses tool paths programmed as a series of points (only linear segments).
The finishing required by today’s 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.
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
• 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).
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 line-
circle 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.
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.
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)
Activates the
algorithm for curve
N20 G113B reconstruction
Deceleration
reduction due to
curvature changes.
Higher values bring
to lower deceleration
(allowed values 0-4)
N40 G135 I1 HX2
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)
Example 1: Recalls a DNC program with G114, G113X KA1 and G113B active
T1M6
OX1 OY1 OZ1
F1000 S4000 M3
G0 Z200
(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
(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
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.1 Profile 1
Y
70 R20
65°
R10 R20
30
R20
20
R15
0
X
0 25 100
121
CNC Z32 - Programming guide (Milling Machines)
10.2 Profile 2
Y
R15
65° 45
R18
40
R8
75°
R7
10
0
R20 X
60°
-20
R18
-40
-35 -20 0 40 50
122
CNC Z32 - Programming guide (Milling Machines)
10.3 Rotation
Y
50
A
B C
45°
Profile A: 45°
OX1 OY1 OZ1 (origin 1) 0
X
T1 M6 S2000 M3
G0 Z10 (initial approach)
G0 X0 Y0 (initial positioning)
0 20
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
123
CNC Z32 - Programming guide (Milling Machines)
10.4 Translation
Y
50
A
0
X
DB-25
0 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
CNC Z32 - Programming guide (Milling Machines)
10.5 Roto-translation 1
40
Y' 20
Y
0 X'
0
R10
R20
50 30°
R10 R20
20
0 X
-20
Y ''
R10 R20
-50
30°
R20
R10
0
0 X''
-20
40
0 30 50 100
125
CNC Z32 - Programming guide (Milling Machines)
10.6 Roto-translation 2
X B X
C Y
Y
A
X
Y
E
X D X
(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
0 30 60
20
B A 10
R10 0
X
D C
(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
60
20
10
0
A
30
0
B 45°
R10
X
(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)
OX1 OY1 OZ1 (uses origin 1) OX1 OY1 OZ1 (uses origin 1)
T1 M6 (uses tool 1) T1 M6 (uses tool 1)
F1000 (machining to 1,000 mm/min) F1000 (machining to 1,000 mm/min)
S2000 M3 (speed 2000 rpm) S2000 M3 (speed 2000 rpm)
R5 (sets tool radius) R5 (sets tool radius)
G0 Z10 (initial approach) KT-1
G0 X0 Y0 G0 Z10 (initial approach)
G1Z0 G0 X0 Y0
--DO G1Z0
Y<Y+1> --DO
G1 X10 Z10 Y<Y+1>
X30 Z0 G1 X10 Z10
X40 X30 Z0
Y<Y+1> X40
X30 Y<Y+1>
X10 Z10 X30
X0 Z0 X10 Z10
--LOOP 9 X0 Z0
G0 Z10 (retract in Z) --LOOP 9
M5 (spindle stop) G0 Z10 (retract in Z)
M2 (program end) M5 (spindle stop)
M2 (program end)
129
CNC Z32 - Programming guide (Milling Machines)
45°
M2
130
CNC Z32 - Programming guide (Milling Machines)
M2
131
CNC Z32 - Programming guide (Milling Machines)
G0 Z10 (retract in Z)
M5 (spindle stop)
M2 (program end)
132
CNC Z32 - Programming guide (Milling Machines)
M2
133
CNC Z32 - Programming guide (Milling Machines)
10.14 Ellipse
134
CNC Z32 - Programming guide (Milling Machines)
135
CNC Z32 - Programming guide (Milling Machines)
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)
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
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)
Z'
Z
B-20
20 X'
X
OX1 OZ1
5 60
OX1 OY1
T2 M6
S1000 M3
F500
Z10
M2
138
CNC Z32 - Programming guide (Milling Machines)
139
CNC Z32 - Programming guide (Milling Machines)
--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)
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)
142
CNC Z32 - Programming guide (Milling Machines)
143